Socket
Socket
Sign inDemoInstall

@zag-js/types

Package Overview
Dependencies
Maintainers
1
Versions
824
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/types - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

8

dist/index.d.ts

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

import type * as React from "react";
import type { JSX } from "./jsx";
export declare type Direction = "ltr" | "rtl";

@@ -36,6 +36,4 @@ export declare type Orientation = "horizontal" | "vertical";

};
export declare type Style = React.CSSProperties & {
[prop: string]: string | number | undefined;
};
export declare type Style = JSX.CSSProperties;
export * from "./prop-types";
export * from "./controls";
export type { JSX };

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

__export(src_exports, {
createNormalizer: () => createNormalizer,
defineControls: () => defineControls,
normalizeProp: () => normalizeProp
createNormalizer: () => createNormalizer
});

@@ -38,7 +36,1 @@ module.exports = __toCommonJS(src_exports);

}
var normalizeProp = createNormalizer((v) => v);
// src/controls.ts
function defineControls(config) {
return config;
}

@@ -1,18 +0,5 @@

import type * as React from "react";
import type { JSX } from "./jsx";
declare type Dict<T = any> = Record<string, T>;
declare type Booleanish = boolean | "true" | "false";
declare type Omit<T, K extends keyof T> = {
[P in Exclude<keyof T, K>]?: T[P];
};
declare type WithStyle<T extends {
style?: any;
}> = Omit<T, "style"> & {
style?: T["style"] & {
[prop: string]: string | number | undefined;
};
};
declare type DataAttr = {
"data-uid"?: string;
"data-name"?: string;
"data-ownedby"?: string;
"data-selected"?: Booleanish;

@@ -28,43 +15,31 @@ "data-expanded"?: Booleanish;

"data-disabled"?: Booleanish;
"data-open"?: Booleanish;
"data-checked"?: Booleanish;
"data-pressed"?: Booleanish;
"data-complete"?: Booleanish;
"data-empty"?: Booleanish;
"data-placeholder-shown"?: Booleanish;
"data-half"?: Booleanish;
"data-uid"?: string;
"data-name"?: string;
"data-ownedby"?: string;
"data-type"?: string;
"data-value"?: string | number;
"data-valuetext"?: string;
"data-open"?: Booleanish;
"data-placement"?: string;
"data-orientation"?: "horizontal" | "vertical";
"data-controls"?: string;
"data-part"?: string;
"data-label"?: string;
"data-checked"?: Booleanish;
"data-pressed"?: Booleanish;
"data-state"?: string | null;
"data-half"?: Booleanish;
"data-value"?: string | number;
"data-orientation"?: "horizontal" | "vertical";
"data-count"?: number;
"data-controls"?: string;
"data-part"?: string;
"data-index"?: number;
"data-complete"?: Booleanish;
"data-empty"?: Booleanish;
"data-placeholder-shown"?: Booleanish;
};
declare type JSXElementAttributes = DataAttr & React.HTMLAttributes<HTMLElement>;
declare type JSXButtonAttributes = DataAttr & React.ButtonHTMLAttributes<HTMLButtonElement>;
declare type JSXInputAttributes = DataAttr & React.InputHTMLAttributes<HTMLInputElement>;
declare type JSXLabelAttributes = DataAttr & React.LabelHTMLAttributes<HTMLLabelElement>;
declare type JSXOutputAttributes = DataAttr & React.OutputHTMLAttributes<HTMLOutputElement>;
export declare type PropTypes = Record<"button" | "label" | "input" | "output" | "element", Dict>;
export declare type ReactPropTypes = {
button: JSXButtonAttributes;
label: JSXLabelAttributes;
input: JSXInputAttributes;
output: JSXOutputAttributes;
element: JSXElementAttributes;
export declare type NormalizeProps<T extends PropTypes> = {
[K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K];
} & {
element(props: DataAttr & JSX.HTMLAttributes<HTMLElement>): T["element"];
};
export declare type NormalizeProps = {
button<T extends PropTypes>(props: WithStyle<JSXButtonAttributes>): T["button"];
label<T extends PropTypes>(props: WithStyle<JSXLabelAttributes>): T["label"];
input<T extends PropTypes>(props: WithStyle<JSXInputAttributes>): T["input"];
output<T extends PropTypes>(props: WithStyle<JSXOutputAttributes>): T["output"];
element<T extends PropTypes>(props: WithStyle<JSXElementAttributes>): T["element"];
};
export declare function createNormalizer(fn: (props: Dict) => Dict): NormalizeProps;
export declare const normalizeProp: NormalizeProps;
export declare function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T>;
export {};
{
"name": "@zag-js/types",
"version": "0.2.0",
"version": "0.2.1",
"keywords": [

@@ -26,2 +26,5 @@ "js",

},
"dependencies": {
"csstype": "3.1.0"
},
"scripts": {

@@ -36,2 +39,2 @@ "build:fast": "zag build",

}
}
}

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