@zag-js/types 0.44.0 → 0.46.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/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;
@@ -992,6 +992,268 @@ declare namespace JSX {
992
992
  disablePictureInPicture?: boolean | undefined;
993
993
  disableRemotePlayback?: boolean | undefined;
994
994
  }
995
+ export interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
996
+ suppressHydrationWarning?: boolean | undefined;
997
+ className?: string | undefined;
998
+ color?: string | undefined;
999
+ height?: number | string | undefined;
1000
+ id?: string | undefined;
1001
+ lang?: string | undefined;
1002
+ max?: number | string | undefined;
1003
+ media?: string | undefined;
1004
+ method?: string | undefined;
1005
+ min?: number | string | undefined;
1006
+ name?: string | undefined;
1007
+ style?: CSSProperties | undefined;
1008
+ target?: string | undefined;
1009
+ type?: string | undefined;
1010
+ width?: number | string | undefined;
1011
+ role?: AriaRole | undefined;
1012
+ tabIndex?: number | undefined;
1013
+ crossOrigin?: any;
1014
+ accentHeight?: number | string | undefined;
1015
+ accumulate?: "none" | "sum" | undefined;
1016
+ additive?: "replace" | "sum" | undefined;
1017
+ alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit" | undefined;
1018
+ allowReorder?: "no" | "yes" | undefined;
1019
+ alphabetic?: number | string | undefined;
1020
+ amplitude?: number | string | undefined;
1021
+ arabicForm?: "initial" | "medial" | "terminal" | "isolated" | undefined;
1022
+ ascent?: number | string | undefined;
1023
+ attributeName?: string | undefined;
1024
+ attributeType?: string | undefined;
1025
+ autoReverse?: Booleanish | undefined;
1026
+ azimuth?: number | string | undefined;
1027
+ baseFrequency?: number | string | undefined;
1028
+ baselineShift?: number | string | undefined;
1029
+ baseProfile?: number | string | undefined;
1030
+ bbox?: number | string | undefined;
1031
+ begin?: number | string | undefined;
1032
+ bias?: number | string | undefined;
1033
+ by?: number | string | undefined;
1034
+ calcMode?: number | string | undefined;
1035
+ capHeight?: number | string | undefined;
1036
+ clip?: number | string | undefined;
1037
+ clipPath?: string | undefined;
1038
+ clipPathUnits?: number | string | undefined;
1039
+ clipRule?: number | string | undefined;
1040
+ colorInterpolation?: number | string | undefined;
1041
+ colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit" | undefined;
1042
+ colorProfile?: number | string | undefined;
1043
+ colorRendering?: number | string | undefined;
1044
+ contentScriptType?: number | string | undefined;
1045
+ contentStyleType?: number | string | undefined;
1046
+ cursor?: number | string | undefined;
1047
+ cx?: number | string | undefined;
1048
+ cy?: number | string | undefined;
1049
+ d?: string | undefined;
1050
+ decelerate?: number | string | undefined;
1051
+ descent?: number | string | undefined;
1052
+ diffuseConstant?: number | string | undefined;
1053
+ direction?: number | string | undefined;
1054
+ display?: number | string | undefined;
1055
+ divisor?: number | string | undefined;
1056
+ dominantBaseline?: number | string | undefined;
1057
+ dur?: number | string | undefined;
1058
+ dx?: number | string | undefined;
1059
+ dy?: number | string | undefined;
1060
+ edgeMode?: number | string | undefined;
1061
+ elevation?: number | string | undefined;
1062
+ enableBackground?: number | string | undefined;
1063
+ end?: number | string | undefined;
1064
+ exponent?: number | string | undefined;
1065
+ externalResourcesRequired?: Booleanish | undefined;
1066
+ fill?: string | undefined;
1067
+ fillOpacity?: number | string | undefined;
1068
+ fillRule?: "nonzero" | "evenodd" | "inherit" | undefined;
1069
+ filter?: string | undefined;
1070
+ filterRes?: number | string | undefined;
1071
+ filterUnits?: number | string | undefined;
1072
+ floodColor?: number | string | undefined;
1073
+ floodOpacity?: number | string | undefined;
1074
+ focusable?: Booleanish | "auto" | undefined;
1075
+ fontFamily?: string | undefined;
1076
+ fontSize?: number | string | undefined;
1077
+ fontSizeAdjust?: number | string | undefined;
1078
+ fontStretch?: number | string | undefined;
1079
+ fontStyle?: number | string | undefined;
1080
+ fontVariant?: number | string | undefined;
1081
+ fontWeight?: number | string | undefined;
1082
+ format?: number | string | undefined;
1083
+ fr?: number | string | undefined;
1084
+ from?: number | string | undefined;
1085
+ fx?: number | string | undefined;
1086
+ fy?: number | string | undefined;
1087
+ g1?: number | string | undefined;
1088
+ g2?: number | string | undefined;
1089
+ glyphName?: number | string | undefined;
1090
+ glyphOrientationHorizontal?: number | string | undefined;
1091
+ glyphOrientationVertical?: number | string | undefined;
1092
+ glyphRef?: number | string | undefined;
1093
+ gradientTransform?: string | undefined;
1094
+ gradientUnits?: string | undefined;
1095
+ hanging?: number | string | undefined;
1096
+ horizAdvX?: number | string | undefined;
1097
+ horizOriginX?: number | string | undefined;
1098
+ href?: string | undefined;
1099
+ ideographic?: number | string | undefined;
1100
+ imageRendering?: number | string | undefined;
1101
+ in2?: number | string | undefined;
1102
+ in?: string | undefined;
1103
+ intercept?: number | string | undefined;
1104
+ k1?: number | string | undefined;
1105
+ k2?: number | string | undefined;
1106
+ k3?: number | string | undefined;
1107
+ k4?: number | string | undefined;
1108
+ k?: number | string | undefined;
1109
+ kernelMatrix?: number | string | undefined;
1110
+ kernelUnitLength?: number | string | undefined;
1111
+ kerning?: number | string | undefined;
1112
+ keyPoints?: number | string | undefined;
1113
+ keySplines?: number | string | undefined;
1114
+ keyTimes?: number | string | undefined;
1115
+ lengthAdjust?: number | string | undefined;
1116
+ letterSpacing?: number | string | undefined;
1117
+ lightingColor?: number | string | undefined;
1118
+ limitingConeAngle?: number | string | undefined;
1119
+ local?: number | string | undefined;
1120
+ markerEnd?: string | undefined;
1121
+ markerHeight?: number | string | undefined;
1122
+ markerMid?: string | undefined;
1123
+ markerStart?: string | undefined;
1124
+ markerUnits?: number | string | undefined;
1125
+ markerWidth?: number | string | undefined;
1126
+ mask?: string | undefined;
1127
+ maskContentUnits?: number | string | undefined;
1128
+ maskUnits?: number | string | undefined;
1129
+ mathematical?: number | string | undefined;
1130
+ mode?: number | string | undefined;
1131
+ numOctaves?: number | string | undefined;
1132
+ offset?: number | string | undefined;
1133
+ opacity?: number | string | undefined;
1134
+ operator?: number | string | undefined;
1135
+ order?: number | string | undefined;
1136
+ orient?: number | string | undefined;
1137
+ orientation?: number | string | undefined;
1138
+ origin?: number | string | undefined;
1139
+ overflow?: number | string | undefined;
1140
+ overlinePosition?: number | string | undefined;
1141
+ overlineThickness?: number | string | undefined;
1142
+ paintOrder?: number | string | undefined;
1143
+ panose1?: number | string | undefined;
1144
+ path?: string | undefined;
1145
+ pathLength?: number | string | undefined;
1146
+ patternContentUnits?: string | undefined;
1147
+ patternTransform?: number | string | undefined;
1148
+ patternUnits?: string | undefined;
1149
+ pointerEvents?: number | string | undefined;
1150
+ points?: string | undefined;
1151
+ pointsAtX?: number | string | undefined;
1152
+ pointsAtY?: number | string | undefined;
1153
+ pointsAtZ?: number | string | undefined;
1154
+ preserveAlpha?: Booleanish | undefined;
1155
+ preserveAspectRatio?: string | undefined;
1156
+ primitiveUnits?: number | string | undefined;
1157
+ r?: number | string | undefined;
1158
+ radius?: number | string | undefined;
1159
+ refX?: number | string | undefined;
1160
+ refY?: number | string | undefined;
1161
+ renderingIntent?: number | string | undefined;
1162
+ repeatCount?: number | string | undefined;
1163
+ repeatDur?: number | string | undefined;
1164
+ requiredExtensions?: number | string | undefined;
1165
+ requiredFeatures?: number | string | undefined;
1166
+ restart?: number | string | undefined;
1167
+ result?: string | undefined;
1168
+ rotate?: number | string | undefined;
1169
+ rx?: number | string | undefined;
1170
+ ry?: number | string | undefined;
1171
+ scale?: number | string | undefined;
1172
+ seed?: number | string | undefined;
1173
+ shapeRendering?: number | string | undefined;
1174
+ slope?: number | string | undefined;
1175
+ spacing?: number | string | undefined;
1176
+ specularConstant?: number | string | undefined;
1177
+ specularExponent?: number | string | undefined;
1178
+ speed?: number | string | undefined;
1179
+ spreadMethod?: string | undefined;
1180
+ startOffset?: number | string | undefined;
1181
+ stdDeviation?: number | string | undefined;
1182
+ stemh?: number | string | undefined;
1183
+ stemv?: number | string | undefined;
1184
+ stitchTiles?: number | string | undefined;
1185
+ stopColor?: string | undefined;
1186
+ stopOpacity?: number | string | undefined;
1187
+ strikethroughPosition?: number | string | undefined;
1188
+ strikethroughThickness?: number | string | undefined;
1189
+ string?: number | string | undefined;
1190
+ stroke?: string | undefined;
1191
+ strokeDasharray?: string | number | undefined;
1192
+ strokeDashoffset?: string | number | undefined;
1193
+ strokeLinecap?: "butt" | "round" | "square" | "inherit" | undefined;
1194
+ strokeLinejoin?: "miter" | "round" | "bevel" | "inherit" | undefined;
1195
+ strokeMiterlimit?: number | string | undefined;
1196
+ strokeOpacity?: number | string | undefined;
1197
+ strokeWidth?: number | string | undefined;
1198
+ surfaceScale?: number | string | undefined;
1199
+ systemLanguage?: number | string | undefined;
1200
+ tableValues?: number | string | undefined;
1201
+ targetX?: number | string | undefined;
1202
+ targetY?: number | string | undefined;
1203
+ textAnchor?: string | undefined;
1204
+ textDecoration?: number | string | undefined;
1205
+ textLength?: number | string | undefined;
1206
+ textRendering?: number | string | undefined;
1207
+ to?: number | string | undefined;
1208
+ transform?: string | undefined;
1209
+ u1?: number | string | undefined;
1210
+ u2?: number | string | undefined;
1211
+ underlinePosition?: number | string | undefined;
1212
+ underlineThickness?: number | string | undefined;
1213
+ unicode?: number | string | undefined;
1214
+ unicodeBidi?: number | string | undefined;
1215
+ unicodeRange?: number | string | undefined;
1216
+ unitsPerEm?: number | string | undefined;
1217
+ vAlphabetic?: number | string | undefined;
1218
+ values?: string | undefined;
1219
+ vectorEffect?: number | string | undefined;
1220
+ version?: string | undefined;
1221
+ vertAdvY?: number | string | undefined;
1222
+ vertOriginX?: number | string | undefined;
1223
+ vertOriginY?: number | string | undefined;
1224
+ vHanging?: number | string | undefined;
1225
+ vIdeographic?: number | string | undefined;
1226
+ viewBox?: string | undefined;
1227
+ viewTarget?: number | string | undefined;
1228
+ visibility?: number | string | undefined;
1229
+ vMathematical?: number | string | undefined;
1230
+ widths?: number | string | undefined;
1231
+ wordSpacing?: number | string | undefined;
1232
+ writingMode?: number | string | undefined;
1233
+ x1?: number | string | undefined;
1234
+ x2?: number | string | undefined;
1235
+ x?: number | string | undefined;
1236
+ xChannelSelector?: string | undefined;
1237
+ xHeight?: number | string | undefined;
1238
+ xlinkActuate?: string | undefined;
1239
+ xlinkArcrole?: string | undefined;
1240
+ xlinkHref?: string | undefined;
1241
+ xlinkRole?: string | undefined;
1242
+ xlinkShow?: string | undefined;
1243
+ xlinkTitle?: string | undefined;
1244
+ xlinkType?: string | undefined;
1245
+ xmlBase?: string | undefined;
1246
+ xmlLang?: string | undefined;
1247
+ xmlns?: string | undefined;
1248
+ xmlnsXlink?: string | undefined;
1249
+ xmlSpace?: string | undefined;
1250
+ y1?: number | string | undefined;
1251
+ y2?: number | string | undefined;
1252
+ y?: number | string | undefined;
1253
+ yChannelSelector?: string | undefined;
1254
+ z?: number | string | undefined;
1255
+ zoomAndPan?: string | undefined;
1256
+ }
995
1257
  export interface IntrinsicElements {
996
1258
  a: AnchorHTMLAttributes<HTMLAnchorElement>;
997
1259
  abbr: HTMLAttributes<HTMLElement>;
@@ -1108,30 +1370,34 @@ declare namespace JSX {
1108
1370
  ul: HTMLAttributes<HTMLUListElement>;
1109
1371
  var: HTMLAttributes<HTMLElement>;
1110
1372
  video: VideoHTMLAttributes<HTMLVideoElement>;
1373
+ svg: SVGAttributes<SVGSVGElement>;
1374
+ circle: SVGAttributes<SVGCircleElement>;
1375
+ path: SVGAttributes<SVGPathElement>;
1111
1376
  }
1112
1377
  export { };
1113
1378
  }
