@ariakit/test 0.2.5 → 0.3.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 (187) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/cjs/__chunks/2KXSRUIV.cjs +205 -0
  3. package/cjs/__chunks/747HORQZ.cjs +30 -0
  4. package/cjs/__chunks/A5IFXY4J.cjs +33 -0
  5. package/cjs/__chunks/DAHHEUOU.cjs +95 -0
  6. package/cjs/__chunks/{2V5PIRJZ.cjs → ESE7QHAQ.cjs} +71 -70
  7. package/cjs/__chunks/FU2U6RZL.cjs +57 -0
  8. package/cjs/__chunks/I2BROIQW.cjs +1 -0
  9. package/cjs/__chunks/KVNENCXT.cjs +36 -0
  10. package/cjs/__chunks/LYOKT276.cjs +69 -0
  11. package/cjs/__chunks/NIEATM7R.cjs +20 -0
  12. package/cjs/__chunks/{PKWBCPZU.cjs → OVN5OYWK.cjs} +2 -1
  13. package/cjs/__chunks/{LUIPCXQX.cjs → PJWPDIUX.cjs} +48 -44
  14. package/cjs/__chunks/SDUGTL2N.cjs +13 -0
  15. package/cjs/__chunks/SEWCIANI.cjs +14 -0
  16. package/cjs/__chunks/T5KVOIJT.cjs +58 -0
  17. package/cjs/__chunks/VZINRVVH.cjs +126 -0
  18. package/cjs/__chunks/ZMMVJ3OT.cjs +72 -0
  19. package/cjs/__tests__/use-all-events.d.cts +1 -0
  20. package/cjs/__utils.d.cts +11 -0
  21. package/cjs/__utils.d.ts +6 -3
  22. package/cjs/blur.cjs +7 -8
  23. package/cjs/blur.d.cts +2 -0
  24. package/cjs/blur.d.ts +1 -2
  25. package/cjs/click.cjs +13 -14
  26. package/cjs/click.d.cts +1 -0
  27. package/cjs/click.d.ts +1 -2
  28. package/cjs/dispatch.cjs +9 -0
  29. package/cjs/dispatch.d.cts +9 -0
  30. package/cjs/dispatch.d.ts +9 -0
  31. package/cjs/focus.cjs +7 -8
  32. package/cjs/focus.d.cts +1 -0
  33. package/cjs/focus.d.ts +1 -2
  34. package/cjs/hover.cjs +8 -9
  35. package/cjs/hover.d.cts +1 -0
  36. package/cjs/hover.d.ts +1 -2
  37. package/cjs/index.cjs +19 -76
  38. package/cjs/index.d.cts +14 -0
  39. package/cjs/index.d.ts +2 -5
  40. package/cjs/mouse-down.cjs +9 -10
  41. package/cjs/mouse-down.d.cts +1 -0
  42. package/cjs/mouse-down.d.ts +1 -2
  43. package/cjs/mouse-up.cjs +7 -7
  44. package/cjs/mouse-up.d.cts +1 -0
  45. package/cjs/mouse-up.d.ts +1 -2
  46. package/cjs/press.cjs +11 -12
  47. package/cjs/press.d.cts +18 -0
  48. package/cjs/press.d.ts +0 -1
  49. package/cjs/query.cjs +10 -0
  50. package/cjs/query.d.cts +3989 -0
  51. package/cjs/query.d.ts +3989 -0
  52. package/cjs/react.cjs +90 -0
  53. package/cjs/react.d.cts +7 -0
  54. package/cjs/react.d.ts +7 -0
  55. package/cjs/select.cjs +13 -14
  56. package/cjs/select.d.cts +1 -0
  57. package/cjs/select.d.ts +1 -2
  58. package/cjs/sleep.cjs +6 -6
  59. package/cjs/sleep.d.cts +1 -0
  60. package/cjs/tap.cjs +14 -15
  61. package/cjs/tap.d.cts +1 -0
  62. package/cjs/tap.d.ts +1 -2
  63. package/cjs/type.cjs +9 -10
  64. package/cjs/type.d.cts +2 -0
  65. package/cjs/type.d.ts +0 -1
  66. package/cjs/wait-for.cjs +6 -4
  67. package/cjs/wait-for.d.cts +2 -0
  68. package/cjs/wait-for.d.ts +2 -1
  69. package/dispatch/package.json +8 -0
  70. package/esm/__chunks/{SWUQE4WB.js → 5DPK2YAQ.js} +48 -44
  71. package/esm/__chunks/7JP5HWUW.js +57 -0
  72. package/esm/__chunks/ANPGABTJ.js +69 -0
  73. package/esm/__chunks/H3BXHZTZ.js +95 -0
  74. package/esm/__chunks/HUBUFZ3U.js +205 -0
  75. package/esm/__chunks/HVRX3U4O.js +126 -0
  76. package/esm/__chunks/LHKK7Y5F.js +72 -0
  77. package/esm/__chunks/LSH2PT34.js +30 -0
  78. package/esm/__chunks/MKNCAN2F.js +13 -0
  79. package/esm/__chunks/{6XO5G2QR.js → Q65FZOE2.js} +1 -0
  80. package/esm/__chunks/RG2JKALK.js +58 -0
  81. package/esm/__chunks/RHBNMDK4.js +1 -0
  82. package/esm/__chunks/{6PY4HXVO.js → UJCT5GXS.js} +71 -70
  83. package/esm/__chunks/WAYMNUAF.js +33 -0
  84. package/esm/__chunks/WLDGXXGP.js +14 -0
  85. package/esm/__chunks/YNAZUNNE.js +20 -0
  86. package/esm/__chunks/ZIWQZF7I.js +36 -0
  87. package/esm/__utils.d.ts +6 -3
  88. package/esm/blur.d.ts +1 -2
  89. package/esm/blur.js +5 -6
  90. package/esm/click.d.ts +1 -2
  91. package/esm/click.js +11 -12
  92. package/esm/dispatch.d.ts +9 -0
  93. package/esm/dispatch.js +9 -0
  94. package/esm/focus.d.ts +1 -2
  95. package/esm/focus.js +5 -6
  96. package/esm/hover.d.ts +1 -2
  97. package/esm/hover.js +6 -7
  98. package/esm/index.d.ts +2 -5
  99. package/esm/index.js +31 -88
  100. package/esm/mouse-down.d.ts +1 -2
  101. package/esm/mouse-down.js +7 -8
  102. package/esm/mouse-up.d.ts +1 -2
  103. package/esm/mouse-up.js +5 -5
  104. package/esm/press.d.ts +0 -1
  105. package/esm/press.js +9 -10
  106. package/esm/query.d.ts +3989 -0
  107. package/esm/query.js +10 -0
  108. package/esm/react.d.ts +7 -0
  109. package/esm/react.js +90 -0
  110. package/esm/select.d.ts +1 -2
  111. package/esm/select.js +11 -12
  112. package/esm/sleep.js +4 -4
  113. package/esm/tap.d.ts +1 -2
  114. package/esm/tap.js +12 -13
  115. package/esm/type.d.ts +0 -1
  116. package/esm/type.js +7 -8
  117. package/esm/wait-for.d.ts +2 -1
  118. package/esm/wait-for.js +4 -2
  119. package/package.json +85 -40
  120. package/query/package.json +8 -0
  121. package/react/package.json +8 -0
  122. package/act/package.json +0 -8
  123. package/cjs/__chunks/3NIZQX5J.cjs +0 -6
  124. package/cjs/__chunks/3WW644T7.cjs +0 -20
  125. package/cjs/__chunks/5F5PNQCC.cjs +0 -22
  126. package/cjs/__chunks/7BZFO6FC.cjs +0 -12
  127. package/cjs/__chunks/7RUXTAPP.cjs +0 -16
  128. package/cjs/__chunks/AYRPODWR.cjs +0 -1
  129. package/cjs/__chunks/B4VP2LEU.cjs +0 -28
  130. package/cjs/__chunks/BHNBCXUN.cjs +0 -33
  131. package/cjs/__chunks/EGF4KWUK.cjs +0 -64
  132. package/cjs/__chunks/HGTTGPFK.cjs +0 -54
  133. package/cjs/__chunks/JY5DGPUE.cjs +0 -14
  134. package/cjs/__chunks/KRQVK4KQ.cjs +0 -38
  135. package/cjs/__chunks/LFNIGEB6.cjs +0 -50
  136. package/cjs/__chunks/MQA5IB4L.cjs +0 -6
  137. package/cjs/__chunks/Q7PN3HIB.cjs +0 -121
  138. package/cjs/__chunks/SYQ5J5KP.cjs +0 -32
  139. package/cjs/__chunks/VIKUJSTX.cjs +0 -83
  140. package/cjs/act.cjs +0 -8
  141. package/cjs/act.d.ts +0 -1
  142. package/cjs/fire-event.cjs +0 -9
  143. package/cjs/fire-event.d.ts +0 -3
  144. package/cjs/polyfills.cjs +0 -3
  145. package/cjs/render.cjs +0 -9
  146. package/cjs/render.d.ts +0 -5
  147. package/cjs/screen.cjs +0 -55
  148. package/cjs/screen.d.ts +0 -26
  149. package/cjs/tsconfig.build.tsbuildinfo +0 -1
  150. package/cjs/within.cjs +0 -7
  151. package/cjs/within.d.ts +0 -1
  152. package/esm/__chunks/2OZA4WAZ.js +0 -50
  153. package/esm/__chunks/2RHTJFSK.js +0 -38
  154. package/esm/__chunks/3C72DPE2.js +0 -54
  155. package/esm/__chunks/4A3YKZRA.js +0 -121
  156. package/esm/__chunks/5JPM5LQX.js +0 -6
  157. package/esm/__chunks/5PINJ4MD.js +0 -16
  158. package/esm/__chunks/AEOE57TZ.js +0 -33
  159. package/esm/__chunks/EVYPE6ZJ.js +0 -32
  160. package/esm/__chunks/EX5WPJOU.js +0 -64
  161. package/esm/__chunks/JTFRQL3H.js +0 -83
  162. package/esm/__chunks/LJWZLI6L.js +0 -14
  163. package/esm/__chunks/OQYWQML5.js +0 -12
  164. package/esm/__chunks/OSCTTZUZ.js +0 -28
  165. package/esm/__chunks/PNBZ5NXH.js +0 -0
  166. package/esm/__chunks/QA3ZS6S2.js +0 -6
  167. package/esm/__chunks/R7IYW63J.js +0 -22
  168. package/esm/__chunks/ZEO5Q6UD.js +0 -20
  169. package/esm/act.d.ts +0 -1
  170. package/esm/act.js +0 -8
  171. package/esm/fire-event.d.ts +0 -3
  172. package/esm/fire-event.js +0 -9
  173. package/esm/polyfills.d.ts +0 -1
  174. package/esm/polyfills.js +0 -3
  175. package/esm/render.d.ts +0 -5
  176. package/esm/render.js +0 -9
  177. package/esm/screen.d.ts +0 -26
  178. package/esm/screen.js +0 -55
  179. package/esm/tsconfig.build.tsbuildinfo +0 -1
  180. package/esm/within.d.ts +0 -1
  181. package/esm/within.js +0 -7
  182. package/fire-event/package.json +0 -8
  183. package/polyfills/package.json +0 -8
  184. package/render/package.json +0 -8
  185. package/screen/package.json +0 -8
  186. package/within/package.json +0 -8
  187. /package/cjs/{polyfills.d.ts → __tests__/blur-test.d.cts} +0 -0
