@ariakit/test 0.3.16 → 0.4.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/cjs/__chunks/{2PZMNP6W.cjs → 4TS37S3Q.cjs} +27 -30
  3. package/cjs/__chunks/{LG7B6NOG.cjs → 6LDGWG7T.cjs} +2 -2
  4. package/cjs/__chunks/{CYMYDRLS.cjs → 6UE2XSIU.cjs} +8 -11
  5. package/cjs/__chunks/AGLSU3Q2.cjs +68 -0
  6. package/cjs/__chunks/{BXOTZFAK.cjs → AV5N3TNH.cjs} +7 -14
  7. package/cjs/__chunks/{VD3ERVOF.cjs → ELVRZW56.cjs} +3 -3
  8. package/cjs/__chunks/{7KITCMSC.cjs → GFFCFEOC.cjs} +12 -13
  9. package/cjs/__chunks/{IL4UOQ5U.cjs → JFCVJ4KU.cjs} +20 -24
  10. package/cjs/__chunks/{BIB7E6LN.cjs → KRKGFFBK.cjs} +10 -16
  11. package/cjs/__chunks/{QCXNVFD7.cjs → LJ2IERQF.cjs} +8 -10
  12. package/cjs/__chunks/{IZ5UGCXW.cjs → QOXIFOCW.cjs} +2 -2
  13. package/cjs/__chunks/{ZNASNKOZ.cjs → QRXZHH5L.cjs} +22 -29
  14. package/cjs/__chunks/{DJWEA66K.cjs → RKZYK2KK.cjs} +30 -34
  15. package/cjs/__chunks/WO6I3N3U.cjs +20 -0
  16. package/cjs/__chunks/{IZMYJH6V.cjs → Z3RYFL2T.cjs} +7 -9
  17. package/cjs/blur.cjs +5 -5
  18. package/cjs/click.cjs +11 -11
  19. package/cjs/dispatch.cjs +4 -4
  20. package/cjs/focus.cjs +5 -5
  21. package/cjs/hover.cjs +6 -6
  22. package/cjs/index.cjs +17 -17
  23. package/cjs/mouse-down.cjs +7 -7
  24. package/cjs/mouse-up.cjs +5 -5
  25. package/cjs/playwright.cjs +2 -2
  26. package/cjs/press.cjs +9 -9
  27. package/cjs/press.d.cts +15 -15
  28. package/cjs/press.d.ts +15 -15
  29. package/cjs/query.cjs +3 -3
  30. package/cjs/query.d.cts +33 -32
  31. package/cjs/query.d.ts +33 -32
  32. package/cjs/react.cjs +36 -26
  33. package/cjs/react.d.cts +4 -1
  34. package/cjs/react.d.ts +4 -1
  35. package/cjs/select.cjs +11 -11
  36. package/cjs/sleep.cjs +4 -4
  37. package/cjs/tap.cjs +12 -12
  38. package/cjs/type.cjs +7 -7
  39. package/cjs/wait-for.cjs +4 -4
  40. package/esm/__chunks/{YGSLLIRN.js → 2TPVB4MR.js} +6 -7
  41. package/esm/__chunks/{JIRMKL2I.js → 7NQ5CXYI.js} +1 -1
  42. package/esm/__chunks/{HKMYG3ZJ.js → DHZBG4QM.js} +11 -14
  43. package/esm/__chunks/{3EIGH73D.js → DZ24E43J.js} +1 -1
  44. package/esm/__chunks/{U5OPLWAZ.js → EMPG4BYT.js} +11 -15
  45. package/esm/__chunks/{6GDQHEBE.js → G32GEXRJ.js} +7 -13
  46. package/esm/__chunks/{7I2TICIC.js → HFG3HB6M.js} +7 -14
  47. package/esm/__chunks/{QE2YCTHV.js → HI4LQVNU.js} +5 -8
  48. package/esm/__chunks/{VD2VFA32.js → HO5N5GTX.js} +4 -6
  49. package/esm/__chunks/{64UIOMYC.js → NSFKY4TP.js} +1 -1
  50. package/esm/__chunks/{G2JU2LVB.js → SB7WYA2U.js} +1 -1
  51. package/esm/__chunks/{VVYOYAEF.js → UQRVXJ7Z.js} +13 -20
  52. package/esm/__chunks/{LRKW54RD.js → VMVRY4TL.js} +5 -6
  53. package/esm/__chunks/{DMIPXMWG.js → W46IR3LA.js} +11 -15
  54. package/esm/__chunks/{V36IYEJN.js → ZPXIP5WW.js} +5 -7
  55. package/esm/blur.js +4 -4
  56. package/esm/click.js +10 -10
  57. package/esm/dispatch.js +3 -3
  58. package/esm/focus.js +4 -4
  59. package/esm/hover.js +5 -5
  60. package/esm/index.js +16 -16
  61. package/esm/mouse-down.js +6 -6
  62. package/esm/mouse-up.js +4 -4
  63. package/esm/playwright.js +1 -1
  64. package/esm/press.d.ts +15 -15
  65. package/esm/press.js +8 -8
  66. package/esm/query.d.ts +33 -32
  67. package/esm/query.js +2 -2
  68. package/esm/react.d.ts +4 -1
  69. package/esm/react.js +34 -24
  70. package/esm/select.js +10 -10
  71. package/esm/sleep.js +3 -3
  72. package/esm/tap.js +11 -11
  73. package/esm/type.js +6 -6
  74. package/esm/wait-for.js +3 -3
  75. package/package.json +3 -3
  76. package/readme.md +18 -0
  77. package/cjs/__chunks/HQ3KUD6F.cjs +0 -20
  78. package/cjs/__chunks/UWCNB4SR.cjs +0 -69
  79. /package/cjs/__chunks/{OVN5OYWK.cjs → DOXEES2I.cjs} +0 -0
  80. /package/esm/__chunks/{Q65FZOE2.js → SM5ASDQ3.js} +0 -0
