New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@salutejs/core-themes

Package Overview
Dependencies
Maintainers
0
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@salutejs/core-themes - npm Package Compare versions

Comparing version 0.15.1-canary.32.11735924898.0 to 0.15.1-canary.1641.12351647715.0

16

build/cjs/creators/createColorTokens.js

@@ -8,8 +8,8 @@ "use strict";

var getJSVariable = function (tokenName, description, value) {
var JSTokenName = utils_1.kebabToCamel(tokenName.replace('-', ''));
var variable = value ? "var(" + tokenName + ", " + value + ")" : "var(" + tokenName + ")";
return "/** " + description + " */\nexport const " + JSTokenName + " = '" + variable + "';\n";
var JSTokenName = (0, utils_1.kebabToCamel)(tokenName.replace('-', ''));
var variable = value ? "var(".concat(tokenName, ", ").concat(value, ")") : "var(".concat(tokenName, ")");
return "/** ".concat(description, " */\nexport const ").concat(JSTokenName, " = '").concat(variable, "';\n");
};
var getCSSVariable = function (tokenName, value) {
return " " + tokenName + ": " + value + ";";
return " ".concat(tokenName, ": ").concat(value, ";");
};

@@ -22,3 +22,3 @@ var getColor = function (color, tokens, mode, isJS) {

var _a = token.name.split('.'), category = _a[1], subcategory = _a[2], name = _a[3];
var tokenName = [subcategory === 'default' ? '-' : "--" + subcategory, category, name].join('-');
var tokenName = [subcategory === 'default' ? '-' : "--".concat(subcategory), category, name].join('-');
var value = color === null || color === void 0 ? void 0 : color[token.name];

@@ -28,3 +28,3 @@ if (!value) {

}
var restoredValue = plasma_tokens_utils_1.getRestoredColorFromPalette(value, -1);
var restoredValue = (0, plasma_tokens_utils_1.getRestoredColorFromPalette)(value, -1);
if (isJS) {

@@ -45,4 +45,4 @@ return getJSVariable(tokenName, token.description, restoredValue);

}
var darkColor = "" + getColor(color, tokens, 'dark', isJS) + (isJS ? '' : "\n" + baseColor);
var lightColor = "" + getColor(color, tokens, 'light', isJS) + (isJS ? '' : "\n" + baseColor);
var darkColor = "".concat(getColor(color, tokens, 'dark', isJS)).concat(isJS ? '' : "\n".concat(baseColor));
var lightColor = "".concat(getColor(color, tokens, 'light', isJS)).concat(isJS ? '' : "\n".concat(baseColor));
return {

@@ -49,0 +49,0 @@ dark: darkColor,

@@ -6,8 +6,8 @@ "use strict";

var getJSVariable = function (tokenName, description, value) {
var JSTokenName = utils_1.kebabToCamel(tokenName.replace('-', ''));
var variable = value ? "var(" + tokenName + ", " + value + ")" : "var(" + tokenName + ")";
return "/** " + description + " */\nexport const " + JSTokenName + " = '" + variable + "';\n";
var JSTokenName = (0, utils_1.kebabToCamel)(tokenName.replace('-', ''));
var variable = value ? "var(".concat(tokenName, ", ").concat(value, ")") : "var(".concat(tokenName, ")");
return "/** ".concat(description, " */\nexport const ").concat(JSTokenName, " = '").concat(variable, "';\n");
};
var getCSSVariable = function (tokenName, value) {
return " " + tokenName + ": " + value + ";";
return " ".concat(tokenName, ": ").concat(value, ";");
};

@@ -20,3 +20,3 @@ var getGradient = function (gradient, tokens, mode, isJS) {

var _a = token.name.split('.'), category = _a[1], subcategory = _a[2], name = _a[3];
var tokenName = [subcategory === 'default' ? '-' : "--" + subcategory, category, name].join('-');
var tokenName = [subcategory === 'default' ? '-' : "--".concat(subcategory), category, name].join('-');
var value = gradient === null || gradient === void 0 ? void 0 : gradient[token.name];

@@ -23,0 +23,0 @@ if (!value) {

@@ -6,8 +6,8 @@ "use strict";

var getJSVariable = function (tokenName, description, value) {
var JSTokenName = utils_1.kebabToCamel("shadow-" + tokenName);
var variable = value ? "var(--shadow-" + tokenName + ", " + value + ")" : "var(--shadow-" + tokenName + ")";
return "/** " + description + " */\nexport const " + JSTokenName + " = '" + variable + "';\n";
var JSTokenName = (0, utils_1.kebabToCamel)("shadow-".concat(tokenName));
var variable = value ? "var(--shadow-".concat(tokenName, ", ").concat(value, ")") : "var(--shadow-".concat(tokenName, ")");
return "/** ".concat(description, " */\nexport const ").concat(JSTokenName, " = '").concat(variable, "';\n");
};
var getCSSVariable = function (tokenName, value) {
return " --shadow-" + tokenName + ": " + value.join(', ') + ";";
return " --shadow-".concat(tokenName, ": ").concat(value.join(', '), ";");
};

@@ -39,3 +39,3 @@ var getShadow = function (shadow, tokens, direction, isJS) {

}
var shadows = getShadow(shadow, tokens, 'down', isJS) + "\n" + getShadow(shadow, tokens, 'up', isJS);
var shadows = "".concat(getShadow(shadow, tokens, 'down', isJS), "\n").concat(getShadow(shadow, tokens, 'up', isJS));
return {

@@ -42,0 +42,0 @@ dark: shadows,

@@ -6,8 +6,8 @@ "use strict";

var getJSVariable = function (tokenName, description, value) {
var JSTokenName = utils_1.kebabToCamel("border-radius-" + tokenName);
var variable = value ? "var(--border-radius-" + tokenName + ", " + value + ")" : "var(--border-radius-" + tokenName + ")";
return "/** " + description + " */\nexport const " + JSTokenName + " = '" + variable + "';\n";
var JSTokenName = (0, utils_1.kebabToCamel)("border-radius-".concat(tokenName));
var variable = value ? "var(--border-radius-".concat(tokenName, ", ").concat(value, ")") : "var(--border-radius-".concat(tokenName, ")");
return "/** ".concat(description, " */\nexport const ").concat(JSTokenName, " = '").concat(variable, "';\n");
};
var getCSSVariable = function (tokenName, value) {
return " --border-radius-" + tokenName + ": " + value + ";";
return " --border-radius-".concat(tokenName, ": ").concat(value, ";");
};

@@ -14,0 +14,0 @@ var getShape = function (shape, tokens, kind, isJS) {

@@ -13,6 +13,10 @@ "use strict";

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -34,3 +38,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

};
var tokenName = __spreadArray([], nameParts);
var tokenName = __spreadArray([], nameParts, true);
tokenName[0] = nameMap[tokenName[0]];

@@ -40,3 +44,3 @@ tokenName[2] = tokenName[2] === 'bold' ? 'bold' : '';

};
var geBaseFonts = function (display, body, header, text) { return " font-size: 16px;\n --plasma-typo-overflow-wrap: break-word;\n --plasma-typo-hyphens: auto;\n --plasma-typo-display-font-family: '" + display + "', sans-serif;\n --plasma-typo-body-font-family: '" + body + "', sans-serif;\n --plasma-typo-header-font-family: '" + header + "', sans-serif;\n --plasma-typo-text-font-family: '" + text + "', sans-serif;"; };
var geBaseFonts = function (display, body, header, text) { return " font-size: 16px;\n --plasma-typo-overflow-wrap: break-word;\n --plasma-typo-hyphens: auto;\n --plasma-typo-display-font-family: '".concat(display, "', sans-serif;\n --plasma-typo-body-font-family: '").concat(body, "', sans-serif;\n --plasma-typo-header-font-family: '").concat(header, "', sans-serif;\n --plasma-typo-text-font-family: '").concat(text, "', sans-serif;"); };
var getTypographyBase = function (typography, fontFamily, tokens, size) {

@@ -70,3 +74,3 @@ var fonts = tokens

var letterSpacing = value.letterSpacing, fontStyle = value.fontStyle;
return " --plasma-typo-" + tokenName + "-font-family: " + fontFamily + ";\n --plasma-typo-" + tokenName + "-letter-spacing: " + letterSpacing + ";\n --plasma-typo-" + tokenName + "-font-style: " + fontStyle + ";";
return " --plasma-typo-".concat(tokenName, "-font-family: ").concat(fontFamily, ";\n --plasma-typo-").concat(tokenName, "-letter-spacing: ").concat(letterSpacing, ";\n --plasma-typo-").concat(tokenName, "-font-style: ").concat(fontStyle, ";");
})

@@ -77,7 +81,7 @@ .join('\n');

// INFO: Приведение размера Xs+ в верхний регистр для сохранения обратной совместимости
var JSTokenName = utils_1.kebabToCamel(tokenName).replace(/(Xx*s)/gm, function (_, group) { return group.toUpperCase(); });
return "/** " + description + " */\nexport const " + JSTokenName + " = {\n fontFamily: 'var(--plasma-typo-" + tokenName + "-font-family)',\n fontSize: 'var(--plasma-typo-" + tokenName + "-font-size)',\n fontStyle: 'var(--plasma-typo-" + tokenName + "-font-style)',\n fontWeight: 'var(--plasma-typo-" + tokenName + "-font-weight)',\n letterSpacing: 'var(--plasma-typo-" + tokenName + "-letter-spacing)',\n lineHeight: 'var(--plasma-typo-" + tokenName + "-line-height)',\n};\n";
var JSTokenName = (0, utils_1.kebabToCamel)(tokenName).replace(/(Xx*s)/gm, function (_, group) { return group.toUpperCase(); });
return "/** ".concat(description, " */\nexport const ").concat(JSTokenName, " = {\n fontFamily: 'var(--plasma-typo-").concat(tokenName, "-font-family)',\n fontSize: 'var(--plasma-typo-").concat(tokenName, "-font-size)',\n fontStyle: 'var(--plasma-typo-").concat(tokenName, "-font-style)',\n fontWeight: 'var(--plasma-typo-").concat(tokenName, "-font-weight)',\n letterSpacing: 'var(--plasma-typo-").concat(tokenName, "-letter-spacing)',\n lineHeight: 'var(--plasma-typo-").concat(tokenName, "-line-height)',\n};\n");
};
var getCSSVariable = function (tokenName, value) {
return " --plasma-typo-" + tokenName + "-font-size: " + value.fontSize + ";\n --plasma-typo-" + tokenName + "-font-weight: " + value.fontWeight + ";\n --plasma-typo-" + tokenName + "-line-height: " + value.lineHeight + ";";
return " --plasma-typo-".concat(tokenName, "-font-size: ").concat(value.fontSize, ";\n --plasma-typo-").concat(tokenName, "-font-weight: ").concat(value.fontWeight, ";\n --plasma-typo-").concat(tokenName, "-line-height: ").concat(value.lineHeight, ";");
};

@@ -117,3 +121,3 @@ var getResponsiveTypography = function (typography, tokens, size, isJS) {

}
var rootTypography = getTypographyBase(typography, fontFamily, tokens, 'screen-s') + "\n" + getTypographyRoot(typography, tokens, 'screen-s');
var rootTypography = "".concat(getTypographyBase(typography, fontFamily, tokens, 'screen-s'), "\n").concat(getTypographyRoot(typography, tokens, 'screen-s'));
var screenSTypography = getResponsiveTypography(typography, tokens, 'screen-s', isJS);

@@ -120,0 +124,0 @@ var screenMTypography = getResponsiveTypography(typography, tokens, 'screen-m', isJS);

"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -10,3 +14,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

var getCSSVariable = function (tokenName, value) {
return " " + tokenName + ": var(" + value + ");";
return " ".concat(tokenName, ": var(").concat(value, ");");
};

@@ -31,3 +35,3 @@ var getOppositeValue = function (mode, category, subcategory, name) {

}
var tokenName = [subcategory === 'default' ? '-' : "--" + subcategory, category, name].join('-');
var tokenName = [subcategory === 'default' ? '-' : "--".concat(subcategory), category, name].join('-');
var tokenValue = getOppositeValue(mode, category, subcategory, name);

@@ -44,7 +48,7 @@ return getCSSVariable(tokenName, tokenValue);

}
var darkTokens = "" + getToken(__spreadArray(__spreadArray([], colorTokens), gradientTokens), 'dark');
var lightTokens = "" + getToken(__spreadArray(__spreadArray([], colorTokens), gradientTokens), 'light');
return "\nexport const viewContainer = {\n dark: `\n" + darkTokens + "\n `,\n light: `\n" + lightTokens + "\n `,\n };\n";
var darkTokens = "".concat(getToken(__spreadArray(__spreadArray([], colorTokens, true), gradientTokens, true), 'dark'));
var lightTokens = "".concat(getToken(__spreadArray(__spreadArray([], colorTokens, true), gradientTokens, true), 'light'));
return "\nexport const viewContainer = {\n dark: `\n".concat(darkTokens, "\n `,\n light: `\n").concat(lightTokens, "\n `,\n };\n");
};
exports.createViewContainerTokens = createViewContainerTokens;
//# sourceMappingURL=createViewContainerTokens.js.map

