@react-aria/test-utils 1.0.0-nightly.5042 → 1.0.0-rc.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.
Files changed (124) hide show
  1. package/README.md +70 -0
  2. package/dist/import.mjs +6 -4
  3. package/dist/main.js +15 -23
  4. package/dist/main.js.map +1 -1
  5. package/dist/module.js +6 -4
  6. package/dist/module.js.map +1 -1
  7. package/dist/private/act.cjs +33 -0
  8. package/dist/private/act.cjs.map +1 -0
  9. package/dist/private/act.js +28 -0
  10. package/dist/private/act.js.map +1 -0
  11. package/dist/private/checkboxgroup.cjs +107 -0
  12. package/dist/private/checkboxgroup.cjs.map +1 -0
  13. package/dist/private/checkboxgroup.js +102 -0
  14. package/dist/private/checkboxgroup.js.map +1 -0
  15. package/dist/private/combobox.cjs +199 -0
  16. package/dist/private/combobox.cjs.map +1 -0
  17. package/dist/private/combobox.js +194 -0
  18. package/dist/private/combobox.js.map +1 -0
  19. package/dist/private/dialog.cjs +110 -0
  20. package/dist/private/dialog.cjs.map +1 -0
  21. package/dist/private/dialog.js +105 -0
  22. package/dist/private/dialog.js.map +1 -0
  23. package/dist/private/gridlist.cjs +173 -0
  24. package/dist/private/gridlist.cjs.map +1 -0
  25. package/dist/private/gridlist.js +168 -0
  26. package/dist/private/gridlist.js.map +1 -0
  27. package/dist/private/listbox.cjs +163 -0
  28. package/dist/private/listbox.cjs.map +1 -0
  29. package/dist/private/listbox.js +158 -0
  30. package/dist/private/listbox.js.map +1 -0
  31. package/dist/private/menu.cjs +265 -0
  32. package/dist/private/menu.cjs.map +1 -0
  33. package/dist/private/menu.js +260 -0
  34. package/dist/private/menu.js.map +1 -0
  35. package/dist/private/radiogroup.cjs +122 -0
  36. package/dist/private/radiogroup.cjs.map +1 -0
  37. package/dist/private/radiogroup.js +117 -0
  38. package/dist/private/radiogroup.js.map +1 -0
  39. package/dist/private/select.cjs +169 -0
  40. package/dist/private/select.cjs.map +1 -0
  41. package/dist/private/select.js +164 -0
  42. package/dist/private/select.js.map +1 -0
  43. package/dist/private/table.cjs +346 -0
  44. package/dist/private/table.cjs.map +1 -0
  45. package/dist/private/table.js +341 -0
  46. package/dist/private/table.js.map +1 -0
  47. package/dist/private/tabs.cjs +131 -0
  48. package/dist/private/tabs.cjs.map +1 -0
  49. package/dist/private/tabs.js +126 -0
  50. package/dist/private/tabs.js.map +1 -0
  51. package/dist/private/testSetup.cjs +87 -0
  52. package/dist/private/testSetup.cjs.map +1 -0
  53. package/dist/private/testSetup.js +81 -0
  54. package/dist/private/testSetup.js.map +1 -0
  55. package/dist/private/tree.cjs +181 -0
  56. package/dist/private/tree.cjs.map +1 -0
  57. package/dist/private/tree.js +176 -0
  58. package/dist/private/tree.js.map +1 -0
  59. package/dist/private/user.cjs +85 -0
  60. package/dist/private/user.cjs.map +1 -0
  61. package/dist/private/user.js +76 -0
  62. package/dist/private/user.js.map +1 -0
  63. package/dist/{userEventMaps.main.js → private/userEventMaps.cjs} +3 -3
  64. package/dist/private/userEventMaps.cjs.map +1 -0
  65. package/dist/{userEventMaps.mjs → private/userEventMaps.js} +3 -3
  66. package/dist/private/userEventMaps.js.map +1 -0
  67. package/dist/private/utils.cjs +136 -0
  68. package/dist/private/utils.cjs.map +1 -0
  69. package/dist/private/utils.js +127 -0
  70. package/dist/private/utils.js.map +1 -0
  71. package/dist/types/src/act.d.ts +4 -0
  72. package/dist/types/src/checkboxgroup.d.ts +47 -0
  73. package/dist/types/src/combobox.d.ts +87 -0
  74. package/dist/types/src/dialog.d.ts +37 -0
  75. package/dist/types/src/events.d.ts +25 -0
  76. package/dist/types/src/gridlist.d.ts +56 -0
  77. package/dist/types/src/index.d.ts +16 -0
  78. package/dist/types/src/listbox.d.ts +91 -0
  79. package/dist/types/src/menu.d.ts +112 -0
  80. package/dist/types/src/radiogroup.d.ts +47 -0
  81. package/dist/types/src/select.d.ts +74 -0
  82. package/dist/types/src/table.d.ts +120 -0
  83. package/dist/types/src/tabs.d.ts +59 -0
  84. package/dist/types/src/testSetup.d.ts +6 -0
  85. package/dist/types/src/tree.d.ts +62 -0
  86. package/dist/types/src/types.d.ts +143 -0
  87. package/dist/types/src/user.d.ts +49 -0
  88. package/dist/types/src/userEventMaps.d.ts +2 -0
  89. package/dist/types/src/utils.d.ts +29 -0
  90. package/package.json +26 -18
  91. package/src/act.ts +35 -0
  92. package/src/checkboxgroup.ts +165 -0
  93. package/src/combobox.ts +307 -0
  94. package/src/dialog.ts +155 -0
  95. package/src/gridlist.ts +278 -0
  96. package/src/index.ts +17 -3
  97. package/src/listbox.ts +300 -0
  98. package/src/menu.ts +479 -0
  99. package/src/radiogroup.ts +179 -0
  100. package/src/select.ts +273 -0
  101. package/src/table.ts +589 -0
  102. package/src/tabs.ts +204 -0
  103. package/src/testSetup.ts +41 -36
  104. package/src/tree.ts +290 -0
  105. package/src/types.ts +171 -0
  106. package/src/user.ts +153 -0
  107. package/src/userEventMaps.ts +1 -1
  108. package/src/utils.ts +155 -0
  109. package/dist/events.main.js +0 -37
  110. package/dist/events.main.js.map +0 -1
  111. package/dist/events.mjs +0 -31
  112. package/dist/events.module.js +0 -31
  113. package/dist/events.module.js.map +0 -1
  114. package/dist/testSetup.main.js +0 -82
  115. package/dist/testSetup.main.js.map +0 -1
  116. package/dist/testSetup.mjs +0 -76
  117. package/dist/testSetup.module.js +0 -76
  118. package/dist/testSetup.module.js.map +0 -1
  119. package/dist/types.d.ts +0 -16
  120. package/dist/types.d.ts.map +0 -1
  121. package/dist/userEventMaps.main.js.map +0 -1
  122. package/dist/userEventMaps.module.js +0 -38
  123. package/dist/userEventMaps.module.js.map +0 -1
  124. package/src/events.ts +0 -28
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED;;CAEC,GACM,SAAS;IACd,UAAU;QACR,IAAI,gBAAgB;QACpB,aAAa;QACb,eAAO,UAAU,GAAG,MAAM,uBAAuB;YAM/C,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YATA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAOF;QACA,aAAa;QACb,eAAO,UAAU,CAAC,aAAa,GAAG;IACpC;IACA,SAAS;QACP,aAAa;QACb,eAAO,UAAU,GAAG,eAAO,UAAU,CAAC,aAAa;IACrD;AACF;AAEO,SAAS;IACd,UAAU;QACR,aAAa;QACb,eAAO,YAAY,GAAG,MAAM,yBAAyB;YAMnD,IAAI,cAAc;oBACT;gBAAP,OAAO,CAAA,0BAAA,IAAI,CAAC,KAAK,CAAC,WAAW,cAAtB,qCAAA,0BAA0B;YACnC;YACA,IAAI,YAAY;gBACd,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS;YAC7B;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,SAAS;gBACX,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM;YAC1B;YArBA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAmBF;IACF;IACA,SAAS;QACP,aAAa;QACb,OAAO,eAAO,YAAY;IAC5B;AACF","sources":["packages/@react-aria/test-utils/src/testSetup.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).\n */\nexport function installMouseEvent() {\n beforeAll(() => {\n let oldMouseEvent = MouseEvent;\n // @ts-ignore\n global.MouseEvent = class FakeMouseEvent extends MouseEvent {\n _init: {pageX: number, pageY: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n };\n // @ts-ignore\n global.MouseEvent.oldMouseEvent = oldMouseEvent;\n });\n afterAll(() => {\n // @ts-ignore\n global.MouseEvent = global.MouseEvent.oldMouseEvent;\n });\n}\n\nexport function installPointerEvent() {\n beforeAll(() => {\n // @ts-ignore\n global.PointerEvent = class FakePointerEvent extends MouseEvent {\n _init: {pageX: number, pageY: number, pointerType: string, pointerId: number, width: number, height: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pointerType() {\n return this._init.pointerType ?? 'mouse';\n }\n get pointerId() {\n return this._init.pointerId;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n get width() {\n return this._init.width;\n }\n get height() {\n return this._init.height;\n }\n };\n });\n afterAll(() => {\n // @ts-ignore\n delete global.PointerEvent;\n });\n}\n"],"names":[],"version":3,"file":"testSetup.main.js.map"}
@@ -1,76 +0,0 @@
1
-
2
- var $parcel$global = globalThis;
3
- /*
4
- * Copyright 2023 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */ /**
14
- * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).
15
- */ function $68df97871cfb5e33$export$de31e3987c917741() {
16
- beforeAll(()=>{
17
- let oldMouseEvent = MouseEvent;
18
- // @ts-ignore
19
- $parcel$global.MouseEvent = class FakeMouseEvent extends MouseEvent {
20
- get pageX() {
21
- return this._init.pageX;
22
- }
23
- get pageY() {
24
- return this._init.pageY;
25
- }
26
- constructor(name, init){
27
- super(name, init);
28
- this._init = init;
29
- }
30
- };
31
- // @ts-ignore
32
- $parcel$global.MouseEvent.oldMouseEvent = oldMouseEvent;
33
- });
34
- afterAll(()=>{
35
- // @ts-ignore
36
- $parcel$global.MouseEvent = $parcel$global.MouseEvent.oldMouseEvent;
37
- });
38
- }
39
- function $68df97871cfb5e33$export$82f0b04c1d69a901() {
40
- beforeAll(()=>{
41
- // @ts-ignore
42
- $parcel$global.PointerEvent = class FakePointerEvent extends MouseEvent {
43
- get pointerType() {
44
- var _this__init_pointerType;
45
- return (_this__init_pointerType = this._init.pointerType) !== null && _this__init_pointerType !== void 0 ? _this__init_pointerType : 'mouse';
46
- }
47
- get pointerId() {
48
- return this._init.pointerId;
49
- }
50
- get pageX() {
51
- return this._init.pageX;
52
- }
53
- get pageY() {
54
- return this._init.pageY;
55
- }
56
- get width() {
57
- return this._init.width;
58
- }
59
- get height() {
60
- return this._init.height;
61
- }
62
- constructor(name, init){
63
- super(name, init);
64
- this._init = init;
65
- }
66
- };
67
- });
68
- afterAll(()=>{
69
- // @ts-ignore
70
- delete $parcel$global.PointerEvent;
71
- });
72
- }
73
-
74
-
75
- export {$68df97871cfb5e33$export$de31e3987c917741 as installMouseEvent, $68df97871cfb5e33$export$82f0b04c1d69a901 as installPointerEvent};
76
- //# sourceMappingURL=testSetup.module.js.map
@@ -1,76 +0,0 @@
1
-
2
- var $parcel$global = globalThis;
3
- /*
4
- * Copyright 2023 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */ /**
14
- * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).
15
- */ function $68df97871cfb5e33$export$de31e3987c917741() {
16
- beforeAll(()=>{
17
- let oldMouseEvent = MouseEvent;
18
- // @ts-ignore
19
- $parcel$global.MouseEvent = class FakeMouseEvent extends MouseEvent {
20
- get pageX() {
21
- return this._init.pageX;
22
- }
23
- get pageY() {
24
- return this._init.pageY;
25
- }
26
- constructor(name, init){
27
- super(name, init);
28
- this._init = init;
29
- }
30
- };
31
- // @ts-ignore
32
- $parcel$global.MouseEvent.oldMouseEvent = oldMouseEvent;
33
- });
34
- afterAll(()=>{
35
- // @ts-ignore
36
- $parcel$global.MouseEvent = $parcel$global.MouseEvent.oldMouseEvent;
37
- });
38
- }
39
- function $68df97871cfb5e33$export$82f0b04c1d69a901() {
40
- beforeAll(()=>{
41
- // @ts-ignore
42
- $parcel$global.PointerEvent = class FakePointerEvent extends MouseEvent {
43
- get pointerType() {
44
- var _this__init_pointerType;
45
- return (_this__init_pointerType = this._init.pointerType) !== null && _this__init_pointerType !== void 0 ? _this__init_pointerType : 'mouse';
46
- }
47
- get pointerId() {
48
- return this._init.pointerId;
49
- }
50
- get pageX() {
51
- return this._init.pageX;
52
- }
53
- get pageY() {
54
- return this._init.pageY;
55
- }
56
- get width() {
57
- return this._init.width;
58
- }
59
- get height() {
60
- return this._init.height;
61
- }
62
- constructor(name, init){
63
- super(name, init);
64
- this._init = init;
65
- }
66
- };
67
- });
68
- afterAll(()=>{
69
- // @ts-ignore
70
- delete $parcel$global.PointerEvent;
71
- });
72
- }
73
-
74
-
75
- export {$68df97871cfb5e33$export$de31e3987c917741 as installMouseEvent, $68df97871cfb5e33$export$82f0b04c1d69a901 as installPointerEvent};
76
- //# sourceMappingURL=testSetup.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC,GAED;;CAEC,GACM,SAAS;IACd,UAAU;QACR,IAAI,gBAAgB;QACpB,aAAa;QACb,eAAO,UAAU,GAAG,MAAM,uBAAuB;YAM/C,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YATA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAOF;QACA,aAAa;QACb,eAAO,UAAU,CAAC,aAAa,GAAG;IACpC;IACA,SAAS;QACP,aAAa;QACb,eAAO,UAAU,GAAG,eAAO,UAAU,CAAC,aAAa;IACrD;AACF;AAEO,SAAS;IACd,UAAU;QACR,aAAa;QACb,eAAO,YAAY,GAAG,MAAM,yBAAyB;YAMnD,IAAI,cAAc;oBACT;gBAAP,OAAO,CAAA,0BAAA,IAAI,CAAC,KAAK,CAAC,WAAW,cAAtB,qCAAA,0BAA0B;YACnC;YACA,IAAI,YAAY;gBACd,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS;YAC7B;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,SAAS;gBACX,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM;YAC1B;YArBA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAmBF;IACF;IACA,SAAS;QACP,aAAa;QACb,OAAO,eAAO,YAAY;IAC5B;AACF","sources":["packages/@react-aria/test-utils/src/testSetup.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).\n */\nexport function installMouseEvent() {\n beforeAll(() => {\n let oldMouseEvent = MouseEvent;\n // @ts-ignore\n global.MouseEvent = class FakeMouseEvent extends MouseEvent {\n _init: {pageX: number, pageY: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n };\n // @ts-ignore\n global.MouseEvent.oldMouseEvent = oldMouseEvent;\n });\n afterAll(() => {\n // @ts-ignore\n global.MouseEvent = global.MouseEvent.oldMouseEvent;\n });\n}\n\nexport function installPointerEvent() {\n beforeAll(() => {\n // @ts-ignore\n global.PointerEvent = class FakePointerEvent extends MouseEvent {\n _init: {pageX: number, pageY: number, pointerType: string, pointerId: number, width: number, height: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pointerType() {\n return this._init.pointerType ?? 'mouse';\n }\n get pointerId() {\n return this._init.pointerId;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n get width() {\n return this._init.width;\n }\n get height() {\n return this._init.height;\n }\n };\n });\n afterAll(() => {\n // @ts-ignore\n delete global.PointerEvent;\n });\n}\n"],"names":[],"version":3,"file":"testSetup.module.js.map"}
package/dist/types.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import { pointerKey } from "@testing-library/user-event/system/pointer/shared";
2
- export const DEFAULT_LONG_PRESS_TIME = 500;
3
- /**
4
- * Simulates a "long press" event on a element.
5
- * @param element - Element to long press.
6
- * @param opts - Options to pass to the simulated event. See https://testing-library.com/docs/dom-testing-library/api-events/#fireevent for more info.
7
- */
8
- export function triggerLongPress(element: HTMLElement, opts?: {}): void;
9
- /**
10
- * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).
11
- */
12
- export function installMouseEvent(): void;
13
- export function installPointerEvent(): void;
14
- export let pointerMap: pointerKey[];
15
-
16
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"mappings":";AAcA,OAAO,MAAM,6BAA6B,CAAC;AAE3C;;;;GAIG;AACH,iCAAiC,OAAO,EAAE,WAAW,EAAE,IAAI,KAAK,GAAG,IAAI,CAMtE;ACfD;;GAEG;AACH,0CAwBC;AAED,4CAiCC;ACxED,OAAO,IAAI,YAAY,UAAU,EAOL,CAAC","sources":["packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/events.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/testSetup.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/userEventMaps.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/index.ts","packages/@react-aria/test-utils/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './events';\nexport * from './testSetup';\nexport * from './userEventMaps';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;AAEO,IAAI,4CAA2B;IACpC;QAAC,MAAM;QAAa,aAAa;QAAS,QAAQ;QAAW,QAAQ;QAAG,OAAO;QAAG,UAAU;IAAG;IAC/F;QAAC,MAAM;QAAc,aAAa;QAAS,QAAQ;IAAW;IAC9D;QAAC,MAAM;QAAe,aAAa;QAAS,QAAQ;IAAW;IAC/D;QAAC,MAAM;QAAU,aAAa;QAAS,QAAQ;QAAG,OAAO;IAAC;IAC1D;QAAC,MAAM;QAAU,aAAa;IAAO;IACrC;QAAC,MAAM;QAAU,aAAa;IAAO;CACtC","sources":["packages/@react-aria/test-utils/src/userEventMaps.ts"],"sourcesContent":["import {pointerKey} from '@testing-library/user-event/system/pointer/shared';\n\nexport let pointerMap: pointerKey[] = [\n {name: 'MouseLeft', pointerType: 'mouse', button: 'primary', height: 1, width: 1, pressure: 0.5},\n {name: 'MouseRight', pointerType: 'mouse', button: 'secondary'},\n {name: 'MouseMiddle', pointerType: 'mouse', button: 'auxiliary'},\n {name: 'TouchA', pointerType: 'touch', height: 1, width: 1},\n {name: 'TouchB', pointerType: 'touch'},\n {name: 'TouchC', pointerType: 'touch'}\n] as unknown as pointerKey[];\n"],"names":[],"version":3,"file":"userEventMaps.main.js.map"}
@@ -1,38 +0,0 @@
1
- let $50ecfb18069ec897$export$7dbde2c4caaa8d35 = [
2
- {
3
- name: 'MouseLeft',
4
- pointerType: 'mouse',
5
- button: 'primary',
6
- height: 1,
7
- width: 1,
8
- pressure: 0.5
9
- },
10
- {
11
- name: 'MouseRight',
12
- pointerType: 'mouse',
13
- button: 'secondary'
14
- },
15
- {
16
- name: 'MouseMiddle',
17
- pointerType: 'mouse',
18
- button: 'auxiliary'
19
- },
20
- {
21
- name: 'TouchA',
22
- pointerType: 'touch',
23
- height: 1,
24
- width: 1
25
- },
26
- {
27
- name: 'TouchB',
28
- pointerType: 'touch'
29
- },
30
- {
31
- name: 'TouchC',
32
- pointerType: 'touch'
33
- }
34
- ];
35
-
36
-
37
- export {$50ecfb18069ec897$export$7dbde2c4caaa8d35 as pointerMap};
38
- //# sourceMappingURL=userEventMaps.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAEO,IAAI,4CAA2B;IACpC;QAAC,MAAM;QAAa,aAAa;QAAS,QAAQ;QAAW,QAAQ;QAAG,OAAO;QAAG,UAAU;IAAG;IAC/F;QAAC,MAAM;QAAc,aAAa;QAAS,QAAQ;IAAW;IAC9D;QAAC,MAAM;QAAe,aAAa;QAAS,QAAQ;IAAW;IAC/D;QAAC,MAAM;QAAU,aAAa;QAAS,QAAQ;QAAG,OAAO;IAAC;IAC1D;QAAC,MAAM;QAAU,aAAa;IAAO;IACrC;QAAC,MAAM;QAAU,aAAa;IAAO;CACtC","sources":["packages/@react-aria/test-utils/src/userEventMaps.ts"],"sourcesContent":["import {pointerKey} from '@testing-library/user-event/system/pointer/shared';\n\nexport let pointerMap: pointerKey[] = [\n {name: 'MouseLeft', pointerType: 'mouse', button: 'primary', height: 1, width: 1, pressure: 0.5},\n {name: 'MouseRight', pointerType: 'mouse', button: 'secondary'},\n {name: 'MouseMiddle', pointerType: 'mouse', button: 'auxiliary'},\n {name: 'TouchA', pointerType: 'touch', height: 1, width: 1},\n {name: 'TouchB', pointerType: 'touch'},\n {name: 'TouchC', pointerType: 'touch'}\n] as unknown as pointerKey[];\n"],"names":[],"version":3,"file":"userEventMaps.module.js.map"}
package/src/events.ts DELETED
@@ -1,28 +0,0 @@
1
- /*
2
- * Copyright 2023 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */
12
-
13
- import {act, fireEvent} from '@testing-library/react';
14
-
15
- export const DEFAULT_LONG_PRESS_TIME = 500;
16
-
17
- /**
18
- * Simulates a "long press" event on a element.
19
- * @param element - Element to long press.
20
- * @param opts - Options to pass to the simulated event. See https://testing-library.com/docs/dom-testing-library/api-events/#fireevent for more info.
21
- */
22
- export function triggerLongPress(element: HTMLElement, opts = {}): void {
23
- fireEvent.pointerDown(element, {pointerType: 'touch', ...opts});
24
- act(() => {
25
- jest.advanceTimersByTime(DEFAULT_LONG_PRESS_TIME);
26
- });
27
- fireEvent.pointerUp(element, {pointerType: 'touch', ...opts});
28
- }