igniteui-theming 25.0.0-beta.4 → 25.0.0-beta.5

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.
Files changed (176) hide show
  1. package/README.md +283 -5
  2. package/dist/mcp/generators/css.d.ts +115 -0
  3. package/dist/mcp/generators/css.js +143 -0
  4. package/dist/mcp/generators/sass.d.ts +50 -0
  5. package/dist/mcp/generators/sass.js +272 -0
  6. package/dist/mcp/index.d.ts +8 -0
  7. package/dist/mcp/index.js +349 -0
  8. package/dist/mcp/json/colors/presets/palettes.json.js +13 -0
  9. package/dist/mcp/json/components/themes.json.js +146 -0
  10. package/dist/mcp/json/elevations/indigo.json.js +8 -0
  11. package/dist/mcp/json/elevations/material.json.js +8 -0
  12. package/dist/mcp/json/typography/presets/typescales.json.js +17 -0
  13. package/dist/mcp/knowledge/color-usage.d.ts +105 -0
  14. package/dist/mcp/knowledge/color-usage.js +506 -0
  15. package/dist/mcp/knowledge/colors.d.ts +64 -0
  16. package/dist/mcp/knowledge/colors.js +52 -0
  17. package/dist/mcp/knowledge/component-metadata.d.ts +131 -0
  18. package/dist/mcp/knowledge/component-metadata.js +542 -0
  19. package/dist/mcp/knowledge/component-themes.d.ts +78 -0
  20. package/dist/mcp/knowledge/component-themes.js +35 -0
  21. package/dist/mcp/knowledge/custom-palettes.d.ts +19 -0
  22. package/dist/mcp/knowledge/custom-palettes.js +11 -0
  23. package/dist/mcp/knowledge/docs/colors/guidance.md.js +4 -0
  24. package/dist/mcp/knowledge/docs/colors/usage.md.js +4 -0
  25. package/dist/mcp/knowledge/docs/layout/functions/border-radius.md.js +4 -0
  26. package/dist/mcp/knowledge/docs/layout/functions/pad.md.js +4 -0
  27. package/dist/mcp/knowledge/docs/layout/functions/sizable.md.js +4 -0
  28. package/dist/mcp/knowledge/docs/layout/mixins/sizable.md.js +4 -0
  29. package/dist/mcp/knowledge/docs/layout/mixins/sizing.md.js +4 -0
  30. package/dist/mcp/knowledge/docs/layout/mixins/spacing.md.js +4 -0
  31. package/dist/mcp/knowledge/docs/layout/overview.md.js +4 -0
  32. package/dist/mcp/knowledge/elevations.d.ts +24 -0
  33. package/dist/mcp/knowledge/elevations.js +13 -0
  34. package/dist/mcp/knowledge/index.d.ts +16 -0
  35. package/dist/mcp/knowledge/index.js +93 -0
  36. package/dist/mcp/knowledge/layout-docs.d.ts +8 -0
  37. package/dist/mcp/knowledge/multipliers.d.ts +20 -0
  38. package/dist/mcp/knowledge/palettes.d.ts +59 -0
  39. package/dist/mcp/knowledge/palettes.js +19 -0
  40. package/dist/mcp/knowledge/platforms/angular.d.ts +106 -0
  41. package/dist/mcp/knowledge/platforms/angular.js +199 -0
  42. package/dist/mcp/knowledge/platforms/blazor.d.ts +54 -0
  43. package/dist/mcp/knowledge/platforms/blazor.js +141 -0
  44. package/dist/mcp/knowledge/platforms/common.d.ts +87 -0
  45. package/dist/mcp/knowledge/platforms/common.js +75 -0
  46. package/dist/mcp/knowledge/platforms/index.d.ts +152 -0
  47. package/dist/mcp/knowledge/platforms/index.js +244 -0
  48. package/dist/mcp/knowledge/platforms/react.d.ts +49 -0
  49. package/dist/mcp/knowledge/platforms/react.js +135 -0
  50. package/dist/mcp/knowledge/platforms/webcomponents.d.ts +129 -0
  51. package/dist/mcp/knowledge/platforms/webcomponents.js +409 -0
  52. package/dist/mcp/knowledge/sass-api.d.ts +275 -0
  53. package/dist/mcp/knowledge/typography.d.ts +38 -0
  54. package/dist/mcp/knowledge/typography.js +5 -0
  55. package/dist/mcp/resources/index.d.ts +4 -0
  56. package/dist/mcp/resources/presets.d.ts +162 -0
  57. package/dist/mcp/resources/presets.js +474 -0
  58. package/dist/mcp/tools/descriptions.d.ts +107 -0
  59. package/dist/mcp/tools/descriptions.js +1058 -0
  60. package/dist/mcp/tools/handlers/color.d.ts +7 -0
  61. package/dist/mcp/tools/handlers/color.js +66 -0
  62. package/dist/mcp/tools/handlers/component-theme.d.ts +14 -0
  63. package/dist/mcp/tools/handlers/component-theme.js +245 -0
  64. package/dist/mcp/tools/handlers/component-tokens.d.ts +7 -0
  65. package/dist/mcp/tools/handlers/component-tokens.js +215 -0
  66. package/dist/mcp/tools/handlers/custom-palette.d.ts +7 -0
  67. package/dist/mcp/tools/handlers/custom-palette.js +193 -0
  68. package/dist/mcp/tools/handlers/elevations.d.ts +7 -0
  69. package/dist/mcp/tools/handlers/elevations.js +30 -0
  70. package/dist/mcp/tools/handlers/index.d.ts +14 -0
  71. package/dist/mcp/tools/handlers/layout.d.ts +37 -0
  72. package/dist/mcp/tools/handlers/layout.js +197 -0
  73. package/dist/mcp/tools/handlers/palette.d.ts +7 -0
  74. package/dist/mcp/tools/handlers/palette.js +128 -0
  75. package/dist/mcp/tools/handlers/platform.d.ts +35 -0
  76. package/dist/mcp/tools/handlers/platform.js +173 -0
  77. package/dist/mcp/tools/handlers/resource.d.ts +14 -0
  78. package/dist/mcp/tools/handlers/resource.js +33 -0
  79. package/dist/mcp/tools/handlers/theme.d.ts +7 -0
  80. package/dist/mcp/tools/handlers/theme.js +103 -0
  81. package/dist/mcp/tools/handlers/typography.d.ts +7 -0
  82. package/dist/mcp/tools/handlers/typography.js +32 -0
  83. package/dist/mcp/tools/index.d.ts +5 -0
  84. package/dist/mcp/tools/schemas.d.ts +867 -0
  85. package/dist/mcp/tools/schemas.js +221 -0
  86. package/dist/mcp/utils/color.d.ts +191 -0
  87. package/dist/mcp/utils/color.js +262 -0
  88. package/dist/mcp/utils/preprocessing.d.ts +41 -0
  89. package/dist/mcp/utils/preprocessing.js +34 -0
  90. package/dist/mcp/utils/result.d.ts +223 -0
  91. package/dist/mcp/utils/result.js +47 -0
  92. package/dist/mcp/utils/sass.d.ts +176 -0
  93. package/dist/mcp/utils/sass.js +194 -0
  94. package/dist/mcp/utils/types.d.ts +288 -0
  95. package/dist/mcp/utils/types.js +57 -0
  96. package/dist/mcp/validators/custom-palette.d.ts +22 -0
  97. package/dist/mcp/validators/custom-palette.js +257 -0
  98. package/dist/mcp/validators/index.d.ts +6 -0
  99. package/dist/mcp/validators/palette.d.ts +115 -0
  100. package/dist/mcp/validators/palette.js +248 -0
  101. package/dist/mcp/vite-env.d.ts +18 -0
  102. package/index.js +5 -5
  103. package/json/components/bootstrap.json +1 -0
  104. package/json/components/fluent.json +1 -0
  105. package/json/components/indigo.json +1 -0
  106. package/json/components/material.json +1 -0
  107. package/json/components/themes.json +7452 -0
  108. package/package.json +41 -16
  109. package/sass/json/components.scss +52 -0
  110. package/sass/themes/charts/_theme.scss +12 -12
  111. package/sass/themes/components/action-strip/_action-strip-theme.scss +9 -4
  112. package/sass/themes/components/avatar/_avatar-theme.scss +10 -4
  113. package/sass/themes/components/badge/_badge-theme.scss +9 -5
  114. package/sass/themes/components/banner/_banner-theme.scss +10 -6
  115. package/sass/themes/components/bottom-nav/_bottom-nav-theme.scss +16 -9
  116. package/sass/themes/components/button/_button-theme.scss +19 -13
  117. package/sass/themes/components/button/_contained-button-theme.scss +27 -22
  118. package/sass/themes/components/button/_fab-button-theme.scss +28 -22
  119. package/sass/themes/components/button/_flat-button-theme.scss +26 -19
  120. package/sass/themes/components/button/_outlined-button-theme.scss +31 -24
  121. package/sass/themes/components/button-group/_button-group-theme.scss +39 -35
  122. package/sass/themes/components/calendar/_calendar-theme.scss +66 -45
  123. package/sass/themes/components/card/_card-theme.scss +11 -6
  124. package/sass/themes/components/carousel/_carousel-theme.scss +25 -18
  125. package/sass/themes/components/chat/_chat-theme.scss +24 -17
  126. package/sass/themes/components/checkbox/_checkbox-theme.scss +21 -13
  127. package/sass/themes/components/chip/_chip-theme.scss +25 -18
  128. package/sass/themes/components/column-actions/_column-actions-theme.scss +9 -3
  129. package/sass/themes/components/combo/_combo-theme.scss +21 -12
  130. package/sass/themes/components/date-range-picker/_date-range-picker-theme.scss +5 -0
  131. package/sass/themes/components/dialog/_dialog-theme.scss +10 -4
  132. package/sass/themes/components/divider/_divider-theme.scss +4 -0
  133. package/sass/themes/components/dock-manager/_dock-manager-theme.scss +6 -1
  134. package/sass/themes/components/drop-down/_drop-down-theme.scss +27 -20
  135. package/sass/themes/components/expansion-panel/_expansion-panel-theme.scss +30 -10
  136. package/sass/themes/components/grid/_grid-summary-theme.scss +14 -6
  137. package/sass/themes/components/grid/_grid-theme.scss +77 -66
  138. package/sass/themes/components/grid/_grid-toolbar-theme.scss +18 -8
  139. package/sass/themes/components/grid/_pivot-data-selector-theme.scss +5 -0
  140. package/sass/themes/components/highlight/_highlight-theme.scss +12 -5
  141. package/sass/themes/components/icon/_icon-theme.scss +4 -0
  142. package/sass/themes/components/icon-button/_contained-icon-button-theme.scss +24 -16
  143. package/sass/themes/components/icon-button/_flat-icon-button-theme.scss +22 -13
  144. package/sass/themes/components/icon-button/_icon-button-theme.scss +19 -9
  145. package/sass/themes/components/icon-button/_outlined-icon-button-theme.scss +24 -15
  146. package/sass/themes/components/input/_file-input-theme.scss +24 -16
  147. package/sass/themes/components/input/_input-theme.scss +86 -27
  148. package/sass/themes/components/label/_label-theme.scss +4 -0
  149. package/sass/themes/components/list/_list-theme.scss +35 -28
  150. package/sass/themes/components/navbar/_navbar-theme.scss +12 -5
  151. package/sass/themes/components/navdrawer/_navdrawer-theme.scss +20 -13
  152. package/sass/themes/components/overlay/_overlay-theme.scss +4 -0
  153. package/sass/themes/components/paginator/_paginator-theme.scss +9 -3
  154. package/sass/themes/components/progress/_circular-theme.scss +6 -1
  155. package/sass/themes/components/progress/_linear-theme.scss +5 -0
  156. package/sass/themes/components/query-builder/_query-builder-theme.scss +22 -13
  157. package/sass/themes/components/radio/_radio-theme.scss +21 -12
  158. package/sass/themes/components/rating/_rating-theme.scss +6 -1
  159. package/sass/themes/components/ripple/_ripple-theme.scss +4 -0
  160. package/sass/themes/components/scrollbar/_scrollbar-theme.scss +5 -1
  161. package/sass/themes/components/select/_select-theme.scss +13 -6
  162. package/sass/themes/components/slider/_slider-theme.scss +24 -15
  163. package/sass/themes/components/snackbar/_snackbar-theme.scss +10 -5
  164. package/sass/themes/components/splitter/_splitter-theme.scss +11 -5
  165. package/sass/themes/components/stepper/_stepper-theme.scss +64 -53
  166. package/sass/themes/components/switch/_switch-theme.scss +27 -19
  167. package/sass/themes/components/tabs/_tabs-theme.scss +30 -22
  168. package/sass/themes/components/time-picker/_time-picker-theme.scss +21 -15
  169. package/sass/themes/components/toast/_toast-theme.scss +10 -3
  170. package/sass/themes/components/tooltip/_tooltip-theme.scss +9 -3
  171. package/sass/themes/components/tree/_tree-theme.scss +21 -13
  172. package/sass/themes/components/watermark/_watermark-theme.scss +9 -6
  173. package/sass/themes/schemas/components/light/_input-group.scss +1 -1
  174. package/tailwind/utilities/fluent.css +1 -1
  175. package/tailwind/utilities/indigo.css +1 -1
  176. package/tailwind/utilities/material.css +1 -1