@@ -60,18 +60,18 @@ "use strict";

theme = themes_1[_i];
return [4 /*yield*/, utils_1.readTheme(theme.name, theme.version)];
return [4 /*yield*/, (0, utils_1.readTheme)(theme.name, theme.version)];
case 2:
themeSource = _a.sent();
meta = themeSource.meta, variations = themeSource.variations;
metaGrouped = utils_1.getMetaGrouped(themeSource.meta);
colorCSSVariables = utils_1.fallbackCreateColorTokensWrapper(theme.name, variations.color, metaGrouped.color);
colorJSVariables = utils_1.fallbackCreateColorTokensWrapper(theme.name, variations.color, metaGrouped.color, isJS);
gradientCSSVariables = creators_1.createGradientTokens(variations.gradient, metaGrouped.gradient);
gradientJSVariables = creators_1.createGradientTokens(variations.gradient, metaGrouped.gradient, isJS);
shapeCSSVariables = creators_1.createShapeTokens(variations.shape, metaGrouped.shape);
shapeJSVariables = creators_1.createShapeTokens(variations.shape, metaGrouped.shape, isJS);
shadowCSSVariables = creators_1.createShadowTokens(variations.shadow, metaGrouped.shadow);
shadowJSVariables = creators_1.createShadowTokens(variations.shadow, metaGrouped.shadow, isJS);
typographyCSSVariables = creators_1.createTypographyTokens(variations.typography, variations.fontFamily, metaGrouped.typography);
typographyJSVariables = creators_1.createTypographyTokens(variations.typography, variations.fontFamily, metaGrouped.typography, true);
viewContainerVariables = creators_1.createViewContainerTokens(metaGrouped.color, metaGrouped.gradient);
metaGrouped = (0, utils_1.getMetaGrouped)(themeSource.meta);
colorCSSVariables = (0, utils_1.fallbackCreateColorTokensWrapper)(theme.name, variations.color, metaGrouped.color);
colorJSVariables = (0, utils_1.fallbackCreateColorTokensWrapper)(theme.name, variations.color, metaGrouped.color, isJS);
gradientCSSVariables = (0, creators_1.createGradientTokens)(variations.gradient, metaGrouped.gradient);
gradientJSVariables = (0, creators_1.createGradientTokens)(variations.gradient, metaGrouped.gradient, isJS);
shapeCSSVariables = (0, creators_1.createShapeTokens)(variations.shape, metaGrouped.shape);
shapeJSVariables = (0, creators_1.createShapeTokens)(variations.shape, metaGrouped.shape, isJS);
shadowCSSVariables = (0, creators_1.createShadowTokens)(variations.shadow, metaGrouped.shadow);
shadowJSVariables = (0, creators_1.createShadowTokens)(variations.shadow, metaGrouped.shadow, isJS);
typographyCSSVariables = (0, creators_1.createTypographyTokens)(variations.typography, variations.fontFamily, metaGrouped.typography);
typographyJSVariables = (0, creators_1.createTypographyTokens)(variations.typography, variations.fontFamily, metaGrouped.typography, true);
viewContainerVariables = (0, creators_1.createViewContainerTokens)(metaGrouped.color, metaGrouped.gradient);
cssVariables = {

@@ -93,6 +93,6 @@ dark: {

};
generators_1.generateThemes(themeDir, meta.name, cssVariables);
generators_1.generateCSSThemes(themeDir, meta.name, cssVariables);
generators_1.generateCSSModuleThemes(themeDir, meta.name, cssVariables);
generators_1.generateTokens(themeDir, meta.name, {
(0, generators_1.generateThemes)(themeDir, meta.name, cssVariables);
(0, generators_1.generateCSSThemes)(themeDir, meta.name, cssVariables);
(0, generators_1.generateCSSModuleThemes)(themeDir, meta.name, cssVariables);
(0, generators_1.generateTokens)(themeDir, meta.name, {
colorTokens: colorJSVariables.dark,

@@ -109,12 +109,12 @@ gradientTokens: gradientJSVariables.dark,

return [3 /*break*/, 1];
case 4: return [4 /*yield*/, utils_1.readTheme('default', 'latest')];
case 4: return [4 /*yield*/, (0, utils_1.readTheme)('default', 'latest')];
case 5:
themeDefault = _a.sent();
metaGroupedDefault = utils_1.getMetaGrouped(themeDefault.meta);
colorDefaultJSVariables = creators_1.createColorTokens(undefined, metaGroupedDefault.color, isJS).dark;
gradientDefaultJSVariables = creators_1.createGradientTokens(undefined, metaGroupedDefault.gradient, isJS).dark;
shapeDefaultJSVariables = creators_1.createShapeTokens(undefined, metaGroupedDefault.shape, isJS).dark;
shadowDefaultJSVariables = creators_1.createShadowTokens(undefined, metaGroupedDefault.shadow, isJS).dark;
typographyDefaultJSVariables = creators_1.createTypographyTokens(undefined, undefined, metaGroupedDefault.typography, true).dark;
generators_1.generateDefaultTokens(themeDir, {
metaGroupedDefault = (0, utils_1.getMetaGrouped)(themeDefault.meta);
colorDefaultJSVariables = (0, creators_1.createColorTokens)(undefined, metaGroupedDefault.color, isJS).dark;
gradientDefaultJSVariables = (0, creators_1.createGradientTokens)(undefined, metaGroupedDefault.gradient, isJS).dark;
shapeDefaultJSVariables = (0, creators_1.createShapeTokens)(undefined, metaGroupedDefault.shape, isJS).dark;
shadowDefaultJSVariables = (0, creators_1.createShadowTokens)(undefined, metaGroupedDefault.shadow, isJS).dark;
typographyDefaultJSVariables = (0, creators_1.createTypographyTokens)(undefined, undefined, metaGroupedDefault.typography, true).dark;
(0, generators_1.generateDefaultTokens)(themeDir, {
colorTokens: colorDefaultJSVariables,

@@ -126,3 +126,3 @@ gradientTokens: gradientDefaultJSVariables,

});
generators_1.generateRootIndex(themeDir);
(0, generators_1.generateRootIndex)(themeDir);
return [2 /*return*/];

@@ -129,0 +129,0 @@ }

@@ -19,21 +19,21 @@ "use strict";

var darkContent = [
utils_1.getSelector(themeContent.dark.colorTokens, darkSelector),
utils_1.getSelector(themeContent.dark.gradientTokens, darkSelector),
(0, utils_1.getSelector)(themeContent.dark.colorTokens, darkSelector),
(0, utils_1.getSelector)(themeContent.dark.gradientTokens, darkSelector),
].join('\n');
var lightContent = [
utils_1.getSelector(themeContent.light.colorTokens, lightSelector),
utils_1.getSelector(themeContent.light.gradientTokens, lightSelector),
(0, utils_1.getSelector)(themeContent.light.colorTokens, lightSelector),
(0, utils_1.getSelector)(themeContent.light.gradientTokens, lightSelector),
].join('\n');
var breakpointContent = [
utils_1.getSelector(themeContent.dark.shadowTokens, groupSelector),
utils_1.getSelector(themeContent.dark.shapeTokens, groupSelector),
utils_1.getSelector(themeContent.dark.typographyTokens.root, groupSelector),
utils_1.getBreakpointSelector(themeContent.dark.typographyTokens.screenS, screenS.from, screenS.to, groupSelector),
utils_1.getBreakpointSelector(themeContent.dark.typographyTokens.screenM, screenM.from, screenM.to, groupSelector),
utils_1.getBreakpointSelector(themeContent.dark.typographyTokens.screenL, screenL.from, screenL.to, groupSelector),
(0, utils_1.getSelector)(themeContent.dark.shadowTokens, groupSelector),
(0, utils_1.getSelector)(themeContent.dark.shapeTokens, groupSelector),
(0, utils_1.getSelector)(themeContent.dark.typographyTokens.root, groupSelector),
(0, utils_1.getBreakpointSelector)(themeContent.dark.typographyTokens.screenS, screenS.from, screenS.to, groupSelector),
(0, utils_1.getBreakpointSelector)(themeContent.dark.typographyTokens.screenM, screenM.from, screenM.to, groupSelector),
(0, utils_1.getBreakpointSelector)(themeContent.dark.typographyTokens.screenL, screenL.from, screenL.to, groupSelector),
].join('\n');
var file = generateFile_1.generateCommonFile(themeName + ".module", 'css', [darkContent, lightContent, breakpointContent].join('\n'));
plasma_tokens_utils_1.writeGeneratedToFS(themesDir, [file], types_1.GENERATE_MESSAGE_FOR_CSS);
var file = (0, generateFile_1.generateCommonFile)("".concat(themeName, ".module"), 'css', [darkContent, lightContent, breakpointContent].join('\n'));
(0, plasma_tokens_utils_1.writeGeneratedToFS)(themesDir, [file], types_1.GENERATE_MESSAGE_FOR_CSS);
};
exports.generateCSSModuleThemes = generateCSSModuleThemes;
//# sourceMappingURL=generateCSSModuleThemes.js.map

@@ -17,15 +17,15 @@ "use strict";

return [
utils_1.getSelector(themeContent[themeMode].colorTokens),
utils_1.getSelector(themeContent[themeMode].gradientTokens),
utils_1.getSelector(themeContent[themeMode].shadowTokens),
utils_1.getSelector(themeContent[themeMode].shapeTokens),
utils_1.getSelector(themeContent[themeMode].typographyTokens.root),
utils_1.getBreakpointSelector(themeContent[themeMode].typographyTokens.screenS, screenS.from),
utils_1.getBreakpointSelector(themeContent[themeMode].typographyTokens.screenM, screenM.from, screenM.to),
utils_1.getBreakpointSelector(themeContent[themeMode].typographyTokens.screenL, screenL.from, screenL.to),
(0, utils_1.getSelector)(themeContent[themeMode].colorTokens),
(0, utils_1.getSelector)(themeContent[themeMode].gradientTokens),
(0, utils_1.getSelector)(themeContent[themeMode].shadowTokens),
(0, utils_1.getSelector)(themeContent[themeMode].shapeTokens),
(0, utils_1.getSelector)(themeContent[themeMode].typographyTokens.root),
(0, utils_1.getBreakpointSelector)(themeContent[themeMode].typographyTokens.screenS, screenS.from),
(0, utils_1.getBreakpointSelector)(themeContent[themeMode].typographyTokens.screenM, screenM.from, screenM.to),
(0, utils_1.getBreakpointSelector)(themeContent[themeMode].typographyTokens.screenL, screenL.from, screenL.to),
].join('\n');
};
plasma_tokens_utils_1.writeGeneratedToFS(themesDir, [
generateFile_1.generateCommonFile(themeName + "__dark", 'css', getContent('dark')),
generateFile_1.generateCommonFile(themeName + "__light", 'css', getContent('light')),
(0, plasma_tokens_utils_1.writeGeneratedToFS)(themesDir, [
(0, generateFile_1.generateCommonFile)("".concat(themeName, "__dark"), 'css', getContent('dark')),
(0, generateFile_1.generateCommonFile)("".concat(themeName, "__light"), 'css', getContent('light')),
], types_1.GENERATE_MESSAGE_FOR_CSS);

@@ -32,0 +32,0 @@ };

@@ -19,5 +19,5 @@ "use strict";

].join('\n');
plasma_tokens_utils_1.writeGeneratedToFS(themesDir, [generateFile_1.generateCommonFile('index', 'ts', content)]);
(0, plasma_tokens_utils_1.writeGeneratedToFS)(themesDir, [(0, generateFile_1.generateCommonFile)('index', 'ts', content)]);
};
exports.generateDefaultTokens = generateDefaultTokens;
//# sourceMappingURL=generateDefaultTokens.js.map

@@ -12,3 +12,3 @@ "use strict";

var rootIndexTsDir = path_1.default.join(srcDir, 'index.ts');
var indexTsContent = plasma_tokens_utils_1.ROBO_COMMENT + "export * from './themes';\n ";
var indexTsContent = "".concat(plasma_tokens_utils_1.ROBO_COMMENT, "export * from './themes';\n ");
fs_1.default.writeFileSync(rootIndexTsDir, indexTsContent);

@@ -15,0 +15,0 @@ };

@@ -15,19 +15,19 @@ "use strict";

var screenS = types_1.webBreakpoints.screenS, screenM = types_1.webBreakpoints.screenM, screenL = types_1.webBreakpoints.screenL;
var indexFile = "export { " + themeName + "__dark } from './" + themeName + "__dark';\nexport { " + themeName + "__light } from './" + themeName + "__light';\n";
var indexFile = "export { ".concat(themeName, "__dark } from './").concat(themeName, "__dark';\nexport { ").concat(themeName, "__light } from './").concat(themeName, "__light';\n");
var getContent = function (themeMode) {
return [
utils_1.getSelector(themeContent[themeMode].colorTokens),
utils_1.getSelector(themeContent[themeMode].gradientTokens),
utils_1.getSelector(themeContent[themeMode].shadowTokens),
utils_1.getSelector(themeContent[themeMode].shapeTokens),
utils_1.getSelector(themeContent[themeMode].typographyTokens.root),
utils_1.getBreakpointSelector(themeContent[themeMode].typographyTokens.screenS, screenS.from),
utils_1.getBreakpointSelector(themeContent[themeMode].typographyTokens.screenM, screenM.from, screenM.to),
utils_1.getBreakpointSelector(themeContent[themeMode].typographyTokens.screenL, screenL.from, screenL.to),
(0, utils_1.getSelector)(themeContent[themeMode].colorTokens),
(0, utils_1.getSelector)(themeContent[themeMode].gradientTokens),
(0, utils_1.getSelector)(themeContent[themeMode].shadowTokens),
(0, utils_1.getSelector)(themeContent[themeMode].shapeTokens),
(0, utils_1.getSelector)(themeContent[themeMode].typographyTokens.root),
(0, utils_1.getBreakpointSelector)(themeContent[themeMode].typographyTokens.screenS, screenS.from),
(0, utils_1.getBreakpointSelector)(themeContent[themeMode].typographyTokens.screenM, screenM.from, screenM.to),
(0, utils_1.getBreakpointSelector)(themeContent[themeMode].typographyTokens.screenL, screenL.from, screenL.to),
].join('\n');
};
plasma_tokens_utils_1.writeGeneratedToFS(themesDir, [
plasma_tokens_utils_1.generateFile(themeName + "__dark", "[`" + getContent('dark') + "`] as unknown as TemplateStringsArray"),
plasma_tokens_utils_1.generateFile(themeName + "__light", "[`" + getContent('light') + "`] as unknown as TemplateStringsArray"),
generateFile_1.generateCommonFile('index', 'ts', indexFile),
(0, plasma_tokens_utils_1.writeGeneratedToFS)(themesDir, [
(0, plasma_tokens_utils_1.generateFile)("".concat(themeName, "__dark"), "[`".concat(getContent('dark'), "`] as unknown as TemplateStringsArray")),
(0, plasma_tokens_utils_1.generateFile)("".concat(themeName, "__light"), "[`".concat(getContent('light'), "`] as unknown as TemplateStringsArray")),
(0, generateFile_1.generateCommonFile)('index', 'ts', indexFile),
]);

@@ -34,0 +34,0 @@ };

@@ -23,5 +23,5 @@ "use strict";

].join('\n');
plasma_tokens_utils_1.writeGeneratedToFS(themeDir, [generateFile_1.generateCommonFile('index', 'ts', content)]);
(0, plasma_tokens_utils_1.writeGeneratedToFS)(themeDir, [(0, generateFile_1.generateCommonFile)('index', 'ts', content)]);
};
exports.generateTokens = generateTokens;
//# sourceMappingURL=generateTokens.js.map

@@ -47,8 +47,8 @@ "use strict";

var oldName = _a[0], actualName = _a[1];
var oldVarName = "--" + other_1.camelToKebab(legacyPrefix) + "-" + other_1.camelToKebab(oldName);
var actualVarName = "--" + other_1.camelToKebab(actualName);
var oldVarName = "--".concat((0, other_1.camelToKebab)(legacyPrefix), "-").concat((0, other_1.camelToKebab)(oldName));
var actualVarName = "--".concat((0, other_1.camelToKebab)(actualName));
if (isJS) {
return "/** @deprecated instead use " + actualName + " */\nexport const " + oldName + " = 'var(" + oldVarName + ", var(" + actualVarName + "))';\n";
return "/** @deprecated instead use ".concat(actualName, " */\nexport const ").concat(oldName, " = 'var(").concat(oldVarName, ", var(").concat(actualVarName, "))';\n");
}
return " " + oldVarName + ": var(" + actualVarName + ");";
return " ".concat(oldVarName, ": var(").concat(actualVarName, ");");
})