@@ -1,64 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _KRQVK4KQcjs = require('./KRQVK4KQ.cjs');
4
-
5
-
6
- var _7RUXTAPPcjs = require('./7RUXTAPP.cjs');
7
-
8
-
9
- var _3WW644T7cjs = require('./3WW644T7.cjs');
10
-
11
-
12
-
13
- var _PKWBCPZUcjs = require('./PKWBCPZU.cjs');
14
-
15
- // src/hover.ts
16
- var _dom = require('@ariakit/core/utils/dom');
17
- function isPointerEventsEnabled(element) {
18
- return getComputedStyle(element).pointerEvents !== "none";
19
- }
20
- async function hover(element, options) {
21
- if (!_dom.isVisible.call(void 0, element))
22
- return;
23
- const document = element.ownerDocument;
24
- const { lastHovered } = document;
25
- const { disabled } = element;
26
- const pointerEventsEnabled = isPointerEventsEnabled(element);
27
- if (lastHovered && lastHovered !== element && _dom.isVisible.call(void 0, lastHovered)) {
28
- _KRQVK4KQcjs.fireEvent.pointerMove(lastHovered, options);
29
- _KRQVK4KQcjs.fireEvent.mouseMove(lastHovered, options);
30
- if (isPointerEventsEnabled(lastHovered)) {
31
- const isElementWithinLastHovered = lastHovered.contains(element);
32
- const relatedTarget = pointerEventsEnabled ? element : null;
33
- const leaveOptions = _PKWBCPZUcjs.__spreadProps.call(void 0, _PKWBCPZUcjs.__spreadValues.call(void 0, {}, options), { relatedTarget });
34
- _KRQVK4KQcjs.fireEvent.pointerOut(lastHovered, leaveOptions);
35
- if (!isElementWithinLastHovered) {
36
- _KRQVK4KQcjs.fireEvent.pointerLeave(lastHovered, leaveOptions);
37
- }
38
- _KRQVK4KQcjs.fireEvent.mouseOut(lastHovered, leaveOptions);
39
- if (!isElementWithinLastHovered) {
40
- _KRQVK4KQcjs.fireEvent.mouseLeave(lastHovered, leaveOptions);
41
- }
42
- }
43
- }
44
- await _7RUXTAPPcjs.sleep.call(void 0, );
45
- if (pointerEventsEnabled) {
46
- const enterOptions = lastHovered ? _PKWBCPZUcjs.__spreadValues.call(void 0, { relatedTarget: lastHovered }, options) : options;
47
- _KRQVK4KQcjs.fireEvent.pointerOver(element, enterOptions);
48
- _KRQVK4KQcjs.fireEvent.pointerEnter(element, enterOptions);
49
- if (!disabled) {
50
- _KRQVK4KQcjs.fireEvent.mouseOver(element, enterOptions);
51
- _KRQVK4KQcjs.fireEvent.mouseEnter(element, enterOptions);
52
- }
53
- }
54
- _KRQVK4KQcjs.fireEvent.pointerMove(element, options);
55
- if (!disabled) {
56
- _KRQVK4KQcjs.fireEvent.mouseMove(element, options);
57
- }
58
- document.lastHovered = element;
59
- await _3WW644T7cjs.queuedMicrotasks.call(void 0, );
60
- }
61
-
62
-
63
-
64
- exports.hover = hover;
@@ -1,54 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/screen.ts
2
- var _react = require('@testing-library/react');
3
- var getByText = _react.screen.getByText;
4
- var getByLabelText = _react.screen.getByLabelText;
5
- var getByRole = _react.screen.getByRole;
6
- var getByPlaceholderText = _react.screen.getByPlaceholderText;
7
- var queryByText = _react.screen.queryByText;
8
- var queryByLabelText = _react.screen.queryByLabelText;
9
- var queryByRole = _react.screen.queryByRole;
10
- var queryByPlaceholderText = _react.screen.queryByPlaceholderText;
11
- var findByText = _react.screen.findByText;
12
- var findByLabelText = _react.screen.findByLabelText;
13
- var findByRole = _react.screen.findByRole;
14
- var findByPlaceholderText = _react.screen.findByPlaceholderText;
15
- var getAllByText = _react.screen.getAllByText;
16
- var getAllByLabelText = _react.screen.getAllByLabelText;
17
- var getAllByRole = _react.screen.getAllByRole;
18
- var getAllByPlaceholderText = _react.screen.getAllByPlaceholderText;
19
- var queryAllByText = _react.screen.queryAllByText;
20
- var queryAllByLabelText = _react.screen.queryAllByLabelText;
21
- var queryAllByRole = _react.screen.queryAllByRole;
22
- var queryAllByPlaceholderText = _react.screen.queryAllByPlaceholderText;
23
- var findAllByText = _react.screen.findAllByText;
24
- var findAllByLabelText = _react.screen.findAllByLabelText;
25
- var findAllByRole = _react.screen.findAllByRole;
26
- var findAllByPlaceholderText = _react.screen.findAllByPlaceholderText;
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
- exports.screen = _react.screen; exports.getByText = getByText; exports.getByLabelText = getByLabelText; exports.getByRole = getByRole; exports.getByPlaceholderText = getByPlaceholderText; exports.queryByText = queryByText; exports.queryByLabelText = queryByLabelText; exports.queryByRole = queryByRole; exports.queryByPlaceholderText = queryByPlaceholderText; exports.findByText = findByText; exports.findByLabelText = findByLabelText; exports.findByRole = findByRole; exports.findByPlaceholderText = findByPlaceholderText; exports.getAllByText = getAllByText; exports.getAllByLabelText = getAllByLabelText; exports.getAllByRole = getAllByRole; exports.getAllByPlaceholderText = getAllByPlaceholderText; exports.queryAllByText = queryAllByText; exports.queryAllByLabelText = queryAllByLabelText; exports.queryAllByRole = queryAllByRole; exports.queryAllByPlaceholderText = queryAllByPlaceholderText; exports.findAllByText = findAllByText; exports.findAllByLabelText = findAllByLabelText; exports.findAllByRole = findAllByRole; exports.findAllByPlaceholderText = findAllByPlaceholderText;
@@ -1,14 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _PKWBCPZUcjs = require('./PKWBCPZU.cjs');
4
-
5
- // src/render.ts
6
- var _react = require('react');
7
- var _react3 = require('@testing-library/react');
8
- function customRender(ui, options) {
9
- return _react3.render.call(void 0, ui, _PKWBCPZUcjs.__spreadValues.call(void 0, { wrapper: _react.StrictMode }, options));
10
- }
11
-
12
-
13
-
14
- exports.customRender = customRender;
@@ -1,38 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/fire-event.ts
2
- var _dom = require('@testing-library/dom');
3
- var pointerEvents = [
4
- "mouseMove",
5
- "mouseOver",
6
- "mouseEnter",
7
- "mouseOut",
8
- "mouseLeave",
9
- "mouseDown",
10
- "mouseUp",
11
- "pointerMove",
12
- "pointerOver",
13
- "pointerEnter",
14
- "pointerOut",
15
- "pointerLeave",
16
- "pointerDown",
17
- "pointerUp",
18
- "click"
19
- ];
20
- for (const event of pointerEvents) {
21
- const baseFireEvent = _dom.fireEvent[event];
22
- _dom.fireEvent[event] = (element, options) => {
23
- if (element instanceof Element) {
24
- const style = getComputedStyle(element);
25
- if (style.pointerEvents === "none") {
26
- if (element.parentElement) {
27
- return _dom.fireEvent[event](element.parentElement, options);
28
- }
29
- return true;
30
- }
31
- }
32
- return baseFireEvent(element, options);
33
- };
34
- }
35
-
36
-
37
-
38
- exports.fireEvent = _dom.fireEvent;
@@ -1,50 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _BHNBCXUNcjs = require('./BHNBCXUN.cjs');
4
-
5
-
6
- var _B4VP2LEUcjs = require('./B4VP2LEU.cjs');
7
-
8
-
9
- var _KRQVK4KQcjs = require('./KRQVK4KQ.cjs');
10
-
11
-
12
- var _PKWBCPZUcjs = require('./PKWBCPZU.cjs');
13
-
14
- // src/mouse-down.ts
15
- var _dom = require('@ariakit/core/utils/dom');
16
- var _focus = require('@ariakit/core/utils/focus');
17
- function mouseDown(element, options) {
18
- if (!_dom.isVisible.call(void 0, element))
19
- return;
20
- const { disabled } = element;
21
- let defaultAllowed = _KRQVK4KQcjs.fireEvent.pointerDown(element, options);
22
- if (!disabled) {
23
- if (!_KRQVK4KQcjs.fireEvent.mouseDown(element, _PKWBCPZUcjs.__spreadValues.call(void 0, { detail: 1 }, options))) {
24
- defaultAllowed = false;
25
- }
26
- }
27
- if (defaultAllowed) {
28
- const selection = _dom.getDocument.call(void 0, element).getSelection();
29
- if (selection && selection.rangeCount) {
30
- const range = selection.getRangeAt(0);
31
- if (!range.collapsed) {
32
- selection.removeAllRanges();
33
- }
34
- }
35
- if (_focus.isFocusable.call(void 0, element) && getComputedStyle(element).pointerEvents !== "none") {
36
- _B4VP2LEUcjs.focus.call(void 0, element);
37
- } else if (element.parentElement) {
38
- const closestFocusable = _focus.getClosestFocusable.call(void 0, element.parentElement);
39
- if (closestFocusable) {
40
- _B4VP2LEUcjs.focus.call(void 0, closestFocusable);
41
- } else {
42
- _BHNBCXUNcjs.blur.call(void 0, );
43
- }
44
- }
45
- }
46
- }
47
-
48
-
49
-
50
- exports.mouseDown = mouseDown;
@@ -1,6 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/within.ts
2
- var _react = require('@testing-library/react');
3
-
4
-
5
-
6
- exports.within = _react.within;
@@ -1,121 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _B4VP2LEUcjs = require('./B4VP2LEU.cjs');
4
-
5
-
6
- var _KRQVK4KQcjs = require('./KRQVK4KQ.cjs');
7
-
8
-
9
- var _7RUXTAPPcjs = require('./7RUXTAPP.cjs');
10
-
11
-
12
- var _3WW644T7cjs = require('./3WW644T7.cjs');
13
-
14
-
15
- var _PKWBCPZUcjs = require('./PKWBCPZU.cjs');
16
-
17
- // src/type.ts
18
- var _dom = require('@ariakit/core/utils/dom');
19
- var _focus = require('@ariakit/core/utils/focus');
20
- function getKeyFromChar(key) {
21
- if (key === "\x7F")
22
- return "Delete";
23
- if (key === "\b")
24
- return "Backspace";
25
- if (key === "\n")
26
- return "Enter";
27
- if (key === " ")
28
- return "Tab";
29
- return key;
30
- }
31
- function workAroundEmailInput(element) {
32
- const input = element;
33
- if (input.tagName !== "INPUT" || input.type !== "email")
34
- return () => {
35
- };
36
- input.type = "text";
37
- return () => {
38
- input.type = "email";
39
- };
40
- }
41
- async function type(text, element, options = {}) {
42
- var _a, _b;
43
- if (element == null) {
44
- element = document.activeElement;
45
- }
46
- if (!element)
47
- return;
48
- if (!_focus.isFocusable.call(void 0, element))
49
- return;
50
- _B4VP2LEUcjs.focus.call(void 0, element);
51
- element.dirty = true;
52
- const restoreEmailInput = workAroundEmailInput(element);
53
- for (const char of text) {
54
- const key = getKeyFromChar(char);
55
- let value = "";
56
- let inputType = options.isComposing ? "insertCompositionText" : "insertText";
57
- let defaultAllowed = _KRQVK4KQcjs.fireEvent.keyDown(element, _PKWBCPZUcjs.__spreadValues.call(void 0, { key }, options));
58
- await _3WW644T7cjs.queuedMicrotasks.call(void 0, );
59
- element = _dom.getActiveElement.call(void 0, element) || element;
60
- if (_dom.isTextField.call(void 0, element)) {
61
- const input = element;
62
- const [start, end] = [(_a = input.selectionStart) != null ? _a : 0, (_b = input.selectionEnd) != null ? _b : 0];
63
- const collapsed = start === end;
64
- let nextCaretPosition = start;
65
- if (char === "\x7F") {
66
- const firstPart = input.value.slice(0, start);
67
- const secondPart = input.value.slice(collapsed ? end + 1 : end);
68
- value = `${firstPart}${secondPart}`;
69
- inputType = "deleteContentForward";
70
- } else if (char === "\b") {
71
- nextCaretPosition = collapsed ? Math.max(start - 1, 0) : start;
72
- const firstPart = input.value.slice(0, nextCaretPosition);
73
- const lastPart = input.value.slice(end, input.value.length);
74
- value = `${firstPart}${lastPart}`;
75
- inputType = "deleteContentBackward";
76
- } else {
77
- const firstPartEnd = options.isComposing ? start - 1 : start;
78
- const firstPart = input.value.slice(0, firstPartEnd);
79
- const lastPart = input.value.slice(end, input.value.length);
80
- nextCaretPosition = start + 1;
81
- value = `${firstPart}${char}${lastPart}`;
82
- }
83
- if (defaultAllowed && !input.readOnly) {
84
- if (inputType === "insertText") {
85
- defaultAllowed = _KRQVK4KQcjs.fireEvent.keyPress(input, _PKWBCPZUcjs.__spreadValues.call(void 0, {
86
- key,
87
- charCode: key.charCodeAt(0)
88
- }, options));
89
- }
90
- if (inputType === "insertCompositionText") {
91
- defaultAllowed = _KRQVK4KQcjs.fireEvent.compositionUpdate(input, _PKWBCPZUcjs.__spreadValues.call(void 0, {
92
- data: char,
93
- target: { value }
94
- }, options));
95
- }
96
- if (defaultAllowed) {
97
- _KRQVK4KQcjs.fireEvent.input(input, _PKWBCPZUcjs.__spreadValues.call(void 0, {
98
- data: char,
99
- target: {
100
- value,
101
- selectionStart: nextCaretPosition,
102
- selectionEnd: nextCaretPosition
103
- },
104
- inputType
105
- }, options));
106
- if (input.selectionStart !== nextCaretPosition) {
107
- input.setSelectionRange(nextCaretPosition, nextCaretPosition);
108
- }
109
- }
110
- }
111
- }
112
- await _7RUXTAPPcjs.sleep.call(void 0, );
113
- _KRQVK4KQcjs.fireEvent.keyUp(element, _PKWBCPZUcjs.__spreadValues.call(void 0, { key }, options));
114
- await _7RUXTAPPcjs.sleep.call(void 0, );
115
- }
116
- restoreEmailInput();
117
- }
118
-
119
-
120
-
121
- exports.type = type;
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- var _3WW644T7cjs = require('./3WW644T7.cjs');
4
-
5
- // src/polyfills.ts
6
- var _focus = require('@ariakit/core/utils/focus');
7
- if (!_3WW644T7cjs.isBrowser && typeof window !== "undefined") {
8
- const originalFocus = window.HTMLElement.prototype.focus;
9
- window.HTMLElement.prototype.focus = function focus(options) {
10
- if (!_focus.isFocusable.call(void 0, this))
11
- return;
12
- return originalFocus.call(this, options);
13
- };
14
- window.Element.prototype.getClientRects = function getClientRects() {
15
- const isHidden = (element) => {
16
- if (!element.isConnected)
17
- return true;
18
- if (element.parentElement && isHidden(element.parentElement))
19
- return true;
20
- if (!(element instanceof HTMLElement))
21
- return false;
22
- if (element.hidden)
23
- return true;
24
- const style = getComputedStyle(element);
25
- return style.display === "none" || style.visibility === "hidden";
26
- };
27
- if (isHidden(this)) {
28
- return [];
29
- }
30
- return [{ width: 1, height: 1 }];
31
- };
32
- }
@@ -1,83 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _5F5PNQCCcjs = require('./5F5PNQCC.cjs');
4
-
5
-
6
- var _LFNIGEB6cjs = require('./LFNIGEB6.cjs');
7
-
8
-
9
- var _EGF4KWUKcjs = require('./EGF4KWUK.cjs');
10
-
11
-
12
- var _KRQVK4KQcjs = require('./KRQVK4KQ.cjs');
13
-
14
-
15
- var _7RUXTAPPcjs = require('./7RUXTAPP.cjs');
16
-
17
-
18
- var _PKWBCPZUcjs = require('./PKWBCPZU.cjs');
19
-
20
- // src/select.ts
21
- var _dom = require('@ariakit/core/utils/dom');
22
- async function select(text, element = document.body, options) {
23
- var _a, _b;
24
- if (!_dom.isVisible.call(void 0, element))
25
- return;
26
- const document2 = element.ownerDocument;
27
- await _EGF4KWUKcjs.hover.call(void 0, element, options);
28
- _LFNIGEB6cjs.mouseDown.call(void 0, element, options);
29
- element.dispatchEvent(
30
- new Event("selectstart", {
31
- bubbles: true,
32
- cancelable: true,
33
- composed: false
34
- })
35
- );
36
- const startIndex = (_b = (_a = element.textContent) == null ? void 0 : _a.indexOf(text)) != null ? _b : -1;
37
- const selection = document2.getSelection();
38
- const range = document2.createRange();
39
- for (let i = 1; i <= text.length; i++) {
40
- const iterator = document2.createNodeIterator(element, NodeFilter.SHOW_TEXT);
41
- const textSlice = text.slice(0, i);
42
- const endIndex = startIndex + textSlice.length;
43
- let index = startIndex;
44
- let node = null;
45
- let charCount = 0;
46
- let startContainer = null;
47
- let startOffset = -1;
48
- let endContainer = null;
49
- let endOffset = -1;
50
- while (index >= 0 && index < endIndex && charCount < endIndex && (node = iterator.nextNode())) {
51
- const textContent = node.textContent;
52
- if (!textContent)
53
- continue;
54
- charCount += textContent.length;
55
- if (index > charCount)
56
- continue;
57
- if (!startContainer) {
58
- startContainer = node;
59
- startOffset = index - charCount + textContent.length;
60
- }
61
- endContainer = node;
62
- endOffset = endIndex - charCount + textContent.length;
63
- index++;
64
- }
65
- if (!startContainer || !endContainer)
66
- continue;
67
- await _EGF4KWUKcjs.hover.call(void 0, element, options);
68
- range.setStart(startContainer, startOffset);
69
- range.setEnd(endContainer, endOffset);
70
- selection == null ? void 0 : selection.removeAllRanges();
71
- selection == null ? void 0 : selection.addRange(range);
72
- }
73
- await _7RUXTAPPcjs.sleep.call(void 0, );
74
- _5F5PNQCCcjs.mouseUp.call(void 0, element, options);
75
- _KRQVK4KQcjs.fireEvent.click(element, _PKWBCPZUcjs.__spreadValues.call(void 0, { detail: 1 }, options));
76
- selection == null ? void 0 : selection.removeAllRanges();
77
- selection == null ? void 0 : selection.addRange(range);
78
- await _7RUXTAPPcjs.sleep.call(void 0, );
79
- }
80
-
81
-
82
-
83
- exports.select = select;
package/cjs/act.cjs DELETED
@@ -1,8 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./__chunks/AYRPODWR.cjs');
2
-
3
-
4
- var _3WW644T7cjs = require('./__chunks/3WW644T7.cjs');
5
- require('./__chunks/PKWBCPZU.cjs');
6
-
7
-
8
- exports.act = _3WW644T7cjs.act;
package/cjs/act.d.ts DELETED
@@ -1 +0,0 @@
1
- export { act } from "./__utils.js";
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _KRQVK4KQcjs = require('./__chunks/KRQVK4KQ.cjs');
4
- require('./__chunks/SYQ5J5KP.cjs');
5
- require('./__chunks/3WW644T7.cjs');
6
- require('./__chunks/PKWBCPZU.cjs');
7
-
8
-
9
- exports.fireEvent = _KRQVK4KQcjs.fireEvent;
@@ -1,3 +0,0 @@
1
- import "./polyfills.js";
2
- import { fireEvent } from "@testing-library/dom";
3
- export { fireEvent };
package/cjs/polyfills.cjs DELETED
@@ -1,3 +0,0 @@
1
- "use strict";require('./__chunks/SYQ5J5KP.cjs');
2
- require('./__chunks/3WW644T7.cjs');
3
- require('./__chunks/PKWBCPZU.cjs');
package/cjs/render.cjs DELETED
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _JY5DGPUEcjs = require('./__chunks/JY5DGPUE.cjs');
4
- require('./__chunks/SYQ5J5KP.cjs');
5
- require('./__chunks/3WW644T7.cjs');
6
- require('./__chunks/PKWBCPZU.cjs');
7
-
8
-
9
- exports.render = _JY5DGPUEcjs.customRender;
package/cjs/render.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import "./polyfills.js";
2
- import type { ReactElement } from "react";
3
- import type { RenderOptions } from "@testing-library/react";
4
- declare function customRender(ui: ReactElement, options?: Omit<RenderOptions, "wrapper">): import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries.js"), HTMLElement, HTMLElement>;
5
- export { customRender as render };
package/cjs/screen.cjs DELETED
@@ -1,55 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
- var _HGTTGPFKcjs = require('./__chunks/HGTTGPFK.cjs');
28
- require('./__chunks/PKWBCPZU.cjs');
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
- exports.findAllByLabelText = _HGTTGPFKcjs.findAllByLabelText; exports.findAllByPlaceholderText = _HGTTGPFKcjs.findAllByPlaceholderText; exports.findAllByRole = _HGTTGPFKcjs.findAllByRole; exports.findAllByText = _HGTTGPFKcjs.findAllByText; exports.findByLabelText = _HGTTGPFKcjs.findByLabelText; exports.findByPlaceholderText = _HGTTGPFKcjs.findByPlaceholderText; exports.findByRole = _HGTTGPFKcjs.findByRole; exports.findByText = _HGTTGPFKcjs.findByText; exports.getAllByLabelText = _HGTTGPFKcjs.getAllByLabelText; exports.getAllByPlaceholderText = _HGTTGPFKcjs.getAllByPlaceholderText; exports.getAllByRole = _HGTTGPFKcjs.getAllByRole; exports.getAllByText = _HGTTGPFKcjs.getAllByText; exports.getByLabelText = _HGTTGPFKcjs.getByLabelText; exports.getByPlaceholderText = _HGTTGPFKcjs.getByPlaceholderText; exports.getByRole = _HGTTGPFKcjs.getByRole; exports.getByText = _HGTTGPFKcjs.getByText; exports.queryAllByLabelText = _HGTTGPFKcjs.queryAllByLabelText; exports.queryAllByPlaceholderText = _HGTTGPFKcjs.queryAllByPlaceholderText; exports.queryAllByRole = _HGTTGPFKcjs.queryAllByRole; exports.queryAllByText = _HGTTGPFKcjs.queryAllByText; exports.queryByLabelText = _HGTTGPFKcjs.queryByLabelText; exports.queryByPlaceholderText = _HGTTGPFKcjs.queryByPlaceholderText; exports.queryByRole = _HGTTGPFKcjs.queryByRole; exports.queryByText = _HGTTGPFKcjs.queryByText; exports.screen = _HGTTGPFKcjs.screen;
package/cjs/screen.d.ts DELETED
@@ -1,26 +0,0 @@
1
- import { screen } from "@testing-library/react";
2
- export { screen };
3
- export declare const getByText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => T) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement);
4
- export declare const getByLabelText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => T) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement);
5
- export declare const getByRole: (<T extends HTMLElement = HTMLElement>(role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => T) & ((role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement);
6
- export declare const getByPlaceholderText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => T) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement);
7
- export declare const queryByText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => T | null) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null);
8
- export declare const queryByLabelText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => T | null) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement | null);
9
- export declare const queryByRole: (<T extends HTMLElement = HTMLElement>(role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => T | null) & ((role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement | null);
10
- export declare const queryByPlaceholderText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => T | null) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement | null);
11
- export declare const findByText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<T>) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>);
12
- export declare const findByLabelText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<T>) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>);
13
- export declare const findByRole: (<T extends HTMLElement = HTMLElement>(role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<T>) & ((role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>);
14
- export declare const findByPlaceholderText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<T>) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>);
15
- export declare const getAllByText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => T[]) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[]);
16
- export declare const getAllByLabelText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => T[]) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[]);
17
- export declare const getAllByRole: (<T extends HTMLElement = HTMLElement>(role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => T[]) & ((role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[]);
18
- export declare const getAllByPlaceholderText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => T[]) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[]);
19
- export declare const queryAllByText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => T[]) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[]);
20
- export declare const queryAllByLabelText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => T[]) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined) => HTMLElement[]);
21
- export declare const queryAllByRole: (<T extends HTMLElement = HTMLElement>(role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => T[]) & ((role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined) => HTMLElement[]);
22
- export declare const queryAllByPlaceholderText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => T[]) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[]);
23
- export declare const findAllByText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<T[]>) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>);
24
- export declare const findAllByLabelText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<T[]>) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>);
25
- export declare const findAllByRole: (<T extends HTMLElement = HTMLElement>(role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<T[]>) & ((role: import("@testing-library/react").ByRoleMatcher, options?: import("@testing-library/react").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>);
26
- export declare const findAllByPlaceholderText: (<T extends HTMLElement = HTMLElement>(id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<T[]>) & ((id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>);