@@ -1,19 +1,19 @@
1
1
  "use client";
2
2
  import {
3
3
  blur
4
- } from "./QE2YCTHV.js";
4
+ } from "./HI4LQVNU.js";
5
5
  import {
6
6
  focus
7
- } from "./VD2VFA32.js";
7
+ } from "./HO5N5GTX.js";
8
8
  import {
9
9
  dispatch
10
- } from "./JIRMKL2I.js";
10
+ } from "./7NQ5CXYI.js";
11
11
  import {
12
12
  wrapAsync
13
- } from "./7I2TICIC.js";
13
+ } from "./HFG3HB6M.js";
14
14
  import {
15
15
  __spreadValues
16
- } from "./Q65FZOE2.js";
16
+ } from "./SM5ASDQ3.js";
17
17
 
18
18
  // src/mouse-down.ts
19
19
  import { getDocument, isVisible } from "@ariakit/core/utils/dom";
@@ -22,8 +22,7 @@ import { invariant } from "@ariakit/core/utils/misc";
22
22
  function mouseDown(element, options) {
23
23
  return wrapAsync(async () => {
24
24
  invariant(element, "Unable to mouseDown on null element");
25
- if (!isVisible(element))
26
- return;
25
+ if (!isVisible(element)) return;
27
26
  const { disabled } = element;
28
27
  let defaultAllowed = await dispatch.pointerDown(element, options);
29
28
  if (!disabled) {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  flushMicrotasks,
4
4
  wrapAsync
5
- } from "./7I2TICIC.js";
5
+ } from "./HFG3HB6M.js";
6
6
 
7
7
  // src/dispatch.ts
8
8
  import { getKeys, invariant } from "@ariakit/core/utils/misc";
@@ -1,28 +1,28 @@
1
1
  "use client";
2
2
  import {
3
3
  mouseUp
4
- } from "./V36IYEJN.js";
4
+ } from "./ZPXIP5WW.js";
5
5
  import {
6
6
  mouseDown
7
- } from "./YGSLLIRN.js";
7
+ } from "./2TPVB4MR.js";
8
8
  import {
9
9
  hover
10
- } from "./LRKW54RD.js";
10
+ } from "./VMVRY4TL.js";
11
11
  import {
12
12
  focus
13
- } from "./VD2VFA32.js";
13
+ } from "./HO5N5GTX.js";
14
14
  import {
15
15
  dispatch
16
- } from "./JIRMKL2I.js";
16
+ } from "./7NQ5CXYI.js";
17
17
  import {
18
18
  sleep
19
- } from "./3EIGH73D.js";
19
+ } from "./DZ24E43J.js";
20
20
  import {
21
21
  wrapAsync
22
- } from "./7I2TICIC.js";
22
+ } from "./HFG3HB6M.js";
23
23
  import {
24
24
  __spreadValues
25
- } from "./Q65FZOE2.js";
25
+ } from "./SM5ASDQ3.js";
26
26
 
