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

@zag-js/core

Package Overview
Dependencies
Maintainers
1
Versions
903
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/core - npm Package Compare versions

Comparing version 0.0.0-dev-20240402190741 to 0.0.0-dev-20240403170757

21

dist/index.js

@@ -867,2 +867,21 @@ "use strict";

var clsx = (...args) => args.map((str) => str?.trim?.()).filter(Boolean).join(" ");
var CSS_REGEX = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
var serialize = (style) => {
const res = {};
let match;
while (match = CSS_REGEX.exec(style)) {
res[match[1]] = match[2];
}
return res;
};
var css = (a, b) => {
if (isString(a)) {
if (isString(b))
return `${a};${b}`;
a = serialize(a);
} else if (isString(b)) {
b = serialize(b);
}
return Object.assign({}, a ?? {}, b ?? {});
};
var eventRegex = /^on[A-Z]/;

@@ -882,3 +901,3 @@ function mergeProps(...args) {

if (key === "style") {
result[key] = Object.assign({}, result[key] ?? {}, props[key] ?? {});
result[key] = css(result[key], props[key]);
continue;

@@ -885,0 +904,0 @@ }

6

package.json
{
"name": "@zag-js/core",
"version": "0.0.0-dev-20240402190741",
"version": "0.0.0-dev-20240403170757",
"description": "A minimal implementation of xstate fsm for UI machines",

@@ -30,7 +30,7 @@ "keywords": [

"klona": "2.0.6",
"@zag-js/store": "0.0.0-dev-20240402190741"
"@zag-js/store": "0.0.0-dev-20240403170757"
},
"devDependencies": {
"clean-package": "2.2.0",
"@zag-js/utils": "0.0.0-dev-20240402190741"
"@zag-js/utils": "0.0.0-dev-20240403170757"
},

@@ -37,0 +37,0 @@ "clean-package": "../../clean-package.config.json",

@@ -1,2 +0,2 @@

import { callAll } from "@zag-js/utils"
import { callAll, isString } from "@zag-js/utils"

@@ -13,2 +13,26 @@ interface Props {

const CSS_REGEX = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g
const serialize = (style: string): Record<string, string> => {
const res: Record<string, string> = {}
let match: RegExpExecArray | null
while ((match = CSS_REGEX.exec(style))) {
res[match[1]!] = match[2]!
}
return res
}
const css = (
a: Record<string, string> | string | undefined,
b: Record<string, string> | string | undefined,
): Record<string, string> | string => {
if (isString(a)) {
if (isString(b)) return `${a};${b}`
a = serialize(a)
} else if (isString(b)) {
b = serialize(b)
}
return Object.assign({}, a ?? {}, b ?? {})
}
type TupleTypes<T extends any[]> = T[number]

@@ -36,3 +60,3 @@

if (key === "style") {
result[key] = Object.assign({}, result[key] ?? {}, props[key] ?? {})
result[key] = css(result[key], props[key])
continue

@@ -39,0 +63,0 @@ }

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