@zag-js/types 0.54.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 +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/jsx.ts +4 -0
- package/src/prop-types.ts +1 -0
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.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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;
|
|
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.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 | \"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
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
|
}
|