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,24 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
//#region src/tools/descriptions.ts
|
|
2
|
+
/**
|
|
3
|
+
* Centralized descriptions for MCP tools and their parameters.
|
|
4
|
+
*
|
|
5
|
+
* Uses XML-like tags for structured content that helps AI models
|
|
6
|
+
* understand tool purpose, workflows, and constraints.
|
|
7
|
+
*
|
|
8
|
+
* Structure:
|
|
9
|
+
* - FRAGMENTS: Reusable text snippets for common concepts
|
|
10
|
+
* - TOOL_DESCRIPTIONS: Full tool descriptions with XML sections
|
|
11
|
+
* - PARAM_DESCRIPTIONS: Individual parameter descriptions
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Reusable text fragments for common concepts.
|
|
15
|
+
* Used to maintain consistency across descriptions.
|
|
16
|
+
*/
|
|
17
|
+
var FRAGMENTS = {
|
|
18
|
+
PLATFORM: `Target platform: "angular" for Ignite UI for Angular, "webcomponents" for Ignite UI for Web Components, "react" for Ignite UI for React, "blazor" for Ignite UI for Blazor, or "generic" for platform-agnostic output (standalone igniteui-theming usage). If omitted, generates generic code. Use detect_platform tool first to auto-detect from project files.`,
|
|
19
|
+
COLOR_FORMAT: `Valid CSS color formats: hex ("#3F51B5", "#3F51B5AA"), rgb/rgba ("rgb(63, 81, 181)", "rgb(63 81 181 / 0.5)"), hsl/hsla ("hsl(231, 48%, 48%)", "hsl(231 48% 48% / 0.5)"), hwb ("hwb(231 20% 30%)"), lab/lch ("lab(50% 40 59)", "lch(50% 80 30)"), oklab/oklch ("oklab(59% 0.1 0.1)", "oklch(60% 0.15 50)"), color() for wide-gamut ("color(display-p3 1 0.5 0)"), or CSS named colors ("indigo", "rebeccapurple").`,
|
|
20
|
+
VARIANT: `Theme variant: "light" (light backgrounds, dark text) or "dark" (dark backgrounds, light text). Defaults to "light".`,
|
|
21
|
+
DESIGN_SYSTEM: `Design system preset: "material" (Material Design), "bootstrap" (Bootstrap), "fluent" (Microsoft Fluent), or "indigo" (Infragistics Indigo). Defaults to "material".`,
|
|
22
|
+
CHROMATIC_SHADES: "14 shades required: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700",
|
|
23
|
+
GRAY_SHADES: "10 shades required: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900",
|
|
24
|
+
LUMINANCE_WARNING: "Colors with extreme luminance (< 0.05 or > 0.45) may produce suboptimal automatic shade generation.",
|
|
25
|
+
MONOCHROMATIC_RULE: "MONOCHROMATIC REQUIREMENT: All shades in a color group (e.g., primary) must be the SAME HUE. Shades are lighter/darker versions of ONE color, NOT different colors. Example: primary shades should all be blue (#E3F2FD → #0D47A1), not blue→green→purple. Vary only lightness and saturation, keep hue constant (±30° tolerance).",
|
|
26
|
+
RESOURCE_SCHEME: "theming://"
|
|
16
27
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Comprehensive tool descriptions with XML-structured sections.
|
|
30
|
+
* These are shown to AI models when listing available tools.
|
|
31
|
+
*/
|
|
32
|
+
var TOOL_DESCRIPTIONS = {
|
|
33
|
+
detect_platform: `Detect the target platform by analyzing dependencies and project config files.
|
|
22
34
|
|
|
23
35
|
<use_case>
|
|
24
36
|
Use this tool FIRST before generating any theme code to ensure platform-optimized output.
|
|
@@ -69,10 +81,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
69
81
|
<related_resources>
|
|
70
82
|
- "theming://guidance/platform-setup": Comprehensive setup guide covering detection workflow, Sass load path configuration, dependency handling, and the recommended theming sequence. Read this for detailed platform-specific setup instructions.
|
|
71
83
|
</related_resources>`,
|
|
72
|
-
|
|
73
|
-
// create_palette - Medium complexity
|
|
74
|
-
// ---------------------------------------------------------------------------
|
|
75
|
-
create_palette: `Generate a color palette for Ignite UI themes using the palette() Sass function.
|
|
84
|
+
create_palette: `Generate a color palette for Ignite UI themes using the palette() Sass function.
|
|
76
85
|
|
|
77
86
|
<use_case>
|
|
78
87
|
Use this tool when you have base colors and want to auto-generate a complete palette
|
|
@@ -157,10 +166,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
157
166
|
- "theming://guidance/colors" — color guidance overview
|
|
158
167
|
- "theming://guidance/colors/rules" — light/dark theme color rules
|
|
159
168
|
</related_resources>`,
|
|
160
|
-
|
|
161
|
-
// create_custom_palette - Complex tool
|
|
162
|
-
// ---------------------------------------------------------------------------
|
|
163
|
-
create_custom_palette: `Generate a custom color palette with fine-grained control over individual shade values.
|
|
169
|
+
create_custom_palette: `Generate a custom color palette with fine-grained control over individual shade values.
|
|
164
170
|
|
|
165
171
|
⚠️ CRITICAL RULES - READ BEFORE GENERATING SHADES:
|
|
166
172
|
1. MONOCHROMATIC: Each color (primary, secondary, etc.) must use ONE HUE only.
|
|
@@ -345,10 +351,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
345
351
|
- "theming://guidance/colors/usage" — which shades to use for different purposes
|
|
346
352
|
- "theming://guidance/colors/roles" — semantic meaning of each color family
|
|
347
353
|
</related_resources>`,
|
|
348
|
-
|
|
349
|
-
// create_typography - Medium complexity
|
|
350
|
-
// ---------------------------------------------------------------------------
|
|
351
|
-
create_typography: `Set up typography for Ignite UI themes with custom font families and type scales.
|
|
354
|
+
create_typography: `Set up typography for Ignite UI themes with custom font families and type scales.
|
|
352
355
|
|
|
353
356
|
<use_case>
|
|
354
357
|
Use this tool to configure fonts that match your brand identity while maintaining
|
|
@@ -397,10 +400,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
397
400
|
Call read_resource to load reference data:
|
|
398
401
|
- "theming://presets/typography" — typography presets for all design systems
|
|
399
402
|
</related_resources>`,
|
|
400
|
-
|
|
401
|
-
// create_elevations - Simple tool
|
|
402
|
-
// ---------------------------------------------------------------------------
|
|
403
|
-
create_elevations: `Set up elevation shadows for Ignite UI themes.
|
|
403
|
+
create_elevations: `Set up elevation shadows for Ignite UI themes.
|
|
404
404
|
|
|
405
405
|
<use_case>
|
|
406
406
|
Use this tool to configure box-shadow values that provide visual depth and hierarchy.
|
|
@@ -436,10 +436,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
436
436
|
Call read_resource to load reference data:
|
|
437
437
|
- "theming://presets/elevations" — elevation presets for Material and Indigo
|
|
438
438
|
</related_resources>`,
|
|
439
|
-
|
|
440
|
-
// create_theme - Complex tool
|
|
441
|
-
// ---------------------------------------------------------------------------
|
|
442
|
-
create_theme: `Generate a complete, production-ready Ignite UI theme with palette, typography, and elevations.
|
|
439
|
+
create_theme: `Generate a complete, production-ready Ignite UI theme with palette, typography, and elevations.
|
|
443
440
|
|
|
444
441
|
<use_case>
|
|
445
442
|
Use this tool as the starting point for new projects. It generates everything needed
|
|
@@ -538,10 +535,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
538
535
|
- "theming://platforms/react" — React platform configuration
|
|
539
536
|
- "theming://platforms/blazor" — Blazor platform configuration
|
|
540
537
|
</related_resources>`,
|
|
541
|
-
|
|
542
|
-
// set_size - Layout tool
|
|
543
|
-
// ---------------------------------------------------------------------------
|
|
544
|
-
set_size: `Set global or component-specific sizing by updating --ig-size.
|
|
538
|
+
set_size: `Set global or component-specific sizing by updating --ig-size.
|
|
545
539
|
|
|
546
540
|
<use_case>
|
|
547
541
|
Use this tool for requests like:
|
|
@@ -580,10 +574,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
580
574
|
- "theming://docs/functions/sizable" — sizable value function
|
|
581
575
|
- "theming://docs/mixins/sizable" — sizable mixin
|
|
582
576
|
</related_resources>`,
|
|
583
|
-
|
|
584
|
-
// set_spacing - Layout tool
|
|
585
|
-
// ---------------------------------------------------------------------------
|
|
586
|
-
set_spacing: `Set global or component-specific spacing by updating --ig-spacing.
|
|
577
|
+
set_spacing: `Set global or component-specific spacing by updating --ig-spacing.
|
|
587
578
|
|
|
588
579
|
<use_case>
|
|
589
580
|
Use this tool for requests like:
|
|
@@ -625,10 +616,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
625
616
|
- "theming://docs/functions/pad" — pad spacing function
|
|
626
617
|
- "theming://docs/mixins/spacing" — spacing mixin
|
|
627
618
|
</related_resources>`,
|
|
628
|
-
|
|
629
|
-
// set_roundness - Layout tool
|
|
630
|
-
// ---------------------------------------------------------------------------
|
|
631
|
-
set_roundness: `Set global or component-specific roundness by updating --ig-radius-factor.
|
|
619
|
+
set_roundness: `Set global or component-specific roundness by updating --ig-radius-factor.
|
|
632
620
|
|
|
633
621
|
<use_case>
|
|
634
622
|
Use this tool for requests like:
|
|
@@ -664,10 +652,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
664
652
|
- "theming://docs/spacing-and-sizing" — spacing and sizing overview
|
|
665
653
|
- "theming://docs/functions/border-radius" — border radius function
|
|
666
654
|
</related_resources>`,
|
|
667
|
-
|
|
668
|
-
// get_component_design_tokens - Discovery tool
|
|
669
|
-
// ---------------------------------------------------------------------------
|
|
670
|
-
get_component_design_tokens: `Discover available design tokens (themeable properties) for an Ignite UI component.
|
|
655
|
+
get_component_design_tokens: `Discover available design tokens (themeable properties) for an Ignite UI component.
|
|
671
656
|
|
|
672
657
|
<use_case>
|
|
673
658
|
ALWAYS call this tool FIRST before using create_component_theme. It returns the
|
|
@@ -737,10 +722,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
737
722
|
<related_tools>
|
|
738
723
|
- create_component_theme: Use the discovered tokens to create a custom theme
|
|
739
724
|
</related_tools>`,
|
|
740
|
-
|
|
741
|
-
// create_component_theme - Theme generation tool
|
|
742
|
-
// ---------------------------------------------------------------------------
|
|
743
|
-
create_component_theme: `Generate Sass or CSS code to customize an Ignite UI component's appearance using design tokens.
|
|
725
|
+
create_component_theme: `Generate Sass or CSS code to customize an Ignite UI component's appearance using design tokens.
|
|
744
726
|
|
|
745
727
|
<use_case>
|
|
746
728
|
Use this tool AFTER calling get_component_design_tokens to customize specific
|
|
@@ -886,10 +868,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
886
868
|
- get_component_design_tokens: MUST call first to discover valid tokens
|
|
887
869
|
- create_theme: Use for full theme (palette + typography + elevations)
|
|
888
870
|
</related_tools>`,
|
|
889
|
-
|
|
890
|
-
// get_color - Color retrieval tool
|
|
891
|
-
// ---------------------------------------------------------------------------
|
|
892
|
-
get_color: `Retrieve a palette color from Ignite UI Theming as a CSS variable reference.
|
|
871
|
+
get_color: `Retrieve a palette color from Ignite UI Theming as a CSS variable reference.
|
|
893
872
|
|
|
894
873
|
<use_case>
|
|
895
874
|
Use this tool when you need to reference a specific palette color in CSS or Sass code.
|
|
@@ -948,10 +927,7 @@ const TOOL_DESCRIPTIONS = {
|
|
|
948
927
|
- create_palette: Generate a complete palette with these colors
|
|
949
928
|
- create_component_theme: Use retrieved colors in component theming
|
|
950
929
|
</related_tools>`,
|
|
951
|
-
|
|
952
|
-
// read_resource - Resource access tool
|
|
953
|
-
// ---------------------------------------------------------------------------
|
|
954
|
-
read_resource: `Read a theming resource by URI. Returns reference data such as platform configurations, color palette presets, typography presets, color guidance, and layout documentation.
|
|
930
|
+
read_resource: `Read a theming resource by URI. Returns reference data such as platform configurations, color palette presets, typography presets, color guidance, and layout documentation.
|
|
955
931
|
|
|
956
932
|
<use_case>
|
|
957
933
|
Use this tool to load reference data before or during theme generation. Other tools
|
|
@@ -981,96 +957,64 @@ const TOOL_DESCRIPTIONS = {
|
|
|
981
957
|
If the URI is not found, returns the list of all available resource URIs.
|
|
982
958
|
</error_handling>`
|
|
983
959
|
};
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
// ---------------------------------------------------------------------------
|
|
1015
|
-
// Elevations parameters
|
|
1016
|
-
// ---------------------------------------------------------------------------
|
|
1017
|
-
elevationPreset: `Elevation shadow preset: "material" (Material Design shadows) or "indigo" (Infragistics Indigo shadows). Defaults to "material".`,
|
|
1018
|
-
// ---------------------------------------------------------------------------
|
|
1019
|
-
// Theme-specific parameters (for create_theme)
|
|
1020
|
-
// ---------------------------------------------------------------------------
|
|
1021
|
-
primaryColor: `Primary brand color for the theme - used for main actions and emphasis. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
1022
|
-
secondaryColor: `Secondary/accent color for the theme - used for highlights and selection. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
1023
|
-
surfaceColor: `Surface/background color for the theme. Use light colors (#FAFAFA) for "light" variant, dark colors (#121212) for "dark" variant. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
1024
|
-
includeTypography: "Include typography setup in the generated theme. Set to false if you want to configure typography separately. Defaults to true.",
|
|
1025
|
-
includeElevations: "Include elevation shadows in the generated theme. Set to false if you want to configure elevations separately. Defaults to true.",
|
|
1026
|
-
includeSpacing: "Include spacing CSS custom properties (Web Components platform only). Defaults to true. Has no effect on Angular platform.",
|
|
1027
|
-
// ---------------------------------------------------------------------------
|
|
1028
|
-
// Custom palette parameters (for create_custom_palette)
|
|
1029
|
-
// ---------------------------------------------------------------------------
|
|
1030
|
-
colorDefinition: `Color definition object with mode selection:
|
|
960
|
+
/**
|
|
961
|
+
* Individual parameter descriptions for schema fields.
|
|
962
|
+
* Include valid values, defaults, formats, and constraints.
|
|
963
|
+
*/
|
|
964
|
+
var PARAM_DESCRIPTIONS = {
|
|
965
|
+
platform: FRAGMENTS.PLATFORM,
|
|
966
|
+
licensed: "Use licensed @infragistics package (Angular only). Set to true if using @infragistics/igniteui-angular from private ProGet registry. Defaults to false (uses open-source igniteui-angular from npm). Note: igniteui-theming is always free/OSS for all other platforms.",
|
|
967
|
+
variant: FRAGMENTS.VARIANT,
|
|
968
|
+
designSystem: FRAGMENTS.DESIGN_SYSTEM,
|
|
969
|
+
name: `Custom variable name (without $ prefix). If omitted, auto-generates based on tool and variant (e.g., "custom-light", "my-theme").`,
|
|
970
|
+
output: `Output format: "sass" generates Sass code using igniteui-theming library functions. "css" generates CSS custom properties (variables) directly - useful for vanilla CSS projects or when you don't want Sass compilation. Defaults to tool-specific output ("sass" for theme generators, "css" for layout setters).`,
|
|
971
|
+
packageJsonPath: `Path to package.json file, relative to current working directory. Defaults to "./package.json".`,
|
|
972
|
+
primary: `Primary brand color - used for main actions, active states, and emphasis. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
973
|
+
secondary: `Secondary/accent color - used for FABs, selection controls, highlights. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
974
|
+
surface: `Surface/background color - should be light for "light" variant, dark for "dark" variant. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
975
|
+
gray: `Gray/neutral base color for text, borders, disabled states. Optional - defaults from design system preset. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
976
|
+
info: `Info state color (typically blue) for informational messages. Optional - defaults from design system. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
977
|
+
success: `Success state color (typically green) for success messages and positive actions. Optional - defaults from design system. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
978
|
+
warn: `Warning state color (typically orange/amber) for warning messages. Optional - defaults from design system. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
979
|
+
error: `Error state color (typically red) for error messages and destructive actions. Optional - defaults from design system. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
980
|
+
fontFamily: `Font family string with fallbacks. Quote names with spaces. Example: '"Inter", "Helvetica Neue", sans-serif'`,
|
|
981
|
+
customScale: "Custom type scale overrides. Object with type style names as keys (h1, h2, body-1, button, etc.) and style objects as values containing fontSize, fontWeight, lineHeight, letterSpacing, textTransform.",
|
|
982
|
+
elevationPreset: `Elevation shadow preset: "material" (Material Design shadows) or "indigo" (Infragistics Indigo shadows). Defaults to "material".`,
|
|
983
|
+
primaryColor: `Primary brand color for the theme - used for main actions and emphasis. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
984
|
+
secondaryColor: `Secondary/accent color for the theme - used for highlights and selection. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
985
|
+
surfaceColor: `Surface/background color for the theme. Use light colors (#FAFAFA) for "light" variant, dark colors (#121212) for "dark" variant. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
986
|
+
includeTypography: "Include typography setup in the generated theme. Set to false if you want to configure typography separately. Defaults to true.",
|
|
987
|
+
includeElevations: "Include elevation shadows in the generated theme. Set to false if you want to configure elevations separately. Defaults to true.",
|
|
988
|
+
includeSpacing: "Include spacing CSS custom properties (Web Components platform only). Defaults to true. Has no effect on Angular platform.",
|
|
989
|
+
colorDefinition: `Color definition object with mode selection:
|
|
1031
990
|
• mode: "shades" + baseColor: Auto-generates all shades from one color
|
|
1032
991
|
• mode: "explicit" + shades: Manually specify all ${FRAGMENTS.CHROMATIC_SHADES}
|
|
1033
992
|
IMPORTANT: All shades must be MONOCHROMATIC (same hue). Shades are lighter/darker versions of ONE color, not different colors.`,
|
|
1034
|
-
|
|
993
|
+
grayDefinition: `Gray color definition object with mode selection:
|
|
1035
994
|
• mode: "shades" + baseColor: Auto-generates all shades from one color
|
|
1036
995
|
• mode: "explicit" + shades: Manually specify all ${FRAGMENTS.GRAY_SHADES}
|
|
1037
996
|
Important: Gray progression is INVERTED for dark themes (50=darkest, 900=lightest).`,
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
radiusFactor: "Roundness scale factor for --ig-radius-factor. 0 = minimum radius, 1 = maximum radius. Values must be between 0 and 1.",
|
|
1060
|
-
// ---------------------------------------------------------------------------
|
|
1061
|
-
// Color operations parameters (for get_color)
|
|
1062
|
-
// ---------------------------------------------------------------------------
|
|
1063
|
-
colorName: `Palette color family name: "primary" (brand color), "secondary" (accent), "gray" (neutrals), "surface" (backgrounds), "info" winformational), "success" (positive), "warn" (warnings), "error" (errors/destructive).`,
|
|
1064
|
-
shadeVariant: `Color shade variant. Standard shades: 50 (lightest) through 900 (darkest). Accent shades: A100, A200, A400, A700 (more saturated). Default: "500" (base color). Note: Gray only supports standard shades (50-900).`,
|
|
1065
|
-
contrastFlag: "If true, returns the contrast color for the specified shade instead of the shade itself. Contrast colors are pre-computed for optimal text readability. Default: false.",
|
|
1066
|
-
opacity: "Opacity value between 0 (fully transparent) and 1 (fully opaque). When provided, wraps the color in CSS relative color syntax: hsl(from var(...) h s l / opacity).",
|
|
1067
|
-
// ---------------------------------------------------------------------------
|
|
1068
|
-
// Resource read parameters
|
|
1069
|
-
// ---------------------------------------------------------------------------
|
|
1070
|
-
resourceUri: `URI of the theming resource to read (e.g., "theming://presets/palettes", "theming://platforms/angular"). See the available_resources list in the tool description for all valid URIs.`
|
|
1071
|
-
};
|
|
1072
|
-
export {
|
|
1073
|
-
FRAGMENTS,
|
|
1074
|
-
PARAM_DESCRIPTIONS,
|
|
1075
|
-
TOOL_DESCRIPTIONS
|
|
997
|
+
baseColor: `Base color for automatic shade generation using shades() function. Choose a mid-luminance color (0.1-0.4) for best results. ${FRAGMENTS.COLOR_FORMAT}`,
|
|
998
|
+
shades: `Object with all shade values. ${FRAGMENTS.CHROMATIC_SHADES}. Luminance should decrease from 50 (lightest) to 900 (darkest). CRITICAL: All shades must be the SAME COLOR (same hue) at different lightness levels - do NOT use different colors for different shades.`,
|
|
999
|
+
grayShades: `Object with all gray shade values. ${FRAGMENTS.GRAY_SHADES}. For light themes: 50=lightest, 900=darkest. For dark themes: 50=darkest, 900=lightest.`,
|
|
1000
|
+
contrastOverrides: "USUALLY OMIT THIS FIELD. Contrast colors are auto-generated using adaptive-contrast(). Only provide this if you have specific accessibility requirements with exact contrast values (rare). When omitted (recommended), the generated Sass code automatically includes adaptive-contrast(#shadeColor) for each shade, which auto-selects black or white for optimal readability.",
|
|
1001
|
+
component: `Component name to get design tokens for (e.g., "button", "avatar", "grid"). Use exact names like "flat-button" for button variants. Call this tool to discover available tokens BEFORE using create_component_theme.`,
|
|
1002
|
+
componentTheme: `Component name to theme (e.g., "button", "avatar", "flat-button", "grid"). Must match a valid component from get_component_design_tokens. For button/icon-button variants, use specific names like "flat-button", "contained-button", "outlined-button", "fab-button".`,
|
|
1003
|
+
tokens: `Object mapping token names to values. Token names must be valid for the component (use get_component_design_tokens to discover them). Values can be CSS colors, dimensions with units, or other Sass-compatible values. Example: { "background": "#1976D2", "border-radius": "8px" }`,
|
|
1004
|
+
selector: `Optional CSS selector to scope the theme. If omitted, uses the platform's default selector for the component. For Angular: "igx-*" selectors, for Web Components: "igc-*" selectors. You can specify custom selectors like ".my-custom-button" for targeted styling.`,
|
|
1005
|
+
themeName: `Optional name for the generated theme variable (without $ prefix). If omitted, auto-generates based on component name (e.g., "$custom-button-theme").`,
|
|
1006
|
+
layoutComponent: `Optional component name to scope the layout change (e.g., "flat-button", "calendar", "avatar"). If omitted, the change applies globally via :root. Note: component targets Ignite UI framework selectors — do not use with platform "generic". Use "scope" instead for custom CSS selectors.`,
|
|
1007
|
+
scope: `Optional CSS selector scope for the change (e.g., ".my-theme", ":root", "#app"). Ignored when component is provided.`,
|
|
1008
|
+
sizeValue: `Size value to set for --ig-size. Accepts "small" (1), "medium" (2), "large" (3), or numeric 1, 2, 3 only.`,
|
|
1009
|
+
spacing: "Spacing scale multiplier for --ig-spacing. 0 = none, 1 = default, 2 = double. Fractions allowed.",
|
|
1010
|
+
spacingInline: "Inline spacing scale multiplier for --ig-spacing-inline. Overrides inline spacing only.",
|
|
1011
|
+
spacingBlock: "Block spacing scale multiplier for --ig-spacing-block. Overrides block spacing only.",
|
|
1012
|
+
radiusFactor: "Roundness scale factor for --ig-radius-factor. 0 = minimum radius, 1 = maximum radius. Values must be between 0 and 1.",
|
|
1013
|
+
colorName: `Palette color family name: "primary" (brand color), "secondary" (accent), "gray" (neutrals), "surface" (backgrounds), "info" winformational), "success" (positive), "warn" (warnings), "error" (errors/destructive).`,
|
|
1014
|
+
shadeVariant: `Color shade variant. Standard shades: 50 (lightest) through 900 (darkest). Accent shades: A100, A200, A400, A700 (more saturated). Default: "500" (base color). Note: Gray only supports standard shades (50-900).`,
|
|
1015
|
+
contrastFlag: "If true, returns the contrast color for the specified shade instead of the shade itself. Contrast colors are pre-computed for optimal text readability. Default: false.",
|
|
1016
|
+
opacity: "Opacity value between 0 (fully transparent) and 1 (fully opaque). When provided, wraps the color in CSS relative color syntax: hsl(from var(...) h s l / opacity).",
|
|
1017
|
+
resourceUri: `URI of the theming resource to read (e.g., "theming://presets/palettes", "theming://platforms/angular"). See the available_resources list in the tool description for all valid URIs.`
|
|
1076
1018
|
};
|
|
1019
|
+
//#endregion
|
|
1020
|
+
export { PARAM_DESCRIPTIONS, TOOL_DESCRIPTIONS };
|
|
@@ -1,66 +1,68 @@
|
|
|
1
|
+
//#region src/tools/handlers/color.ts
|
|
2
|
+
/**
|
|
3
|
+
* Build a CSS variable reference for a palette color.
|
|
4
|
+
*/
|
|
1
5
|
function buildColorReference(color, variant, contrast) {
|
|
2
|
-
|
|
3
|
-
return `var(--ig-${color}-${variant}${suffix})`;
|
|
6
|
+
return `var(--ig-${color}-${variant}${contrast ? "-contrast" : ""})`;
|
|
4
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Wrap a color reference with opacity using CSS relative color syntax.
|
|
10
|
+
*/
|
|
5
11
|
function applyOpacity(colorRef, opacity) {
|
|
6
|
-
|
|
12
|
+
return `hsl(from ${colorRef} h s l / ${opacity})`;
|
|
7
13
|
}
|
|
8
14
|
async function handleGetColor(params) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"```",
|
|
25
|
-
"",
|
|
26
|
-
buildUsageExample(color, variant, contrast, opacity, result)
|
|
27
|
-
].join("\n")
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
};
|
|
15
|
+
const { color, variant = "500", contrast = false, opacity } = params;
|
|
16
|
+
let result = buildColorReference(color, variant, contrast);
|
|
17
|
+
if (opacity !== void 0) result = applyOpacity(result, opacity);
|
|
18
|
+
return { content: [{
|
|
19
|
+
type: "text",
|
|
20
|
+
text: [
|
|
21
|
+
buildDescription(color, variant, contrast, opacity),
|
|
22
|
+
"",
|
|
23
|
+
"```css",
|
|
24
|
+
result,
|
|
25
|
+
"```",
|
|
26
|
+
"",
|
|
27
|
+
buildUsageExample(color, variant, contrast, opacity, result)
|
|
28
|
+
].join("\n")
|
|
29
|
+
}] };
|
|
31
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Build a human-readable description of what was returned.
|
|
33
|
+
*/
|
|
32
34
|
function buildDescription(color, variant, contrast, opacity) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
return desc;
|
|
35
|
+
let desc = contrast ? `Contrast color for ${color} ${variant}` : `${color.charAt(0).toUpperCase() + color.slice(1)} color, shade ${variant}`;
|
|
36
|
+
if (opacity !== void 0) desc += ` at ${Math.round(opacity * 100)}% opacity`;
|
|
37
|
+
return desc;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Build a usage example showing how to use the returned value.
|
|
41
|
+
*/
|
|
39
42
|
function buildUsageExample(color, variant, contrast, opacity, result) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
43
|
+
const examples = ["**Usage example:**"];
|
|
44
|
+
if (contrast) {
|
|
45
|
+
examples.push("```scss");
|
|
46
|
+
examples.push(".my-element {");
|
|
47
|
+
examples.push(` background: var(--ig-${color}-${variant});`);
|
|
48
|
+
examples.push(` color: ${result};`);
|
|
49
|
+
examples.push("}");
|
|
50
|
+
examples.push("```");
|
|
51
|
+
} else if (opacity !== void 0) {
|
|
52
|
+
examples.push("```scss");
|
|
53
|
+
examples.push(".my-element {");
|
|
54
|
+
examples.push(` background: ${result};`);
|
|
55
|
+
examples.push("}");
|
|
56
|
+
examples.push("```");
|
|
57
|
+
} else {
|
|
58
|
+
examples.push("```scss");
|
|
59
|
+
examples.push(".my-element {");
|
|
60
|
+
examples.push(` background: ${result};`);
|
|
61
|
+
examples.push(` color: var(--ig-${color}-${variant}-contrast);`);
|
|
62
|
+
examples.push("}");
|
|
63
|
+
examples.push("```");
|
|
64
|
+
}
|
|
65
|
+
return examples.join("\n");
|
|
63
66
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
+
//#endregion
|
|
68
|
+
export { handleGetColor };
|