@zag-js/types 0.0.0-dev-20240410000101 → 0.0.0-dev-20240412181302

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
@@ -12,7 +12,7 @@ type NativePointerEvent = PointerEvent;
12
12
  type NativeTransitionEvent = TransitionEvent;
13
13
  type NativeUIEvent = UIEvent;
14
14
  type NativeWheelEvent = WheelEvent;
15
- type Booleanish$1 = boolean | "true" | "false";
15
+ type Booleanish = boolean | "true" | "false";
16
16
  declare namespace JSX {
17
17
  export interface BaseSyntheticEvent<E = object, C = any, T = any> {
18
18
  nativeEvent: E;
@@ -256,14 +256,14 @@ declare namespace JSX {
256
256
  /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
257
257
  "aria-activedescendant"?: string | undefined;
258
258
  /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */
259
- "aria-atomic"?: Booleanish$1 | undefined;
259
+ "aria-atomic"?: Booleanish | undefined;
260
260
  /**
261
261
  * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be
262
262
  * presented if they are made.
263
263
  */
264
264
  "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
265
265
  /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */
266
- "aria-busy"?: Booleanish$1 | undefined;
266
+ "aria-busy"?: Booleanish | undefined;
267
267
  /**
268
268
  * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
269
269
  * @see aria-pressed @see aria-selected.
@@ -305,7 +305,7 @@ declare namespace JSX {
305
305
  * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
306
306
  * @see aria-hidden @see aria-readonly.
307
307
  */
308
- "aria-disabled"?: Booleanish$1 | undefined;
308
+ "aria-disabled"?: Booleanish | undefined;
309
309
  /**
310
310
  * Indicates what functions can be performed when a dragged object is released on the drop target.
311
311
  * @deprecated in ARIA 1.1
@@ -317,7 +317,7 @@ declare namespace JSX {
317
317
  */
318
318
  "aria-errormessage"?: string | undefined;
319
319
  /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
320
- "aria-expanded"?: Booleanish$1 | undefined;
320
+ "aria-expanded"?: Booleanish | undefined;
321
321
  /**
322
322
  * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
323
323
  * allows assistive technology to override the general default of reading in document source order.
@@ -327,14 +327,14 @@ declare namespace JSX {
327
327
  * Indicates an element's "grabbed" state in a drag-and-drop operation.
328
328
  * @deprecated in ARIA 1.1
329
329
  */
330
- "aria-grabbed"?: Booleanish$1 | undefined;
330
+ "aria-grabbed"?: Booleanish | undefined;
331
331
  /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
332
332
  "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
333
333
  /**
334
334
  * Indicates whether the element is exposed to an accessibility API.
335
335
  * @see aria-disabled.
336
336
  */
337
- "aria-hidden"?: Booleanish$1 | undefined;
337
+ "aria-hidden"?: Booleanish | undefined;
338
338
  /**
339
339
  * Indicates the entered value does not conform to the format expected by the application.
340
340
  * @see aria-errormessage.
@@ -357,11 +357,11 @@ declare namespace JSX {
357
357
  /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */
358
358
  "aria-live"?: "off" | "assertive" | "polite" | undefined;
359
359
  /** Indicates whether an element is modal when displayed. */
360
- "aria-modal"?: Booleanish$1 | undefined;
360
+ "aria-modal"?: Booleanish | undefined;
361
361
  /** Indicates whether a text box accepts multiple lines of input or only a single line. */
362
- "aria-multiline"?: Booleanish$1 | undefined;
362
+ "aria-multiline"?: Booleanish | undefined;
363
363
  /** Indicates that the user may select more than one item from the current selectable descendants. */
364
- "aria-multiselectable"?: Booleanish$1 | undefined;
364
+ "aria-multiselectable"?: Booleanish | undefined;
365
365
  /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
366
366
  "aria-orientation"?: "horizontal" | "vertical" | undefined;
367
367
  /**
@@ -389,14 +389,14 @@ declare namespace JSX {
389
389
  * Indicates that the element is not editable, but is otherwise operable.
390
390
  * @see aria-disabled.
391
391
  */
392
- "aria-readonly"?: Booleanish$1 | undefined;
392
+ "aria-readonly"?: Booleanish | undefined;
393
393
  /**
394
394
  * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
395
395
  * @see aria-atomic.
396
396
  */
397
397
  "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
398
398
  /** Indicates that user input is required on the element before a form may be submitted. */
399
- "aria-required"?: Booleanish$1 | undefined;
399
+ "aria-required"?: Booleanish | undefined;
400
400
  /** Defines a human-readable, author-localized description for the role of an element. */
401
401
  "aria-roledescription"?: string | undefined;
402
402
  /**
@@ -418,7 +418,7 @@ declare namespace JSX {
418
418
  * Indicates the current "selected" state of various widgets.
419
419
  * @see aria-checked @see aria-pressed.
420
420
  */
421
- "aria-selected"?: Booleanish$1 | undefined;
421
+ "aria-selected"?: Booleanish | undefined;
422
422
  /**
423
423
  * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
424
424
  * @see aria-posinset.
@@ -446,16 +446,16 @@ declare namespace JSX {
446
446
  suppressHydrationWarning?: boolean | undefined;
447
447
  accessKey?: string | undefined;
448
448
  className?: string | undefined;
449
- contentEditable?: Booleanish$1 | "inherit" | undefined;
449
+ contentEditable?: Booleanish | "inherit" | undefined;
450
450
  contextMenu?: string | undefined;
451
451
  dir?: string | undefined;
452
- draggable?: Booleanish$1 | undefined;
452
+ draggable?: Booleanish | undefined;
453
453
  hidden?: boolean | undefined;
454
454
  id?: string | undefined;
455
455
  lang?: string | undefined;
456
456
  placeholder?: string | undefined;
457
457
  slot?: string | undefined;
458
- spellCheck?: Booleanish$1 | undefined;
458
+ spellCheck?: Booleanish | undefined;
459
459
  style?: CSSProperties | undefined;
460
460
  tabIndex?: number | undefined;
461
461
  title?: string | undefined;
@@ -1022,7 +1022,7 @@ declare namespace JSX {
1022
1022
  ascent?: number | string | undefined;
1023
1023
  attributeName?: string | undefined;
1024
1024
  attributeType?: string | undefined;
1025
- autoReverse?: Booleanish$1 | undefined;
1025
+ autoReverse?: Booleanish | undefined;
1026
1026
  azimuth?: number | string | undefined;
1027
1027
  baseFrequency?: number | string | undefined;
1028
1028
  baselineShift?: number | string | undefined;
@@ -1062,7 +1062,7 @@ declare namespace JSX {
1062
1062
  enableBackground?: number | string | undefined;
1063
1063
  end?: number | string | undefined;
1064
1064
  exponent?: number | string | undefined;
1065
- externalResourcesRequired?: Booleanish$1 | undefined;
1065
+ externalResourcesRequired?: Booleanish | undefined;
1066
1066
  fill?: string | undefined;
1067
1067
  fillOpacity?: number | string | undefined;
1068
1068
  fillRule?: "nonzero" | "evenodd" | "inherit" | undefined;
@@ -1071,7 +1071,7 @@ declare namespace JSX {
1071
1071
  filterUnits?: number | string | undefined;
1072
1072
  floodColor?: number | string | undefined;
1073
1073
  floodOpacity?: number | string | undefined;
1074
- focusable?: Booleanish$1 | "auto" | undefined;
1074
+ focusable?: Booleanish | "auto" | undefined;
1075
1075
  fontFamily?: string | undefined;
1076
1076
  fontSize?: number | string | undefined;
1077
1077
  fontSizeAdjust?: number | string | undefined;
@@ -1151,7 +1151,7 @@ declare namespace JSX {
1151
1151
  pointsAtX?: number | string | undefined;
1152
1152
  pointsAtY?: number | string | undefined;
1153
1153
  pointsAtZ?: number | string | undefined;
1154
- preserveAlpha?: Booleanish$1 | undefined;
1154
+ preserveAlpha?: Booleanish | undefined;
1155
1155
  preserveAspectRatio?: string | undefined;
1156
1156
  primitiveUnits?: number | string | undefined;
1157
1157
  r?: number | string | undefined;
@@ -1378,25 +1378,26 @@ declare namespace JSX {
1378
1378
  }
1379
1379
 
1380
1380
  type Dict<T = any> = Record<string, T>;
1381
- type Booleanish = boolean | "true" | "false";
1382
1381
  type DataAttr = {
1383
- "data-selected"?: Booleanish;
1384
- "data-expanded"?: Booleanish;
1385
- "data-highlighted"?: Booleanish;
1386
- "data-readonly"?: Booleanish;
1387
- "data-indeterminate"?: Booleanish;
1388
- "data-invalid"?: Booleanish;
1389
- "data-hover"?: Booleanish;
1390
- "data-active"?: Booleanish;
1391
- "data-focus"?: Booleanish;
1392
- "data-disabled"?: Booleanish;
1393
- "data-open"?: Booleanish;
1394
- "data-checked"?: Booleanish;
1395
- "data-pressed"?: Booleanish;
1396
- "data-complete"?: Booleanish;
1397
- "data-empty"?: Booleanish;
1398
- "data-placeholder-shown"?: Booleanish;
1399
- "data-half"?: Booleanish;
1382
+ "data-selected"?: any;
1383
+ "data-expanded"?: any;
1384
+ "data-highlighted"?: any;
1385
+ "data-readonly"?: any;
1386
+ "data-indeterminate"?: any;
1387
+ "data-invalid"?: any;
1388
+ "data-hover"?: any;
1389
+ "data-active"?: any;
1390
+ "data-focus"?: any;
1391
+ "data-disabled"?: any;
1392
+ "data-open"?: any;
1393
+ "data-checked"?: any;
1394
+ "data-pressed"?: any;
1395
+ "data-complete"?: any;
1396
+ "data-side"?: any;
1397
+ "data-align"?: any;
1398
+ "data-empty"?: any;
1399
+ "data-placeholder-shown"?: any;
1400
+ "data-half"?: any;
1400
1401
  "data-scope"?: string;
1401
1402
  "data-uid"?: string;
1402
1403
  "data-name"?: string;
@@ -1413,7 +1414,7 @@ type DataAttr = {
1413
1414
  "data-count"?: number;
1414
1415
  "data-index"?: number;
1415
1416
  } & {
1416
- [key in `data-${string}`]?: string | number | Booleanish;
1417
+ [key in `data-${string}`]?: any;
1417
1418
  };
1418
1419
  type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "textarea" | "img" | "output" | "element" | "select" | "style" | "circle" | "svg" | "path", T>;
1419
1420
  type NormalizeProps<T extends PropTypes> = {
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ type NativePointerEvent = PointerEvent;
12
12
  type NativeTransitionEvent = TransitionEvent;
13
13
  type NativeUIEvent = UIEvent;
14
14
  type NativeWheelEvent = WheelEvent;
15
- type Booleanish$1 = boolean | "true" | "false";
15
+ type Booleanish = boolean | "true" | "false";
16
16
  declare namespace JSX {
17
17
  export interface BaseSyntheticEvent<E = object, C = any, T = any> {
18
18
  nativeEvent: E;
@@ -256,14 +256,14 @@ declare namespace JSX {
256
256
  /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */
257
257
  "aria-activedescendant"?: string | undefined;
258
258
  /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */
259
- "aria-atomic"?: Booleanish$1 | undefined;
259
+ "aria-atomic"?: Booleanish | undefined;
260
260
  /**
261
261
  * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be
262
262
  * presented if they are made.
263
263
  */
264
264
  "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
265
265
  /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */
266
- "aria-busy"?: Booleanish$1 | undefined;
266
+ "aria-busy"?: Booleanish | undefined;
267
267
  /**
268
268
  * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
269
269
  * @see aria-pressed @see aria-selected.
@@ -305,7 +305,7 @@ declare namespace JSX {
305
305
  * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
306
306
  * @see aria-hidden @see aria-readonly.
307
307
  */
308
- "aria-disabled"?: Booleanish$1 | undefined;
308
+ "aria-disabled"?: Booleanish | undefined;
309
309
  /**
310
310
  * Indicates what functions can be performed when a dragged object is released on the drop target.
311
311
  * @deprecated in ARIA 1.1
@@ -317,7 +317,7 @@ declare namespace JSX {
317
317
  */
318
318
  "aria-errormessage"?: string | undefined;
319
319
  /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
320
- "aria-expanded"?: Booleanish$1 | undefined;
320
+ "aria-expanded"?: Booleanish | undefined;
321
321
  /**
322
322
  * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
323
323
  * allows assistive technology to override the general default of reading in document source order.
@@ -327,14 +327,14 @@ declare namespace JSX {
327
327
  * Indicates an element's "grabbed" state in a drag-and-drop operation.
328
328
  * @deprecated in ARIA 1.1
329
329
  */
330
- "aria-grabbed"?: Booleanish$1 | undefined;
330
+ "aria-grabbed"?: Booleanish | undefined;
331
331
  /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
332
332
  "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
333
333
  /**
334
334
  * Indicates whether the element is exposed to an accessibility API.
335
335
  * @see aria-disabled.
336
336
  */
337
- "aria-hidden"?: Booleanish$1 | undefined;
337
+ "aria-hidden"?: Booleanish | undefined;
338
338
  /**
339
339
  * Indicates the entered value does not conform to the format expected by the application.
340
340
  * @see aria-errormessage.
@@ -357,11 +357,11 @@ declare namespace JSX {
357
357
  /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */
358
358
  "aria-live"?: "off" | "assertive" | "polite" | undefined;
359
359
  /** Indicates whether an element is modal when displayed. */
360
- "aria-modal"?: Booleanish$1 | undefined;
360
+ "aria-modal"?: Booleanish | undefined;
361
361
  /** Indicates whether a text box accepts multiple lines of input or only a single line. */
362
- "aria-multiline"?: Booleanish$1 | undefined;
362
+ "aria-multiline"?: Booleanish | undefined;
363
363
  /** Indicates that the user may select more than one item from the current selectable descendants. */
364
- "aria-multiselectable"?: Booleanish$1 | undefined;
364
+ "aria-multiselectable"?: Booleanish | undefined;
365
365
  /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */
366
366
  "aria-orientation"?: "horizontal" | "vertical" | undefined;
367
367
  /**
@@ -389,14 +389,14 @@ declare namespace JSX {
389
389
  * Indicates that the element is not editable, but is otherwise operable.
390
390
  * @see aria-disabled.
391
391
  */
392
- "aria-readonly"?: Booleanish$1 | undefined;
392
+ "aria-readonly"?: Booleanish | undefined;
393
393
  /**
394
394
  * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
395
395
  * @see aria-atomic.
396
396
  */
397
397
  "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
398
398
  /** Indicates that user input is required on the element before a form may be submitted. */
399
- "aria-required"?: Booleanish$1 | undefined;
399
+ "aria-required"?: Booleanish | undefined;
400
400
  /** Defines a human-readable, author-localized description for the role of an element. */
401
401
  "aria-roledescription"?: string | undefined;
402
402
  /**
@@ -418,7 +418,7 @@ declare namespace JSX {
418
418
  * Indicates the current "selected" state of various widgets.
419
419
  * @see aria-checked @see aria-pressed.
420
420
  */
421
- "aria-selected"?: Booleanish$1 | undefined;
421
+ "aria-selected"?: Booleanish | undefined;
422
422
  /**
423
423
  * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
424
424
  * @see aria-posinset.
@@ -446,16 +446,16 @@ declare namespace JSX {
446
446
  suppressHydrationWarning?: boolean | undefined;
447
447
  accessKey?: string | undefined;
448
448
  className?: string | undefined;
449
- contentEditable?: Booleanish$1 | "inherit" | undefined;
449
+ contentEditable?: Booleanish | "inherit" | undefined;
450
450
  contextMenu?: string | undefined;
451
451
  dir?: string | undefined;
452
- draggable?: Booleanish$1 | undefined;
452
+ draggable?: Booleanish | undefined;
453
453
  hidden?: boolean | undefined;
454
454
  id?: string | undefined;
455
455
  lang?: string | undefined;
456
456
  placeholder?: string | undefined;
457
457
  slot?: string | undefined;
458
- spellCheck?: Booleanish$1 | undefined;
458
+ spellCheck?: Booleanish | undefined;
459
459
  style?: CSSProperties | undefined;
460
460
  tabIndex?: number | undefined;
461
461
  title?: string | undefined;
@@ -1022,7 +1022,7 @@ declare namespace JSX {
1022
1022
  ascent?: number | string | undefined;
1023
1023
  attributeName?: string | undefined;
1024
1024
  attributeType?: string | undefined;
1025
- autoReverse?: Booleanish$1 | undefined;
1025
+ autoReverse?: Booleanish | undefined;
1026
1026
  azimuth?: number | string | undefined;
1027
1027
  baseFrequency?: number | string | undefined;
1028
1028
  baselineShift?: number | string | undefined;
@@ -1062,7 +1062,7 @@ declare namespace JSX {
1062
1062
  enableBackground?: number | string | undefined;
1063
1063
  end?: number | string | undefined;
1064
1064
  exponent?: number | string | undefined;
1065
- externalResourcesRequired?: Booleanish$1 | undefined;
1065
+ externalResourcesRequired?: Booleanish | undefined;
1066
1066
  fill?: string | undefined;
1067
1067
  fillOpacity?: number | string | undefined;
1068
1068
  fillRule?: "nonzero" | "evenodd" | "inherit" | undefined;
@@ -1071,7 +1071,7 @@ declare namespace JSX {
1071
1071
  filterUnits?: number | string | undefined;
1072
1072
  floodColor?: number | string | undefined;
1073
1073
  floodOpacity?: number | string | undefined;
1074
- focusable?: Booleanish$1 | "auto" | undefined;
1074
+ focusable?: Booleanish | "auto" | undefined;
1075
1075
  fontFamily?: string | undefined;
1076
1076
  fontSize?: number | string | undefined;
1077
1077
  fontSizeAdjust?: number | string | undefined;
@@ -1151,7 +1151,7 @@ declare namespace JSX {
1151
1151
  pointsAtX?: number | string | undefined;
1152
1152
  pointsAtY?: number | string | undefined;
1153
1153
  pointsAtZ?: number | string | undefined;
1154
- preserveAlpha?: Booleanish$1 | undefined;
1154
+ preserveAlpha?: Booleanish | undefined;
1155
1155
  preserveAspectRatio?: string | undefined;
1156
1156
  primitiveUnits?: number | string | undefined;
1157
1157
  r?: number | string | undefined;
@@ -1378,25 +1378,26 @@ declare namespace JSX {
1378
1378
  }
1379
1379
 
1380
1380
  type Dict<T = any> = Record<string, T>;
1381
- type Booleanish = boolean | "true" | "false";
1382
1381
  type DataAttr = {
1383
- "data-selected"?: Booleanish;
1384
- "data-expanded"?: Booleanish;
1385
- "data-highlighted"?: Booleanish;
1386
- "data-readonly"?: Booleanish;
1387
- "data-indeterminate"?: Booleanish;
1388
- "data-invalid"?: Booleanish;
1389
- "data-hover"?: Booleanish;
1390
- "data-active"?: Booleanish;
1391
- "data-focus"?: Booleanish;
1392
- "data-disabled"?: Booleanish;
1393
- "data-open"?: Booleanish;
1394
- "data-checked"?: Booleanish;
1395
- "data-pressed"?: Booleanish;
1396
- "data-complete"?: Booleanish;
1397
- "data-empty"?: Booleanish;
1398
- "data-placeholder-shown"?: Booleanish;
1399
- "data-half"?: Booleanish;
1382
+ "data-selected"?: any;
1383
+ "data-expanded"?: any;
1384
+ "data-highlighted"?: any;
1385
+ "data-readonly"?: any;
1386
+ "data-indeterminate"?: any;
1387
+ "data-invalid"?: any;
1388
+ "data-hover"?: any;
1389
+ "data-active"?: any;
1390
+ "data-focus"?: any;
1391
+ "data-disabled"?: any;
1392
+ "data-open"?: any;
1393
+ "data-checked"?: any;
1394
+ "data-pressed"?: any;
1395
+ "data-complete"?: any;
1396
+ "data-side"?: any;
1397
+ "data-align"?: any;
1398
+ "data-empty"?: any;
1399
+ "data-placeholder-shown"?: any;
1400
+ "data-half"?: any;
1400
1401
  "data-scope"?: string;
1401
1402
  "data-uid"?: string;
1402
1403
  "data-name"?: string;
@@ -1413,7 +1414,7 @@ type DataAttr = {
1413
1414
  "data-count"?: number;
1414
1415
  "data-index"?: number;
1415
1416
  } & {
1416
- [key in `data-${string}`]?: string | number | Booleanish;
1417
+ [key in `data-${string}`]?: any;
1417
1418
  };
1418
1419
  type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "textarea" | "img" | "output" | "element" | "select" | "style" | "circle" | "svg" | "path", T>;
1419
1420
  type NormalizeProps<T extends PropTypes> = {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/prop-types.ts","../src/create-props.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 type Style = JSX.CSSProperties\n\nexport * from \"./prop-types\"\nexport type { JSX }\nexport * from \"./create-props\"\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\"\n | \"label\"\n | \"input\"\n | \"textarea\"\n | \"img\"\n | \"output\"\n | \"element\"\n | \"select\"\n | \"style\"\n | \"circle\"\n | \"svg\"\n | \"path\",\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}\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","type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]\n ? [keyof T] extends [K[number]]\n ? unknown\n : `Missing required keys: ${Exclude<keyof T, K[number]>}`\n : never\n\nexport const createProps =\n <T extends Record<never, never>>() =>\n <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>\n Array.from(new Set(props))\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqEO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;;;ACrEO,IAAM,cACX,MACA,CAAwB,UACtB,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/prop-types.ts","../src/create-props.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 type Style = JSX.CSSProperties\n\nexport * from \"./prop-types\"\nexport type { JSX }\nexport * from \"./create-props\"\n","import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype DataAttr = {\n \"data-selected\"?: any\n \"data-expanded\"?: any\n \"data-highlighted\"?: any\n \"data-readonly\"?: any\n \"data-indeterminate\"?: any\n \"data-invalid\"?: any\n \"data-hover\"?: any\n \"data-active\"?: any\n \"data-focus\"?: any\n \"data-disabled\"?: any\n \"data-open\"?: any\n \"data-checked\"?: any\n \"data-pressed\"?: any\n \"data-complete\"?: any\n \"data-side\"?: any\n \"data-align\"?: any\n \"data-empty\"?: any\n \"data-placeholder-shown\"?: any\n \"data-half\"?: any\n \"data-scope\"?: string\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 \"data-orientation\"?: \"horizontal\" | \"vertical\"\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: any\n}\n\nexport type PropTypes<T = Dict> = Record<\n | \"button\"\n | \"label\"\n | \"input\"\n | \"textarea\"\n | \"img\"\n | \"output\"\n | \"element\"\n | \"select\"\n | \"style\"\n | \"circle\"\n | \"svg\"\n | \"path\",\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}\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","type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]\n ? [keyof T] extends [K[number]]\n ? unknown\n : `Missing required keys: ${Exclude<keyof T, K[number]>}`\n : never\n\nexport const createProps =\n <T extends Record<never, never>>() =>\n <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>\n Array.from(new Set(props))\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkEO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;;;AClEO,IAAM,cACX,MACA,CAAwB,UACtB,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/prop-types.ts","../src/create-props.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\"\n | \"label\"\n | \"input\"\n | \"textarea\"\n | \"img\"\n | \"output\"\n | \"element\"\n | \"select\"\n | \"style\"\n | \"circle\"\n | \"svg\"\n | \"path\",\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}\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","type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]\n ? [keyof T] extends [K[number]]\n ? unknown\n : `Missing required keys: ${Exclude<keyof T, K[number]>}`\n : never\n\nexport const createProps =\n <T extends Record<never, never>>() =>\n <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>\n Array.from(new Set(props))\n"],"mappings":";AAqEO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;;;ACrEO,IAAM,cACX,MACA,CAAwB,UACtB,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/prop-types.ts","../src/create-props.ts"],"sourcesContent":["import type { JSX } from \"./jsx\"\n\ntype Dict<T = any> = Record<string, T>\n\ntype DataAttr = {\n \"data-selected\"?: any\n \"data-expanded\"?: any\n \"data-highlighted\"?: any\n \"data-readonly\"?: any\n \"data-indeterminate\"?: any\n \"data-invalid\"?: any\n \"data-hover\"?: any\n \"data-active\"?: any\n \"data-focus\"?: any\n \"data-disabled\"?: any\n \"data-open\"?: any\n \"data-checked\"?: any\n \"data-pressed\"?: any\n \"data-complete\"?: any\n \"data-side\"?: any\n \"data-align\"?: any\n \"data-empty\"?: any\n \"data-placeholder-shown\"?: any\n \"data-half\"?: any\n \"data-scope\"?: string\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 \"data-orientation\"?: \"horizontal\" | \"vertical\"\n \"data-count\"?: number\n \"data-index\"?: number\n} & {\n [key in `data-${string}`]?: any\n}\n\nexport type PropTypes<T = Dict> = Record<\n | \"button\"\n | \"label\"\n | \"input\"\n | \"textarea\"\n | \"img\"\n | \"output\"\n | \"element\"\n | \"select\"\n | \"style\"\n | \"circle\"\n | \"svg\"\n | \"path\",\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}\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","type StrictKeys<K extends (keyof T)[], T> = K extends (keyof T)[]\n ? [keyof T] extends [K[number]]\n ? unknown\n : `Missing required keys: ${Exclude<keyof T, K[number]>}`\n : never\n\nexport const createProps =\n <T extends Record<never, never>>() =>\n <K extends (keyof T)[]>(props: K & StrictKeys<K, T>) =>\n Array.from(new Set(props))\n"],"mappings":";AAkEO,SAAS,iBAAsC,IAA8C;AAClG,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,MAAM;AACJ,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;;;AClEO,IAAM,cACX,MACA,CAAwB,UACtB,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/types",
3
- "version": "0.0.0-dev-20240410000101",
3
+ "version": "0.0.0-dev-20240412181302",
4
4
  "keywords": [
5
5
  "js",
6
6
  "utils",
package/src/prop-types.ts CHANGED
@@ -2,28 +2,27 @@ import type { JSX } from "./jsx"
2
2
 
3
3
  type Dict<T = any> = Record<string, T>
4
4
 
5
- type Booleanish = boolean | "true" | "false"
6
-
7
5
  type DataAttr = {
8
- "data-selected"?: Booleanish
9
- "data-expanded"?: Booleanish
10
- "data-highlighted"?: Booleanish
11
- "data-readonly"?: Booleanish
12
- "data-indeterminate"?: Booleanish
13
- "data-invalid"?: Booleanish
14
- "data-hover"?: Booleanish
15
- "data-active"?: Booleanish
16
- "data-focus"?: Booleanish
17
- "data-disabled"?: Booleanish
18
- "data-open"?: Booleanish
19
- "data-checked"?: Booleanish
20
- "data-pressed"?: Booleanish
21
- "data-complete"?: Booleanish
22
- "data-empty"?: Booleanish
23
- "data-placeholder-shown"?: Booleanish
24
- "data-half"?: Booleanish
6
+ "data-selected"?: any
7
+ "data-expanded"?: any
8
+ "data-highlighted"?: any
9
+ "data-readonly"?: any
10
+ "data-indeterminate"?: any
11
+ "data-invalid"?: any
12
+ "data-hover"?: any
13
+ "data-active"?: any
14
+ "data-focus"?: any
15
+ "data-disabled"?: any
16
+ "data-open"?: any
17
+ "data-checked"?: any
18
+ "data-pressed"?: any
19
+ "data-complete"?: any
20
+ "data-side"?: any
21
+ "data-align"?: any
22
+ "data-empty"?: any
23
+ "data-placeholder-shown"?: any
24
+ "data-half"?: any
25
25
  "data-scope"?: string
26
-
27
26
  "data-uid"?: string
28
27
  "data-name"?: string
29
28
  "data-ownedby"?: string
@@ -35,13 +34,11 @@ type DataAttr = {
35
34
  "data-label"?: string
36
35
  "data-state"?: string | null
37
36
  "data-value"?: string | number
38
-
39
37
  "data-orientation"?: "horizontal" | "vertical"
40
-
41
38
  "data-count"?: number
42
39
  "data-index"?: number
43
40
  } & {
44
- [key in `data-${string}`]?: string | number | Booleanish
41
+ [key in `data-${string}`]?: any
45
42
  }
46
43
 
47
44
  export type PropTypes<T = Dict> = Record<