27
27
  // src/click.ts
28
28
  import { isVisible } from "@ariakit/core/utils/dom";
@@ -105,13 +105,11 @@ async function clickOption(element, eventOptions) {
105
105
  function click(element, options, tap = false) {
106
106
  return wrapAsync(async () => {
107
107
  invariant(element, "Unable to click on null element");
108
- if (!isVisible(element))
109
- return;
108
+ if (!isVisible(element)) return;
110
109
  await hover(element, options);
111
110
  await mouseDown(element, options);
112
111
  while (!isVisible(element)) {
113
- if (!element.parentElement)
114
- return;
112
+ if (!element.parentElement) return;
115
113
  element = element.parentElement;
116
114
  }
117
115
  if (!tap) {
@@ -119,8 +117,7 @@ function click(element, options, tap = false) {
119
117
  }
120
118
  await mouseUp(element, options);
121
119
  const { disabled } = element;
122
- if (disabled)
123
- return;
120
+ if (disabled) return;
124
121
  const label = getClosestLabel(element);
125
122
  if (label) {
126
123
  await clickLabel(label, __spreadValues({ detail: 1 }, options));
@@ -3,7 +3,7 @@ import {
3
3
  isBrowser,
4
4
  nextFrame,
5
5
  wrapAsync
6
- } from "./7I2TICIC.js";
6
+ } from "./HFG3HB6M.js";
7
7
 
8
8
  // src/sleep.ts
9
9
  var defaultMs = isBrowser ? 150 : 10;
@@ -1,25 +1,25 @@
1
1
  "use client";
2
2
  import {
3
3
  mouseUp
4
- } from "./V36IYEJN.js";
4
+ } from "./ZPXIP5WW.js";
5
5
  import {
6
6
  mouseDown
7
- } from "./YGSLLIRN.js";
7
+ } from "./2TPVB4MR.js";
8
8
  import {
9
9
  hover
10
- } from "./LRKW54RD.js";
10
+ } from "./VMVRY4TL.js";
11
11
  import {
12
12
  dispatch
13
- } from "./JIRMKL2I.js";
13
+ } from "./7NQ5CXYI.js";
14
14
  import {
15
15
  sleep
16
- } from "./3EIGH73D.js";
16
+ } from "./DZ24E43J.js";
17
17
  import {
18
18
  wrapAsync
19
- } from "./7I2TICIC.js";
19
+ } from "./HFG3HB6M.js";
20
20
  import {
21
21
  __spreadValues
22
- } from "./Q65FZOE2.js";
22
+ } from "./SM5ASDQ3.js";
23
23
 
24
24
  // src/select.ts
25
25
  import { isVisible } from "@ariakit/core/utils/dom";
