@zag-js/types 1.47.0 → 1.48.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/create-props.d.mts +2 -3
- package/dist/create-props.d.ts +2 -3
- package/dist/create-props.js +6 -29
- package/dist/create-props.mjs +2 -4
- package/dist/index.d.mts +51 -58
- package/dist/index.d.ts +51 -58
- package/dist/index.js +7 -25
- package/dist/index.mjs +3 -3
- package/dist/jsx.d.mts +1442 -1448
- package/dist/jsx.d.ts +1442 -1448
- package/dist/jsx.js +4 -18
- package/dist/jsx.mjs +1 -0
- package/dist/prop-types.d.mts +43 -50
- package/dist/prop-types.d.ts +43 -50
- package/dist/prop-types.js +11 -37
- package/dist/prop-types.mjs +7 -12
- package/package.json +3 -3
package/dist/create-props.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[] ? [keyof T] extends [K[number]] ? unknown : `Missing required keys: ${Exclude<keyof T, K[number]>}` : never;
|
|
2
|
-
declare const createProps: <T extends Record<never, never>>() => <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) => (keyof T)[];
|
|
3
|
-
|
|
4
|
-
export { createProps };
|
|
2
|
+
export declare const createProps: <T extends Record<never, never>>() => <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) => (keyof T)[];
|
|
3
|
+
export {};
|
package/dist/create-props.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[] ? [keyof T] extends [K[number]] ? unknown : `Missing required keys: ${Exclude<keyof T, K[number]>}` : never;
|
|
2
|
-
declare const createProps: <T extends Record<never, never>>() => <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) => (keyof T)[];
|
|
3
|
-
|
|
4
|
-
export { createProps };
|
|
2
|
+
export declare const createProps: <T extends Record<never, never>>() => <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) => (keyof T)[];
|
|
3
|
+
export {};
|
package/dist/create-props.js
CHANGED
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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/create-props.ts
|
|
21
|
-
var create_props_exports = {};
|
|
22
|
-
__export(create_props_exports, {
|
|
23
|
-
createProps: () => createProps
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(create_props_exports);
|
|
26
|
-
var createProps = () => (props) => Array.from(new Set(props));
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
createProps
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
30
4
|
});
|
|
5
|
+
// src/create-props.ts
|
|
6
|
+
const createProps = () => (props) => Array.from(new Set(props));
|
|
7
|
+
exports.createProps = createProps;
|
package/dist/create-props.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,65 +1,58 @@
|
|
|
1
|
-
import { JSX } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* The orientation of the element.
|
|
19
|
-
* @default "horizontal"
|
|
20
|
-
*/
|
|
21
|
-
orientation?: "horizontal" | "vertical" | undefined;
|
|
1
|
+
import { JSX } from "./jsx.mjs";
|
|
2
|
+
import { NormalizeProps, PropTypes, createNormalizer } from "./prop-types.mjs";
|
|
3
|
+
import { createProps } from "./create-props.mjs";
|
|
4
|
+
export type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
|
|
5
|
+
export type Nullable<T> = T | null;
|
|
6
|
+
export type NonNullable<T> = T extends null | undefined ? never : T;
|
|
7
|
+
export type Required<T> = { [P in keyof T]-?: NonNullable<T[P]>; };
|
|
8
|
+
export type Direction = "ltr" | "rtl";
|
|
9
|
+
export type Orientation = "horizontal" | "vertical";
|
|
10
|
+
export type MaybeFn<T> = T | (() => T);
|
|
11
|
+
export type MaybeElement<T extends HTMLElement = HTMLElement> = Nullable<T>;
|
|
12
|
+
export interface OrientationProperty {
|
|
13
|
+
/**
|
|
14
|
+
* The orientation of the element.
|
|
15
|
+
* @default "horizontal"
|
|
16
|
+
*/
|
|
17
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
22
18
|
}
|
|
23
|
-
interface DirectionProperty {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
export interface DirectionProperty {
|
|
20
|
+
/**
|
|
21
|
+
* The document's text/writing direction.
|
|
22
|
+
* @default "ltr"
|
|
23
|
+
*/
|
|
24
|
+
dir?: "ltr" | "rtl" | undefined;
|
|
29
25
|
}
|
|
30
|
-
interface LocaleProperties extends DirectionProperty {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
export interface LocaleProperties extends DirectionProperty {
|
|
27
|
+
/**
|
|
28
|
+
* The current locale. Based on the BCP 47 definition.
|
|
29
|
+
* @default "en-US"
|
|
30
|
+
*/
|
|
31
|
+
locale?: string | undefined;
|
|
36
32
|
}
|
|
37
|
-
interface CommonProperties {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
export interface CommonProperties {
|
|
34
|
+
/**
|
|
35
|
+
* The unique identifier of the machine.
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
|
|
40
|
+
*/
|
|
41
|
+
getRootNode?: (() => ShadowRoot | Document | Node) | undefined;
|
|
46
42
|
}
|
|
47
|
-
type Style = JSX.CSSProperties;
|
|
48
|
-
type EventKey = "ArrowDown" | "ArrowUp" | "ArrowLeft" | "ArrowRight" | "Space" | "Enter" | "Comma" | "Escape" | "Backspace" | "Delete" | "Home" | "End" | "Tab" | "PageUp" | "PageDown" | (string & {});
|
|
49
|
-
type EventKeyMap<T extends HTMLElement = HTMLElement> = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
x: number;
|
|
54
|
-
y: number;
|
|
43
|
+
export type Style = JSX.CSSProperties;
|
|
44
|
+
export type EventKey = "ArrowDown" | "ArrowUp" | "ArrowLeft" | "ArrowRight" | "Space" | "Enter" | "Comma" | "Escape" | "Backspace" | "Delete" | "Home" | "End" | "Tab" | "PageUp" | "PageDown" | (string & {});
|
|
45
|
+
export type EventKeyMap<T extends HTMLElement = HTMLElement> = { [key in EventKey]?: (event: JSX.KeyboardEvent<T>) => void; };
|
|
46
|
+
export interface Point {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
55
49
|
}
|
|
56
|
-
interface Size {
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
export interface Size {
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
59
53
|
}
|
|
60
|
-
interface Rect extends Size {
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
export interface Rect extends Size {
|
|
55
|
+
y: number;
|
|
56
|
+
x: number;
|
|
63
57
|
}
|
|
64
|
-
|
|
65
|
-
export { type CommonProperties, type Direction, type DirectionProperty, type EventKey, type EventKeyMap, JSX, type LocaleProperties, type MaybeElement, type MaybeFn, type NonNullable, type Nullable, type Orientation, type OrientationProperty, type Point, type Rect, type Required, type RequiredBy, type Size, type Style };
|
|
58
|
+
export { type JSX, NormalizeProps, PropTypes, createNormalizer, createProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,65 +1,58 @@
|
|
|
1
|
-
import { JSX } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* The orientation of the element.
|
|
19
|
-
* @default "horizontal"
|
|
20
|
-
*/
|
|
21
|
-
orientation?: "horizontal" | "vertical" | undefined;
|
|
1
|
+
import { JSX } from "./jsx.js";
|
|
2
|
+
import { NormalizeProps, PropTypes, createNormalizer } from "./prop-types.js";
|
|
3
|
+
import { createProps } from "./create-props.js";
|
|
4
|
+
export type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
|
|
5
|
+
export type Nullable<T> = T | null;
|
|
6
|
+
export type NonNullable<T> = T extends null | undefined ? never : T;
|
|
7
|
+
export type Required<T> = { [P in keyof T]-?: NonNullable<T[P]>; };
|
|
8
|
+
export type Direction = "ltr" | "rtl";
|
|
9
|
+
export type Orientation = "horizontal" | "vertical";
|
|
10
|
+
export type MaybeFn<T> = T | (() => T);
|
|
11
|
+
export type MaybeElement<T extends HTMLElement = HTMLElement> = Nullable<T>;
|
|
12
|
+
export interface OrientationProperty {
|
|
13
|
+
/**
|
|
14
|
+
* The orientation of the element.
|
|
15
|
+
* @default "horizontal"
|
|
16
|
+
*/
|
|
17
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
22
18
|
}
|
|
23
|
-
interface DirectionProperty {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
export interface DirectionProperty {
|
|
20
|
+
/**
|
|
21
|
+
* The document's text/writing direction.
|
|
22
|
+
* @default "ltr"
|
|
23
|
+
*/
|
|
24
|
+
dir?: "ltr" | "rtl" | undefined;
|
|
29
25
|
}
|
|
30
|
-
interface LocaleProperties extends DirectionProperty {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
export interface LocaleProperties extends DirectionProperty {
|
|
27
|
+
/**
|
|
28
|
+
* The current locale. Based on the BCP 47 definition.
|
|
29
|
+
* @default "en-US"
|
|
30
|
+
*/
|
|
31
|
+
locale?: string | undefined;
|
|
36
32
|
}
|
|
37
|
-
interface CommonProperties {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
export interface CommonProperties {
|
|
34
|
+
/**
|
|
35
|
+
* The unique identifier of the machine.
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
|
|
40
|
+
*/
|
|
41
|
+
getRootNode?: (() => ShadowRoot | Document | Node) | undefined;
|
|
46
42
|
}
|
|
47
|
-
type Style = JSX.CSSProperties;
|
|
48
|
-
type EventKey = "ArrowDown" | "ArrowUp" | "ArrowLeft" | "ArrowRight" | "Space" | "Enter" | "Comma" | "Escape" | "Backspace" | "Delete" | "Home" | "End" | "Tab" | "PageUp" | "PageDown" | (string & {});
|
|
49
|
-
type EventKeyMap<T extends HTMLElement = HTMLElement> = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
x: number;
|
|
54
|
-
y: number;
|
|
43
|
+
export type Style = JSX.CSSProperties;
|
|
44
|
+
export type EventKey = "ArrowDown" | "ArrowUp" | "ArrowLeft" | "ArrowRight" | "Space" | "Enter" | "Comma" | "Escape" | "Backspace" | "Delete" | "Home" | "End" | "Tab" | "PageUp" | "PageDown" | (string & {});
|
|
45
|
+
export type EventKeyMap<T extends HTMLElement = HTMLElement> = { [key in EventKey]?: (event: JSX.KeyboardEvent<T>) => void; };
|
|
46
|
+
export interface Point {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
55
49
|
}
|
|
56
|
-
interface Size {
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
export interface Size {
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
59
53
|
}
|
|
60
|
-
interface Rect extends Size {
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
export interface Rect extends Size {
|
|
55
|
+
y: number;
|
|
56
|
+
x: number;
|
|
63
57
|
}
|
|
64
|
-
|
|
65
|
-
export { type CommonProperties, type Direction, type DirectionProperty, type EventKey, type EventKeyMap, JSX, type LocaleProperties, type MaybeElement, type MaybeFn, type NonNullable, type Nullable, type Orientation, type OrientationProperty, type Point, type Rect, type Required, type RequiredBy, type Size, type Style };
|
|
58
|
+
export { type JSX, NormalizeProps, PropTypes, createNormalizer, createProps };
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
|
|
17
|
-
// src/index.ts
|
|
18
|
-
var index_exports = {};
|
|
19
|
-
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("./prop-types.js"), module.exports);
|
|
21
|
-
__reExport(index_exports, require("./create-props.js"), module.exports);
|
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
-
0 && (module.exports = {
|
|
24
|
-
...require("./prop-types.js"),
|
|
25
|
-
...require("./create-props.js")
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
26
4
|
});
|
|
5
|
+
const require_prop_types = require("./prop-types.js");
|
|
6
|
+
const require_create_props = require("./create-props.js");
|
|
7
|
+
exports.createNormalizer = require_prop_types.createNormalizer;
|
|
8
|
+
exports.createProps = require_create_props.createProps;
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { createNormalizer } from "./prop-types.mjs";
|
|
2
|
+
import { createProps } from "./create-props.mjs";
|
|
3
|
+
export { createNormalizer, createProps };
|