@zag-js/types 0.53.0 → 0.55.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.d.mts CHANGED
@@ -1370,9 +1370,13 @@ declare namespace JSX {
1370
1370
  ul: HTMLAttributes<HTMLUListElement>;
1371
1371
  var: HTMLAttributes<HTMLElement>;
1372
1372
  video: VideoHTMLAttributes<HTMLVideoElement>;
1373
+ g: SVGAttributes<SVGGElement>;
1373
1374
  svg: SVGAttributes<SVGSVGElement>;
1374
1375
  circle: SVGAttributes<SVGCircleElement>;
1375
1376
  path: SVGAttributes<SVGPathElement>;
1377
+ rect: SVGAttributes<SVGRectElement>;
1378
+ polyline: SVGAttributes<SVGPolylineElement>;
1379
+ polygon: SVGAttributes<SVGPolygonElement>;
1376
1380
  }
1377
1381
  export { };
1378
1382
  }
@@ -1416,7 +1420,7 @@ type DataAttr = {
1416
1420
  } & {
1417
1421
  [key in `data-${string}`]?: any;
1418
1422
  };
1419
- type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "textarea" | "img" | "output" | "element" | "select" | "style" | "circle" | "svg" | "path", T>;
1423
+ type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "textarea" | "img" | "output" | "element" | "select" | "rect" | "style" | "circle" | "svg" | "path", T>;
1420
1424
  type NormalizeProps<T extends PropTypes> = {
1421
1425
  [K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K];
1422
1426
  } & {
package/dist/index.d.ts CHANGED
@@ -1370,9 +1370,13 @@ declare namespace JSX {
1370
1370
  ul: HTMLAttributes<HTMLUListElement>;
1371
1371
  var: HTMLAttributes<HTMLElement>;
1372
1372
  video: VideoHTMLAttributes<HTMLVideoElement>;
1373
+ g: SVGAttributes<SVGGElement>;
1373
1374
  svg: SVGAttributes<SVGSVGElement>;
1374
1375
  circle: SVGAttributes<SVGCircleElement>;
1375
1376
  path: SVGAttributes<SVGPathElement>;
1377
+ rect: SVGAttributes<SVGRectElement>;
1378
+ polyline: SVGAttributes<SVGPolylineElement>;
1379
+ polygon: SVGAttributes<SVGPolygonElement>;
1376
1380
  }
1377
1381
  export { };
1378
1382
  }
@@ -1416,7 +1420,7 @@ type DataAttr = {
1416
1420
  } & {
1417
1421
  [key in `data-${string}`]?: any;
1418
1422
  };
1419
- type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "textarea" | "img" | "output" | "element" | "select" | "style" | "circle" | "svg" | "path", T>;
1423
+ type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "textarea" | "img" | "output" | "element" | "select" | "rect" | "style" | "circle" | "svg" | "path", T>;
1420
1424
  type NormalizeProps<T extends PropTypes> = {
1421
1425
  [K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K];
1422
1426
  } & {
package/dist/index.js CHANGED
@@ -1,2 +1,44 @@
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});
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
+ });
2
44
  //# 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":"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":[]}
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 | \"rect\"\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmEO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;;;ACnEO,IAAM,cACX,MACA,CAAwB,UACtB,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC;","names":[]}
package/dist/index.mjs CHANGED
@@ -1,2 +1,16 @@
1
- function createNormalizer(fn){return new Proxy({},{get(){return fn}})}var createProps=()=>props=>Array.from(new Set(props));export{createNormalizer,createProps};
1
+ // src/prop-types.ts
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
+ };
2
16
  //# sourceMappingURL=index.mjs.map
@@ -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":"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":[]}
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 | \"rect\"\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":";AAmEO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;;;ACnEO,IAAM,cACX,MACA,CAAwB,UACtB,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/types",
3
- "version": "0.53.0",
3
+ "version": "0.55.0",
4
4
  "keywords": [
5
5
  "js",
6
6
  "utils",
package/src/jsx.ts CHANGED
@@ -1638,8 +1638,12 @@ export namespace JSX {
1638
1638
  var: HTMLAttributes<HTMLElement>
1639
1639
  video: VideoHTMLAttributes<HTMLVideoElement>
1640
1640
 
1641
+ g: SVGAttributes<SVGGElement>
1641
1642
  svg: SVGAttributes<SVGSVGElement>
1642
1643
  circle: SVGAttributes<SVGCircleElement>
1643
1644
  path: SVGAttributes<SVGPathElement>
1645
+ rect: SVGAttributes<SVGRectElement>
1646
+ polyline: SVGAttributes<SVGPolylineElement>
1647
+ polygon: SVGAttributes<SVGPolygonElement>
1644
1648
  }
1645
1649
  }
package/src/prop-types.ts CHANGED
@@ -50,6 +50,7 @@ export type PropTypes<T = Dict> = Record<
50
50
  | "output"
51
51
  | "element"
52
52
  | "select"
53
+ | "rect"
53
54
  | "style"
54
55
  | "circle"
55
56
  | "svg"