@zag-js/types 0.10.2 → 0.10.4

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.ts CHANGED
@@ -1,19 +1,16 @@
1
- import { JSX } from './jsx.js';
2
- export { NormalizeProps, PropTypes, createNormalizer } from './prop-types.js';
3
- import 'csstype';
4
-
5
- type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
6
- type Direction = "ltr" | "rtl";
7
- type Orientation = "horizontal" | "vertical";
8
- type MaybeElement<T extends HTMLElement = HTMLElement> = T | null;
9
- type DirectionProperty = {
1
+ import type { JSX } from "./jsx";
2
+ export type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
3
+ export type Direction = "ltr" | "rtl";
4
+ export type Orientation = "horizontal" | "vertical";
5
+ export type MaybeElement<T extends HTMLElement = HTMLElement> = T | null;
6
+ export type DirectionProperty = {
10
7
  /**
11
8
  * The document's text/writing direction.
12
9
  * @default "ltr"
13
10
  */
14
11
  dir?: "ltr" | "rtl";
15
12
  };
16
- type CommonProperties = {
13
+ export type CommonProperties = {
17
14
  /**
18
15
  * The unique identifier of the machine.
19
16
  */
@@ -23,7 +20,7 @@ type CommonProperties = {
23
20
  */
24
21
  getRootNode?: () => ShadowRoot | Document | Node;
25
22
  };
26
- type RootProperties = {
23
+ export type RootProperties = {
27
24
  /**
28
25
  * The owner document of the machine.
29
26
  */
@@ -38,7 +35,7 @@ type RootProperties = {
38
35
  */
39
36
  pointerdownNode?: HTMLElement | null;
40
37
  };
41
- type Context<T> = T & RootProperties;
42
- type Style = JSX.CSSProperties;
43
-
44
- export { CommonProperties, Context, Direction, DirectionProperty, JSX, MaybeElement, Orientation, RequiredBy, RootProperties, Style };
38
+ export type Context<T> = T & RootProperties;
39
+ export type Style = JSX.CSSProperties;
40
+ export * from "./prop-types";
41
+ export type { JSX };
package/dist/index.js CHANGED
@@ -1,38 +1,9 @@
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);
1
+ 'use strict';
19
2
 
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- createNormalizer: () => createNormalizer
24
- });
25
- module.exports = __toCommonJS(src_exports);
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26
4
 
27
- // src/prop-types.ts
28
- function createNormalizer(fn) {
29
- return new Proxy({}, {
30
- get() {
31
- return fn;
32
- }
33
- });
34
- }
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- createNormalizer
38
- });
5
+ const propTypes = require('./prop-types.js');
6
+
7
+
8
+
9
+ exports.createNormalizer = propTypes.createNormalizer;
package/dist/index.mjs CHANGED
@@ -1,6 +1 @@
1
- import {
2
- createNormalizer
3
- } from "./chunk-D5R2W3NO.mjs";
4
- export {
5
- createNormalizer
6
- };
1
+ export { createNormalizer } from './prop-types.mjs';
package/dist/jsx.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import * as CSS from 'csstype';
2
-
1
+ import type * as CSS from "csstype";
3
2
  type NativeAnimationEvent = AnimationEvent;
4
3
  type NativeClipboardEvent = ClipboardEvent;
5
4
  type NativeCompositionEvent = CompositionEvent;
@@ -13,7 +12,7 @@ type NativeTransitionEvent = TransitionEvent;
13
12
  type NativeUIEvent = UIEvent;
14
13
  type NativeWheelEvent = WheelEvent;
15
14
  type Booleanish = boolean | "true" | "false";
16
- declare namespace JSX {
15
+ export declare namespace JSX {
17
16
  export interface BaseSyntheticEvent<E = object, C = any, T = any> {
18
17
  nativeEvent: E;
19
18
  currentTarget: C;
@@ -1110,5 +1109,4 @@ declare namespace JSX {
1110
1109
  }
1111
1110
  export {};
1112
1111
  }
1113
-
1114
- export { JSX };
1112
+ export {};
@@ -1,6 +1,4 @@
1
- import { JSX } from './jsx.js';
2
- import 'csstype';
3
-
1
+ import type { JSX } from "./jsx";
4
2
  type Dict<T = any> = Record<string, T>;
5
3
  type Booleanish = boolean | "true" | "false";
6
4
  type DataAttr = {
@@ -39,13 +37,12 @@ type DataAttr = {
39
37
  } & {
40
38
  [key in `data-${string}`]?: string | number | Booleanish;
41
39
  };
42
- type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "img" | "output" | "element" | "select" | "style", T>;
43
- type NormalizeProps<T extends PropTypes> = {
40
+ export type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "img" | "output" | "element" | "select" | "style", T>;
41
+ export type NormalizeProps<T extends PropTypes> = {
44
42
  [K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K];
45
43
  } & {
46
44
  element(props: DataAttr & JSX.HTMLAttributes<HTMLElement>): T["element"];
47
45
  style: JSX.CSSProperties;
48
46
  };
49
- declare function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T>;
50
-
51
- export { NormalizeProps, PropTypes, createNormalizer };
47
+ export declare function createNormalizer<T extends PropTypes>(fn: (props: Dict) => Dict): NormalizeProps<T>;
48
+ export {};
@@ -1,28 +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);
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
19
4
 
20
- // src/prop-types.ts
21
- var prop_types_exports = {};
22
- __export(prop_types_exports, {
23
- createNormalizer: () => createNormalizer
24
- });
25
- module.exports = __toCommonJS(prop_types_exports);
26
5
  function createNormalizer(fn) {
27
6
  return new Proxy({}, {
28
7
  get() {
@@ -30,7 +9,5 @@ function createNormalizer(fn) {
30
9
  }
31
10
  });
32
11
  }
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- createNormalizer
36
- });
12
+
13
+ exports.createNormalizer = createNormalizer;
@@ -1,6 +1,9 @@
1
- import {
2
- createNormalizer
3
- } from "./chunk-D5R2W3NO.mjs";
4
- export {
5
- createNormalizer
6
- };
1
+ function createNormalizer(fn) {
2
+ return new Proxy({}, {
3
+ get() {
4
+ return fn;
5
+ }
6
+ });
7
+ }
8
+
9
+ export { createNormalizer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/types",
3
- "version": "0.10.2",
3
+ "version": "0.10.4",
4
4
  "keywords": [
5
5
  "js",
6
6
  "utils",
@@ -40,13 +40,9 @@
40
40
  "./package.json": "./package.json"
41
41
  },
42
42
  "scripts": {
43
- "build-fast": "tsup src",
44
- "start": "pnpm build --watch",
45
- "build": "tsup src --dts",
43
+ "build": "vite build -c ../../vite.config.ts",
46
44
  "test": "jest --config ../../jest.config.js --rootDir . --passWithNoTests",
47
45
  "lint": "eslint src --ext .ts,.tsx",
48
- "test-ci": "pnpm test --ci --runInBand",
49
- "test-watch": "pnpm test --watch -u",
50
46
  "typecheck": "tsc --noEmit"
51
47
  }
52
48
  }
@@ -1,12 +0,0 @@
1
- // src/prop-types.ts
2
- function createNormalizer(fn) {
3
- return new Proxy({}, {
4
- get() {
5
- return fn;
6
- }
7
- });
8
- }
9
-
10
- export {
11
- createNormalizer
12
- };
package/dist/jsx.js DELETED
@@ -1,18 +0,0 @@
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/jsx.ts
17
- var jsx_exports = {};
18
- module.exports = __toCommonJS(jsx_exports);
package/dist/jsx.mjs DELETED
File without changes