Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kuma-ui/compiler

Package Overview
Dependencies
Maintainers
3
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kuma-ui/compiler - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

dist/chunk-EHB6QUDM.mjs

31

dist/compile.js

@@ -327,15 +327,26 @@ "use strict";

} else if (import_ts_morph7.Node.isCallExpression(tag) && tag.getExpressionIfKind(import_ts_morph7.SyntaxKind.Identifier)?.getText() === bindings["styled"]) {
const className = extractClassName(node.getTemplate());
if (className) {
const componentArg = tag.getArguments()[0];
const component = import_ts_morph7.Node.isStringLiteral(componentArg) ? componentArg.getLiteralText() : "div";
node.replaceWithText(`props => {
const existingClassName = props.className || "";
const newClassName = "${className || ""}";
const combinedClassName = [existingClassName, newClassName].filter(Boolean).join(" ");
return <${bindings["Box"]} as="${component}" {...props} className={combinedClassName} IS_KUMA_DEFAULT />;
}`);
const componentArg = tag.getArguments()[0];
if (import_ts_morph7.Node.isStringLiteral(componentArg)) {
const componentName = componentArg.getLiteralText();
replaceTaggedTemplate(node, getBoxComponent(componentName, bindings));
} else {
replaceTaggedTemplate(node, componentArg.getFullText());
}
} else if (import_ts_morph7.Node.isPropertyAccessExpression(tag) && tag.getExpressionIfKind(import_ts_morph7.SyntaxKind.Identifier)?.getText() === bindings["styled"]) {
replaceTaggedTemplate(node, getBoxComponent(tag.getName(), bindings));
}
};
function getBoxComponent(intrinsicComponentName, bindings) {
return `${bindings["Box"]} as="${intrinsicComponentName}"`;
}
function replaceTaggedTemplate(node, component) {
const className = extractClassName(node.getTemplate());
if (className) {
const replacement = `props => {
const combinedClassName = [props.className, "${className}"].filter(Boolean).join(" ");
return <${component} {...props} className={combinedClassName} IS_KUMA_DEFAULT />;
}`;
node.replaceWithText(replacement);
}
}

@@ -342,0 +353,0 @@ // src/compile.ts

@@ -329,15 +329,26 @@ "use strict";

} else if (import_ts_morph7.Node.isCallExpression(tag) && tag.getExpressionIfKind(import_ts_morph7.SyntaxKind.Identifier)?.getText() === bindings["styled"]) {
const className = extractClassName(node.getTemplate());
if (className) {
const componentArg = tag.getArguments()[0];
const component = import_ts_morph7.Node.isStringLiteral(componentArg) ? componentArg.getLiteralText() : "div";
node.replaceWithText(`props => {
const existingClassName = props.className || "";
const newClassName = "${className || ""}";
const combinedClassName = [existingClassName, newClassName].filter(Boolean).join(" ");
return <${bindings["Box"]} as="${component}" {...props} className={combinedClassName} IS_KUMA_DEFAULT />;
}`);
const componentArg = tag.getArguments()[0];
if (import_ts_morph7.Node.isStringLiteral(componentArg)) {
const componentName = componentArg.getLiteralText();
replaceTaggedTemplate(node, getBoxComponent(componentName, bindings));
} else {
replaceTaggedTemplate(node, componentArg.getFullText());
}
} else if (import_ts_morph7.Node.isPropertyAccessExpression(tag) && tag.getExpressionIfKind(import_ts_morph7.SyntaxKind.Identifier)?.getText() === bindings["styled"]) {
replaceTaggedTemplate(node, getBoxComponent(tag.getName(), bindings));
}
};
function getBoxComponent(intrinsicComponentName, bindings) {
return `${bindings["Box"]} as="${intrinsicComponentName}"`;
}
function replaceTaggedTemplate(node, component) {
const className = extractClassName(node.getTemplate());
if (className) {
const replacement = `props => {
const combinedClassName = [props.className, "${className}"].filter(Boolean).join(" ");
return <${component} {...props} className={combinedClassName} IS_KUMA_DEFAULT />;
}`;
node.replaceWithText(replacement);
}
}

@@ -344,0 +355,0 @@ // src/compile.ts

@@ -43,15 +43,26 @@ "use strict";

} else if (import_ts_morph.Node.isCallExpression(tag) && tag.getExpressionIfKind(import_ts_morph.SyntaxKind.Identifier)?.getText() === bindings["styled"]) {
const className = extractClassName(node.getTemplate());
if (className) {
const componentArg = tag.getArguments()[0];
const component = import_ts_morph.Node.isStringLiteral(componentArg) ? componentArg.getLiteralText() : "div";
node.replaceWithText(`props => {
const existingClassName = props.className || "";
const newClassName = "${className || ""}";
const combinedClassName = [existingClassName, newClassName].filter(Boolean).join(" ");
return <${bindings["Box"]} as="${component}" {...props} className={combinedClassName} IS_KUMA_DEFAULT />;
}`);
const componentArg = tag.getArguments()[0];
if (import_ts_morph.Node.isStringLiteral(componentArg)) {
const componentName = componentArg.getLiteralText();
replaceTaggedTemplate(node, getBoxComponent(componentName, bindings));
} else {
replaceTaggedTemplate(node, componentArg.getFullText());
}
} else if (import_ts_morph.Node.isPropertyAccessExpression(tag) && tag.getExpressionIfKind(import_ts_morph.SyntaxKind.Identifier)?.getText() === bindings["styled"]) {
replaceTaggedTemplate(node, getBoxComponent(tag.getName(), bindings));
}
};
function getBoxComponent(intrinsicComponentName, bindings) {
return `${bindings["Box"]} as="${intrinsicComponentName}"`;
}
function replaceTaggedTemplate(node, component) {
const className = extractClassName(node.getTemplate());
if (className) {
const replacement = `props => {
const combinedClassName = [props.className, "${className}"].filter(Boolean).join(" ");
return <${component} {...props} className={combinedClassName} IS_KUMA_DEFAULT />;
}`;
node.replaceWithText(replacement);
}
}
// Annotate the CommonJS export names for ESM import in node:

@@ -58,0 +69,0 @@ 0 && (module.exports = {

{
"name": "@kuma-ui/compiler",
"version": "1.1.1",
"version": "1.2.0",
"description": "🐻 Kuma UI is a utility-first, zero-runtime CSS-in-JS library that offers an outstanding developer experience and optimized performance.",

@@ -34,3 +34,3 @@ "repository": {

"ts-pattern": "^5.0.1",
"@kuma-ui/core": "^1.4.1",
"@kuma-ui/core": "^1.5.0",
"@kuma-ui/sheet": "^1.3.0",

@@ -37,0 +37,0 @@ "@kuma-ui/system": "^1.5.1"

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