@zag-js/types 0.50.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,44 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
createNormalizer: () => createNormalizer,
|
|
24
|
-
createProps: () => createProps
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(src_exports);
|
|
27
|
-
|
|
28
|
-
// src/prop-types.ts
|
|
29
|
-
function createNormalizer(fn) {
|
|
30
|
-
return new Proxy({}, {
|
|
31
|
-
get() {
|
|
32
|
-
return fn;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// src/create-props.ts
|
|
38
|
-
var createProps = () => (props) => Array.from(new Set(props));
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
createNormalizer,
|
|
42
|
-
createProps
|
|
43
|
-
});
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var src_exports={};__export(src_exports,{createNormalizer:()=>createNormalizer,createProps:()=>createProps});module.exports=__toCommonJS(src_exports);function createNormalizer(fn){return new Proxy({},{get(){return fn}})}var createProps=()=>props=>Array.from(new Set(props));0&&(module.exports={createNormalizer,createProps});
|
|
44
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/prop-types.ts","../src/create-props.ts"],"sourcesContent":["import type { JSX } from \"./jsx\"\n\nexport type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>\n\nexport type Direction = \"ltr\" | \"rtl\"\n\nexport type Orientation = \"horizontal\" | \"vertical\"\n\nexport type MaybeElement<T extends HTMLElement = HTMLElement> = T | null\n\nexport interface OrientationProperty {\n /**\n * The orientation of the element.\n * @default \"horizontal\"\n */\n orientation?: Orientation\n}\n\nexport interface DirectionProperty {\n /**\n * The document's text/writing direction.\n * @default \"ltr\"\n */\n dir?: \"ltr\" | \"rtl\"\n}\n\nexport interface LocaleProperties extends DirectionProperty {\n /**\n * The current locale. Based on the BCP 47 definition.\n * @default \"en-US\"\n */\n locale?: string\n}\n\nexport interface CommonProperties {\n /**\n * The unique identifier of the machine.\n */\n id: string\n /**\n * A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.\n */\n getRootNode?: () => ShadowRoot | Document | Node\n}\n\nexport type Style = JSX.CSSProperties\n\nexport * from \"./prop-types\"\nexport type { JSX }\nexport * from \"./create-props\"\n","import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype DataAttr = {\n \"data-selected\"?: any\n \"data-expanded\"?: any\n \"data-highlighted\"?: any\n \"data-readonly\"?: any\n \"data-indeterminate\"?: any\n \"data-invalid\"?: any\n \"data-hover\"?: any\n \"data-active\"?: any\n \"data-focus\"?: any\n \"data-disabled\"?: any\n \"data-open\"?: any\n \"data-checked\"?: any\n \"data-pressed\"?: any\n \"data-complete\"?: any\n \"data-side\"?: any\n \"data-align\"?: any\n \"data-empty\"?: any\n \"data-placeholder-shown\"?: any\n \"data-half\"?: any\n \"data-scope\"?: string\n \"data-uid\"?: string\n \"data-name\"?: string\n \"data-ownedby\"?: string\n \"data-type\"?: string\n \"data-valuetext\"?: string\n \"data-placement\"?: string\n \"data-controls\"?: string\n \"data-part\"?: string\n \"data-label\"?: string\n \"data-state\"?: string | null\n \"data-value\"?: string | number\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: any\n}\n\nexport type PropTypes<T = Dict> = Record<\n | \"button\"\n | \"label\"\n | \"input\"\n | \"textarea\"\n | \"img\"\n | \"output\"\n | \"element\"\n | \"select\"\n | \"style\"\n | \"circle\"\n | \"svg\"\n | \"path\",\n T\n>\n\nexport type NormalizeProps<T extends PropTypes> = {\n [K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K]\n} & {\n element(props: DataAttr & JSX.HTMLAttributes<HTMLElement> & Record<string, any>): T[\"element\"]\n style: JSX.CSSProperties\n}\n\nexport function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T> {\n return new Proxy({} as any, {\n get() {\n return fn\n },\n })\n}\n","type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]\n ? [keyof T] extends [K[number]]\n ? unknown\n : `Missing required keys: ${Exclude<keyof T, K[number]>}`\n : never\n\nexport const createProps =\n <T extends Record<never, never>>() =>\n <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>\n Array.from(new Set(props))\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/prop-types.ts","../src/create-props.ts"],"sourcesContent":["import type { JSX } from \"./jsx\"\n\nexport type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>\n\nexport type Direction = \"ltr\" | \"rtl\"\n\nexport type Orientation = \"horizontal\" | \"vertical\"\n\nexport type MaybeElement<T extends HTMLElement = HTMLElement> = T | null\n\nexport interface OrientationProperty {\n /**\n * The orientation of the element.\n * @default \"horizontal\"\n */\n orientation?: Orientation\n}\n\nexport interface DirectionProperty {\n /**\n * The document's text/writing direction.\n * @default \"ltr\"\n */\n dir?: \"ltr\" | \"rtl\"\n}\n\nexport interface LocaleProperties extends DirectionProperty {\n /**\n * The current locale. Based on the BCP 47 definition.\n * @default \"en-US\"\n */\n locale?: string\n}\n\nexport interface CommonProperties {\n /**\n * The unique identifier of the machine.\n */\n id: string\n /**\n * A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.\n */\n getRootNode?: () => ShadowRoot | Document | Node\n}\n\nexport type Style = JSX.CSSProperties\n\nexport * from \"./prop-types\"\nexport type { JSX }\nexport * from \"./create-props\"\n","import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype DataAttr = {\n \"data-selected\"?: any\n \"data-expanded\"?: any\n \"data-highlighted\"?: any\n \"data-readonly\"?: any\n \"data-indeterminate\"?: any\n \"data-invalid\"?: any\n \"data-hover\"?: any\n \"data-active\"?: any\n \"data-focus\"?: any\n \"data-disabled\"?: any\n \"data-open\"?: any\n \"data-checked\"?: any\n \"data-pressed\"?: any\n \"data-complete\"?: any\n \"data-side\"?: any\n \"data-align\"?: any\n \"data-empty\"?: any\n \"data-placeholder-shown\"?: any\n \"data-half\"?: any\n \"data-scope\"?: string\n \"data-uid\"?: string\n \"data-name\"?: string\n \"data-ownedby\"?: string\n \"data-type\"?: string\n \"data-valuetext\"?: string\n \"data-placement\"?: string\n \"data-controls\"?: string\n \"data-part\"?: string\n \"data-label\"?: string\n \"data-state\"?: string | null\n \"data-value\"?: string | number\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: any\n}\n\nexport type PropTypes<T = Dict> = Record<\n | \"button\"\n | \"label\"\n | \"input\"\n | \"textarea\"\n | \"img\"\n | \"output\"\n | \"element\"\n | \"select\"\n | \"style\"\n | \"circle\"\n | \"svg\"\n | \"path\",\n T\n>\n\nexport type NormalizeProps<T extends PropTypes> = {\n [K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K]\n} & {\n element(props: DataAttr & JSX.HTMLAttributes<HTMLElement> & Record<string, any>): T[\"element\"]\n style: JSX.CSSProperties\n}\n\nexport function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T> {\n return new Proxy({} as any, {\n get() {\n return fn\n },\n })\n}\n","type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]\n ? [keyof T] extends [K[number]]\n ? unknown\n : `Missing required keys: ${Exclude<keyof T, K[number]>}`\n : never\n\nexport const createProps =\n <T extends Record<never, never>>() =>\n <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>\n Array.from(new Set(props))\n"],"mappings":"qqBAAA,sJCkEO,SAAS,iBAAsC,GAA8C,CAClG,OAAO,IAAI,MAAM,CAAC,EAAU,CAC1B,KAAM,CACJ,OAAO,EACT,CACF,CAAC,CACH,CClEO,IAAM,YACX,IACwB,OACtB,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
function createNormalizer(fn) {
|
|
3
|
-
return new Proxy({}, {
|
|
4
|
-
get() {
|
|
5
|
-
return fn;
|
|
6
|
-
}
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// src/create-props.ts
|
|
11
|
-
var createProps = () => (props) => Array.from(new Set(props));
|
|
12
|
-
export {
|
|
13
|
-
createNormalizer,
|
|
14
|
-
createProps
|
|
15
|
-
};
|
|
1
|
+
function createNormalizer(fn){return new Proxy({},{get(){return fn}})}var createProps=()=>props=>Array.from(new Set(props));export{createNormalizer,createProps};
|
|
16
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/prop-types.ts","../src/create-props.ts"],"sourcesContent":["import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype DataAttr = {\n \"data-selected\"?: any\n \"data-expanded\"?: any\n \"data-highlighted\"?: any\n \"data-readonly\"?: any\n \"data-indeterminate\"?: any\n \"data-invalid\"?: any\n \"data-hover\"?: any\n \"data-active\"?: any\n \"data-focus\"?: any\n \"data-disabled\"?: any\n \"data-open\"?: any\n \"data-checked\"?: any\n \"data-pressed\"?: any\n \"data-complete\"?: any\n \"data-side\"?: any\n \"data-align\"?: any\n \"data-empty\"?: any\n \"data-placeholder-shown\"?: any\n \"data-half\"?: any\n \"data-scope\"?: string\n \"data-uid\"?: string\n \"data-name\"?: string\n \"data-ownedby\"?: string\n \"data-type\"?: string\n \"data-valuetext\"?: string\n \"data-placement\"?: string\n \"data-controls\"?: string\n \"data-part\"?: string\n \"data-label\"?: string\n \"data-state\"?: string | null\n \"data-value\"?: string | number\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: any\n}\n\nexport type PropTypes<T = Dict> = Record<\n | \"button\"\n | \"label\"\n | \"input\"\n | \"textarea\"\n | \"img\"\n | \"output\"\n | \"element\"\n | \"select\"\n | \"style\"\n | \"circle\"\n | \"svg\"\n | \"path\",\n T\n>\n\nexport type NormalizeProps<T extends PropTypes> = {\n [K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K]\n} & {\n element(props: DataAttr & JSX.HTMLAttributes<HTMLElement> & Record<string, any>): T[\"element\"]\n style: JSX.CSSProperties\n}\n\nexport function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T> {\n return new Proxy({} as any, {\n get() {\n return fn\n },\n })\n}\n","type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]\n ? [keyof T] extends [K[number]]\n ? unknown\n : `Missing required keys: ${Exclude<keyof T, K[number]>}`\n : never\n\nexport const createProps =\n <T extends Record<never, never>>() =>\n <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>\n Array.from(new Set(props))\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/prop-types.ts","../src/create-props.ts"],"sourcesContent":["import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype DataAttr = {\n \"data-selected\"?: any\n \"data-expanded\"?: any\n \"data-highlighted\"?: any\n \"data-readonly\"?: any\n \"data-indeterminate\"?: any\n \"data-invalid\"?: any\n \"data-hover\"?: any\n \"data-active\"?: any\n \"data-focus\"?: any\n \"data-disabled\"?: any\n \"data-open\"?: any\n \"data-checked\"?: any\n \"data-pressed\"?: any\n \"data-complete\"?: any\n \"data-side\"?: any\n \"data-align\"?: any\n \"data-empty\"?: any\n \"data-placeholder-shown\"?: any\n \"data-half\"?: any\n \"data-scope\"?: string\n \"data-uid\"?: string\n \"data-name\"?: string\n \"data-ownedby\"?: string\n \"data-type\"?: string\n \"data-valuetext\"?: string\n \"data-placement\"?: string\n \"data-controls\"?: string\n \"data-part\"?: string\n \"data-label\"?: string\n \"data-state\"?: string | null\n \"data-value\"?: string | number\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: any\n}\n\nexport type PropTypes<T = Dict> = Record<\n | \"button\"\n | \"label\"\n | \"input\"\n | \"textarea\"\n | \"img\"\n | \"output\"\n | \"element\"\n | \"select\"\n | \"style\"\n | \"circle\"\n | \"svg\"\n | \"path\",\n T\n>\n\nexport type NormalizeProps<T extends PropTypes> = {\n [K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K]\n} & {\n element(props: DataAttr & JSX.HTMLAttributes<HTMLElement> & Record<string, any>): T[\"element\"]\n style: JSX.CSSProperties\n}\n\nexport function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T> {\n return new Proxy({} as any, {\n get() {\n return fn\n },\n })\n}\n","type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]\n ? [keyof T] extends [K[number]]\n ? unknown\n : `Missing required keys: ${Exclude<keyof T, K[number]>}`\n : never\n\nexport const createProps =\n <T extends Record<never, never>>() =>\n <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>\n Array.from(new Set(props))\n"],"mappings":"AAkEO,SAAS,iBAAsC,GAA8C,CAClG,OAAO,IAAI,MAAM,CAAC,EAAU,CAC1B,KAAM,CACJ,OAAO,EACT,CACF,CAAC,CACH,CClEO,IAAM,YACX,IACwB,OACtB,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC","names":[]}
|