1114
1379
 
1115
1380
  type Dict<T = any> = Record<string, T>;
1116
- type Booleanish = boolean | "true" | "false";
1117
1381
  type DataAttr = {
1118
- "data-selected"?: Booleanish;
1119
- "data-expanded"?: Booleanish;
1120
- "data-highlighted"?: Booleanish;
1121
- "data-readonly"?: Booleanish;
1122
- "data-indeterminate"?: Booleanish;
1123
- "data-invalid"?: Booleanish;
1124
- "data-hover"?: Booleanish;
1125
- "data-active"?: Booleanish;
1126
- "data-focus"?: Booleanish;
1127
- "data-disabled"?: Booleanish;
1128
- "data-open"?: Booleanish;
1129
- "data-checked"?: Booleanish;
1130
- "data-pressed"?: Booleanish;
1131
- "data-complete"?: Booleanish;
1132
- "data-empty"?: Booleanish;
1133
- "data-placeholder-shown"?: Booleanish;
1134
- "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;
1135
1401
  "data-scope"?: string;
1136
1402
  "data-uid"?: string;
1137
1403
  "data-name"?: string;
@@ -1148,9 +1414,9 @@ type DataAttr = {
1148
1414
  "data-count"?: number;
1149
1415
  "data-index"?: number;
1150
1416
  } & {
1151
- [key in `data-${string}`]?: string | number | Booleanish;
1417
+ [key in `data-${string}`]?: any;
1152
1418
  };
1153
- type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "textarea" | "img" | "output" | "element" | "select" | "style" | "circle" | "svg", T>;
1419
+ type PropTypes<T = Dict> = Record<"button" | "label" | "input" | "textarea" | "img" | "output" | "element" | "select" | "style" | "circle" | "svg" | "path", T>;
1154
1420
  type NormalizeProps<T extends PropTypes> = {
1155
1421
  [K in keyof T]: (props: K extends keyof JSX.IntrinsicElements ? DataAttr & JSX.IntrinsicElements[K] : never) => T[K];
1156
1422
  } & {