package/README.md CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  <h1 align="center">
3
2
  Ignite UI Theming - from Infragistics
4
3
  </h1>
@@ -8,6 +7,7 @@
8
7
  The Ignite UI Theming repository collects a set of Sass mixins, functions, and variables used to create themes for a variety of UI frameworks built by Infragistics. The theming package makes it super easy to create palettes, elevations and typography styles for your projects.
9
8
 
10
9
  ## Palettes
10
+
11
11
  We provide four predefined palettes - material, bootstrap, fluent and indigo that have all the necessary colors along with diffent variants of those colors to make it even easier picking the right one for your case. Here's what they look like:
12
12
 
13
13
  ![Palettes](https://user-images.githubusercontent.com/45598235/189592212-0d58b08d-3c98-4f27-8ec3-c6f674c9942b.png)
@@ -18,10 +18,10 @@ To access any of the colors in the palettes, you can use the `color` function:
18
18
  background: color($light-material-palette, 'primary', 500);
19
19
  ```
20
20
 
21
- You can take a further look on what color functions and mixins the package contains and how to use them in the [Colors Wiki Page](https://github.com/IgniteUI/igniteui-theming/wiki/Colors-(Draft))
22
-
21
+ You can take a further look on what color functions and mixins the package contains and how to use them in the [Colors Wiki Page](<https://github.com/IgniteUI/igniteui-theming/wiki/Colors-(Draft)>)
23
22
 
24
23
  ## Typography
24
+
25
25
  Another valuable module of our theming package is the typography, helping you have consistency all over your project. There are again four typography presets for the four themes that we provide out of the box.
26
26
 
27
27
  ![Typography](https://user-images.githubusercontent.com/45598235/189596034-d8697bc1-e683-4d4a-a113-96e17fc90d4b.png)
@@ -32,9 +32,10 @@ You can set any of the typefaces by using the `typography` mixin, which accepts
32
32
  @include typography($font-family: $material-typeface, $type-scale: $material-type-scale);
33
33
  ```
34
34
 
35
- Learn more about the typography module in the package by checking out the [Typography Wiki Page](https://github.com/IgniteUI/igniteui-theming/wiki/Typography-(Draft))
35
+ Learn more about the typography module in the package by checking out the [Typography Wiki Page](<https://github.com/IgniteUI/igniteui-theming/wiki/Typography-(Draft)>)
36
36
 
37
37
  ## Elevations
38
+
38
39
  The theming package is providing one preset of shadows that can be used to give your components a lift. They're super helpful using with buttons, cards, navigation bars, etc.
39
40
 
40
41
  ![Elevations](https://user-images.githubusercontent.com/45598235/189627744-1fa47d35-6b3b-4b7a-b26e-5b46fe4311a4.png)
@@ -45,7 +46,7 @@ You can set elevations 0-24, by using the `elevation` function, which accepts th
45
46
  box-shadow: elevation(12);
46
47
  ```
47
48
 
48
- Learn more about elevations and their abilities in the [Elevations Wiki Page](https://github.com/IgniteUI/igniteui-theming/wiki/Elevations-(draft))
49
+ Learn more about elevations and their abilities in the [Elevations Wiki Page](<https://github.com/IgniteUI/igniteui-theming/wiki/Elevations-(draft)>)
49
50
 
50
51
  ## Usage
51
52
 
@@ -106,8 +107,285 @@ npm run serve:docs
106
107
  ## Testing and Debugging
107
108
 
108
109
  ### Preview Palettes
110
+
109
111
  To preview a palette you can pass the palette (`material`, `bootstrap`, `fluent`, `indigo`) and variant (`light` or `dark`) to the `palette` and `variant` arguments respectively. If you want to output the result to a file in the `./dist` folder add the `out` option.
110
112
 
111
113
  ```
112
114
  npm run preview:palette -- --palette=material --variant=light --out
113
115
  ```
116
+
117
+ ---
118
+
119
+ ## MCP Server (AI-Assisted Theming)
120
+
121
+ The Ignite UI Theming package includes a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that enables AI assistants to generate production-ready theming code for your Ignite UI applications.
122
+
123
+ ### What is MCP?
124
+
125
+ The Model Context Protocol allows AI assistants (like Claude, GitHub Copilot, and others) to connect to external tools and data sources. The Ignite UI Theming MCP server acts as an expert theming assistant that can:
126
+
127
+ - 🎨 **Generate color palettes** with automatic shade variations
128
+ - 📝 **Create typography systems** following design standards
129
+ - 🌓 **Build complete themes** for light and dark modes
130
+ - 🎯 **Customize components** with design tokens
131
+ - ✅ **Validate colors** for accessibility compliance
132
+
133
+ ### Quick Start
134
+
135
+ #### 1. Clone and Build
136
+
137
+ Clone the repository and build the MCP server:
138
+
139
+ ```bash
140
+ npm install
141
+ npm run build:mcp
142
+ ```
143
+
144
+ #### 2. Configure Your AI Client
145
+
146
+ The MCP server works with any MCP-compatible client. Here are setup instructions for popular clients:
147
+
148
+ <details>
149
+ <summary><strong>VS Code</strong> (with MCP-compatible extensions)</summary>
150
+
151
+ **For local development** - Create or edit `.vscode/mcp.json`:
152
+
153
+ ```json
154
+ {
155
+ "mcp.servers": {
156
+ "igniteui-theming": {
157
+ "command": "node",
158
+ "args": ["/absolute/path/to/igniteui-theming/dist/mcp/index.js"]
159
+ }
160
+ }
161
+ }
162
+ ```
163
+
164
+ **Using published package**:
165
+
166
+ ```json
167
+ {
168
+ "mcp.servers": {
169
+ "igniteui-theming": {
170
+ "command": "npx",
171
+ "args": ["igniteui-theming-mcp"]
172
+ }
173
+ }
174
+ }
175
+ ```
176
+
177
+ </details>
178
+
179
+ <details>
180
+ <summary><strong>WebStorm / JetBrains IDEs</strong></summary>
181
+
182
+ 1. Go to **Settings → Tools → AI Assistant → MCP Servers**
183
+ 2. Click **+ Add MCP Server**
184
+ 3. Configure:
185
+ - **Name**: `igniteui-theming`
186
+ - **Command**: `node` (for local) or `npx` (for package)
187
+ - **Arguments**:
188
+ - Local: `/absolute/path/to/igniteui-theming/dist/mcp/index.js`
189
+ - Package: `igniteui-theming-mcp`
190
+ 4. Click **OK** and restart AI Assistant
191
+
192
+ </details>
193
+
194
+ <details>
195
+ <summary><strong>Claude Desktop</strong></summary>
196
+
197
+ Add to your configuration file:
198
+
199
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
200
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
201
+
202
+ **For local development**:
203
+
204
+ ```json
205
+ {
206
+ "mcpServers": {
207
+ "igniteui-theming": {
208
+ "command": "node",
209
+ "args": ["/absolute/path/to/igniteui-theming/dist/mcp/index.js"]
210
+ }
211
+ }
212
+ }
213
+ ```
214
+
215
+ **Using published package**:
216
+
217
+ ```json
218
+ {
219
+ "mcpServers": {
220
+ "igniteui-theming": {
221
+ "command": "npx",
222
+ "args": ["igniteui-theming-mcp"]
223
+ }
224
+ }
225
+ }
226
+ ```
227
+
228
+ </details>
229
+
230
+ <details>
231
+ <summary><strong>Cursor</strong></summary>
232
+
233
+ Create or edit `.cursor/mcp.json` in your project:
234
+
235
+ **For local development**:
236
+
237
+ ```json
238
+ {
239
+ "mcpServers": {
240
+ "igniteui-theming": {
241
+ "command": "node",
242
+ "args": ["/absolute/path/to/igniteui-theming/dist/mcp/index.js"]
243
+ }
244
+ }
245
+ }
246
+ ```
247
+
248
+ **Using published package**:
249
+
250
+ ```json
251
+ {
252
+ "mcpServers": {
253
+ "igniteui-theming": {
254
+ "command": "npx",
255
+ "args": ["igniteui-theming-mcp"]
256
+ }
257
+ }
258
+ }
259
+ ```
260
+
261
+ </details>
262
+
263
+ ### What Can It Do?
264
+
265
+ #### 🎨 Create Complete Themes
266
+
267
+ Simply describe your theme to your AI assistant:
268
+
269
+ > "Create a Material Design dark theme for my Angular app with that takes inspiration from the Gruvbox color scheme."
270
+
271
+ The AI will generate production-ready Sass code with:
272
+
273
+ - Color palette with all shade variations
274
+ - Typography setup with proper type scales
275
+ - Elevation shadows
276
+ - Platform-specific imports and configuration
277
+
278
+ #### 🌈 Generate Color Palettes
279
+
280
+ > "Generate a light theme palette using teal as primary and purple as secondary"
281
+
282
+ Get perfectly calculated color shades following design system standards.
283
+
284
+ #### 📝 Setup Typography
285
+
286
+ > "Set up typography using Inter font with Material Design type scale for Web Components"
287
+
288
+ Get proper typography configuration with font families and responsive type scales.
289
+
290
+ #### 🎯 Customize Components
291
+
292
+ > "What design tokens are available for the button component?"
293
+ >
294
+ > "Create a flat button theme with purple background and white text"
295
+
296
+ Discover and customize individual component styles using design tokens.
297
+
298
+ ### Available Capabilities
299
+
300
+ The MCP server provides **8 tools** and **16 resources**:
301
+
302
+ #### Tools (Actions)
303
+
304
+ | Tool | Description |
305
+ | ----------------------------- | --------------------------------------------------------------- |
306
+ | `detect_platform` | Auto-detect which Ignite UI platform your project uses |
307
+ | `create_palette` | Generate color palette with automatic shade calculations |
308
+ | `create_custom_palette` | Create palette with fine-grained control over individual shades |
309
+ | `create_typography` | Setup typography with font families and type scales |
310
+ | `create_elevations` | Configure elevation shadows |
311
+ | `create_theme` | Generate complete theme (palette + typography + elevations) |
312
+ | `get_component_design_tokens` | Discover customizable properties for components |
313
+ | `create_component_theme` | Generate component-specific theme code |
314
+
315
+ #### Resources (Reference Data)
316
+
317
+ - **Platform Information**: Configuration for Angular, Web Components, React, and Blazor
318
+ - **Preset Libraries**: Pre-built palettes, typography, and elevation sets
319
+ - **Color Guidance**: Best practices for color selection and usage
320
+ - **Design System Schemas**: Material, Bootstrap, Fluent, and Indigo configurations
321
+
322
+ ### Supported Platforms
323
+
324
+ - **Angular** - `igniteui-angular`
325
+ - **Web Components** - `igniteui-webcomponents`
326
+ - **React** - `igniteui-react`
327
+ - **Blazor** - `igniteui-blazor`
328
+
329
+ ### Example Interactions
330
+
331
+ <details>
332
+ <summary><strong>Creating a new project theme</strong></summary>
333
+
334
+ **You**: "I'm starting a new Angular project with Ignite UI. Create a complete Material Design theme with primary blue, secondary coral, light theme, and Roboto font"
335
+
336
+ **AI**: _Uses `create_theme` tool and generates complete Sass code ready to use_
337
+
338
+ </details>
339
+
340
+ <details>
341
+ <summary><strong>Adding dark mode</strong></summary>
342
+
343
+ **You**: "I need a dark mode version with the same primary blue but dark surface"
344
+
345
+ **AI**: _Uses `create_theme` with `variant: "dark"` and generates dark theme code_
346
+
347
+ </details>
348
+
349
+ <details>
350
+ <summary><strong>Customizing components</strong></summary>
351
+
352
+ **You**: "What properties can I customize on the card component?"
353
+
354
+ **AI**: _Uses `get_component_design_tokens` to show available tokens_
355
+
356
+ **You**: "Make the card have a light gray background with subtle shadow"
357
+
358
+ **AI**: _Uses `create_component_theme` to generate component theme code_
359
+
360
+ </details>
361
+
362
+ ### Full Documentation
363
+
364
+ For detailed documentation including:
365
+
366
+ - Complete tool parameter reference
367
+ - All prompt examples
368
+ - Platform-specific differences
369
+ - Troubleshooting guide
370
+ - Development instructions
371
+
372
+ See the [MCP Server README](./src/mcp/README.md)
373
+
374
+ ### Development Scripts
375
+
376
+ ```bash
377
+ # Build for production
378
+ npm run build:mcp
379
+
380
+ # Debug with MCP Inspector
381
+ npm run mcp:inspector
382
+
383
+ # Run tests
384
+ npm run test
385
+ ```
386
+
387
+ ---
388
+
389
+ ## Contributing
390
+
391
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -0,0 +1,115 @@
1
+ import { ColorDefinition, GrayDefinition, PLATFORMS, ThemeVariant } from '../utils/types.js';
2
+ /**
3
+ * Result from generating CSS palette variables.
4
+ */
5
+ export interface CssPaletteResult {
6
+ css: string;
7
+ description: string;
8
+ }
9
+ /**
10
+ * Result from generating component theme CSS.
11
+ */
12
+ export interface CssComponentThemeResult {
13
+ css: string;
14
+ description: string;
15
+ }
16
+ /**
17
+ * Options for generating standard palette CSS variables.
18
+ */
19
+ export interface PaletteCssOptions {
20
+ primary: string;
21
+ secondary: string;
22
+ surface: string;
23
+ gray?: string;
24
+ info?: string;
25
+ success?: string;
26
+ warn?: string;
27
+ error?: string;
28
+ variant?: ThemeVariant;
29
+ _loadPaths?: string[];
30
+ }
31
+ /**
32
+ * Generate CSS custom properties for a standard palette.
33
+ *
34
+ * This function compiles Sass code that uses the palette() function and
35
+ * @include palette() mixin, then returns the compiled CSS output.
36
+ *
37
+ * @example
38
+ * const result = await generatePaletteCss({
39
+ * primary: '#1976d2',
40
+ * secondary: '#ff9800',
41
+ * surface: '#fafafa',
42
+ * variant: 'light'
43
+ * });
44
+ * // result.css contains :root { --ig-primary-50: ...; --ig-primary-100: ...; ... }
45
+ */
46
+ export declare function generatePaletteCss(options: PaletteCssOptions): Promise<CssPaletteResult>;
47
+ /**
48
+ * Options for generating custom palette CSS variables.
49
+ */
50
+ export interface CustomPaletteCssOptions {
51
+ variant?: ThemeVariant;
52
+ surfaceColor?: string;
53
+ colors: {
54
+ primary: ColorDefinition;
55
+ secondary: ColorDefinition;
56
+ surface: ColorDefinition;
57
+ gray: GrayDefinition;
58
+ info: ColorDefinition;
59
+ success: ColorDefinition;
60
+ warn: ColorDefinition;
61
+ error: ColorDefinition;
62
+ };
63
+ _loadPaths?: string[];
64
+ }
65
+ /**
66
+ * Generate CSS custom properties for a custom palette.
67
+ *
68
+ * This function generates Sass code for the custom palette structure
69
+ * (using either shades() function or explicit values), compiles it,
70
+ * and returns the CSS output.
71
+ */
72
+ export declare function generateCustomPaletteCss(options: CustomPaletteCssOptions): Promise<CssPaletteResult>;
73
+ /**
74
+ * Format CSS output for display.
75
+ * Adds a header comment and ensures consistent formatting.
76
+ */
77
+ export declare function formatCssOutput(css: string, description: string): string;
78
+ /**
79
+ * Options for generating component theme CSS variables.
80
+ */
81
+ export interface ComponentThemeCssOptions {
82
+ platform: (typeof PLATFORMS)[number];
83
+ /** Design system (defaults to 'material') */
84
+ designSystem?: string;
85
+ /** Theme variant - light or dark (defaults to 'light') */
86
+ variant?: string;
87
+ /** Component name (e.g., "button", "avatar") */
88
+ component: string;
89
+ /** Token name-value pairs */
90
+ tokens: Record<string, string | number>;
91
+ /** CSS selector to scope the theme (optional) */
92
+ selector?: string;
93
+ /** Custom variable name (optional) */
94
+ name?: string;
95
+ /** Internal testing parameter for load paths */
96
+ _loadPaths?: string[];
97
+ }
98
+ /**
99
+ * Generate CSS custom properties for a component theme.
100
+ *
101
+ * This function compiles Sass code that uses the component theme function
102
+ * and @include tokens() mixin, then returns the compiled CSS output.
103
+ *
104
+ * @example
105
+ * const result = await generateComponentThemeCss({
106
+ * platform: 'webcomponents',
107
+ * designSystem: 'bootstrap',
108
+ * variant: 'light',
109
+ * component: 'button',
110
+ * tokens: { background: '#1976d2', 'text-color': 'white' },
111
+ * selector: 'igc-button'
112
+ * });
113
+ * // result.css contains: igc-button { --ig-button-background: var(--ig-button-background, #1976d2); ... }
114
+ */
115
+ export declare function generateComponentThemeCss(options: ComponentThemeCssOptions): Promise<CssComponentThemeResult>;
@@ -0,0 +1,143 @@
1
+ import * as path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import * as sass from "sass-embedded";
4
+ const __filename$1 = fileURLToPath(import.meta.url);
5
+ const __dirname$1 = path.dirname(__filename$1);
6
+ const PACKAGE_ROOT = path.resolve(__dirname$1, "..", "..", "..");
7
+ async function generatePaletteCss(options) {
8
+ const variant = options.variant ?? "light";
9
+ const paletteArgs = [
10
+ `$primary: ${options.primary}`,
11
+ `$secondary: ${options.secondary}`,
12
+ `$surface: ${options.surface}`
13
+ ];
14
+ if (options.gray) paletteArgs.push(`$gray: ${options.gray}`);
15
+ if (options.info) paletteArgs.push(`$info: ${options.info}`);
16
+ if (options.success) paletteArgs.push(`$success: ${options.success}`);
17
+ if (options.warn) paletteArgs.push(`$warn: ${options.warn}`);
18
+ if (options.error) paletteArgs.push(`$error: ${options.error}`);
19
+ const sassCode = `
20
+ @use 'sass/color' as *;
21
+
22
+ $palette: palette(
23
+ ${paletteArgs.join(",\n ")}
24
+ );
25
+
26
+ @include palette($palette);
27
+ `;
28
+ try {
29
+ const loadPaths = options._loadPaths ?? [PACKAGE_ROOT];
30
+ const result = await sass.compileStringAsync(sassCode, {
31
+ loadPaths,
32
+ style: "expanded"
33
+ });
34
+ return {
35
+ css: result.css,
36
+ description: `Generated CSS custom properties for a ${variant} palette with primary color ${options.primary}`
37
+ };
38
+ } catch (error) {
39
+ const message = error instanceof Error ? error.message : String(error);
40
+ throw new Error(`Failed to compile palette CSS: ${message}`);
41
+ }
42
+ }
43
+ async function generateCustomPaletteCss(options) {
44
+ const variant = options.variant ?? "light";
45
+ const { generateCustomPaletteCode } = await import("../utils/sass.js");
46
+ const paletteLines = generateCustomPaletteCode({
47
+ variant,
48
+ variableName: "custom",
49
+ surfaceColor: options.surfaceColor,
50
+ colors: options.colors
51
+ });
52
+ const sassCode = `
53
+ @use 'sass/color' as *;
54
+
55
+ ${paletteLines.join("\n")}
56
+
57
+ @include palette($custom-palette);
58
+ `;
59
+ try {
60
+ const loadPaths = options._loadPaths ?? [PACKAGE_ROOT];
61
+ const result = await sass.compileStringAsync(sassCode, {
62
+ loadPaths,
63
+ style: "expanded"
64
+ });
65
+ return {
66
+ css: result.css,
67
+ description: `Generated CSS custom properties for a custom ${variant} palette`
68
+ };
69
+ } catch (error) {
70
+ const message = error instanceof Error ? error.message : String(error);
71
+ throw new Error(`Failed to compile custom palette CSS: ${message}`);
72
+ }
73
+ }
74
+ function formatCssOutput(css, description) {
75
+ const header = `/* Generated by Ignite UI Theming MCP Server */
76
+ /* ${description} */
77
+ `;
78
+ return header + css;
79
+ }
80
+ async function generateComponentThemeCss(options) {
81
+ const {
82
+ getComponentTheme,
83
+ getComponentSelector,
84
+ getVariablePrefix,
85
+ SCHEMA_PRESETS
86
+ } = await import("../knowledge/index.js");
87
+ const { toVariableName } = await import("../utils/sass.js");
88
+ const theme = getComponentTheme(options.component);
89
+ if (!theme) {
90
+ throw new Error(`Unknown component: ${options.component}`);
91
+ }
92
+ const designSystem = options.designSystem ?? "material";
93
+ const variant = options.variant ?? "light";
94
+ const themeFn = theme.themeFunctionName;
95
+ const themeName = options.name ? `$${toVariableName(options.name)}` : `$custom-${options.component}-theme`;
96
+ const schemaVar = SCHEMA_PRESETS[variant][designSystem];
97
+ const tokenArgs = [`$schema: ${schemaVar}`];
98
+ for (const [tokenName, value] of Object.entries(options.tokens)) {
99
+ const stringValue = typeof value === "number" ? String(value) : value;
100
+ tokenArgs.push(`$${tokenName}: ${stringValue}`);
101
+ }
102
+ const defaultSelectors = getComponentSelector(
103
+ options.component,
104
+ options.platform
105
+ );
106
+ const selector = options.selector || (defaultSelectors.length > 0 ? defaultSelectors[0] : options.component);
107
+ const prefix = getVariablePrefix(options.platform);
108
+ `${prefix}-${options.component}`;
109
+ const sassCode = `
110
+ @use 'sass/themes' as *;
111
+ @use 'sass/themes/schemas' as *;
112
+
113
+ // Custom ${options.component} theme
114
+ ${themeName}: ${themeFn}(
115
+ ${tokenArgs.join(",\n ")}
116
+ );
117
+
118
+ // Apply the theme to ${selector}
119
+ ${selector} {
120
+ @include tokens(${themeName});
121
+ }
122
+ `;
123
+ try {
124
+ const loadPaths = options._loadPaths ?? [PACKAGE_ROOT];
125
+ const result = await sass.compileStringAsync(sassCode, {
126
+ loadPaths,
127
+ style: "expanded"
128
+ });
129
+ return {
130
+ css: result.css,
131
+ description: `Generated CSS custom properties for ${options.component} component with ${Object.keys(options.tokens).length} token(s) using ${designSystem} design system (${variant} variant)`
132
+ };
133
+ } catch (error) {
134
+ const message = error instanceof Error ? error.message : String(error);
135
+ throw new Error(`Failed to compile component theme CSS: ${message}`);
136
+ }
137
+ }
138
+ export {
139
+ formatCssOutput,
140
+ generateComponentThemeCss,
141
+ generateCustomPaletteCss,
142
+ generatePaletteCss
143
+ };
@@ -0,0 +1,50 @@
1
+ import { CreateElevationsInput, CreatePaletteInput, CreateThemeInput, CreateTypographyInput, DesignSystem, GeneratedCode, Platform, ThemeVariant } from '../utils/types.js';
2
+ export type { ElevationsCodeOptions, PaletteCodeOptions, PaletteCodeResult, TypographyCodeOptions, } from '../utils/sass.js';
3
+ export { generateElevationsCode, generateHeader, generatePaletteCode, generateTypographyCode, generateUseStatement, quoteFontFamily, toVariableName, } from '../utils/sass.js';
4
+ /**
5
+ * Generate a palette definition.
6
+ */
7
+ export declare function generatePalette(input: CreatePaletteInput): GeneratedCode;
8
+ /**
9
+ * Generate typography setup.
10
+ */
11
+ export declare function generateTypography(input: CreateTypographyInput): GeneratedCode;
12
+ /**
13
+ * Generate elevations setup.
14
+ */
15
+ export declare function generateElevations(input: CreateElevationsInput): GeneratedCode;
16
+ /**
17
+ * Generate a complete theme (palette + typography + elevations).
18
+ *
19
+ * Supports two platforms:
20
+ * - `angular`: Uses `igniteui-angular/theming` with `core()` and `theme()` mixins
21
+ * - `webcomponents`: Uses `igniteui-theming` directly with individual mixins
22
+ *
23
+ * If no platform is specified, defaults to generating platform-agnostic code
24
+ * using igniteui-theming directly (similar to webcomponents but simpler).
25
+ */
26
+ export declare function generateTheme(input: CreateThemeInput): GeneratedCode;
27
+ /**
28
+ * Input for generating a component theme.
29
+ */
30
+ export interface CreateComponentThemeInput {
31
+ platform: Platform;
32
+ /** Whether to use licensed @infragistics package (Angular only, defaults to false) */
33
+ licensed?: boolean;
34
+ /** Design system (defaults to 'material') */
35
+ designSystem?: DesignSystem;
36
+ /** Theme variant - light or dark (defaults to 'light') */
37
+ variant?: ThemeVariant;
38
+ /** Component name (e.g., "flat-button", "avatar") */
39
+ component: string;
40
+ /** Token name-value pairs */
41
+ tokens: Record<string, string | number>;
42
+ /** Optional CSS selector to scope the theme */
43
+ selector?: string;
44
+ /** Optional custom variable name */
45
+ name?: string;
46
+ }
47
+ /**
48
+ * Generate Sass code for a component theme.
49
+ */
50
+ export declare function generateComponentTheme(input: CreateComponentThemeInput): GeneratedCode;