@@ -28,8 +28,7 @@ function select(text, element = document.body, options) {
28
28
  return wrapAsync(async () => {
29
29
  var _a, _b;
30
30
  invariant(element, "Unable to select text on null element");
31
- if (!isVisible(element))
32
- return;
31
+ if (!isVisible(element)) return;
33
32
  const document2 = element.ownerDocument;
34
33
  await hover(element, options);
35
34
  await mouseDown(element, options);
@@ -60,11 +59,9 @@ function select(text, element = document.body, options) {
60
59
  let endOffset = -1;
61
60
  while (index >= 0 && index < endIndex && charCount < endIndex && (node = iterator.nextNode())) {
62
61
  const textContent = node.textContent;
63
- if (!textContent)
64
- continue;
62
+ if (!textContent) continue;
65
63
  charCount += textContent.length;
66
- if (index > charCount)
67
- continue;
64
+ if (index > charCount) continue;
68
65
  if (!startContainer) {
69
66
  startContainer = node;
70
67
  startOffset = index - charCount + textContent.length;
@@ -73,8 +70,7 @@ function select(text, element = document.body, options) {
73
70
  endOffset = endIndex - charCount + textContent.length;
74
71
  index++;
75
72
  }
76
- if (!startContainer || !endContainer)
77
- continue;
73
+ if (!startContainer || !endContainer) continue;
78
74
  await hover(element, options);
79
75
  range.setStart(startContainer, startOffset);
80
76
  range.setEnd(endContainer, endOffset);
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  __spreadProps,
7
7
  __spreadValues
8
- } from "./Q65FZOE2.js";
8
+ } from "./SM5ASDQ3.js";
9
9
 
10
10
  // src/query.ts
11
11
  import { invariant } from "@ariakit/core/utils/misc";
@@ -18,8 +18,7 @@ function createQueries(container = document.body) {
18
18
  }
19
19
  var documentQueries = createQueries();
20
20
  function matchName(name, accessibleName) {
21
- if (accessibleName == null)
22
- return false;
21
+ if (accessibleName == null) return false;
23
22
  if (typeof name === "string") {
24
23
  return accessibleName === name;
25
24
  }
@@ -27,22 +26,17 @@ function matchName(name, accessibleName) {
27
26
  }
28
27
  function getNameOption(name, includesHidden) {
29
28
  return (accessibleName, element) => {
30
- if (!includesHidden && element.closest("[inert]"))
31
- return false;
32
- if (!name)
33
- return true;
34
- if (matchName(name, accessibleName))
35
- return true;
36
- if (element.getAttribute("aria-label"))
37
- return false;
29
+ if (!includesHidden && element.closest("[inert]")) return false;
30
+ if (!name) return true;
31
+ if (matchName(name, accessibleName)) return true;
32
+ if (element.getAttribute("aria-label")) return false;
38
33
  const labeledBy = element.getAttribute("aria-labelledby");
39
34
  if (!labeledBy) {
40
35
  const content = "placeholder" in element && element.placeholder != null ? element.placeholder : element.textContent;
41
36
  return matchName(name, content);
42
37
  }
43
38
  const label = document.getElementById(labeledBy);
44
- if (!(label == null ? void 0 : label.textContent))
45
- return false;
39
+ if (!(label == null ? void 0 : label.textContent)) return false;
46
40
  return matchName(name, label.textContent);
47
41
  };
48
42
  }
@@ -22,30 +22,23 @@ function setActEnvironment(value) {
22
22
  return restoreActEnvironment;
23
23
  }
24
24
  function applyBrowserPolyfills() {
25
- if (isBrowser)
26
- return noop;
25
+ if (isBrowser) return noop;
27
26
  const originalFocus = HTMLElement.prototype.focus;
28
27
  HTMLElement.prototype.focus = function focus(options) {
29
- if (!isFocusable(this))
30
- return;
28
+ if (!isFocusable(this)) return;
31
29
  return originalFocus.call(this, options);
32
30
  };
33
31
  const originalGetClientRects = Element.prototype.getClientRects;
34
32
  Element.prototype.getClientRects = function getClientRects() {
35
33
  const isHidden = (element) => {
36
- if (!element.isConnected)
37
- return true;
38
- if (element.parentElement && isHidden(element.parentElement))
39
- return true;
40
- if (!(element instanceof HTMLElement))
41
- return false;
42
- if (element.hidden)
43
- return true;
34
+ if (!element.isConnected) return true;
35
+ if (element.parentElement && isHidden(element.parentElement)) return true;
36
+ if (!(element instanceof HTMLElement)) return false;
37
+ if (element.hidden) return true;
44
38
  const style = getComputedStyle(element);
45
39
  return style.display === "none" || style.visibility === "hidden";
46
40
  };
47
- if (isHidden(this))
48
- return [];
41
+ if (isHidden(this)) return [];
49
42
  return [{ width: 1, height: 1 }];
50
43
  };
51
44
  if (!Element.prototype.scrollIntoView) {
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  dispatch
4
- } from "./JIRMKL2I.js";
4
+ } from "./7NQ5CXYI.js";
5
5
  import {
6
6
  flushMicrotasks,
7
7
  wrapAsync
8
- } from "./7I2TICIC.js";
8
+ } from "./HFG3HB6M.js";
9
9
 
10
10
  // src/blur.ts
11
11
  import { getActiveElement } from "@ariakit/core/utils/dom";
@@ -14,12 +14,9 @@ function blur(element) {
14
14
  if (element == null) {
15
15
  element = document.activeElement;
16
16
  }
17
- if (!element)
18
- return;
19
- if (element.tagName === "BODY")
20
- return;
21
- if (getActiveElement(element) !== element)
22
- return;
17
+ if (!element) return;
18
+ if (element.tagName === "BODY") return;
19
+ if (getActiveElement(element) !== element) return;
23
20
  if (element.dirty) {
24
21
  await dispatch.change(element);
25
22
  element.dirty = false;
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  dispatch
4
- } from "./JIRMKL2I.js";
4
+ } from "./7NQ5CXYI.js";
5
5
  import {
6
6
  flushMicrotasks,
7
7
  wrapAsync
8
- } from "./7I2TICIC.js";
8
+ } from "./HFG3HB6M.js";
9
9
 
10
10
  // src/focus.ts
11
11
  import { getActiveElement } from "@ariakit/core/utils/dom";
@@ -14,10 +14,8 @@ import { invariant } from "@ariakit/core/utils/misc";
14
14
  function focus(element) {
15
15
  return wrapAsync(async () => {
16
16
  invariant(element, "Unable to focus on null element");
17
- if (getActiveElement(element) === element)
18
- return;
19
- if (!isFocusable(element))
20
- return;
17
+ if (getActiveElement(element) === element) return;
18
+ if (!isFocusable(element)) return;
21
19
  const htmlElement = element;
22
20
  const activeElement = getActiveElement(
23
21
  htmlElement
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  click
4
- } from "./HKMYG3ZJ.js";
4
+ } from "./DHZBG4QM.js";
5
5
 
6
6
  // src/tap.ts
7
7
  function tap(element, options) {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  wrapAsync
4
- } from "./7I2TICIC.js";
4
+ } from "./HFG3HB6M.js";
5
5
 
6
6
  // src/wait-for.ts
7
7
  import * as DOMTestingLibrary from "@testing-library/dom";
@@ -1,39 +1,34 @@
1
1
  "use client";
2
2
  import {
3
3
  focus
4
- } from "./VD2VFA32.js";
4
+ } from "./HO5N5GTX.js";
5
5
  import {
6
6
  dispatch
7
- } from "./JIRMKL2I.js";
7
+ } from "./7NQ5CXYI.js";
8
8
  import {
9
9
  sleep
10
- } from "./3EIGH73D.js";
10
+ } from "./DZ24E43J.js";
11
11
  import {
12
12
  wrapAsync
13
- } from "./7I2TICIC.js";
13
+ } from "./HFG3HB6M.js";
14
14
  import {
15
15
  __spreadValues
16
- } from "./Q65FZOE2.js";
16
+ } from "./SM5ASDQ3.js";
17
17
 