@@ -60,8 +60,8 @@ .join('\n');

if (isJS === void 0) { isJS = false; }
var colorVariables = creators_1.createColorTokens(color, tokens, isJS);
var colorVariables = (0, creators_1.createColorTokens)(color, tokens, isJS);
if (name === 'plasma_web' || name === 'plasma_b2c') {
var fallbackTokens = exports.getFallbackTokens(isJS);
var fallbackTokens = (0, exports.getFallbackTokens)(isJS);
return {
dark: colorVariables.dark + "\n" + fallbackTokens,
light: colorVariables.light + "\n" + fallbackTokens,
dark: "".concat(colorVariables.dark, "\n").concat(fallbackTokens),
light: "".concat(colorVariables.light, "\n").concat(fallbackTokens),
};

@@ -68,0 +68,0 @@ }

@@ -13,6 +13,10 @@ "use strict";

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -25,3 +29,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

var _a;
return __assign(__assign({}, acc), (_a = {}, _a[token.type] = __spreadArray(__spreadArray([], (acc[token.type] || [])), [token]), _a));
return __assign(__assign({}, acc), (_a = {}, _a[token.type] = __spreadArray(__spreadArray([], (acc[token.type] || []), true), [token], false), _a));
}, {});

@@ -28,0 +32,0 @@ return metaGrouped;

