igniteui-theming 25.1.0 → 25.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/index.d.ts +75 -0
  2. package/dist/index.js +12 -0
  3. package/dist/json/components/bootstrap.json +1 -0
  4. package/dist/json/components/fluent.json +1 -0
  5. package/dist/json/components/indigo.json +1 -0
  6. package/dist/json/components/material.json +1 -0
  7. package/{json → dist/json}/components/themes.json +31 -1
  8. package/dist/mcp/generators/css.d.ts +7 -4
  9. package/dist/mcp/generators/css.js +129 -104
  10. package/dist/mcp/generators/sass.js +227 -254
  11. package/dist/mcp/index.js +259 -323
  12. package/dist/mcp/knowledge/color-usage.js +524 -502
  13. package/dist/mcp/knowledge/colors.js +61 -50
  14. package/dist/mcp/knowledge/component-metadata.js +697 -598
  15. package/dist/mcp/knowledge/component-themes.js +70 -57
  16. package/dist/mcp/knowledge/custom-palettes.js +4 -9
  17. package/dist/mcp/knowledge/docs/colors/guidance.js +4 -0
  18. package/dist/mcp/knowledge/docs/colors/usage.js +4 -0
  19. package/dist/mcp/knowledge/docs/layout/functions/border-radius.js +4 -0
  20. package/dist/mcp/knowledge/docs/layout/functions/pad.js +4 -0
  21. package/dist/mcp/knowledge/docs/layout/functions/sizable.js +4 -0
  22. package/dist/mcp/knowledge/docs/layout/mixins/sizable.js +4 -0
  23. package/dist/mcp/knowledge/docs/layout/mixins/sizing.js +4 -0
  24. package/dist/mcp/knowledge/docs/layout/mixins/spacing.js +4 -0
  25. package/dist/mcp/knowledge/docs/layout/overview.js +4 -0
  26. package/dist/mcp/knowledge/docs/setup/platform.js +4 -0
  27. package/dist/mcp/knowledge/elevations.d.ts +1 -1
  28. package/dist/mcp/knowledge/elevations.js +26 -12
  29. package/dist/mcp/knowledge/index.js +23 -87
  30. package/dist/mcp/knowledge/layout-docs.d.ts +1 -1
  31. package/dist/mcp/knowledge/multipliers.js +5 -0
  32. package/dist/mcp/knowledge/palettes.js +29 -17
  33. package/dist/mcp/knowledge/platforms/angular.js +98 -120
  34. package/dist/mcp/knowledge/platforms/blazor.js +39 -34
  35. package/dist/mcp/knowledge/platforms/common.js +83 -68
  36. package/dist/mcp/knowledge/platforms/index.js +265 -242
  37. package/dist/mcp/knowledge/platforms/react.js +43 -35
  38. package/dist/mcp/knowledge/platforms/webcomponents.js +266 -292
  39. package/dist/mcp/knowledge/sass-api.js +1 -0
  40. package/dist/mcp/knowledge/typography.js +13 -5
  41. package/dist/mcp/resources/index.js +1 -0
  42. package/dist/mcp/resources/presets.js +409 -508
  43. package/dist/mcp/theming/dist/json/colors/meta/multipliers.js +50 -0
  44. package/dist/mcp/theming/dist/json/colors/presets/palettes.js +85 -0
  45. package/dist/mcp/theming/dist/json/components/themes.js +5792 -0
  46. package/dist/mcp/theming/dist/json/elevations/indigo.js +29 -0
  47. package/dist/mcp/theming/dist/json/elevations/material.js +3 -0
  48. package/dist/mcp/theming/dist/json/typography/presets/typescales.js +621 -0
  49. package/dist/mcp/tools/descriptions.js +98 -154
  50. package/dist/mcp/tools/handlers/color.js +58 -56
  51. package/dist/mcp/tools/handlers/component-theme.js +163 -225
  52. package/dist/mcp/tools/handlers/component-tokens.js +159 -219
  53. package/dist/mcp/tools/handlers/custom-palette.js +138 -179
  54. package/dist/mcp/tools/handlers/elevations.js +27 -28
  55. package/dist/mcp/tools/handlers/index.js +11 -0
  56. package/dist/mcp/tools/handlers/layout.js +125 -176
  57. package/dist/mcp/tools/handlers/palette.js +105 -120
  58. package/dist/mcp/tools/handlers/platform.js +289 -311
  59. package/dist/mcp/tools/handlers/resource.js +22 -31
  60. package/dist/mcp/tools/handlers/theme.js +86 -103
  61. package/dist/mcp/tools/handlers/typography.js +29 -30
  62. package/dist/mcp/tools/index.js +13 -0
  63. package/dist/mcp/tools/schemas.js +239 -218
  64. package/dist/mcp/utils/color.js +277 -239
  65. package/dist/mcp/utils/preprocessing.js +57 -30
  66. package/dist/mcp/utils/result.js +43 -45
  67. package/dist/mcp/utils/sass.js +271 -191
  68. package/dist/mcp/utils/theming-resolve.d.ts +19 -0
  69. package/dist/mcp/utils/theming-resolve.js +57 -0
  70. package/dist/mcp/utils/types.js +96 -53
  71. package/dist/mcp/validators/custom-palette.js +218 -243
  72. package/dist/mcp/validators/index.js +3 -0
  73. package/dist/mcp/validators/palette.js +231 -229
  74. package/dist/tailwind/utilities/bootstrap.css +1 -0
  75. package/dist/tailwind/utilities/fluent.css +1 -0
  76. package/dist/tailwind/utilities/indigo.css +1 -0
  77. package/dist/tailwind/utilities/material.css +1 -0
  78. package/package.json +45 -64
  79. package/sass/json/README.md +12 -7
  80. package/sass/themes/_mixins.scss +1 -0
  81. package/sass/themes/components/button-group/_button-group-theme.scss +42 -0
  82. package/sass/themes/components/grid/_grid-theme.scss +1 -1
  83. package/sass/themes/schemas/components/dark/_button-group.scss +173 -50
  84. package/sass/themes/schemas/components/dark/_grid.scss +0 -16
  85. package/sass/themes/schemas/components/light/_button-group.scss +221 -99
  86. package/sass/themes/schemas/components/light/_grid.scss +14 -20
  87. package/LICENSE +0 -21
  88. package/README.md +0 -391
  89. package/dist/mcp/json/colors/presets/palettes.json.js +0 -13
  90. package/dist/mcp/json/components/themes.json.js +0 -143
  91. package/dist/mcp/json/elevations/indigo.json.js +0 -8
  92. package/dist/mcp/json/elevations/material.json.js +0 -8
  93. package/dist/mcp/json/typography/presets/typescales.json.js +0 -17
  94. package/dist/mcp/knowledge/docs/colors/guidance.md.js +0 -4
  95. package/dist/mcp/knowledge/docs/colors/usage.md.js +0 -4
  96. package/dist/mcp/knowledge/docs/layout/functions/border-radius.md.js +0 -4
  97. package/dist/mcp/knowledge/docs/layout/functions/pad.md.js +0 -4
  98. package/dist/mcp/knowledge/docs/layout/functions/sizable.md.js +0 -4
  99. package/dist/mcp/knowledge/docs/layout/mixins/sizable.md.js +0 -4
  100. package/dist/mcp/knowledge/docs/layout/mixins/sizing.md.js +0 -4
  101. package/dist/mcp/knowledge/docs/layout/mixins/spacing.md.js +0 -4
  102. package/dist/mcp/knowledge/docs/layout/overview.md.js +0 -4
  103. package/dist/mcp/knowledge/docs/setup/platform.md.js +0 -4
  104. package/dist/mcp/vite-env.d.ts +0 -18
  105. package/index.js +0 -5
  106. package/json/components/bootstrap.json +0 -1
  107. package/json/components/fluent.json +0 -1
  108. package/json/components/indigo.json +0 -1
  109. package/json/components/material.json +0 -1
  110. package/tailwind/utilities/bootstrap.css +0 -1
  111. package/tailwind/utilities/fluent.css +0 -1
  112. package/tailwind/utilities/indigo.css +0 -1
  113. package/tailwind/utilities/material.css +0 -1
  114. /package/{json → dist/json}/colors/meta/multipliers.json +0 -0
  115. /package/{json → dist/json}/colors/meta/palette.json +0 -0
  116. /package/{json → dist/json}/colors/presets/palettes.json +0 -0
  117. /package/{json → dist/json}/elevations/indigo.json +0 -0
  118. /package/{json → dist/json}/elevations/material.json +0 -0
  119. /package/{json → dist/json}/typography/presets/typescales.json +0 -0
  120. /package/{tailwind → dist/tailwind}/themes/base.css +0 -0
  121. /package/{tailwind → dist/tailwind}/themes/dark/bootstrap.css +0 -0
  122. /package/{tailwind → dist/tailwind}/themes/dark/fluent.css +0 -0
  123. /package/{tailwind → dist/tailwind}/themes/dark/indigo.css +0 -0
  124. /package/{tailwind → dist/tailwind}/themes/dark/material.css +0 -0
  125. /package/{tailwind → dist/tailwind}/themes/light/bootstrap.css +0 -0
  126. /package/{tailwind → dist/tailwind}/themes/light/fluent.css +0 -0
  127. /package/{tailwind → dist/tailwind}/themes/light/indigo.css +0 -0
  128. /package/{tailwind → dist/tailwind}/themes/light/material.css +0 -0
@@ -1,29 +1,20 @@
1
- import { generateComponentTheme } from "../../generators/sass.js";
2
- import "../../knowledge/colors.js";
3
- import { hasVariants, getVariants, isComponentAvailable, getComponentPlatformAvailability, getComponentSelector } from "../../knowledge/component-metadata.js";
4
- import { getComponentTheme, searchComponents, COMPONENT_NAMES, validateTokens } from "../../knowledge/component-themes.js";
5
- import "../../knowledge/custom-palettes.js";
6
- import "../../utils/types.js";
7
- import "../../knowledge/palettes.js";
1
+ import { getComponentPlatformAvailability, getComponentSelector, getVariants, hasVariants, isComponentAvailable } from "../../knowledge/component-metadata.js";
2
+ import { COMPONENT_NAMES, getComponentTheme, searchComponents, validateTokens } from "../../knowledge/component-themes.js";
8
3
  import { PLATFORM_METADATA } from "../../knowledge/platforms/index.js";
4
+ import "../../knowledge/index.js";
5
+ import { generateComponentTheme } from "../../generators/sass.js";
6
+ //#region src/tools/handlers/component-theme.ts
7
+ /**
8
+ * Handler for create_component_theme tool.
9
+ * Generates Sass code to customize a component's appearance.
10
+ */
9
11
  async function handleCreateComponentTheme(params) {
10
- const {
11
- platform,
12
- component,
13
- tokens,
14
- selector,
15
- name,
16
- output = "sass",
17
- designSystem = "material",
18
- variant = "light"
19
- } = params;
20
- const normalizedComponent = component.toLowerCase().trim();
21
- if (!platform) {
22
- return {
23
- content: [
24
- {
25
- type: "text",
26
- text: `**Error:** The \`platform\` parameter is required.
12
+ const { platform, component, tokens, selector, name, output = "sass", designSystem = "material", variant = "light" } = params;
13
+ const normalizedComponent = component.toLowerCase().trim();
14
+ if (!platform) return {
15
+ content: [{
16
+ type: "text",
17
+ text: `**Error:** The \`platform\` parameter is required.
27
18
 
28
19
  **Valid platforms:**
29
20
  - \`angular\` - Ignite UI for Angular
@@ -32,17 +23,13 @@ async function handleCreateComponentTheme(params) {
32
23
  - \`blazor\` - Ignite UI for Blazor
33
24
 
34
25
  Please specify which platform you're using to generate the correct variable prefixes and selectors.`
35
- }
36
- ],
37
- isError: true
38
- };
39
- }
40
- if (platform === "generic") {
41
- return {
42
- content: [
43
- {
44
- type: "text",
45
- text: `**Error:** \`create_component_theme\` requires a specific Ignite UI product platform.
26
+ }],
27
+ isError: true
28
+ };
29
+ if (platform === "generic") return {
30
+ content: [{
31
+ type: "text",
32
+ text: `**Error:** \`create_component_theme\` requires a specific Ignite UI product platform.
46
33
 
47
34
  The \`"generic"\` platform is not supported for component theming because component selectors and variable prefixes are platform-specific and do not exist in generic mode.
48
35
 
@@ -51,37 +38,31 @@ The \`"generic"\` platform is not supported for component theming because compon
51
38
  - \`webcomponents\` - Ignite UI for Web Components
52
39
  - \`react\` - Ignite UI for React
53
40
  - \`blazor\` - Ignite UI for Blazor`
54
- }
55
- ],
56
- isError: true
57
- };
58
- }
59
- const theme = getComponentTheme(normalizedComponent);
60
- if (!theme) {
61
- const suggestions = searchComponents(normalizedComponent);
62
- const componentList = suggestions.length > 0 ? suggestions.slice(0, 10) : COMPONENT_NAMES.slice(0, 15);
63
- return {
64
- content: [
65
- {
66
- type: "text",
67
- text: `**Error:** Component "${component}" not found.
41
+ }],
42
+ isError: true
43
+ };
44
+ if (!getComponentTheme(normalizedComponent)) {
45
+ const suggestions = searchComponents(normalizedComponent);
46
+ const componentList = suggestions.length > 0 ? suggestions.slice(0, 10) : COMPONENT_NAMES.slice(0, 15);
47
+ return {
48
+ content: [{
49
+ type: "text",
50
+ text: `**Error:** Component "${component}" not found.
68
51
 
69
52
  ${suggestions.length > 0 ? "**Similar components:**" : "**Available components:**"}
70
53
  ${componentList.map((c) => `- ${c}`).join("\n")}
71
54
 
72
55
  **Tip:** Use \`get_component_design_tokens\` first to discover valid component names and their tokens.`
73
- }
74
- ],
75
- isError: true
76
- };
77
- }
78
- if (hasVariants(normalizedComponent)) {
79
- const variants = getVariants(normalizedComponent);
80
- return {
81
- content: [
82
- {
83
- type: "text",
84
- text: `**Error:** The \`${component}\` component has multiple variants and requires a specific variant for theming.
56
+ }],
57
+ isError: true
58
+ };
59
+ }
60
+ if (hasVariants(normalizedComponent)) {
61
+ const variants = getVariants(normalizedComponent);
62
+ return {
63
+ content: [{
64
+ type: "text",
65
+ text: `**Error:** The \`${component}\` component has multiple variants and requires a specific variant for theming.
85
66
 
86
67
  **Available variants:**
87
68
  ${variants.map((v) => `- \`${v}\``).join("\n")}
@@ -89,175 +70,132 @@ ${variants.map((v) => `- \`${v}\``).join("\n")}
89
70
  Please use \`create_component_theme\` with one of the specific variant names above.
90
71
 
91
72
  **Tip:** Use \`get_component_design_tokens\` with a specific variant (e.g., \`${variants[0]}\`) to see available tokens.`
92
- }
93
- ],
94
- isError: true
95
- };
96
- }
97
- if (platform) {
98
- const isAvailable = isComponentAvailable(normalizedComponent, platform);
99
- if (!isAvailable) {
100
- const availability = getComponentPlatformAvailability(normalizedComponent);
101
- const availablePlatforms = [];
102
- if (availability?.angular) availablePlatforms.push("Angular");
103
- if (availability?.webcomponents)
104
- availablePlatforms.push("Web Components");
105
- const error = `**Error:** The \`${component}\` component is not available on ${PLATFORM_METADATA[platform]?.name ?? platform}. ${availablePlatforms.length > 0 ? `It is available on: ${availablePlatforms.join(", ")}.` : ""}`;
106
- return {
107
- content: [{ type: "text", text: error }],
108
- isError: true
109
- };
110
- }
111
- }
112
- const tokenNames = Object.keys(tokens);
113
- if (tokenNames.length === 0) {
114
- return {
115
- content: [
116
- {
117
- type: "text",
118
- text: `**Error:** No tokens provided. At least one token must be specified.
73
+ }],
74
+ isError: true
75
+ };
76
+ }
77
+ if (platform) {
78
+ if (!isComponentAvailable(normalizedComponent, platform)) {
79
+ const availability = getComponentPlatformAvailability(normalizedComponent);
80
+ const availablePlatforms = [];
81
+ if (availability?.angular) availablePlatforms.push("Angular");
82
+ if (availability?.webcomponents) availablePlatforms.push("Web Components");
83
+ return {
84
+ content: [{
85
+ type: "text",
86
+ text: `**Error:** The \`${component}\` component is not available on ${PLATFORM_METADATA[platform]?.name ?? platform}. ${availablePlatforms.length > 0 ? `It is available on: ${availablePlatforms.join(", ")}.` : ""}`
87
+ }],
88
+ isError: true
89
+ };
90
+ }
91
+ }
92
+ const tokenNames = Object.keys(tokens);
93
+ if (tokenNames.length === 0) return {
94
+ content: [{
95
+ type: "text",
96
+ text: `**Error:** No tokens provided. At least one token must be specified.
119
97
 
120
98
  Use \`get_component_design_tokens\` with component "${component}" to see available tokens.`
121
- }
122
- ],
123
- isError: true
124
- };
125
- }
126
- const validation = validateTokens(normalizedComponent, tokenNames);
127
- if (!validation.isValid) {
128
- return {
129
- content: [
130
- {
131
- type: "text",
132
- text: `**Error:** Invalid token(s) for component "${component}":
99
+ }],
100
+ isError: true
101
+ };
102
+ const validation = validateTokens(normalizedComponent, tokenNames);
103
+ if (!validation.isValid) return {
104
+ content: [{
105
+ type: "text",
106
+ text: `**Error:** Invalid token(s) for component "${component}":
133
107
  ${validation.invalidTokens.map((t) => `- \`${t}\``).join("\n")}
134
108
 
135
109
  **Valid tokens for ${component}:**
136
- ${validation.validTokens.slice(0, 20).map((t) => `- \`${t}\``).join(
137
- "\n"
138
- )}${validation.validTokens.length > 20 ? `
139
- ... and ${validation.validTokens.length - 20} more` : ""}
110
+ ${validation.validTokens.slice(0, 20).map((t) => `- \`${t}\``).join("\n")}${validation.validTokens.length > 20 ? `\n... and ${validation.validTokens.length - 20} more` : ""}
140
111
 
141
112
  Use \`get_component_design_tokens\` to see all tokens with descriptions.`
142
- }
143
- ],
144
- isError: true
145
- };
146
- }
147
- let finalSelector = selector;
148
- if (!finalSelector && platform) {
149
- const selectors = getComponentSelector(normalizedComponent, platform);
150
- if (selectors.length > 0) {
151
- finalSelector = selectors[0];
152
- }
153
- }
154
- if (output === "css") {
155
- try {
156
- const { generateComponentThemeCss, formatCssOutput } = await import("../../generators/css.js");
157
- const result = await generateComponentThemeCss({
158
- platform,
159
- component: normalizedComponent,
160
- tokens,
161
- selector: finalSelector,
162
- name,
163
- designSystem,
164
- variant
165
- });
166
- const responseParts = [];
167
- responseParts.push(result.description);
168
- responseParts.push("");
169
- const platformNote = platform ? `Platform: ${PLATFORM_METADATA[platform]?.name ?? platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized imports.";
170
- responseParts.push(platformNote);
171
- responseParts.push(
172
- `Design System: ${designSystem.charAt(0).toUpperCase() + designSystem.slice(1)} (${variant})`
173
- );
174
- if (finalSelector) {
175
- responseParts.push(`Selector: \`${finalSelector}\``);
176
- }
177
- responseParts.push("");
178
- responseParts.push("```css");
179
- responseParts.push(
180
- formatCssOutput(result.css, result.description).trimEnd()
181
- );
182
- responseParts.push("```");
183
- responseParts.push("");
184
- responseParts.push("---");
185
- responseParts.push(
186
- "**Usage:** Include this CSS in your stylesheet or add it to your application's global styles."
187
- );
188
- return {
189
- content: [
190
- {
191
- type: "text",
192
- text: responseParts.join("\n")
193
- }
194
- ]
195
- };
196
- } catch (error) {
197
- return {
198
- content: [
199
- {
200
- type: "text",
201
- text: `**Error generating CSS:** ${error instanceof Error ? error.message : String(error)}`
202
- }
203
- ],
204
- isError: true
205
- };
206
- }
207
- }
208
- try {
209
- const result = generateComponentTheme({
210
- platform,
211
- licensed: params.licensed,
212
- component: normalizedComponent,
213
- tokens,
214
- selector: finalSelector,
215
- name,
216
- designSystem,
217
- variant
218
- });
219
- const responseParts = [];
220
- responseParts.push(result.description);
221
- responseParts.push("");
222
- const platformNote = platform ? `Platform: ${PLATFORM_METADATA[platform]?.name ?? platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized imports.";
223
- responseParts.push(platformNote);
224
- responseParts.push(
225
- `Design System: ${designSystem.charAt(0).toUpperCase() + designSystem.slice(1)} (${variant})`
226
- );
227
- if (finalSelector) {
228
- responseParts.push(`Selector: \`${finalSelector}\``);
229
- }
230
- responseParts.push("");
231
- responseParts.push(`Variables created: ${result.variables.join(", ")}`);
232
- responseParts.push("");
233
- responseParts.push("```scss");
234
- responseParts.push(result.code.trimEnd());
235
- responseParts.push("```");
236
- responseParts.push("");
237
- responseParts.push("---");
238
- responseParts.push(
239
- "**Usage:** Import this Sass file in your main styles file, or include the code in your theme file."
240
- );
241
- return {
242
- content: [
243
- {
244
- type: "text",
245
- text: responseParts.join("\n")
246
- }
247
- ]
248
- };
249
- } catch (error) {
250
- return {
251
- content: [
252
- {
253
- type: "text",
254
- text: `**Error generating theme:** ${error instanceof Error ? error.message : String(error)}`
255
- }
256
- ],
257
- isError: true
258
- };
259
- }
113
+ }],
114
+ isError: true
115
+ };
116
+ let finalSelector = selector;
117
+ if (!finalSelector && platform) {
118
+ const selectors = getComponentSelector(normalizedComponent, platform);
119
+ if (selectors.length > 0) finalSelector = selectors[0];
120
+ }
121
+ if (output === "css") try {
122
+ const { generateComponentThemeCss, formatCssOutput } = await import("../../generators/css.js");
123
+ const result = await generateComponentThemeCss({
124
+ platform,
125
+ component: normalizedComponent,
126
+ tokens,
127
+ selector: finalSelector,
128
+ name,
129
+ designSystem,
130
+ variant
131
+ });
132
+ const responseParts = [];
133
+ responseParts.push(result.description);
134
+ responseParts.push("");
135
+ const platformNote = platform ? `Platform: ${PLATFORM_METADATA[platform]?.name ?? platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized imports.";
136
+ responseParts.push(platformNote);
137
+ responseParts.push(`Design System: ${designSystem.charAt(0).toUpperCase() + designSystem.slice(1)} (${variant})`);
138
+ if (finalSelector) responseParts.push(`Selector: \`${finalSelector}\``);
139
+ responseParts.push("");
140
+ responseParts.push("```css");
141
+ responseParts.push(formatCssOutput(result.css, result.description).trimEnd());
142
+ responseParts.push("```");
143
+ responseParts.push("");
144
+ responseParts.push("---");
145
+ responseParts.push("**Usage:** Include this CSS in your stylesheet or add it to your application's global styles.");
146
+ return { content: [{
147
+ type: "text",
148
+ text: responseParts.join("\n")
149
+ }] };
150
+ } catch (error) {
151
+ return {
152
+ content: [{
153
+ type: "text",
154
+ text: `**Error generating CSS:** ${error instanceof Error ? error.message : String(error)}`
155
+ }],
156
+ isError: true
157
+ };
158
+ }
159
+ try {
160
+ const result = generateComponentTheme({
161
+ platform,
162
+ licensed: params.licensed,
163
+ component: normalizedComponent,
164
+ tokens,
165
+ selector: finalSelector,
166
+ name,
167
+ designSystem,
168
+ variant
169
+ });
170
+ const responseParts = [];
171
+ responseParts.push(result.description);
172
+ responseParts.push("");
173
+ const platformNote = platform ? `Platform: ${PLATFORM_METADATA[platform]?.name ?? platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized imports.";
174
+ responseParts.push(platformNote);
175
+ responseParts.push(`Design System: ${designSystem.charAt(0).toUpperCase() + designSystem.slice(1)} (${variant})`);
176
+ if (finalSelector) responseParts.push(`Selector: \`${finalSelector}\``);
177
+ responseParts.push("");
178
+ responseParts.push(`Variables created: ${result.variables.join(", ")}`);
179
+ responseParts.push("");
180
+ responseParts.push("```scss");
181
+ responseParts.push(result.code.trimEnd());
182
+ responseParts.push("```");
183
+ responseParts.push("");
184
+ responseParts.push("---");
185
+ responseParts.push("**Usage:** Import this Sass file in your main styles file, or include the code in your theme file.");
186
+ return { content: [{
187
+ type: "text",
188
+ text: responseParts.join("\n")
189
+ }] };
190
+ } catch (error) {
191
+ return {
192
+ content: [{
193
+ type: "text",
194
+ text: `**Error generating theme:** ${error instanceof Error ? error.message : String(error)}`
195
+ }],
196
+ isError: true
197
+ };
198
+ }
260
199
  }
261
- export {
262
- handleCreateComponentTheme
263
- };
200
+ //#endregion
201
+ export { handleCreateComponentTheme };