18
18
  // src/type.ts
19
19
  import { getActiveElement, isTextField } from "@ariakit/core/utils/dom";
20
20
  import { isFocusable } from "@ariakit/core/utils/focus";
21
21
  function getKeyFromChar(key) {
22
- if (key === "\x7F")
23
- return "Delete";
24
- if (key === "\b")
25
- return "Backspace";
26
- if (key === "\n")
27
- return "Enter";
28
- if (key === " ")
29
- return "Tab";
22
+ if (key === "\x7F") return "Delete";
23
+ if (key === "\b") return "Backspace";
24
+ if (key === "\n") return "Enter";
25
+ if (key === " ") return "Tab";
30
26
  return key;
31
27
  }
32
28
  function workAroundEmailInput(element) {
33
29
  const input = element;
34
- if (input.tagName !== "INPUT" || input.type !== "email")
35
- return () => {
36
- };
30
+ if (input.tagName !== "INPUT" || input.type !== "email") return () => {
31
+ };
37
32
  input.type = "text";
38
33
  return () => {
39
34
  input.type = "email";
@@ -45,10 +40,8 @@ function type(text, element, options = {}) {
45
40
  if (element == null) {
46
41
  element = document.activeElement;
47
42
  }
48
- if (!element)
49
- return;
50
- if (!isFocusable(element))
51
- return;
43
+ if (!element) return;
44
+ if (!isFocusable(element)) return;
52
45
  await focus(element);
53
46
  element.dirty = true;
54
47
  const restoreEmailInput = workAroundEmailInput(element);
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import {
3
3
  dispatch
4
- } from "./JIRMKL2I.js";
4
+ } from "./7NQ5CXYI.js";
5
5
  import {
6
6
  sleep
7
- } from "./3EIGH73D.js";
7
+ } from "./DZ24E43J.js";
8
8
  import {
9
9
  wrapAsync
10
- } from "./7I2TICIC.js";
10
+ } from "./HFG3HB6M.js";
11
11
  import {
12
12
  __spreadProps,
13
13
  __spreadValues
14
- } from "./Q65FZOE2.js";
14
+ } from "./SM5ASDQ3.js";
15
15
 
