@easypost/easy-ui 1.0.0-alpha.118 → 1.0.0-alpha.119
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/CHANGELOG.md +6 -0
- package/Drawer/index.js +1 -1
- package/Drawer/index.mjs +1 -1
- package/Notification/index.js +1 -1
- package/Notification/index.mjs +1 -1
- package/Provider/index.js +1 -1
- package/Provider/index.mjs +1 -1
- package/Tooltip/Tooltip.test.d.ts.map +1 -1
- package/__chunks__/{CSSTransition-BXyX0mUc.js → CSSTransition-C23znX_H.js} +3 -5
- package/__chunks__/{CSSTransition-C4FQrt4m.mjs → CSSTransition-DZuEb-M0.mjs} +3 -5
- package/__chunks__/{Notification-DDQHWloB.js → Notification-CFtJx7Uz.js} +1 -1
- package/__chunks__/{Notification-DnNx0rb6.mjs → Notification-YATlp3lK.mjs} +1 -1
- package/__chunks__/config-ChibgUKd.js +5 -0
- package/__chunks__/config-DeltQABu.mjs +6 -0
- package/package.json +1 -1
- package/utilities/test.d.ts +4 -5
- package/utilities/test.d.ts.map +1 -1
- package/utilities/test.js +163 -0
- package/utilities/test.mjs +163 -0
package/CHANGELOG.md
CHANGED
package/Drawer/index.js
CHANGED
|
@@ -39,7 +39,7 @@ const Icon = require("../__chunks__/Icon-BRlbo3RF.js");
|
|
|
39
39
|
const Text = require("../__chunks__/Text-DkzMEqky.js");
|
|
40
40
|
const useModalOverlay = require("../__chunks__/useModalOverlay-C4Gci3MA.js");
|
|
41
41
|
const Overlay = require("../__chunks__/Overlay-BNP_t3v4.js");
|
|
42
|
-
const CSSTransition = require("../__chunks__/CSSTransition-
|
|
42
|
+
const CSSTransition = require("../__chunks__/CSSTransition-C23znX_H.js");
|
|
43
43
|
const useOverlayTrigger = require("../__chunks__/useOverlayTrigger-DP9RbCAF.js");
|
|
44
44
|
const useDialog = require("../__chunks__/useDialog-uxNR0maK.js");
|
|
45
45
|
function _interopNamespaceDefault(e) {
|
package/Drawer/index.mjs
CHANGED
|
@@ -38,7 +38,7 @@ import { I as Icon } from "../__chunks__/Icon-BIpaQJ_I.mjs";
|
|
|
38
38
|
import { T as Text } from "../__chunks__/Text-D6oT5WJQ.mjs";
|
|
39
39
|
import { $ as $8ac8429251c45e4b$export$dbc0f175b25fb0fb } from "../__chunks__/useModalOverlay-BmYXH7rq.mjs";
|
|
40
40
|
import { d as $337b884510726a0d$export$c6fdb837b070b4ff, a as $fc909762b330b746$export$61c6a8c84e605fb6 } from "../__chunks__/Overlay-Dkjxuk6V.mjs";
|
|
41
|
-
import { C as CSSTransition } from "../__chunks__/CSSTransition-
|
|
41
|
+
import { C as CSSTransition } from "../__chunks__/CSSTransition-DZuEb-M0.mjs";
|
|
42
42
|
import { $ as $628037886ba31236$export$f9d5c8beee7d008d } from "../__chunks__/useOverlayTrigger-CIVwezu3.mjs";
|
|
43
43
|
import { $ as $40df3f8667284809$export$d55e7ee900f34e93 } from "../__chunks__/useDialog-nKMoC_Cs.mjs";
|
|
44
44
|
const underlayBg = "_underlayBg_pn8iw_4";
|
package/Notification/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Notification = require("../__chunks__/Notification-
|
|
3
|
+
const Notification = require("../__chunks__/Notification-CFtJx7Uz.js");
|
|
4
4
|
exports.Notification = Notification.Notification;
|
|
5
5
|
exports.NotificationContext = Notification.NotificationContext;
|
|
6
6
|
exports.NotificationProvider = Notification.NotificationProvider;
|
package/Notification/index.mjs
CHANGED
package/Provider/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const useFocusVisible = require("../__chunks__/useFocusVisible-BNcpO5Sv.js");
|
|
5
|
-
const Notification = require("../__chunks__/Notification-
|
|
5
|
+
const Notification = require("../__chunks__/Notification-CFtJx7Uz.js");
|
|
6
6
|
const Theme = require("../__chunks__/Theme-C2nSZUpG.js");
|
|
7
7
|
function Provider({ children, theme, colorScheme, notificationPlacement, navigate, useHref }) {
|
|
8
8
|
return jsxRuntime.jsx(EasyUIRouterProvider, {
|
package/Provider/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { o as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb } from "../__chunks__/useFocusVisible-DDvp2PwR.mjs";
|
|
3
|
-
import { b as NotificationProvider } from "../__chunks__/Notification-
|
|
3
|
+
import { b as NotificationProvider } from "../__chunks__/Notification-YATlp3lK.mjs";
|
|
4
4
|
import { T as ThemeProvider } from "../__chunks__/Theme-M__gFMM3.mjs";
|
|
5
5
|
function Provider({ children, theme, colorScheme, notificationPlacement, navigate, useHref }) {
|
|
6
6
|
return jsx(EasyUIRouterProvider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.test.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.test.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.test.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.test.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AA6F/E,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,SAAS,EACf,EAAE,EAAE,WAAW,EACf,EAAE,SAAgB,EAAE;;CAAK,iBAS1B"}
|
|
@@ -3,6 +3,7 @@ const objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose-C4M
|
|
|
3
3
|
const _commonjsHelpers = require("./_commonjsHelpers-Bc2YnDe1.js");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const ReactDOM = require("react-dom");
|
|
6
|
+
const config = require("./config-ChibgUKd.js");
|
|
6
7
|
function _setPrototypeOf(t, e) {
|
|
7
8
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
|
|
8
9
|
return t2.__proto__ = e2, t2;
|
|
@@ -977,9 +978,6 @@ function removeClass$1(element, className) {
|
|
|
977
978
|
element.setAttribute("class", replaceClassName(element.className && element.className.baseVal || "", className));
|
|
978
979
|
}
|
|
979
980
|
}
|
|
980
|
-
const config = {
|
|
981
|
-
disabled: false
|
|
982
|
-
};
|
|
983
981
|
var timeoutsShape = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
984
982
|
enter: PropTypes.number,
|
|
985
983
|
exit: PropTypes.number,
|
|
@@ -1110,7 +1108,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1110
1108
|
var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1];
|
|
1111
1109
|
var timeouts = this.getTimeouts();
|
|
1112
1110
|
var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
|
|
1113
|
-
if (!mounting && !enter || config.disabled) {
|
|
1111
|
+
if (!mounting && !enter || config.reactTransitionGroupConfig.disabled) {
|
|
1114
1112
|
this.safeSetState({
|
|
1115
1113
|
status: ENTERED
|
|
1116
1114
|
}, function() {
|
|
@@ -1137,7 +1135,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1137
1135
|
var exit = this.props.exit;
|
|
1138
1136
|
var timeouts = this.getTimeouts();
|
|
1139
1137
|
var maybeNode = this.props.nodeRef ? void 0 : ReactDOM.findDOMNode(this);
|
|
1140
|
-
if (!exit || config.disabled) {
|
|
1138
|
+
if (!exit || config.reactTransitionGroupConfig.disabled) {
|
|
1141
1139
|
this.safeSetState({
|
|
1142
1140
|
status: EXITED
|
|
1143
1141
|
}, function() {
|
|
@@ -2,6 +2,7 @@ import { _ as _objectWithoutPropertiesLoose, a as _extends } from "./objectWitho
|
|
|
2
2
|
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-DWwsNxpa.mjs";
|
|
3
3
|
import React__default from "react";
|
|
4
4
|
import ReactDOM from "react-dom";
|
|
5
|
+
import { r as reactTransitionGroupConfig } from "./config-DeltQABu.mjs";
|
|
5
6
|
function _setPrototypeOf(t, e) {
|
|
6
7
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
|
|
7
8
|
return t2.__proto__ = e2, t2;
|
|
@@ -976,9 +977,6 @@ function removeClass$1(element, className) {
|
|
|
976
977
|
element.setAttribute("class", replaceClassName(element.className && element.className.baseVal || "", className));
|
|
977
978
|
}
|
|
978
979
|
}
|
|
979
|
-
const config = {
|
|
980
|
-
disabled: false
|
|
981
|
-
};
|
|
982
980
|
var timeoutsShape = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
983
981
|
enter: PropTypes.number,
|
|
984
982
|
exit: PropTypes.number,
|
|
@@ -1109,7 +1107,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1109
1107
|
var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1];
|
|
1110
1108
|
var timeouts = this.getTimeouts();
|
|
1111
1109
|
var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
|
|
1112
|
-
if (!mounting && !enter ||
|
|
1110
|
+
if (!mounting && !enter || reactTransitionGroupConfig.disabled) {
|
|
1113
1111
|
this.safeSetState({
|
|
1114
1112
|
status: ENTERED
|
|
1115
1113
|
}, function() {
|
|
@@ -1136,7 +1134,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
|
|
|
1136
1134
|
var exit = this.props.exit;
|
|
1137
1135
|
var timeouts = this.getTimeouts();
|
|
1138
1136
|
var maybeNode = this.props.nodeRef ? void 0 : ReactDOM.findDOMNode(this);
|
|
1139
|
-
if (!exit ||
|
|
1137
|
+
if (!exit || reactTransitionGroupConfig.disabled) {
|
|
1140
1138
|
this.safeSetState({
|
|
1141
1139
|
status: EXITED
|
|
1142
1140
|
}, function() {
|
|
@@ -48,7 +48,7 @@ const Icon = require("./Icon-BRlbo3RF.js");
|
|
|
48
48
|
const Text = require("./Text-DkzMEqky.js");
|
|
49
49
|
const utilities_css = require("../utilities/css.js");
|
|
50
50
|
const UnstyledButton = require("./UnstyledButton-DW8CjaXN.js");
|
|
51
|
-
const CSSTransition = require("./CSSTransition-
|
|
51
|
+
const CSSTransition = require("./CSSTransition-C23znX_H.js");
|
|
52
52
|
const objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose-C4Mip8ZU.js");
|
|
53
53
|
function _interopNamespaceDefault(e) {
|
|
54
54
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -48,7 +48,7 @@ import { I as Icon } from "./Icon-BIpaQJ_I.mjs";
|
|
|
48
48
|
import { T as Text } from "./Text-D6oT5WJQ.mjs";
|
|
49
49
|
import { classNames, variationName } from "../utilities/css.mjs";
|
|
50
50
|
import { U as UnstyledButton } from "./UnstyledButton-DxJLvL-G.mjs";
|
|
51
|
-
import { _ as _inheritsLoose, T as TransitionGroupContext, P as PropTypes, C as CSSTransition } from "./CSSTransition-
|
|
51
|
+
import { _ as _inheritsLoose, T as TransitionGroupContext, P as PropTypes, C as CSSTransition } from "./CSSTransition-DZuEb-M0.mjs";
|
|
52
52
|
import { a as _extends, _ as _objectWithoutPropertiesLoose } from "./objectWithoutPropertiesLoose-COdxq1Ge.mjs";
|
|
53
53
|
function $77b352cf12efcf73$export$84726ef35ca2129a(queue) {
|
|
54
54
|
let subscribe = useCallback((fn) => queue.subscribe(fn), [
|
package/package.json
CHANGED
package/utilities/test.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { UserEvent } from "@testing-library/user-event";
|
|
2
2
|
import { ReactElement } from "react";
|
|
3
|
-
declare global {
|
|
4
|
-
var jest: object;
|
|
5
|
-
var IS_REACT_ACT_ENVIRONMENT: boolean;
|
|
6
|
-
}
|
|
7
3
|
/**
|
|
8
4
|
* Render a react element for testing. Passes in vitest's timers for user-event.
|
|
9
5
|
*/
|
|
@@ -69,11 +65,14 @@ export declare function render(jsx: ReactElement): {
|
|
|
69
65
|
* user-event with `vi.useFakeTimers()`
|
|
70
66
|
*
|
|
71
67
|
* See https://github.com/testing-library/react-testing-library/issues/1195
|
|
68
|
+
*
|
|
69
|
+
* Note: relies on the test runner's `beforeAll` global, so it must be called
|
|
70
|
+
* from a vitest/jest environment that exposes globals.
|
|
72
71
|
*/
|
|
73
72
|
export declare function installJestCompatibleFakeTimers(): void;
|
|
74
73
|
export declare function mockGetComputedStyle(): () => void;
|
|
75
74
|
export declare function mockIntersectionObserver(): () => void;
|
|
76
|
-
export declare function installScrollToMock(): void;
|
|
75
|
+
export declare function installScrollToMock(): () => void;
|
|
77
76
|
export declare function mockMatchMedia({ getMatches, }: {
|
|
78
77
|
getMatches: (query: string) => boolean;
|
|
79
78
|
}): () => void;
|
package/utilities/test.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/utilities/test.ts"],"names":[],"mappings":"AACA,OAAkB,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrC
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/utilities/test.ts"],"names":[],"mappings":"AACA,OAAkB,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrC;;GAEG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,YAAY;;;uBAkBvB,CAAC,yJAGkB,CAAC,6BAEZ,CAAC;mBAGpB,MAAE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAnBhB;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,SAc9C;AAED,wBAAgB,oBAAoB,eAMnC;AAED,wBAAgB,wBAAwB,eAUvC;AAED,wBAAgB,mBAAmB,eAMlC;AAED,wBAAgB,cAAc,CAAC,EAC7B,UAAU,GACX,EAAE;IACD,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CACxC,cAeA;AAED,wBAAgB,mBAAmB,eAKlC;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,iBAEhE;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAE/D;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,iBAEhE;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,SAAS,iBAE5C;AAED,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,iBAGb;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,iBAEpE;AAED,wBAAgB,2BAA2B,SAE1C;AAED,wBAAgB,0BAA0B,SAEzC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __async = (__this, __arguments, generator) => {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
var fulfilled = (value) => {
|
|
24
|
+
try {
|
|
25
|
+
step(generator.next(value));
|
|
26
|
+
} catch (e) {
|
|
27
|
+
reject(e);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var rejected = (value) => {
|
|
31
|
+
try {
|
|
32
|
+
step(generator.throw(value));
|
|
33
|
+
} catch (e) {
|
|
34
|
+
reject(e);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
38
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
42
|
+
const react = require("@testing-library/react");
|
|
43
|
+
const userEvent = require("@testing-library/user-event");
|
|
44
|
+
const vitest = require("vitest");
|
|
45
|
+
const config = require("../__chunks__/config-ChibgUKd.js");
|
|
46
|
+
function render(jsx) {
|
|
47
|
+
return __spreadValues({
|
|
48
|
+
user: userEvent.setup({
|
|
49
|
+
advanceTimers: vitest.vi.advanceTimersByTime.bind(vitest.vi)
|
|
50
|
+
})
|
|
51
|
+
}, react.render(jsx));
|
|
52
|
+
}
|
|
53
|
+
function installJestCompatibleFakeTimers() {
|
|
54
|
+
beforeAll(() => {
|
|
55
|
+
const globalWithJest = globalThis;
|
|
56
|
+
const _jest = globalWithJest.jest;
|
|
57
|
+
globalWithJest.jest = __spreadProps(__spreadValues({}, globalWithJest.jest), {
|
|
58
|
+
advanceTimersByTime: vitest.vi.advanceTimersByTime.bind(vitest.vi)
|
|
59
|
+
});
|
|
60
|
+
return () => {
|
|
61
|
+
globalWithJest.jest = _jest;
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function mockGetComputedStyle() {
|
|
66
|
+
const originalGetComputedStyle = window.getComputedStyle;
|
|
67
|
+
window.getComputedStyle = (elt) => originalGetComputedStyle(elt);
|
|
68
|
+
return () => {
|
|
69
|
+
window.getComputedStyle = originalGetComputedStyle;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function mockIntersectionObserver() {
|
|
73
|
+
const originalIntersectionObserver = window.IntersectionObserver;
|
|
74
|
+
window.IntersectionObserver = vitest.vi.fn(() => ({
|
|
75
|
+
observe: vitest.vi.fn(),
|
|
76
|
+
unobserve: vitest.vi.fn(),
|
|
77
|
+
disconnect: vitest.vi.fn()
|
|
78
|
+
}));
|
|
79
|
+
return () => {
|
|
80
|
+
window.IntersectionObserver = originalIntersectionObserver;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function installScrollToMock() {
|
|
84
|
+
const originalScrollTo = Element.prototype.scrollTo;
|
|
85
|
+
Element.prototype.scrollTo = () => {
|
|
86
|
+
};
|
|
87
|
+
return () => {
|
|
88
|
+
Element.prototype.scrollTo = originalScrollTo;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function mockMatchMedia({ getMatches }) {
|
|
92
|
+
const originalMatchMedia = window.matchMedia;
|
|
93
|
+
window.matchMedia = vitest.vi.fn().mockImplementation((query) => ({
|
|
94
|
+
matches: getMatches(query),
|
|
95
|
+
media: query,
|
|
96
|
+
onchange: null,
|
|
97
|
+
addListener: vitest.vi.fn(),
|
|
98
|
+
removeListener: vitest.vi.fn(),
|
|
99
|
+
addEventListener: vitest.vi.fn(),
|
|
100
|
+
removeEventListener: vitest.vi.fn(),
|
|
101
|
+
dispatchEvent: vitest.vi.fn()
|
|
102
|
+
}));
|
|
103
|
+
return () => {
|
|
104
|
+
window.matchMedia = originalMatchMedia;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function silenceConsoleError() {
|
|
108
|
+
const mock = vitest.vi.spyOn(console, "error").mockImplementation(() => vitest.vi.fn());
|
|
109
|
+
return () => {
|
|
110
|
+
mock.mockRestore();
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function userClick(user, element) {
|
|
114
|
+
return __async(this, null, function* () {
|
|
115
|
+
yield user.click(element);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function userKeyboard(user, text) {
|
|
119
|
+
return __async(this, null, function* () {
|
|
120
|
+
yield user.keyboard(text);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function userHover(user, element) {
|
|
124
|
+
return __async(this, null, function* () {
|
|
125
|
+
yield user.hover(element);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function userTab(user) {
|
|
129
|
+
return __async(this, null, function* () {
|
|
130
|
+
yield user.tab();
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function userType(user, element, text) {
|
|
134
|
+
return __async(this, null, function* () {
|
|
135
|
+
yield user.type(element, text);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function selectCheckbox(user, el) {
|
|
139
|
+
return __async(this, null, function* () {
|
|
140
|
+
yield userClick(user, el);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function disableReactTransitionGroup() {
|
|
144
|
+
config.reactTransitionGroupConfig.disabled = true;
|
|
145
|
+
}
|
|
146
|
+
function enableReactTransitionGroup() {
|
|
147
|
+
config.reactTransitionGroupConfig.disabled = false;
|
|
148
|
+
}
|
|
149
|
+
exports.disableReactTransitionGroup = disableReactTransitionGroup;
|
|
150
|
+
exports.enableReactTransitionGroup = enableReactTransitionGroup;
|
|
151
|
+
exports.installJestCompatibleFakeTimers = installJestCompatibleFakeTimers;
|
|
152
|
+
exports.installScrollToMock = installScrollToMock;
|
|
153
|
+
exports.mockGetComputedStyle = mockGetComputedStyle;
|
|
154
|
+
exports.mockIntersectionObserver = mockIntersectionObserver;
|
|
155
|
+
exports.mockMatchMedia = mockMatchMedia;
|
|
156
|
+
exports.render = render;
|
|
157
|
+
exports.selectCheckbox = selectCheckbox;
|
|
158
|
+
exports.silenceConsoleError = silenceConsoleError;
|
|
159
|
+
exports.userClick = userClick;
|
|
160
|
+
exports.userHover = userHover;
|
|
161
|
+
exports.userKeyboard = userKeyboard;
|
|
162
|
+
exports.userTab = userTab;
|
|
163
|
+
exports.userType = userType;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __async = (__this, __arguments, generator) => {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
var fulfilled = (value) => {
|
|
23
|
+
try {
|
|
24
|
+
step(generator.next(value));
|
|
25
|
+
} catch (e) {
|
|
26
|
+
reject(e);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var rejected = (value) => {
|
|
30
|
+
try {
|
|
31
|
+
step(generator.throw(value));
|
|
32
|
+
} catch (e) {
|
|
33
|
+
reject(e);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
import { render as render$1 } from "@testing-library/react";
|
|
41
|
+
import userEvent from "@testing-library/user-event";
|
|
42
|
+
import { vi } from "vitest";
|
|
43
|
+
import { r as reactTransitionGroupConfig } from "../__chunks__/config-DeltQABu.mjs";
|
|
44
|
+
function render(jsx) {
|
|
45
|
+
return __spreadValues({
|
|
46
|
+
user: userEvent.setup({
|
|
47
|
+
advanceTimers: vi.advanceTimersByTime.bind(vi)
|
|
48
|
+
})
|
|
49
|
+
}, render$1(jsx));
|
|
50
|
+
}
|
|
51
|
+
function installJestCompatibleFakeTimers() {
|
|
52
|
+
beforeAll(() => {
|
|
53
|
+
const globalWithJest = globalThis;
|
|
54
|
+
const _jest = globalWithJest.jest;
|
|
55
|
+
globalWithJest.jest = __spreadProps(__spreadValues({}, globalWithJest.jest), {
|
|
56
|
+
advanceTimersByTime: vi.advanceTimersByTime.bind(vi)
|
|
57
|
+
});
|
|
58
|
+
return () => {
|
|
59
|
+
globalWithJest.jest = _jest;
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function mockGetComputedStyle() {
|
|
64
|
+
const originalGetComputedStyle = window.getComputedStyle;
|
|
65
|
+
window.getComputedStyle = (elt) => originalGetComputedStyle(elt);
|
|
66
|
+
return () => {
|
|
67
|
+
window.getComputedStyle = originalGetComputedStyle;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function mockIntersectionObserver() {
|
|
71
|
+
const originalIntersectionObserver = window.IntersectionObserver;
|
|
72
|
+
window.IntersectionObserver = vi.fn(() => ({
|
|
73
|
+
observe: vi.fn(),
|
|
74
|
+
unobserve: vi.fn(),
|
|
75
|
+
disconnect: vi.fn()
|
|
76
|
+
}));
|
|
77
|
+
return () => {
|
|
78
|
+
window.IntersectionObserver = originalIntersectionObserver;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function installScrollToMock() {
|
|
82
|
+
const originalScrollTo = Element.prototype.scrollTo;
|
|
83
|
+
Element.prototype.scrollTo = () => {
|
|
84
|
+
};
|
|
85
|
+
return () => {
|
|
86
|
+
Element.prototype.scrollTo = originalScrollTo;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function mockMatchMedia({ getMatches }) {
|
|
90
|
+
const originalMatchMedia = window.matchMedia;
|
|
91
|
+
window.matchMedia = vi.fn().mockImplementation((query) => ({
|
|
92
|
+
matches: getMatches(query),
|
|
93
|
+
media: query,
|
|
94
|
+
onchange: null,
|
|
95
|
+
addListener: vi.fn(),
|
|
96
|
+
removeListener: vi.fn(),
|
|
97
|
+
addEventListener: vi.fn(),
|
|
98
|
+
removeEventListener: vi.fn(),
|
|
99
|
+
dispatchEvent: vi.fn()
|
|
100
|
+
}));
|
|
101
|
+
return () => {
|
|
102
|
+
window.matchMedia = originalMatchMedia;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function silenceConsoleError() {
|
|
106
|
+
const mock = vi.spyOn(console, "error").mockImplementation(() => vi.fn());
|
|
107
|
+
return () => {
|
|
108
|
+
mock.mockRestore();
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function userClick(user, element) {
|
|
112
|
+
return __async(this, null, function* () {
|
|
113
|
+
yield user.click(element);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function userKeyboard(user, text) {
|
|
117
|
+
return __async(this, null, function* () {
|
|
118
|
+
yield user.keyboard(text);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function userHover(user, element) {
|
|
122
|
+
return __async(this, null, function* () {
|
|
123
|
+
yield user.hover(element);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function userTab(user) {
|
|
127
|
+
return __async(this, null, function* () {
|
|
128
|
+
yield user.tab();
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function userType(user, element, text) {
|
|
132
|
+
return __async(this, null, function* () {
|
|
133
|
+
yield user.type(element, text);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function selectCheckbox(user, el) {
|
|
137
|
+
return __async(this, null, function* () {
|
|
138
|
+
yield userClick(user, el);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function disableReactTransitionGroup() {
|
|
142
|
+
reactTransitionGroupConfig.disabled = true;
|
|
143
|
+
}
|
|
144
|
+
function enableReactTransitionGroup() {
|
|
145
|
+
reactTransitionGroupConfig.disabled = false;
|
|
146
|
+
}
|
|
147
|
+
export {
|
|
148
|
+
disableReactTransitionGroup,
|
|
149
|
+
enableReactTransitionGroup,
|
|
150
|
+
installJestCompatibleFakeTimers,
|
|
151
|
+
installScrollToMock,
|
|
152
|
+
mockGetComputedStyle,
|
|
153
|
+
mockIntersectionObserver,
|
|
154
|
+
mockMatchMedia,
|
|
155
|
+
render,
|
|
156
|
+
selectCheckbox,
|
|
157
|
+
silenceConsoleError,
|
|
158
|
+
userClick,
|
|
159
|
+
userHover,
|
|
160
|
+
userKeyboard,
|
|
161
|
+
userTab,
|
|
162
|
+
userType
|
|
163
|
+
};
|