igniteui-theming
Version:
A set of Sass variables, mixins, and functions for generating palettes, typography, and elevations used by Ignite UI components.
33 lines (32 loc) • 1.19 kB
JavaScript
import { PLATFORM_METADATA } from "../../knowledge/platforms/index.js";
import { SASS_USE_ASSEMBLY_NOTE } from "../../utils/sass.js";
import { generateElevations } from "../../generators/sass.js";
//#region src/tools/handlers/elevations.ts
/**
* Handler for create_elevations tool.
*/
function handleCreateElevations(params) {
const result = generateElevations({
platform: params.platform,
licensed: params.licensed,
designSystem: params.designSystem,
name: params.name
});
const responseParts = [result.description];
const platformNote = params.platform ? `Platform: ${PLATFORM_METADATA[params.platform]?.name ?? params.platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized code.";
responseParts.push("");
responseParts.push(platformNote);
responseParts.push("");
responseParts.push(`Variables used: ${result.variables.join(", ")}`);
responseParts.push("");
responseParts.push("```scss");
responseParts.push(result.code.trimEnd());
responseParts.push("```");
responseParts.push(SASS_USE_ASSEMBLY_NOTE);
return { content: [{
type: "text",
text: responseParts.join("\n")
}] };
}
//#endregion
export { handleCreateElevations };