@zag-js/types 0.22.0 → 0.24.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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/prop-types.ts +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1153,7 +1153,7 @@ type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "img" | "output
|
|
|
1153
1153
|
type NormalizeProps<T extends PropTypes> = {
|
|
1154
1154
|
[K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K];
|
|
1155
1155
|
} & {
|
|
1156
|
-
element(props: DataAttr & JSX.HTMLAttributes<HTMLElement>): T["element"];
|
|
1156
|
+
element(props: DataAttr & JSX.HTMLAttributes<HTMLElement> & Record<string, any>): T["element"];
|
|
1157
1157
|
style: JSX.CSSProperties;
|
|
1158
1158
|
};
|
|
1159
1159
|
declare function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1153,7 +1153,7 @@ type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "img" | "output
|
|
|
1153
1153
|
type NormalizeProps<T extends PropTypes> = {
|
|
1154
1154
|
[K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K];
|
|
1155
1155
|
} & {
|
|
1156
|
-
element(props: DataAttr & JSX.HTMLAttributes<HTMLElement>): T["element"];
|
|
1156
|
+
element(props: DataAttr & JSX.HTMLAttributes<HTMLElement> & Record<string, any>): T["element"];
|
|
1157
1157
|
style: JSX.CSSProperties;
|
|
1158
1158
|
};
|
|
1159
1159
|
declare function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T>;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/prop-types.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 interface RootProperties {\n /**\n * The owner document of the machine.\n */\n doc?: Document\n /**\n * The root node of the machine. Useful for shadow DOM.\n */\n rootNode?: ShadowRoot\n /**\n * The related target when the element is blurred.\n * Used as a polyfill for `e.relatedTarget`\n */\n pointerdownNode?: HTMLElement | null\n}\n\nexport type Context<T> = T & RootProperties\n\nexport type Style = JSX.CSSProperties\n\nexport * from \"./prop-types\"\nexport type { JSX }\n","import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype Booleanish = boolean | \"true\" | \"false\"\n\ntype DataAttr = {\n \"data-selected\"?: Booleanish\n \"data-expanded\"?: Booleanish\n \"data-highlighted\"?: Booleanish\n \"data-readonly\"?: Booleanish\n \"data-indeterminate\"?: Booleanish\n \"data-invalid\"?: Booleanish\n \"data-hover\"?: Booleanish\n \"data-active\"?: Booleanish\n \"data-focus\"?: Booleanish\n \"data-disabled\"?: Booleanish\n \"data-open\"?: Booleanish\n \"data-checked\"?: Booleanish\n \"data-pressed\"?: Booleanish\n \"data-complete\"?: Booleanish\n \"data-empty\"?: Booleanish\n \"data-placeholder-shown\"?: Booleanish\n \"data-half\"?: Booleanish\n \"data-scope\"?: string\n\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\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: string | number | Booleanish\n}\n\nexport type PropTypes<T = Dict> = Record<\n \"button\" | \"label\" | \"input\" | \"img\" | \"output\" | \"element\" | \"select\" | \"style\",\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>): T[\"element\"]\n style: JSX.CSSProperties\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACyDO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/prop-types.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 interface RootProperties {\n /**\n * The owner document of the machine.\n */\n doc?: Document\n /**\n * The root node of the machine. Useful for shadow DOM.\n */\n rootNode?: ShadowRoot\n /**\n * The related target when the element is blurred.\n * Used as a polyfill for `e.relatedTarget`\n */\n pointerdownNode?: HTMLElement | null\n}\n\nexport type Context<T> = T & RootProperties\n\nexport type Style = JSX.CSSProperties\n\nexport * from \"./prop-types\"\nexport type { JSX }\n","import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype Booleanish = boolean | \"true\" | \"false\"\n\ntype DataAttr = {\n \"data-selected\"?: Booleanish\n \"data-expanded\"?: Booleanish\n \"data-highlighted\"?: Booleanish\n \"data-readonly\"?: Booleanish\n \"data-indeterminate\"?: Booleanish\n \"data-invalid\"?: Booleanish\n \"data-hover\"?: Booleanish\n \"data-active\"?: Booleanish\n \"data-focus\"?: Booleanish\n \"data-disabled\"?: Booleanish\n \"data-open\"?: Booleanish\n \"data-checked\"?: Booleanish\n \"data-pressed\"?: Booleanish\n \"data-complete\"?: Booleanish\n \"data-empty\"?: Booleanish\n \"data-placeholder-shown\"?: Booleanish\n \"data-half\"?: Booleanish\n \"data-scope\"?: string\n\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\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: string | number | Booleanish\n}\n\nexport type PropTypes<T = Dict> = Record<\n \"button\" | \"label\" | \"input\" | \"img\" | \"output\" | \"element\" | \"select\" | \"style\",\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}\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACyDO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/prop-types.ts"],"sourcesContent":["import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype Booleanish = boolean | \"true\" | \"false\"\n\ntype DataAttr = {\n \"data-selected\"?: Booleanish\n \"data-expanded\"?: Booleanish\n \"data-highlighted\"?: Booleanish\n \"data-readonly\"?: Booleanish\n \"data-indeterminate\"?: Booleanish\n \"data-invalid\"?: Booleanish\n \"data-hover\"?: Booleanish\n \"data-active\"?: Booleanish\n \"data-focus\"?: Booleanish\n \"data-disabled\"?: Booleanish\n \"data-open\"?: Booleanish\n \"data-checked\"?: Booleanish\n \"data-pressed\"?: Booleanish\n \"data-complete\"?: Booleanish\n \"data-empty\"?: Booleanish\n \"data-placeholder-shown\"?: Booleanish\n \"data-half\"?: Booleanish\n \"data-scope\"?: string\n\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\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: string | number | Booleanish\n}\n\nexport type PropTypes<T = Dict> = Record<\n \"button\" | \"label\" | \"input\" | \"img\" | \"output\" | \"element\" | \"select\" | \"style\",\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>): T[\"element\"]\n style: JSX.CSSProperties\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"],"mappings":";AAyDO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/prop-types.ts"],"sourcesContent":["import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype Booleanish = boolean | \"true\" | \"false\"\n\ntype DataAttr = {\n \"data-selected\"?: Booleanish\n \"data-expanded\"?: Booleanish\n \"data-highlighted\"?: Booleanish\n \"data-readonly\"?: Booleanish\n \"data-indeterminate\"?: Booleanish\n \"data-invalid\"?: Booleanish\n \"data-hover\"?: Booleanish\n \"data-active\"?: Booleanish\n \"data-focus\"?: Booleanish\n \"data-disabled\"?: Booleanish\n \"data-open\"?: Booleanish\n \"data-checked\"?: Booleanish\n \"data-pressed\"?: Booleanish\n \"data-complete\"?: Booleanish\n \"data-empty\"?: Booleanish\n \"data-placeholder-shown\"?: Booleanish\n \"data-half\"?: Booleanish\n \"data-scope\"?: string\n\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\n \"data-orientation\"?: \"horizontal\" | \"vertical\"\n\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: string | number | Booleanish\n}\n\nexport type PropTypes<T = Dict> = Record<\n \"button\" | \"label\" | \"input\" | \"img\" | \"output\" | \"element\" | \"select\" | \"style\",\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}\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"],"mappings":";AAyDO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/package.json
CHANGED
package/src/prop-types.ts
CHANGED
|
@@ -52,7 +52,7 @@ export type PropTypes<T = Dict> = Record<
|
|
|
52
52
|
export type NormalizeProps<T extends PropTypes> = {
|
|
53
53
|
[K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K]
|
|
54
54
|
} & {
|
|
55
|
-
element(props: DataAttr & JSX.HTMLAttributes<HTMLElement>): T["element"]
|
|
55
|
+
element(props: DataAttr & JSX.HTMLAttributes<HTMLElement> & Record<string, any>): T["element"]
|
|
56
56
|
style: JSX.CSSProperties
|
|
57
57
|
}
|
|
58
58
|
export function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T> {
|