@@ -8,4 +8,4 @@ "use strict";

exports.kebabToCamel = kebabToCamel;
var camelToKebab = function (str) { return str.replace(/[A-Z]/g, function (match) { return "-" + match.toLowerCase(); }); };
var camelToKebab = function (str) { return str.replace(/[A-Z]/g, function (match) { return "-".concat(match.toLowerCase()); }); };
exports.camelToKebab = camelToKebab;
//# sourceMappingURL=other.js.map

@@ -116,3 +116,3 @@ "use strict";

switch (_a.label) {
case 0: return [4 /*yield*/, fetch("https://api.github.com/repos/" + owner + "/" + repo + "/contents/" + path + "?ref=" + branchName, {
case 0: return [4 /*yield*/, fetch("https://api.github.com/repos/".concat(owner, "/").concat(repo, "/contents/").concat(path, "?ref=").concat(branchName), {
headers: {

@@ -136,3 +136,3 @@ accept: 'application/vnd.github.v3.full',

switch (_a.label) {
case 0: return [4 /*yield*/, getFileSource('salute-developers', 'theme-converter', "themes/" + themeName + "/" + themeVersion + ".zip", 'main')];
case 0: return [4 /*yield*/, getFileSource('salute-developers', 'theme-converter', "themes/".concat(themeName, "/").concat(themeVersion, ".zip"), 'main')];
case 1:

@@ -156,3 +156,3 @@ response = _a.sent();

if (selector === void 0) { selector = ':root'; }
return "\n" + selector + " {\n" + content + "\n}";
return "\n".concat(selector, " {\n").concat(content, "\n}");
};

@@ -163,6 +163,6 @@ exports.getSelector = getSelector;

var indent = ' ';
var mediaQuery = plasma_tokens_utils_1.getMediaQuery(from, to);
return "\n" + mediaQuery + " {\n " + selector + " {\n" + content.replace(/ {2}/gim, indent) + "\n }\n}";
var mediaQuery = (0, plasma_tokens_utils_1.getMediaQuery)(from, to);
return "\n".concat(mediaQuery, " {\n ").concat(selector, " {\n").concat(content.replace(/ {2}/gim, indent), "\n }\n}");
};
exports.getBreakpointSelector = getBreakpointSelector;
//# sourceMappingURL=theme.js.map

@@ -6,7 +6,7 @@ import { getRestoredColorFromPalette } from '@salutejs/plasma-tokens-utils';

var JSTokenName = kebabToCamel(tokenName.replace('-', ''));
var variable = value ? "var(" + tokenName + ", " + value + ")" : "var(" + tokenName + ")";
return "/** " + description + " */\nexport const " + JSTokenName + " = '" + variable + "';\n";
var variable = value ? "var(".concat(tokenName, ", ").concat(value, ")") : "var(".concat(tokenName, ")");
return "/** ".concat(description, " */\nexport const ").concat(JSTokenName, " = '").concat(variable, "';\n");
};
var getCSSVariable = function (tokenName, value) {
return " " + tokenName + ": " + value + ";";
return " ".concat(tokenName, ": ").concat(value, ";");
};

@@ -19,3 +19,3 @@ var getColor = function (color, tokens, mode, isJS) {

var _a = token.name.split('.'), category = _a[1], subcategory = _a[2], name = _a[3];
var tokenName = [subcategory === 'default' ? '-' : "--" + subcategory, category, name].join('-');
var tokenName = [subcategory === 'default' ? '-' : "--".concat(subcategory), category, name].join('-');
var value = color === null || color === void 0 ? void 0 : color[token.name];

@@ -41,4 +41,4 @@ if (!value) {

}
var darkColor = "" + getColor(color, tokens, 'dark', isJS) + (isJS ? '' : "\n" + baseColor);
var lightColor = "" + getColor(color, tokens, 'light', isJS) + (isJS ? '' : "\n" + baseColor);
var darkColor = "".concat(getColor(color, tokens, 'dark', isJS)).concat(isJS ? '' : "\n".concat(baseColor));
var lightColor = "".concat(getColor(color, tokens, 'light', isJS)).concat(isJS ? '' : "\n".concat(baseColor));
return {

@@ -45,0 +45,0 @@ dark: darkColor,

import { kebabToCamel } from '../utils';
var getJSVariable = function (tokenName, description, value) {
var JSTokenName = kebabToCamel(tokenName.replace('-', ''));
var variable = value ? "var(" + tokenName + ", " + value + ")" : "var(" + tokenName + ")";
return "/** " + description + " */\nexport const " + JSTokenName + " = '" + variable + "';\n";
var variable = value ? "var(".concat(tokenName, ", ").concat(value, ")") : "var(".concat(tokenName, ")");
return "/** ".concat(description, " */\nexport const ").concat(JSTokenName, " = '").concat(variable, "';\n");
};
var getCSSVariable = function (tokenName, value) {
return " " + tokenName + ": " + value + ";";
return " ".concat(tokenName, ": ").concat(value, ";");
};

@@ -16,3 +16,3 @@ var getGradient = function (gradient, tokens, mode, isJS) {

var _a = token.name.split('.'), category = _a[1], subcategory = _a[2], name = _a[3];
var tokenName = [subcategory === 'default' ? '-' : "--" + subcategory, category, name].join('-');
var tokenName = [subcategory === 'default' ? '-' : "--".concat(subcategory), category, name].join('-');
var value = gradient === null || gradient === void 0 ? void 0 : gradient[token.name];

@@ -19,0 +19,0 @@ if (!value) {

import { kebabToCamel } from '../utils';
var getJSVariable = function (tokenName, description, value) {
var JSTokenName = kebabToCamel("shadow-" + tokenName);
var variable = value ? "var(--shadow-" + tokenName + ", " + value + ")" : "var(--shadow-" + tokenName + ")";
return "/** " + description + " */\nexport const " + JSTokenName + " = '" + variable + "';\n";
var JSTokenName = kebabToCamel("shadow-".concat(tokenName));
var variable = value ? "var(--shadow-".concat(tokenName, ", ").concat(value, ")") : "var(--shadow-".concat(tokenName, ")");
return "/** ".concat(description, " */\nexport const ").concat(JSTokenName, " = '").concat(variable, "';\n");
};
var getCSSVariable = function (tokenName, value) {
return " --shadow-" + tokenName + ": " + value.join(', ') + ";";
return " --shadow-".concat(tokenName, ": ").concat(value.join(', '), ";");
};

@@ -35,3 +35,3 @@ var getShadow = function (shadow, tokens, direction, isJS) {

}
var shadows = getShadow(shadow, tokens, 'down', isJS) + "\n" + getShadow(shadow, tokens, 'up', isJS);
var shadows = "".concat(getShadow(shadow, tokens, 'down', isJS), "\n").concat(getShadow(shadow, tokens, 'up', isJS));
return {

@@ -38,0 +38,0 @@ dark: shadows,

import { kebabToCamel } from '../utils';
var getJSVariable = function (tokenName, description, value) {
var JSTokenName = kebabToCamel("border-radius-" + tokenName);
var variable = value ? "var(--border-radius-" + tokenName + ", " + value + ")" : "var(--border-radius-" + tokenName + ")";
return "/** " + description + " */\nexport const " + JSTokenName + " = '" + variable + "';\n";
var JSTokenName = kebabToCamel("border-radius-".concat(tokenName));
var variable = value ? "var(--border-radius-".concat(tokenName, ", ").concat(value, ")") : "var(--border-radius-".concat(tokenName, ")");
return "/** ".concat(description, " */\nexport const ").concat(JSTokenName, " = '").concat(variable, "';\n");
};
var getCSSVariable = function (tokenName, value) {
return " --border-radius-" + tokenName + ": " + value + ";";
return " --border-radius-".concat(tokenName, ": ").concat(value, ";");
};

@@ -10,0 +10,0 @@ var getShape = function (shape, tokens, kind, isJS) {

@@ -12,6 +12,10 @@ var __assign = (this && this.__assign) || function () {

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -31,3 +35,3 @@ import { kebabToCamel } from '../utils';

};
var tokenName = __spreadArray([], nameParts);
var tokenName = __spreadArray([], nameParts, true);
tokenName[0] = nameMap[tokenName[0]];

@@ -37,3 +41,3 @@ tokenName[2] = tokenName[2] === 'bold' ? 'bold' : '';

};
var geBaseFonts = function (display, body, header, text) { return " font-size: 16px;\n --plasma-typo-overflow-wrap: break-word;\n --plasma-typo-hyphens: auto;\n --plasma-typo-display-font-family: '" + display + "', sans-serif;\n --plasma-typo-body-font-family: '" + body + "', sans-serif;\n --plasma-typo-header-font-family: '" + header + "', sans-serif;\n --plasma-typo-text-font-family: '" + text + "', sans-serif;"; };
var geBaseFonts = function (display, body, header, text) { return " font-size: 16px;\n --plasma-typo-overflow-wrap: break-word;\n --plasma-typo-hyphens: auto;\n --plasma-typo-display-font-family: '".concat(display, "', sans-serif;\n --plasma-typo-body-font-family: '").concat(body, "', sans-serif;\n --plasma-typo-header-font-family: '").concat(header, "', sans-serif;\n --plasma-typo-text-font-family: '").concat(text, "', sans-serif;"); };
var getTypographyBase = function (typography, fontFamily, tokens, size) {

@@ -67,3 +71,3 @@ var fonts = tokens

var letterSpacing = value.letterSpacing, fontStyle = value.fontStyle;
return " --plasma-typo-" + tokenName + "-font-family: " + fontFamily + ";\n --plasma-typo-" + tokenName + "-letter-spacing: " + letterSpacing + ";\n --plasma-typo-" + tokenName + "-font-style: " + fontStyle + ";";
return " --plasma-typo-".concat(tokenName, "-font-family: ").concat(fontFamily, ";\n --plasma-typo-").concat(tokenName, "-letter-spacing: ").concat(letterSpacing, ";\n --plasma-typo-").concat(tokenName, "-font-style: ").concat(fontStyle, ";");
})

@@ -75,6 +79,6 @@ .join('\n');

var JSTokenName = kebabToCamel(tokenName).replace(/(Xx*s)/gm, function (_, group) { return group.toUpperCase(); });
return "/** " + description + " */\nexport const " + JSTokenName + " = {\n fontFamily: 'var(--plasma-typo-" + tokenName + "-font-family)',\n fontSize: 'var(--plasma-typo-" + tokenName + "-font-size)',\n fontStyle: 'var(--plasma-typo-" + tokenName + "-font-style)',\n fontWeight: 'var(--plasma-typo-" + tokenName + "-font-weight)',\n letterSpacing: 'var(--plasma-typo-" + tokenName + "-letter-spacing)',\n lineHeight: 'var(--plasma-typo-" + tokenName + "-line-height)',\n};\n";
return "/** ".concat(description, " */\nexport const ").concat(JSTokenName, " = {\n fontFamily: 'var(--plasma-typo-").concat(tokenName, "-font-family)',\n fontSize: 'var(--plasma-typo-").concat(tokenName, "-font-size)',\n fontStyle: 'var(--plasma-typo-").concat(tokenName, "-font-style)',\n fontWeight: 'var(--plasma-typo-").concat(tokenName, "-font-weight)',\n letterSpacing: 'var(--plasma-typo-").concat(tokenName, "-letter-spacing)',\n lineHeight: 'var(--plasma-typo-").concat(tokenName, "-line-height)',\n};\n");
};
var getCSSVariable = function (tokenName, value) {
return " --plasma-typo-" + tokenName + "-font-size: " + value.fontSize + ";\n --plasma-typo-" + tokenName + "-font-weight: " + value.fontWeight + ";\n --plasma-typo-" + tokenName + "-line-height: " + value.lineHeight + ";";
return " --plasma-typo-".concat(tokenName, "-font-size: ").concat(value.fontSize, ";\n --plasma-typo-").concat(tokenName, "-font-weight: ").concat(value.fontWeight, ";\n --plasma-typo-").concat(tokenName, "-line-height: ").concat(value.lineHeight, ";");
};

@@ -114,3 +118,3 @@ var getResponsiveTypography = function (typography, tokens, size, isJS) {

}
var rootTypography = getTypographyBase(typography, fontFamily, tokens, 'screen-s') + "\n" + getTypographyRoot(typography, tokens, 'screen-s');
var rootTypography = "".concat(getTypographyBase(typography, fontFamily, tokens, 'screen-s'), "\n").concat(getTypographyRoot(typography, tokens, 'screen-s'));
var screenSTypography = getResponsiveTypography(typography, tokens, 'screen-s', isJS);

@@ -117,0 +121,0 @@ var screenMTypography = getResponsiveTypography(typography, tokens, 'screen-m', isJS);

@@ -1,8 +0,12 @@

var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var getCSSVariable = function (tokenName, value) {
return " " + tokenName + ": var(" + value + ");";
return " ".concat(tokenName, ": var(").concat(value, ");");
};

@@ -27,3 +31,3 @@ var getOppositeValue = function (mode, category, subcategory, name) {

}
var tokenName = [subcategory === 'default' ? '-' : "--" + subcategory, category, name].join('-');
var tokenName = [subcategory === 'default' ? '-' : "--".concat(subcategory), category, name].join('-');
var tokenValue = getOppositeValue(mode, category, subcategory, name);

@@ -40,6 +44,6 @@ return getCSSVariable(tokenName, tokenValue);

}
var darkTokens = "" + getToken(__spreadArray(__spreadArray([], colorTokens), gradientTokens), 'dark');
var lightTokens = "" + getToken(__spreadArray(__spreadArray([], colorTokens), gradientTokens), 'light');
return "\nexport const viewContainer = {\n dark: `\n" + darkTokens + "\n `,\n light: `\n" + lightTokens + "\n `,\n };\n";
var darkTokens = "".concat(getToken(__spreadArray(__spreadArray([], colorTokens, true), gradientTokens, true), 'dark'));
var lightTokens = "".concat(getToken(__spreadArray(__spreadArray([], colorTokens, true), gradientTokens, true), 'light'));
return "\nexport const viewContainer = {\n dark: `\n".concat(darkTokens, "\n `,\n light: `\n").concat(lightTokens, "\n `,\n };\n");
};
//# sourceMappingURL=createViewContainerTokens.js.map

@@ -28,5 +28,5 @@ import path from 'path';

].join('\n');
var file = generateCommonFile(themeName + ".module", 'css', [darkContent, lightContent, breakpointContent].join('\n'));
var file = generateCommonFile("".concat(themeName, ".module"), 'css', [darkContent, lightContent, breakpointContent].join('\n'));
writeGeneratedToFS(themesDir, [file], GENERATE_MESSAGE_FOR_CSS);
};
//# sourceMappingURL=generateCSSModuleThemes.js.map

@@ -22,6 +22,6 @@ import path from 'path';

writeGeneratedToFS(themesDir, [
generateCommonFile(themeName + "__dark", 'css', getContent('dark')),
generateCommonFile(themeName + "__light", 'css', getContent('light')),
generateCommonFile("".concat(themeName, "__dark"), 'css', getContent('dark')),
generateCommonFile("".concat(themeName, "__light"), 'css', getContent('light')),
], GENERATE_MESSAGE_FOR_CSS);
};
//# sourceMappingURL=generateCSSThemes.js.map

@@ -6,5 +6,5 @@ import fs from 'fs';

var rootIndexTsDir = path.join(srcDir, 'index.ts');
var indexTsContent = ROBO_COMMENT + "export * from './themes';\n ";
var indexTsContent = "".concat(ROBO_COMMENT, "export * from './themes';\n ");
fs.writeFileSync(rootIndexTsDir, indexTsContent);
};
//# sourceMappingURL=generateRootIndex.js.map

@@ -9,3 +9,3 @@ import path from 'path';

var screenS = webBreakpoints.screenS, screenM = webBreakpoints.screenM, screenL = webBreakpoints.screenL;
var indexFile = "export { " + themeName + "__dark } from './" + themeName + "__dark';\nexport { " + themeName + "__light } from './" + themeName + "__light';\n";
var indexFile = "export { ".concat(themeName, "__dark } from './").concat(themeName, "__dark';\nexport { ").concat(themeName, "__light } from './").concat(themeName, "__light';\n");
var getContent = function (themeMode) {

@@ -24,4 +24,4 @@ return [

writeGeneratedToFS(themesDir, [
generateFile(themeName + "__dark", "[`" + getContent('dark') + "`] as unknown as TemplateStringsArray"),
generateFile(themeName + "__light", "[`" + getContent('light') + "`] as unknown as TemplateStringsArray"),
generateFile("".concat(themeName, "__dark"), "[`".concat(getContent('dark'), "`] as unknown as TemplateStringsArray")),
generateFile("".concat(themeName, "__light"), "[`".concat(getContent('light'), "`] as unknown as TemplateStringsArray")),
generateCommonFile('index', 'ts', indexFile),

@@ -28,0 +28,0 @@ ]);

@@ -44,8 +44,8 @@ // TODO: Убрать использование файла: https://github.com/salute-developers/plasma/issues/1363

var oldName = _a[0], actualName = _a[1];
var oldVarName = "--" + camelToKebab(legacyPrefix) + "-" + camelToKebab(oldName);
var actualVarName = "--" + camelToKebab(actualName);
var oldVarName = "--".concat(camelToKebab(legacyPrefix), "-").concat(camelToKebab(oldName));
var actualVarName = "--".concat(camelToKebab(actualName));
if (isJS) {
return "/** @deprecated instead use " + actualName + " */\nexport const " + oldName + " = 'var(" + oldVarName + ", var(" + actualVarName + "))';\n";
return "/** @deprecated instead use ".concat(actualName, " */\nexport const ").concat(oldName, " = 'var(").concat(oldVarName, ", var(").concat(actualVarName, "))';\n");
}
return " " + oldVarName + ": var(" + actualVarName + ");";
return " ".concat(oldVarName, ": var(").concat(actualVarName, ");");
})

@@ -60,4 +60,4 @@ .join('\n');

return {
dark: colorVariables.dark + "\n" + fallbackTokens,
light: colorVariables.light + "\n" + fallbackTokens,
dark: "".concat(colorVariables.dark, "\n").concat(fallbackTokens),
light: "".concat(colorVariables.light, "\n").concat(fallbackTokens),
};

@@ -64,0 +64,0 @@ }

@@ -12,6 +12,10 @@ var __assign = (this && this.__assign) || function () {

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -22,3 +26,3 @@ export var getMetaGrouped = function (meta) {

var _a;
return __assign(__assign({}, acc), (_a = {}, _a[token.type] = __spreadArray(__spreadArray([], (acc[token.type] || [])), [token]), _a));
return __assign(__assign({}, acc), (_a = {}, _a[token.type] = __spreadArray(__spreadArray([], (acc[token.type] || []), true), [token], false), _a));
}, {});

@@ -25,0 +29,0 @@ return metaGrouped;

export var kebabToCamel = function (str) {
return str.replace(/-([a-z])/g, function (_, group) { return group.toUpperCase(); }).replace(/^./, function (char) { return char.toLowerCase(); });
};
export var camelToKebab = function (str) { return str.replace(/[A-Z]/g, function (match) { return "-" + match.toLowerCase(); }); };
export var camelToKebab = function (str) { return str.replace(/[A-Z]/g, function (match) { return "-".concat(match.toLowerCase()); }); };
//# sourceMappingURL=other.js.map

@@ -110,3 +110,3 @@ // INFO: Файл частично скопирован из репозитория plasma/website/plasma-theme-builder

switch (_a.label) {
case 0: return [4 /*yield*/, fetch("https://api.github.com/repos/" + owner + "/" + repo + "/contents/" + path + "?ref=" + branchName, {
case 0: return [4 /*yield*/, fetch("https://api.github.com/repos/".concat(owner, "/").concat(repo, "/contents/").concat(path, "?ref=").concat(branchName), {
headers: {

@@ -130,3 +130,3 @@ accept: 'application/vnd.github.v3.full',

switch (_a.label) {
case 0: return [4 /*yield*/, getFileSource('salute-developers', 'theme-converter', "themes/" + themeName + "/" + themeVersion + ".zip", 'main')];
case 0: return [4 /*yield*/, getFileSource('salute-developers', 'theme-converter', "themes/".concat(themeName, "/").concat(themeVersion, ".zip"), 'main')];
case 1:

@@ -149,3 +149,3 @@ response = _a.sent();

if (selector === void 0) { selector = ':root'; }
return "\n" + selector + " {\n" + content + "\n}";
return "\n".concat(selector, " {\n").concat(content, "\n}");
};

@@ -156,4 +156,4 @@ export var getBreakpointSelector = function (content, from, to, selector) {

var mediaQuery = getMediaQuery(from, to);
return "\n" + mediaQuery + " {\n " + selector + " {\n" + content.replace(/ {2}/gim, indent) + "\n }\n}";
return "\n".concat(mediaQuery, " {\n ").concat(selector, " {\n").concat(content.replace(/ {2}/gim, indent), "\n }\n}");
};
//# sourceMappingURL=theme.js.map
{
"name": "@salutejs/core-themes",
"version": "0.15.1-canary.32.11735924898.0",
"version": "0.15.1-canary.1641.12351647715.0",
"description": "Core-themes package",

@@ -25,7 +25,6 @@ "author": "Salute Frontend Team <salute.developers@gmail.com>",

"devDependencies": {
"@salutejs/plasma-tokens-utils": "0.44.1-canary.32.11735924898.0",
"@salutejs/plasma-tokens-utils": "0.44.1-canary.1641.12351647715.0",
"@types/node": "16.7.13",
"jszip": "3.10.1",
"ts-node": "10.2.1",
"typescript": "4.2.4"
"ts-node": "10.2.1"
},

@@ -38,3 +37,3 @@ "contributors": [

"sideEffects": false,
"gitHead": "90400d0f4ad7f940d51945e38d514c063070e59d"
"gitHead": "b17a7006652ceeaf081f705cfaeb88015f61a3c0"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc