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.
- package/dist/index.d.ts +75 -0
- package/dist/index.js +12 -0
- package/dist/json/components/bootstrap.json +1 -0
- package/dist/json/components/fluent.json +1 -0
- package/dist/json/components/indigo.json +1 -0
- package/dist/json/components/material.json +1 -0
- package/{json → dist/json}/components/themes.json +31 -1
- package/dist/mcp/generators/css.d.ts +7 -4
- package/dist/mcp/generators/css.js +129 -104
- package/dist/mcp/generators/sass.js +227 -254
- package/dist/mcp/index.js +259 -323
- package/dist/mcp/knowledge/color-usage.js +524 -502
- package/dist/mcp/knowledge/colors.js +61 -50
- package/dist/mcp/knowledge/component-metadata.js +697 -598
- package/dist/mcp/knowledge/component-themes.js +70 -57
- package/dist/mcp/knowledge/custom-palettes.js +4 -9
- package/dist/mcp/knowledge/docs/colors/guidance.js +4 -0
- package/dist/mcp/knowledge/docs/colors/usage.js +4 -0
- package/dist/mcp/knowledge/docs/layout/functions/border-radius.js +4 -0
- package/dist/mcp/knowledge/docs/layout/functions/pad.js +4 -0
- package/dist/mcp/knowledge/docs/layout/functions/sizable.js +4 -0
- package/dist/mcp/knowledge/docs/layout/mixins/sizable.js +4 -0
- package/dist/mcp/knowledge/docs/layout/mixins/sizing.js +4 -0
- package/dist/mcp/knowledge/docs/layout/mixins/spacing.js +4 -0
- package/dist/mcp/knowledge/docs/layout/overview.js +4 -0
- package/dist/mcp/knowledge/docs/setup/platform.js +4 -0
- package/dist/mcp/knowledge/elevations.d.ts +1 -1
- package/dist/mcp/knowledge/elevations.js +26 -12
- package/dist/mcp/knowledge/index.js +23 -87
- package/dist/mcp/knowledge/layout-docs.d.ts +1 -1
- package/dist/mcp/knowledge/multipliers.js +5 -0
- package/dist/mcp/knowledge/palettes.js +29 -17
- package/dist/mcp/knowledge/platforms/angular.js +98 -120
- package/dist/mcp/knowledge/platforms/blazor.js +39 -34
- package/dist/mcp/knowledge/platforms/common.js +83 -68
- package/dist/mcp/knowledge/platforms/index.js +265 -242
- package/dist/mcp/knowledge/platforms/react.js +43 -35
- package/dist/mcp/knowledge/platforms/webcomponents.js +266 -292
- package/dist/mcp/knowledge/sass-api.js +1 -0
- package/dist/mcp/knowledge/typography.js +13 -5
- package/dist/mcp/resources/index.js +1 -0
- package/dist/mcp/resources/presets.js +409 -508
- package/dist/mcp/theming/dist/json/colors/meta/multipliers.js +50 -0
- package/dist/mcp/theming/dist/json/colors/presets/palettes.js +85 -0
- package/dist/mcp/theming/dist/json/components/themes.js +5792 -0
- package/dist/mcp/theming/dist/json/elevations/indigo.js +29 -0
- package/dist/mcp/theming/dist/json/elevations/material.js +3 -0
- package/dist/mcp/theming/dist/json/typography/presets/typescales.js +621 -0
- package/dist/mcp/tools/descriptions.js +98 -154
- package/dist/mcp/tools/handlers/color.js +58 -56
- package/dist/mcp/tools/handlers/component-theme.js +163 -225
- package/dist/mcp/tools/handlers/component-tokens.js +159 -219
- package/dist/mcp/tools/handlers/custom-palette.js +138 -179
- package/dist/mcp/tools/handlers/elevations.js +27 -28
- package/dist/mcp/tools/handlers/index.js +11 -0
- package/dist/mcp/tools/handlers/layout.js +125 -176
- package/dist/mcp/tools/handlers/palette.js +105 -120
- package/dist/mcp/tools/handlers/platform.js +289 -311
- package/dist/mcp/tools/handlers/resource.js +22 -31
- package/dist/mcp/tools/handlers/theme.js +86 -103
- package/dist/mcp/tools/handlers/typography.js +29 -30
- package/dist/mcp/tools/index.js +13 -0
- package/dist/mcp/tools/schemas.js +239 -218
- package/dist/mcp/utils/color.js +277 -239
- package/dist/mcp/utils/preprocessing.js +57 -30
- package/dist/mcp/utils/result.js +43 -45
- package/dist/mcp/utils/sass.js +271 -191
- package/dist/mcp/utils/theming-resolve.d.ts +19 -0
- package/dist/mcp/utils/theming-resolve.js +57 -0
- package/dist/mcp/utils/types.js +96 -53
- package/dist/mcp/validators/custom-palette.js +218 -243
- package/dist/mcp/validators/index.js +3 -0
- package/dist/mcp/validators/palette.js +231 -229
- package/dist/tailwind/utilities/bootstrap.css +1 -0
- package/dist/tailwind/utilities/fluent.css +1 -0
- package/dist/tailwind/utilities/indigo.css +1 -0
- package/dist/tailwind/utilities/material.css +1 -0
- package/package.json +45 -64
- package/sass/json/README.md +12 -7
- package/sass/themes/_mixins.scss +1 -0
- package/sass/themes/components/button-group/_button-group-theme.scss +42 -0
- package/sass/themes/components/grid/_grid-theme.scss +1 -1
- package/sass/themes/schemas/components/dark/_button-group.scss +173 -50
- package/sass/themes/schemas/components/dark/_grid.scss +0 -16
- package/sass/themes/schemas/components/light/_button-group.scss +221 -99
- package/sass/themes/schemas/components/light/_grid.scss +14 -20
- package/LICENSE +0 -21
- package/README.md +0 -391
- package/dist/mcp/json/colors/presets/palettes.json.js +0 -13
- package/dist/mcp/json/components/themes.json.js +0 -143
- package/dist/mcp/json/elevations/indigo.json.js +0 -8
- package/dist/mcp/json/elevations/material.json.js +0 -8
- package/dist/mcp/json/typography/presets/typescales.json.js +0 -17
- package/dist/mcp/knowledge/docs/colors/guidance.md.js +0 -4
- package/dist/mcp/knowledge/docs/colors/usage.md.js +0 -4
- package/dist/mcp/knowledge/docs/layout/functions/border-radius.md.js +0 -4
- package/dist/mcp/knowledge/docs/layout/functions/pad.md.js +0 -4
- package/dist/mcp/knowledge/docs/layout/functions/sizable.md.js +0 -4
- package/dist/mcp/knowledge/docs/layout/mixins/sizable.md.js +0 -4
- package/dist/mcp/knowledge/docs/layout/mixins/sizing.md.js +0 -4
- package/dist/mcp/knowledge/docs/layout/mixins/spacing.md.js +0 -4
- package/dist/mcp/knowledge/docs/layout/overview.md.js +0 -4
- package/dist/mcp/knowledge/docs/setup/platform.md.js +0 -4
- package/dist/mcp/vite-env.d.ts +0 -18
- package/index.js +0 -5
- package/json/components/bootstrap.json +0 -1
- package/json/components/fluent.json +0 -1
- package/json/components/indigo.json +0 -1
- package/json/components/material.json +0 -1
- package/tailwind/utilities/bootstrap.css +0 -1
- package/tailwind/utilities/fluent.css +0 -1
- package/tailwind/utilities/indigo.css +0 -1
- package/tailwind/utilities/material.css +0 -1
- /package/{json → dist/json}/colors/meta/multipliers.json +0 -0
- /package/{json → dist/json}/colors/meta/palette.json +0 -0
- /package/{json → dist/json}/colors/presets/palettes.json +0 -0
- /package/{json → dist/json}/elevations/indigo.json +0 -0
- /package/{json → dist/json}/elevations/material.json +0 -0
- /package/{json → dist/json}/typography/presets/typescales.json +0 -0
- /package/{tailwind → dist/tailwind}/themes/base.css +0 -0
- /package/{tailwind → dist/tailwind}/themes/dark/bootstrap.css +0 -0
- /package/{tailwind → dist/tailwind}/themes/dark/fluent.css +0 -0
- /package/{tailwind → dist/tailwind}/themes/dark/indigo.css +0 -0
- /package/{tailwind → dist/tailwind}/themes/dark/material.css +0 -0
- /package/{tailwind → dist/tailwind}/themes/light/bootstrap.css +0 -0
- /package/{tailwind → dist/tailwind}/themes/light/fluent.css +0 -0
- /package/{tailwind → dist/tailwind}/themes/light/indigo.css +0 -0
- /package/{tailwind → dist/tailwind}/themes/light/material.css +0 -0
|
@@ -1,33 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RESOURCE_DEFINITIONS, getResourceContent } from "../../resources/presets.js";
|
|
2
|
+
import "../../resources/index.js";
|
|
3
|
+
//#region src/tools/handlers/resource.ts
|
|
4
|
+
/**
|
|
5
|
+
* Handler for read_resource tool.
|
|
6
|
+
* Reads theming resource content by URI, bypassing the custom protocol scheme.
|
|
7
|
+
*/
|
|
2
8
|
async function handleReadResource(params) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
${available}`
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
isError: true
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
content: [
|
|
24
|
-
{
|
|
25
|
-
type: "text",
|
|
26
|
-
text: content.content
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
};
|
|
9
|
+
const { uri } = params;
|
|
10
|
+
const content = getResourceContent(uri);
|
|
11
|
+
if (!content) return {
|
|
12
|
+
content: [{
|
|
13
|
+
type: "text",
|
|
14
|
+
text: `Resource not found: ${uri}\n\nAvailable resources:\n${RESOURCE_DEFINITIONS.map((r) => ` - ${r.uri}: ${r.name}`).join("\n")}`
|
|
15
|
+
}],
|
|
16
|
+
isError: true
|
|
17
|
+
};
|
|
18
|
+
return { content: [{
|
|
19
|
+
type: "text",
|
|
20
|
+
text: content.content
|
|
21
|
+
}] };
|
|
30
22
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { handleReadResource };
|
|
@@ -1,106 +1,89 @@
|
|
|
1
1
|
import { generateTheme } from "../../generators/sass.js";
|
|
2
|
-
import "../../
|
|
3
|
-
import "../../
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import "node:path";
|
|
9
|
-
import "../../utils/color.js";
|
|
10
|
-
import { validatePaletteColors, analyzeThemeColorsForPalette, generateWarningComments, generatePaletteSuitabilityComments, formatValidationResult, formatPaletteSuitabilityWarnings } from "../../validators/palette.js";
|
|
2
|
+
import { analyzeThemeColorsForPalette, formatPaletteSuitabilityWarnings, formatValidationResult, generatePaletteSuitabilityComments, generateWarningComments, validatePaletteColors } from "../../validators/palette.js";
|
|
3
|
+
import "../../validators/index.js";
|
|
4
|
+
//#region src/tools/handlers/theme.ts
|
|
5
|
+
/**
|
|
6
|
+
* Handler for create_theme tool.
|
|
7
|
+
*/
|
|
11
8
|
async function handleCreateTheme(params) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
responseParts.push(`Variables created/used: ${result.variables.join(", ")}`);
|
|
91
|
-
responseParts.push("");
|
|
92
|
-
responseParts.push("```scss");
|
|
93
|
-
responseParts.push(finalCode.trimEnd());
|
|
94
|
-
responseParts.push("```");
|
|
95
|
-
return {
|
|
96
|
-
content: [
|
|
97
|
-
{
|
|
98
|
-
type: "text",
|
|
99
|
-
text: responseParts.join("\n")
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
};
|
|
9
|
+
const validation = await validatePaletteColors({
|
|
10
|
+
variant: params.variant ?? "light",
|
|
11
|
+
surface: params.surfaceColor
|
|
12
|
+
});
|
|
13
|
+
const suitabilityAnalysis = await analyzeThemeColorsForPalette({
|
|
14
|
+
primary: params.primaryColor,
|
|
15
|
+
secondary: params.secondaryColor,
|
|
16
|
+
surface: params.surfaceColor
|
|
17
|
+
});
|
|
18
|
+
const result = generateTheme({
|
|
19
|
+
platform: params.platform,
|
|
20
|
+
licensed: params.licensed,
|
|
21
|
+
designSystem: params.designSystem,
|
|
22
|
+
primaryColor: params.primaryColor,
|
|
23
|
+
secondaryColor: params.secondaryColor,
|
|
24
|
+
surfaceColor: params.surfaceColor,
|
|
25
|
+
variant: params.variant,
|
|
26
|
+
name: params.name,
|
|
27
|
+
fontFamily: params.fontFamily,
|
|
28
|
+
includeTypography: params.includeTypography,
|
|
29
|
+
includeElevations: params.includeElevations,
|
|
30
|
+
includeSpacing: params.includeSpacing
|
|
31
|
+
});
|
|
32
|
+
let finalCode = result.code;
|
|
33
|
+
const allWarningComments = [];
|
|
34
|
+
if (!validation.isValid) allWarningComments.push(...generateWarningComments(validation));
|
|
35
|
+
if (!suitabilityAnalysis.allSuitable) allWarningComments.push(...generatePaletteSuitabilityComments(suitabilityAnalysis));
|
|
36
|
+
if (allWarningComments.length > 0) {
|
|
37
|
+
const lines = finalCode.split("\n");
|
|
38
|
+
const useIndex = lines.findIndex((line) => line.startsWith("@use '") || line.startsWith("@use \""));
|
|
39
|
+
if (useIndex > 0) {
|
|
40
|
+
lines.splice(useIndex, 0, ...allWarningComments, "");
|
|
41
|
+
finalCode = lines.join("\n");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const responseParts = [result.description];
|
|
45
|
+
let platformNote = "";
|
|
46
|
+
switch (params.platform) {
|
|
47
|
+
case "angular":
|
|
48
|
+
platformNote = "Platform: Ignite UI for Angular";
|
|
49
|
+
break;
|
|
50
|
+
case "webcomponents":
|
|
51
|
+
platformNote = "Platform: Ignite UI for Web Components";
|
|
52
|
+
break;
|
|
53
|
+
case "react":
|
|
54
|
+
platformNote = "Platform: Ignite UI for React";
|
|
55
|
+
break;
|
|
56
|
+
case "blazor":
|
|
57
|
+
platformNote = "Platform: Ignite UI for Blazor";
|
|
58
|
+
break;
|
|
59
|
+
case "generic":
|
|
60
|
+
platformNote = "Platform: Ignite UI Theming (Standalone)";
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
platformNote = "Platform: Not specified (generic output). Specify `platform` for optimized code.";
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
responseParts.push("");
|
|
67
|
+
responseParts.push(platformNote);
|
|
68
|
+
const validationText = formatValidationResult(validation);
|
|
69
|
+
if (validationText) {
|
|
70
|
+
responseParts.push("");
|
|
71
|
+
responseParts.push(validationText);
|
|
72
|
+
}
|
|
73
|
+
if (!suitabilityAnalysis.allSuitable) {
|
|
74
|
+
responseParts.push("");
|
|
75
|
+
responseParts.push(formatPaletteSuitabilityWarnings(suitabilityAnalysis));
|
|
76
|
+
}
|
|
77
|
+
responseParts.push("");
|
|
78
|
+
responseParts.push(`Variables created/used: ${result.variables.join(", ")}`);
|
|
79
|
+
responseParts.push("");
|
|
80
|
+
responseParts.push("```scss");
|
|
81
|
+
responseParts.push(finalCode.trimEnd());
|
|
82
|
+
responseParts.push("```");
|
|
83
|
+
return { content: [{
|
|
84
|
+
type: "text",
|
|
85
|
+
text: responseParts.join("\n")
|
|
86
|
+
}] };
|
|
103
87
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
};
|
|
88
|
+
//#endregion
|
|
89
|
+
export { handleCreateTheme };
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { generateTypography } from "../../generators/sass.js";
|
|
2
1
|
import { PLATFORM_METADATA } from "../../knowledge/platforms/index.js";
|
|
2
|
+
import { generateTypography } from "../../generators/sass.js";
|
|
3
|
+
//#region src/tools/handlers/typography.ts
|
|
4
|
+
/**
|
|
5
|
+
* Handler for create_typography tool.
|
|
6
|
+
*/
|
|
3
7
|
function handleCreateTypography(params) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
text: responseParts.join("\n")
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
};
|
|
8
|
+
const result = generateTypography({
|
|
9
|
+
platform: params.platform,
|
|
10
|
+
licensed: params.licensed,
|
|
11
|
+
fontFamily: params.fontFamily,
|
|
12
|
+
designSystem: params.designSystem,
|
|
13
|
+
customScale: params.customScale,
|
|
14
|
+
name: params.name
|
|
15
|
+
});
|
|
16
|
+
const responseParts = [result.description];
|
|
17
|
+
const platformNote = params.platform ? `Platform: ${PLATFORM_METADATA[params.platform]?.name ?? params.platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized code.";
|
|
18
|
+
responseParts.push("");
|
|
19
|
+
responseParts.push(platformNote);
|
|
20
|
+
responseParts.push("");
|
|
21
|
+
responseParts.push(`Variables used: ${result.variables.join(", ")}`);
|
|
22
|
+
responseParts.push("");
|
|
23
|
+
responseParts.push("```scss");
|
|
24
|
+
responseParts.push(result.code.trimEnd());
|
|
25
|
+
responseParts.push("```");
|
|
26
|
+
return { content: [{
|
|
27
|
+
type: "text",
|
|
28
|
+
text: responseParts.join("\n")
|
|
29
|
+
}] };
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { handleCreateTypography };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "./handlers/color.js";
|
|
2
|
+
import "./handlers/component-theme.js";
|
|
3
|
+
import "./handlers/component-tokens.js";
|
|
4
|
+
import "./handlers/custom-palette.js";
|
|
5
|
+
import "./handlers/elevations.js";
|
|
6
|
+
import "./handlers/layout.js";
|
|
7
|
+
import "./handlers/palette.js";
|
|
8
|
+
import "./handlers/platform.js";
|
|
9
|
+
import "./handlers/resource.js";
|
|
10
|
+
import "./handlers/theme.js";
|
|
11
|
+
import "./handlers/typography.js";
|
|
12
|
+
import "./handlers/index.js";
|
|
13
|
+
import "./schemas.js";
|