@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.
@@ -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 {};
@@ -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 {};
@@ -1,30 +1,7 @@
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/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;
@@ -1,5 +1,3 @@
1
1
  // src/create-props.ts
2
- var createProps = () => (props) => Array.from(new Set(props));
3
- export {
4
- createProps
5
- };
2
+ const createProps = () => (props) => Array.from(new Set(props));
3
+ export { createProps };
package/dist/index.d.mts CHANGED
@@ -1,65 +1,58 @@
1
- import { JSX } from './jsx.mjs';
2
- export { NormalizeProps, PropTypes, createNormalizer } from './prop-types.mjs';
3
- export { createProps } from './create-props.mjs';
4
- import 'csstype';
5
-
6
- type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
7
- type Nullable<T> = T | null;
8
- type NonNullable<T> = T extends null | undefined ? never : T;
9
- type Required<T> = {
10
- [P in keyof T]-?: NonNullable<T[P]>;
11
- };
12
- type Direction = "ltr" | "rtl";
13
- type Orientation = "horizontal" | "vertical";
14
- type MaybeFn<T> = T | (() => T);
15
- type MaybeElement<T extends HTMLElement = HTMLElement> = Nullable<T>;
16
- interface OrientationProperty {
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
- * The document's text/writing direction.
26
- * @default "ltr"
27
- */
28
- dir?: "ltr" | "rtl" | undefined;
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
- * The current locale. Based on the BCP 47 definition.
33
- * @default "en-US"
34
- */
35
- locale?: string | undefined;
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
- * The unique identifier of the machine.
40
- */
41
- id: string;
42
- /**
43
- * A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
44
- */
45
- getRootNode?: (() => ShadowRoot | Document | Node) | undefined;
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
- [key in EventKey]?: (event: JSX.KeyboardEvent<T>) => void;
51
- };
52
- interface Point {
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
- width: number;
58
- height: number;
50
+ export interface Size {
51
+ width: number;
52
+ height: number;
59
53
  }
60
- interface Rect extends Size {
61
- y: number;
62
- x: number;
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 './jsx.js';
2
- export { NormalizeProps, PropTypes, createNormalizer } from './prop-types.js';
3
- export { createProps } from './create-props.js';
4
- import 'csstype';
5
-
6
- type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
7
- type Nullable<T> = T | null;
8
- type NonNullable<T> = T extends null | undefined ? never : T;
9
- type Required<T> = {
10
- [P in keyof T]-?: NonNullable<T[P]>;
11
- };
12
- type Direction = "ltr" | "rtl";
13
- type Orientation = "horizontal" | "vertical";
14
- type MaybeFn<T> = T | (() => T);
15
- type MaybeElement<T extends HTMLElement = HTMLElement> = Nullable<T>;
16
- interface OrientationProperty {
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
- * The document's text/writing direction.
26
- * @default "ltr"
27
- */
28
- dir?: "ltr" | "rtl" | undefined;
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
- * The current locale. Based on the BCP 47 definition.
33
- * @default "en-US"
34
- */
35
- locale?: string | undefined;
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
- * The unique identifier of the machine.
40
- */
41
- id: string;
42
- /**
43
- * A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.
44
- */
45
- getRootNode?: (() => ShadowRoot | Document | Node) | undefined;
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
- [key in EventKey]?: (event: JSX.KeyboardEvent<T>) => void;
51
- };
52
- interface Point {
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
- width: number;
58
- height: number;
50
+ export interface Size {
51
+ width: number;
52
+ height: number;
59
53
  }
60
- interface Rect extends Size {
61
- y: number;
62
- x: number;
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
- "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 __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
- // src/index.ts
2
- export * from "./prop-types.mjs";
3
- export * from "./create-props.mjs";
1
+ import { createNormalizer } from "./prop-types.mjs";
2
+ import { createProps } from "./create-props.mjs";
3
+ export { createNormalizer, createProps };