@sky.ui/mcp 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +139 -0
- package/README.md +182 -0
- package/data/chart-api-sections.json +4185 -0
- package/data/component-tier.json +25 -0
- package/data/design-guidelines/p0-guidelines.json +13381 -0
- package/data/reactivity-readme-snapshot.json +1 -0
- package/data/theme-authoring-contract.json +598 -0
- package/data/utils-suggestion-snapshot.json +1 -0
- package/dist/cache.d.ts +3 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +15 -0
- package/dist/cache.js.map +1 -0
- package/dist/catalog.d.ts +60 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +343 -0
- package/dist/catalog.js.map +1 -0
- package/dist/cem.d.ts +26 -0
- package/dist/cem.d.ts.map +1 -0
- package/dist/cem.js +348 -0
- package/dist/cem.js.map +1 -0
- package/dist/chart-usage-tool.d.ts +20 -0
- package/dist/chart-usage-tool.d.ts.map +1 -0
- package/dist/chart-usage-tool.js +153 -0
- package/dist/chart-usage-tool.js.map +1 -0
- package/dist/component-docs-tool.d.ts +45 -0
- package/dist/component-docs-tool.d.ts.map +1 -0
- package/dist/component-docs-tool.js +217 -0
- package/dist/component-docs-tool.js.map +1 -0
- package/dist/component-method-filter.d.ts +3 -0
- package/dist/component-method-filter.d.ts.map +1 -0
- package/dist/component-method-filter.js +32 -0
- package/dist/component-method-filter.js.map +1 -0
- package/dist/component-tier.d.ts +20 -0
- package/dist/component-tier.d.ts.map +1 -0
- package/dist/component-tier.js +59 -0
- package/dist/component-tier.js.map +1 -0
- package/dist/component-usage-tool.d.ts +20 -0
- package/dist/component-usage-tool.d.ts.map +1 -0
- package/dist/component-usage-tool.js +90 -0
- package/dist/component-usage-tool.js.map +1 -0
- package/dist/design-guidelines/a11y-engine.d.ts +22 -0
- package/dist/design-guidelines/a11y-engine.d.ts.map +1 -0
- package/dist/design-guidelines/a11y-engine.js +78 -0
- package/dist/design-guidelines/a11y-engine.js.map +1 -0
- package/dist/design-guidelines/compatibility-engine.d.ts +20 -0
- package/dist/design-guidelines/compatibility-engine.d.ts.map +1 -0
- package/dist/design-guidelines/compatibility-engine.js +57 -0
- package/dist/design-guidelines/compatibility-engine.js.map +1 -0
- package/dist/design-guidelines/component-guideline-engine.d.ts +19 -0
- package/dist/design-guidelines/component-guideline-engine.d.ts.map +1 -0
- package/dist/design-guidelines/component-guideline-engine.js +40 -0
- package/dist/design-guidelines/component-guideline-engine.js.map +1 -0
- package/dist/design-guidelines/composition-engine.d.ts +10 -0
- package/dist/design-guidelines/composition-engine.d.ts.map +1 -0
- package/dist/design-guidelines/composition-engine.js +29 -0
- package/dist/design-guidelines/composition-engine.js.map +1 -0
- package/dist/design-guidelines/pattern-engine.d.ts +20 -0
- package/dist/design-guidelines/pattern-engine.d.ts.map +1 -0
- package/dist/design-guidelines/pattern-engine.js +58 -0
- package/dist/design-guidelines/pattern-engine.js.map +1 -0
- package/dist/design-guidelines/recommendation-engine.d.ts +11 -0
- package/dist/design-guidelines/recommendation-engine.d.ts.map +1 -0
- package/dist/design-guidelines/recommendation-engine.js +88 -0
- package/dist/design-guidelines/recommendation-engine.js.map +1 -0
- package/dist/design-guidelines/repository.d.ts +19 -0
- package/dist/design-guidelines/repository.d.ts.map +1 -0
- package/dist/design-guidelines/repository.js +71 -0
- package/dist/design-guidelines/repository.js.map +1 -0
- package/dist/design-guidelines/review-engine.d.ts +20 -0
- package/dist/design-guidelines/review-engine.d.ts.map +1 -0
- package/dist/design-guidelines/review-engine.js +179 -0
- package/dist/design-guidelines/review-engine.js.map +1 -0
- package/dist/design-guidelines/schema.d.ts +256 -0
- package/dist/design-guidelines/schema.d.ts.map +1 -0
- package/dist/design-guidelines/schema.js +124 -0
- package/dist/design-guidelines/schema.js.map +1 -0
- package/dist/design-guidelines/token-engine.d.ts +23 -0
- package/dist/design-guidelines/token-engine.d.ts.map +1 -0
- package/dist/design-guidelines/token-engine.js +119 -0
- package/dist/design-guidelines/token-engine.js.map +1 -0
- package/dist/docs-read.d.ts +28 -0
- package/dist/docs-read.d.ts.map +1 -0
- package/dist/docs-read.js +102 -0
- package/dist/docs-read.js.map +1 -0
- package/dist/docs.d.ts +73 -0
- package/dist/docs.d.ts.map +1 -0
- package/dist/docs.js +323 -0
- package/dist/docs.js.map +1 -0
- package/dist/example-site-doc-enrichment.d.ts +27 -0
- package/dist/example-site-doc-enrichment.d.ts.map +1 -0
- package/dist/example-site-doc-enrichment.js +171 -0
- package/dist/example-site-doc-enrichment.js.map +1 -0
- package/dist/example-site-fetch.d.ts +44 -0
- package/dist/example-site-fetch.d.ts.map +1 -0
- package/dist/example-site-fetch.js +255 -0
- package/dist/example-site-fetch.js.map +1 -0
- package/dist/framework-wrappers.d.ts +46 -0
- package/dist/framework-wrappers.d.ts.map +1 -0
- package/dist/framework-wrappers.js +131 -0
- package/dist/framework-wrappers.js.map +1 -0
- package/dist/mcp-response-truth.d.ts +18 -0
- package/dist/mcp-response-truth.d.ts.map +1 -0
- package/dist/mcp-response-truth.js +45 -0
- package/dist/mcp-response-truth.js.map +1 -0
- package/dist/mcp-runtime-status.d.ts +37 -0
- package/dist/mcp-runtime-status.d.ts.map +1 -0
- package/dist/mcp-runtime-status.js +96 -0
- package/dist/mcp-runtime-status.js.map +1 -0
- package/dist/mcp-stdio-entry.d.ts +3 -0
- package/dist/mcp-stdio-entry.d.ts.map +1 -0
- package/dist/mcp-stdio-entry.js +35 -0
- package/dist/mcp-stdio-entry.js.map +1 -0
- package/dist/mcp-tool-errors.d.ts +35 -0
- package/dist/mcp-tool-errors.d.ts.map +1 -0
- package/dist/mcp-tool-errors.js +42 -0
- package/dist/mcp-tool-errors.js.map +1 -0
- package/dist/parse-component-ast.d.ts +112 -0
- package/dist/parse-component-ast.d.ts.map +1 -0
- package/dist/parse-component-ast.js +695 -0
- package/dist/parse-component-ast.js.map +1 -0
- package/dist/post-endpoint-server.d.ts +19 -0
- package/dist/post-endpoint-server.d.ts.map +1 -0
- package/dist/post-endpoint-server.js +777 -0
- package/dist/post-endpoint-server.js.map +1 -0
- package/dist/reactivity-info.d.ts +22 -0
- package/dist/reactivity-info.d.ts.map +1 -0
- package/dist/reactivity-info.js +99 -0
- package/dist/reactivity-info.js.map +1 -0
- package/dist/reactivity-layer-tool.d.ts +18 -0
- package/dist/reactivity-layer-tool.d.ts.map +1 -0
- package/dist/reactivity-layer-tool.js +58 -0
- package/dist/reactivity-layer-tool.js.map +1 -0
- package/dist/reactivity-readme-topics.d.ts +46 -0
- package/dist/reactivity-readme-topics.d.ts.map +1 -0
- package/dist/reactivity-readme-topics.js +206 -0
- package/dist/reactivity-readme-topics.js.map +1 -0
- package/dist/read-only-tool-allowlist.d.ts +7 -0
- package/dist/read-only-tool-allowlist.d.ts.map +1 -0
- package/dist/read-only-tool-allowlist.js +17 -0
- package/dist/read-only-tool-allowlist.js.map +1 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +786 -0
- package/dist/server.js.map +1 -0
- package/dist/source-read.d.ts +31 -0
- package/dist/source-read.d.ts.map +1 -0
- package/dist/source-read.js +213 -0
- package/dist/source-read.js.map +1 -0
- package/dist/theme-authoring/contract-schema.d.ts +191 -0
- package/dist/theme-authoring/contract-schema.d.ts.map +1 -0
- package/dist/theme-authoring/contract-schema.js +49 -0
- package/dist/theme-authoring/contract-schema.js.map +1 -0
- package/dist/theme-authoring/repository.d.ts +18 -0
- package/dist/theme-authoring/repository.d.ts.map +1 -0
- package/dist/theme-authoring/repository.js +55 -0
- package/dist/theme-authoring/repository.js.map +1 -0
- package/dist/theme-tool.d.ts +26 -0
- package/dist/theme-tool.d.ts.map +1 -0
- package/dist/theme-tool.js +312 -0
- package/dist/theme-tool.js.map +1 -0
- package/dist/utils-guide-topics.d.ts +39 -0
- package/dist/utils-guide-topics.d.ts.map +1 -0
- package/dist/utils-guide-topics.js +202 -0
- package/dist/utils-guide-topics.js.map +1 -0
- package/dist/utils-info.d.ts +75 -0
- package/dist/utils-info.d.ts.map +1 -0
- package/dist/utils-info.js +219 -0
- package/dist/utils-info.js.map +1 -0
- package/dist/utils-suggestion-grounding.d.ts +59 -0
- package/dist/utils-suggestion-grounding.d.ts.map +1 -0
- package/dist/utils-suggestion-grounding.js +267 -0
- package/dist/utils-suggestion-grounding.js.map +1 -0
- package/docs/agent-recipe-example-site.md +91 -0
- package/docs/ai-design-mcp-blueprint.md +75 -0
- package/docs/cross-model-mcp-playbook.md +127 -0
- package/docs/example-site-and-mcp-training.md +82 -0
- package/docs/mcp-capability-status.md +51 -0
- package/docs/mcp-tooling-roadmap.md +36 -0
- package/docs/sky-chart-option-api.md +47 -0
- package/docs/starter-prompt.md +17 -0
- package/docs/theme-config-guide.md +178 -0
- package/docs/utils-usage-guide.md +110 -0
- package/docs/vue-wrapper-v-model.md +36 -0
- package/package.json +63 -0
|
@@ -0,0 +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.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Using @sky.ui/utils
|
|
2
|
+
|
|
3
|
+
Sky UI utilities are **JIT CSS classes** you add in HTML/JSX/Vue/Lit templates (`class` / `className`). A **PostCSS plugin** scans your project, reads **`skyui.config.js`**, and emits only the CSS you use.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @sky.ui/utils postcss
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Register in PostCSS (exact wiring depends on your bundler — use MCP **`get_project_guide`** with `kind: setup`):
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import skyui from '@sky.ui/utils/postcss';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
plugins: [skyui()]
|
|
18
|
+
};
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Peer dependency:** `postcss` >= 8.4.
|
|
22
|
+
|
|
23
|
+
## Public imports
|
|
24
|
+
|
|
25
|
+
| Import | Use |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `@sky.ui/utils` / `@sky.ui/utils/postcss` | PostCSS plugin (**`SkyUIPlugin`**) |
|
|
28
|
+
| `@sky.ui/utils/vite` | Vite integration |
|
|
29
|
+
| `@sky.ui/utils/css-data` | VS Code `css.customData` — silences “Unknown at rule” for `@apply` / `@skyui` |
|
|
30
|
+
| `@sky.ui/utils/suggestion-engine` | Editor completions (optional) |
|
|
31
|
+
| `@sky.ui/utils/prettier-plugin` | Sort class strings in `class` / `@apply` |
|
|
32
|
+
| `@sky.ui/utils/runtime` | Browser **`skyui`** helper for static pages |
|
|
33
|
+
|
|
34
|
+
## `skyui.config.js`
|
|
35
|
+
|
|
36
|
+
Typical fields:
|
|
37
|
+
|
|
38
|
+
| Field | Purpose |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `content` | Globs of files to scan for class names |
|
|
41
|
+
| `safelist` | Classes always generated (strings or `{ pattern, variants }`) |
|
|
42
|
+
| `plugins` | Built-ins such as `@skyuicss/forms`, `@skyuicss/typography`, `@skyuicss/container-queries` |
|
|
43
|
+
| `theme` / `theme.extend` | Colors, spacing, screens, `preflight`, `formsStrategy`, animations |
|
|
44
|
+
| `breakpoints` | Screen map for `sm:`, `md:`, … |
|
|
45
|
+
|
|
46
|
+
The plugin discovers config by walking up from the processed CSS file.
|
|
47
|
+
|
|
48
|
+
## VS Code CSS validation
|
|
49
|
+
|
|
50
|
+
Add to `.vscode/settings.json` so `@apply` and `@skyui` are not flagged as unknown at-rules:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"css.customData": ["./node_modules/@sky.ui/utils/skyui.css-data.json"]
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Or install the **Sky UI IntelliSense** extension (bundles the same custom data).
|
|
59
|
+
|
|
60
|
+
## CSS layers and `@skyui` directives
|
|
61
|
+
|
|
62
|
+
Declare layer order once:
|
|
63
|
+
|
|
64
|
+
```css
|
|
65
|
+
@layer skyui.base, skyui.components, skyui.utilities;
|
|
66
|
+
@skyui utilities;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
| Directive | Purpose |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| `@apply` | Compose utilities inside component CSS |
|
|
72
|
+
| `@skyui theme { … }` | CSS-first design tokens |
|
|
73
|
+
| `@skyui source "glob"` | Extra scan paths |
|
|
74
|
+
| `@skyui source inline("a b")` | Safelist in CSS |
|
|
75
|
+
| `@skyui reference` | Tokens only in scoped styles (pair with global utilities) |
|
|
76
|
+
| `@skyui utility` / `@skyui variant` | Custom utility or variant |
|
|
77
|
+
| `@skyui plugin "…"` | Load a plugin spec |
|
|
78
|
+
|
|
79
|
+
## Built-in plugins (`@skyuicss/*`)
|
|
80
|
+
|
|
81
|
+
| Spec | Role |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `@skyuicss/forms` | Form control utilities; optional `formsStrategy`: `class` \| `base` \| `both` |
|
|
84
|
+
| `@skyuicss/typography` | `prose` utilities (`--sky-prose-*` variables) |
|
|
85
|
+
| `@skyuicss/container-queries` | Container-query variants from theme screens |
|
|
86
|
+
|
|
87
|
+
Short aliases: `forms`, `typography`, `container-queries`.
|
|
88
|
+
|
|
89
|
+
## Preflight
|
|
90
|
+
|
|
91
|
+
`theme.preflight`: `true` | `"minimal"` | `"full"` — optional base reset in `@layer skyui.base` (default off).
|
|
92
|
+
|
|
93
|
+
## Variants (common families)
|
|
94
|
+
|
|
95
|
+
Responsive (`sm:`, `md:`, `max-sm:`), dark/light, state (`hover:`, `focus:`, `disabled:`), `not-*`, `group-*` / `peer-*`, `starting:`, `aria-*`, arbitrary (`has-[…]:`, `[&…]:`).
|
|
96
|
+
|
|
97
|
+
Use MCP **`utility_classes`** (`operation: variant_prefixes`) for the full prefix list, **`search_classes`** to browse names, **`check_class`** to validate a token.
|
|
98
|
+
|
|
99
|
+
## Theme alignment with components
|
|
100
|
+
|
|
101
|
+
Use MCP **`get_theme`** — start with **`operation: guide`**, then **`fields`** / **`field`** for `userTheme` paths, and **`operation: variables`** for emitted **`--sky-*`** names. Align `skyui.config` `theme.extend` with tokens from **`@sky.ui/core`**. Prefer utility classes for layout/spacing/typography around **`<sky-*>`** elements.
|
|
102
|
+
|
|
103
|
+
## Styling workflow for assistants
|
|
104
|
+
|
|
105
|
+
1. **`get_project_guide`** — install + bundler wiring
|
|
106
|
+
2. **`utility_classes`** — validate and discover class names
|
|
107
|
+
3. **`get_theme`** — token names for custom theme keys
|
|
108
|
+
4. **`get_docs`** — `packages/mcp/docs/utils-usage-guide.md` (this file) when needed
|
|
109
|
+
|
|
110
|
+
Prefer utility `class` / `className` over large hand-written CSS unless the user asks otherwise.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Vue wrappers: `v-model` support and usage
|
|
2
|
+
|
|
3
|
+
## When `v-model` works
|
|
4
|
+
|
|
5
|
+
Use `v-model` on a `@sky.ui/vue` wrapper **when that component is documented for two-way binding**—confirm the primary value prop and update event in **`get_sky_component_docs`** (props/events surfaces).
|
|
6
|
+
|
|
7
|
+
If the component does **not** document a two-way pair, treat it as **one-way**: bind with `:prop` / `@event` using the names from those tools. Do not assume `v-model` matches other UI libraries.
|
|
8
|
+
|
|
9
|
+
## Usage patterns
|
|
10
|
+
|
|
11
|
+
**Default `v-model`** — when the primary bound prop is the default for that component (often `modelValue` / `value`-style APIs exposed to Vue):
|
|
12
|
+
|
|
13
|
+
```vue
|
|
14
|
+
<SkyExample v-model="selected" />
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Named `v-model`** — when you bind a specific prop (replace `propName` with the actual prop from docs):
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<SkyExample v-model:propName="selected" />
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Explicit two-way** — use the prop and event names from docs (`get_component_events`). Payload is on **`CustomEvent.detail`**:
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<SkyExample :foo="state" @foo-changed="onFooChanged" />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
function onFooChanged(e: Event) {
|
|
31
|
+
const detail = (e as CustomEvent).detail;
|
|
32
|
+
// Map detail to local state using the shape documented for this component.
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Sky UI elements expose **`CustomEvent`** payloads on **`detail`**; wrappers follow the same contract where two-way binding applies.
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sky.ui/mcp",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "MCP server for Sky UI — component catalog, docs, theme tokens, and live snippets from library.sky-ui.com for AI coding assistants.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"sky-ui-mcp": "dist/mcp-stdio-entry.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./dist/server.js",
|
|
12
|
+
"./docs": "./dist/docs.js",
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"data",
|
|
19
|
+
"docs",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE.md"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "node ./scripts/gen-chart-api-sections.mjs && node ./scripts/gen-utils-suggestion-fallback.mjs && node ./scripts/gen-reactivity-readme-snapshot.mjs && tsc -p tsconfig.json && node ./scripts/verify-mcp-tool-parity.mjs && node ./scripts/validate-guideline-component-refs.mjs && node ./scripts/scan-guideline-banned-patterns.mjs && npm run check:guideline-coverage",
|
|
25
|
+
"start": "node ./dist/mcp-stdio-entry.js",
|
|
26
|
+
"dev": "tsx ./src/server.ts",
|
|
27
|
+
"serve:post": "tsx ./src/post-endpoint-server.ts",
|
|
28
|
+
"serve:post:dist": "node ./dist/post-endpoint-server.js",
|
|
29
|
+
"check:guideline-coverage": "node ./scripts/check-guideline-coverage.mjs",
|
|
30
|
+
"check:guideline-coverage:strict": "node ./scripts/check-guideline-coverage.mjs --strict",
|
|
31
|
+
"check:guideline-banned-patterns": "node ./scripts/scan-guideline-banned-patterns.mjs",
|
|
32
|
+
"clean": "rimraf dist"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@fastify/cors": "^11.2.0",
|
|
36
|
+
"@fastify/rate-limit": "^10.3.0",
|
|
37
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
38
|
+
"fastify": "^5.8.5",
|
|
39
|
+
"typescript": "^5.9.3",
|
|
40
|
+
"zod": "^3.25.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@sky.ui/core": ">=0.0.1",
|
|
44
|
+
"@sky.ui/utils": ">=0.0.1"
|
|
45
|
+
},
|
|
46
|
+
"peerDependenciesMeta": {
|
|
47
|
+
"@sky.ui/utils": {
|
|
48
|
+
"optional": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^22.10.0",
|
|
53
|
+
"rimraf": "^6.1.2",
|
|
54
|
+
"tsx": "^4.19.0"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=18"
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public",
|
|
61
|
+
"registry": "https://registry.npmjs.org/"
|
|
62
|
+
}
|
|
63
|
+
}
|