16
16
  // src/hover.ts
17
17
  import { isVisible } from "@ariakit/core/utils/dom";
@@ -22,8 +22,7 @@ function isPointerEventsEnabled(element) {
22
22
  function hover(element, options) {
23
23
  return wrapAsync(async () => {
24
24
  invariant(element, "Unable to hover on null element");
25
- if (!isVisible(element))
26
- return;
25
+ if (!isVisible(element)) return;
27
26
  const document = element.ownerDocument;
28
27
  const { lastHovered } = document;
29
28
  const { disabled } = element;
@@ -1,25 +1,25 @@
1
1
  "use client";
2
2
  import {
3
3
  type
4
- } from "./VVYOYAEF.js";
4
+ } from "./UQRVXJ7Z.js";
5
5
  import {
6
6
  blur
7
- } from "./QE2YCTHV.js";
7
+ } from "./HI4LQVNU.js";
8
8
  import {
9
9
  focus
10
- } from "./VD2VFA32.js";
10
+ } from "./HO5N5GTX.js";
11
11
  import {
12
12
  dispatch
13
- } from "./JIRMKL2I.js";
13
+ } from "./7NQ5CXYI.js";
14
14
  import {
15
15
  sleep
16
- } from "./3EIGH73D.js";
16
+ } from "./DZ24E43J.js";
17
17
  import {
18
18
  wrapAsync
19
- } from "./7I2TICIC.js";
19
+ } from "./HFG3HB6M.js";
20
20
  import {
21
21
  __spreadValues
22
- } from "./Q65FZOE2.js";
22
+ } from "./SM5ASDQ3.js";
23
23
 
24
24
  // src/press.ts
25
25
  import { isTextField, setSelectionRange } from "@ariakit/core/utils/dom";
@@ -38,8 +38,7 @@ var clickableInputTypes = [
38
38
  ];
39
39
  async function submitFormByPressingEnterOn(element, options) {
40
40
  const { form } = element;
41
- if (!form)
42
- return;
41
+ if (!form) return;
43
42
  const elements = Array.from(form.elements);
44
43
  const validInputs = elements.filter(
45
44
  (el) => el instanceof HTMLInputElement && isTextField(el)
@@ -58,8 +57,7 @@ async function incrementNumberInput(element, by = 1) {
58
57
  const value = +element.value + by;
59
58
  const max = element.max ? +element.max : Number.MAX_SAFE_INTEGER;
60
59
  const min = element.min ? +element.min : Number.MIN_SAFE_INTEGER;
61
- if (value > max || value < min)
62
- return;
60
+ if (value > max || value < min) return;
63
61
  element.value = value.toString();
64
62
  await dispatch.input(element);
65
63
  await dispatch.change(element);
@@ -177,10 +175,8 @@ function press(key, element, options = {}) {
177
175
  if (element == null) {
178
176
  element = document.activeElement || document.body;
179
177
  }
180
- if (!element)
181
- return;
182
- if (!isFocusable(element) && element.tagName !== "BODY")
183
- return;
178
+ if (!element) return;
179
+ if (!isFocusable(element) && element.tagName !== "BODY") return;
184
180
  if (isTextField(element)) {
185
181
  if (key.length === 1) {
186
182
  return type(key, element, options);
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import {
3
3
  dispatch
4
- } from "./JIRMKL2I.js";
4
+ } from "./7NQ5CXYI.js";
5
5
  import {
6
6
  wrapAsync
7
- } from "./7I2TICIC.js";
7
+ } from "./HFG3HB6M.js";
8
8
  import {
9
9
  __spreadValues
10
- } from "./Q65FZOE2.js";
10
+ } from "./SM5ASDQ3.js";
11
11
 
12
12
  // src/mouse-up.ts
13
13
  import { isVisible } from "@ariakit/core/utils/dom";
@@ -15,12 +15,10 @@ import { invariant } from "@ariakit/core/utils/misc";
15
15
  function mouseUp(element, options) {
16
16
  return wrapAsync(async () => {
17
17
  invariant(element, "Unable to mouseUp on null element");
18
- if (!isVisible(element))
19
- return;
18
+ if (!isVisible(element)) return;
20
19
  const { disabled } = element;
21
20
  await dispatch.pointerUp(element, options);
22
- if (disabled)
23
- return;
21
+ if (disabled) return;
24
22
  await dispatch.mouseUp(element, __spreadValues({ detail: 1 }, options));
25
23
  });
26
24
  }
package/esm/blur.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  blur
4
- } from "./__chunks/QE2YCTHV.js";
5
- import "./__chunks/JIRMKL2I.js";
6
- import "./__chunks/7I2TICIC.js";
7
- import "./__chunks/Q65FZOE2.js";
4
+ } from "./__chunks/HI4LQVNU.js";
5
+ import "./__chunks/7NQ5CXYI.js";
6
+ import "./__chunks/HFG3HB6M.js";
7
+ import "./__chunks/SM5ASDQ3.js";
8
8
  export {
9
9
  blur
10
10
  };
package/esm/click.js CHANGED
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import {
3
3
  click
4
- } from "./__chunks/HKMYG3ZJ.js";
5
- import "./__chunks/V36IYEJN.js";
6
- import "./__chunks/YGSLLIRN.js";
7
- import "./__chunks/LRKW54RD.js";
8
- import "./__chunks/QE2YCTHV.js";
9
- import "./__chunks/VD2VFA32.js";
10
- import "./__chunks/JIRMKL2I.js";
11
- import "./__chunks/3EIGH73D.js";
12
- import "./__chunks/7I2TICIC.js";
13
- import "./__chunks/Q65FZOE2.js";
4
+ } from "./__chunks/DHZBG4QM.js";
5
+ import "./__chunks/ZPXIP5WW.js";
6
+ import "./__chunks/2TPVB4MR.js";
7
+ import "./__chunks/VMVRY4TL.js";
8
+ import "./__chunks/HI4LQVNU.js";
9
+ import "./__chunks/HO5N5GTX.js";
10
+ import "./__chunks/7NQ5CXYI.js";
11
+ import "./__chunks/DZ24E43J.js";
12
+ import "./__chunks/HFG3HB6M.js";
13
+ import "./__chunks/SM5ASDQ3.js";
14
14
  export {
15
15
  click
16
16
  };
package/esm/dispatch.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  dispatch
4
- } from "./__chunks/JIRMKL2I.js";
5
- import "./__chunks/7I2TICIC.js";
6
- import "./__chunks/Q65FZOE2.js";
4
+ } from "./__chunks/7NQ5CXYI.js";
5
+ import "./__chunks/HFG3HB6M.js";
6
+ import "./__chunks/SM5ASDQ3.js";
7
7
  export {
8
8
  dispatch
9
9
  };
package/esm/focus.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  focus
4
- } from "./__chunks/VD2VFA32.js";
5
- import "./__chunks/JIRMKL2I.js";
6
- import "./__chunks/7I2TICIC.js";
7
- import "./__chunks/Q65FZOE2.js";
4
+ } from "./__chunks/HO5N5GTX.js";
5
+ import "./__chunks/7NQ5CXYI.js";
6
+ import "./__chunks/HFG3HB6M.js";
7
+ import "./__chunks/SM5ASDQ3.js";
8
8
  export {
9
9
  focus
10
10
  };
package/esm/hover.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  hover
4
- } from "./__chunks/LRKW54RD.js";
5
- import "./__chunks/JIRMKL2I.js";
6
- import "./__chunks/3EIGH73D.js";
7
- import "./__chunks/7I2TICIC.js";
8
- import "./__chunks/Q65FZOE2.js";
4
+ } from "./__chunks/VMVRY4TL.js";
5
+ import "./__chunks/7NQ5CXYI.js";
6
+ import "./__chunks/DZ24E43J.js";
7
+ import "./__chunks/HFG3HB6M.js";
8
+ import "./__chunks/SM5ASDQ3.js";
9
9
  export {
10
10
  hover
11
11
  };