@zag-js/types 0.80.0 → 0.81.1

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 CHANGED
@@ -1434,13 +1434,15 @@ type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[] ? [keyof T] ex
1434
1434
  declare const createProps: <T extends Record<never, never>>() => <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) => (keyof T)[];
1435
1435
 
1436
1436
  type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
1437
+ type Nullable<T> = T | null;
1437
1438
  type NonNullable<T> = T extends null | undefined ? never : T;
1438
1439
  type Required<T> = {
1439
1440
  [P in keyof T]-?: NonNullable<T[P]>;
1440
1441
  };
1441
1442
  type Direction = "ltr" | "rtl";
1442
1443
  type Orientation = "horizontal" | "vertical";
1443
- type MaybeElement<T extends HTMLElement = HTMLElement> = T | null;
1444
+ type MaybeFn<T> = T | (() => T);
1445
+ type MaybeElement<T extends HTMLElement = HTMLElement> = Nullable<T>;
1444
1446
  interface OrientationProperty {
1445
1447
  /**
1446
1448
  * The orientation of the element.
@@ -1473,5 +1475,13 @@ interface CommonProperties {
1473
1475
  getRootNode?: (() => ShadowRoot | Document | Node) | undefined;
1474
1476
  }
1475
1477
  type Style = JSX.CSSProperties;
1478
+ type EventKey = "ArrowDown" | "ArrowUp" | "ArrowLeft" | "ArrowRight" | "Space" | "Enter" | "Comma" | "Escape" | "Backspace" | "Delete" | "Home" | "End" | "Tab" | "PageUp" | "PageDown" | (string & {});
1479
+ type EventKeyMap = {
1480
+ [key in EventKey]?: (event: JSX.KeyboardEvent) => void;
1481
+ };
1482
+ interface Point {
1483
+ x: number;
1484
+ y: number;
1485
+ }
1476
1486
 
1477
- export { type CommonProperties, type Direction, type DirectionProperty, JSX, type LocaleProperties, type MaybeElement, type NonNullable, type NormalizeProps, type Orientation, type OrientationProperty, type PropTypes, type Required, type RequiredBy, type Style, createNormalizer, createProps };
1487
+ export { type CommonProperties, type Direction, type DirectionProperty, type EventKey, type EventKeyMap, JSX, type LocaleProperties, type MaybeElement, type MaybeFn, type NonNullable, type NormalizeProps, type Nullable, type Orientation, type OrientationProperty, type Point, type PropTypes, type Required, type RequiredBy, type Style, createNormalizer, createProps };
package/dist/index.d.ts CHANGED
@@ -1434,13 +1434,15 @@ type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[] ? [keyof T] ex
1434
1434
  declare const createProps: <T extends Record<never, never>>() => <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) => (keyof T)[];
1435
1435
 
1436
1436
  type RequiredBy<T, K extends keyof T> = Partial<Omit<T, K>> & Required<Pick<T, K>>;
1437
+ type Nullable<T> = T | null;
1437
1438
  type NonNullable<T> = T extends null | undefined ? never : T;
1438
1439
  type Required<T> = {
1439
1440
  [P in keyof T]-?: NonNullable<T[P]>;
1440
1441
  };
1441
1442
  type Direction = "ltr" | "rtl";
1442
1443
  type Orientation = "horizontal" | "vertical";
1443
- type MaybeElement<T extends HTMLElement = HTMLElement> = T | null;
1444
+ type MaybeFn<T> = T | (() => T);
1445
+ type MaybeElement<T extends HTMLElement = HTMLElement> = Nullable<T>;
1444
1446
  interface OrientationProperty {
1445
1447
  /**
1446
1448
  * The orientation of the element.
@@ -1473,5 +1475,13 @@ interface CommonProperties {
1473
1475
  getRootNode?: (() => ShadowRoot | Document | Node) | undefined;
1474
1476
  }
1475
1477
  type Style = JSX.CSSProperties;
1478
+ type EventKey = "ArrowDown" | "ArrowUp" | "ArrowLeft" | "ArrowRight" | "Space" | "Enter" | "Comma" | "Escape" | "Backspace" | "Delete" | "Home" | "End" | "Tab" | "PageUp" | "PageDown" | (string & {});
1479
+ type EventKeyMap = {
1480
+ [key in EventKey]?: (event: JSX.KeyboardEvent) => void;
1481
+ };
1482
+ interface Point {
1483
+ x: number;
1484
+ y: number;
1485
+ }
1476
1486
 
1477
- export { type CommonProperties, type Direction, type DirectionProperty, JSX, type LocaleProperties, type MaybeElement, type NonNullable, type NormalizeProps, type Orientation, type OrientationProperty, type PropTypes, type Required, type RequiredBy, type Style, createNormalizer, createProps };
1487
+ export { type CommonProperties, type Direction, type DirectionProperty, type EventKey, type EventKeyMap, JSX, type LocaleProperties, type MaybeElement, type MaybeFn, type NonNullable, type NormalizeProps, type Nullable, type Orientation, type OrientationProperty, type Point, type PropTypes, type Required, type RequiredBy, type Style, createNormalizer, createProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/types",
3
- "version": "0.80.0",
3
+ "version": "0.81.1",
4
4
  "keywords": [
5
5
  "js",
6
6
  "utils",