@pingux/astro 2.32.0-alpha.6 → 2.32.0-alpha.8

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 (109) hide show
  1. package/lib/cjs/components/AccordionGroup/AccordionGroup.stories.js +1 -1
  2. package/lib/cjs/components/Badge/Badge.stories.js +1 -1
  3. package/lib/cjs/components/Badge/Convenience/ConvenienceBadges.stories.js +1 -1
  4. package/lib/cjs/components/Bracket/Bracket.stories.js +1 -1
  5. package/lib/cjs/components/Breadcrumbs/Breadcrumbs.stories.js +1 -1
  6. package/lib/cjs/components/Button/Button.stories.d.ts +1 -1
  7. package/lib/cjs/components/Button/Button.stories.js +1 -1
  8. package/lib/cjs/components/Calendar/Calendar.stories.js +1 -1
  9. package/lib/cjs/components/Calendar/Calendar.test.js +9 -32
  10. package/lib/cjs/components/Callout/Callout.stories.js +1 -1
  11. package/lib/cjs/components/Card/Card.stories.js +1 -1
  12. package/lib/cjs/components/CodeView/CodeView.stories.js +1 -1
  13. package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.stories.js +1 -1
  14. package/lib/cjs/components/CopyText/CopyText.stories.js +1 -1
  15. package/lib/cjs/components/HelpHint/HelpHint.stories.js +1 -1
  16. package/lib/cjs/components/Icon/Icon.stories.js +1 -1
  17. package/lib/cjs/components/IconBadge/IconBadge.stories.js +1 -1
  18. package/lib/cjs/components/IconButton/IconButton.stories.js +1 -1
  19. package/lib/cjs/components/ImageUploadField/ImageUploadField.test.js +47 -14
  20. package/lib/cjs/components/Label/Label.test.js +10 -7
  21. package/lib/cjs/components/Link/Link.stories.js +1 -1
  22. package/lib/cjs/components/Loader/Loader.stories.js +1 -1
  23. package/lib/cjs/components/Menu/Menu.stories.js +1 -1
  24. package/lib/cjs/components/Messages/Messages.js +42 -9
  25. package/lib/cjs/components/Messages/Messages.stories.js +1 -1
  26. package/lib/cjs/components/Messages/Messages.test.js +7 -4
  27. package/lib/cjs/components/Modal/Modal.stories.js +1 -1
  28. package/lib/cjs/components/NavBar/NavBar.stories.js +1 -1
  29. package/lib/cjs/components/PanelHeader/PanelHeader.stories.js +1 -1
  30. package/lib/cjs/components/PanelHeader/PanelHeader.test.js +7 -3
  31. package/lib/cjs/components/PopoverMenu/PopoverMenu.stories.js +1 -1
  32. package/lib/cjs/components/RequirementsList/RequirementsList.stories.js +1 -1
  33. package/lib/cjs/components/ScrollBox/ScrollBox.stories.js +1 -1
  34. package/lib/cjs/components/Separator/Separator.stories.js +1 -1
  35. package/lib/cjs/components/Stepper/Stepper.stories.js +1 -1
  36. package/lib/cjs/hooks/useComponentToggle/index.d.ts +1 -0
  37. package/lib/cjs/hooks/useComponentToggle/useComponentToggle.d.ts +32 -0
  38. package/lib/cjs/hooks/useComponentToggle/useComponentToggle.js +4 -20
  39. package/lib/cjs/hooks/useComponentToggle/useComponentToggle.test.d.ts +1 -0
  40. package/lib/cjs/hooks/useComponentToggle/useComponentToggle.test.js +8 -9
  41. package/lib/cjs/hooks/useImageUploadState/index.d.ts +1 -0
  42. package/lib/cjs/hooks/useImageUploadState/useImageUploadState.d.ts +28 -0
  43. package/lib/cjs/hooks/useImageUploadState/useImageUploadState.js +9 -6
  44. package/lib/cjs/recipes/AttributeMapping.stories.js +1 -1
  45. package/lib/cjs/recipes/ConditionFilter.stories.js +1 -1
  46. package/lib/cjs/recipes/MaskedValue.stories.js +1 -1
  47. package/lib/cjs/recipes/MultipagePopup.stories.js +1 -1
  48. package/lib/cjs/recipes/OneWayToBidirectionalArrow.stories.js +1 -1
  49. package/lib/cjs/recipes/PanelContent.stories.js +1 -1
  50. package/lib/cjs/recipes/Slider.stories.js +1 -1
  51. package/lib/cjs/recipes/TrialExperienceIndustryButtons.stories.js +1 -1
  52. package/lib/cjs/recipes/TrialExperienceStatusBar.stories.js +1 -1
  53. package/lib/cjs/utils/designUtils/figmaLinks.d.ts +7 -0
  54. package/lib/cjs/utils/testUtils/setupTests.d.ts +4 -0
  55. package/lib/cjs/utils/testUtils/testAxe.d.ts +2 -0
  56. package/lib/cjs/utils/testUtils/testTheme.d.ts +21 -0
  57. package/lib/cjs/utils/testUtils/testWrapper.d.ts +5 -0
  58. package/lib/cjs/utils/testUtils/testWrapper.js +3 -2
  59. package/lib/cjs/utils/testUtils/universalComponentTest.d.ts +5 -0
  60. package/lib/cjs/utils/testUtils/universalComponentTest.js +86 -0
  61. package/lib/components/AccordionGroup/AccordionGroup.stories.js +1 -1
  62. package/lib/components/Badge/Badge.stories.js +1 -1
  63. package/lib/components/Badge/Convenience/ConvenienceBadges.stories.js +1 -1
  64. package/lib/components/Bracket/Bracket.stories.js +1 -1
  65. package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +1 -1
  66. package/lib/components/Button/Button.stories.js +1 -1
  67. package/lib/components/Calendar/Calendar.stories.js +1 -1
  68. package/lib/components/Calendar/Calendar.test.js +9 -32
  69. package/lib/components/Callout/Callout.stories.js +1 -1
  70. package/lib/components/Card/Card.stories.js +1 -1
  71. package/lib/components/CodeView/CodeView.stories.js +1 -1
  72. package/lib/components/CollapsiblePanel/CollapsiblePanel.stories.js +1 -1
  73. package/lib/components/CopyText/CopyText.stories.js +1 -1
  74. package/lib/components/HelpHint/HelpHint.stories.js +1 -1
  75. package/lib/components/Icon/Icon.stories.js +1 -1
  76. package/lib/components/IconBadge/IconBadge.stories.js +1 -1
  77. package/lib/components/IconButton/IconButton.stories.js +1 -1
  78. package/lib/components/ImageUploadField/ImageUploadField.test.js +47 -14
  79. package/lib/components/Label/Label.test.js +8 -5
  80. package/lib/components/Link/Link.stories.js +1 -1
  81. package/lib/components/Loader/Loader.stories.js +1 -1
  82. package/lib/components/Menu/Menu.stories.js +1 -1
  83. package/lib/components/Messages/Messages.js +47 -15
  84. package/lib/components/Messages/Messages.stories.js +1 -1
  85. package/lib/components/Messages/Messages.test.js +7 -4
  86. package/lib/components/Modal/Modal.stories.js +1 -1
  87. package/lib/components/NavBar/NavBar.stories.js +1 -1
  88. package/lib/components/PanelHeader/PanelHeader.stories.js +1 -1
  89. package/lib/components/PanelHeader/PanelHeader.test.js +7 -3
  90. package/lib/components/PopoverMenu/PopoverMenu.stories.js +1 -1
  91. package/lib/components/RequirementsList/RequirementsList.stories.js +1 -1
  92. package/lib/components/ScrollBox/ScrollBox.stories.js +1 -1
  93. package/lib/components/Separator/Separator.stories.js +1 -1
  94. package/lib/components/Stepper/Stepper.stories.js +1 -1
  95. package/lib/hooks/useComponentToggle/useComponentToggle.js +4 -21
  96. package/lib/hooks/useComponentToggle/useComponentToggle.test.js +8 -9
  97. package/lib/hooks/useImageUploadState/useImageUploadState.js +9 -6
  98. package/lib/recipes/AttributeMapping.stories.js +1 -1
  99. package/lib/recipes/ConditionFilter.stories.js +1 -1
  100. package/lib/recipes/MaskedValue.stories.js +1 -1
  101. package/lib/recipes/MultipagePopup.stories.js +1 -1
  102. package/lib/recipes/OneWayToBidirectionalArrow.stories.js +1 -1
  103. package/lib/recipes/PanelContent.stories.js +1 -1
  104. package/lib/recipes/Slider.stories.js +1 -1
  105. package/lib/recipes/TrialExperienceIndustryButtons.stories.js +1 -1
  106. package/lib/recipes/TrialExperienceStatusBar.stories.js +1 -1
  107. package/lib/utils/testUtils/testWrapper.js +3 -2
  108. package/lib/utils/testUtils/universalComponentTest.js +74 -0
  109. package/package.json +4 -1
@@ -43,7 +43,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
43
43
  } : {
44
44
  name: "zxbwtf-GlobalTestStyles",
45
45
  styles: ".is-disabled{opacity:0.5;pointer-events:none;};label:GlobalTestStyles;",
46
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlscy90ZXN0VXRpbHMvdGVzdFdyYXBwZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBVVMiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjL3V0aWxzL3Rlc3RVdGlscy90ZXN0V3JhcHBlci5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBjc3MsIEdsb2JhbCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHJlbmRlciB9IGZyb20gJ0B0ZXN0aW5nLWxpYnJhcnkvcmVhY3QnO1xuaW1wb3J0IHsgVGhlbWVQcm92aWRlciB9IGZyb20gJ3RoZW1lLXVpJztcblxuaW1wb3J0IHRoZW1lIGZyb20gJy4uLy4uL3N0eWxlcy90aGVtZSc7XG5cbmNvbnN0IEdsb2JhbFRlc3RTdHlsZXMgPSAoKSA9PiAoXG4gIDxHbG9iYWxcbiAgICBzdHlsZXM9e1xuICAgICAgY3NzYFxuICAgICAgICAuaXMtZGlzYWJsZWQge1xuICAgICAgICAgIG9wYWNpdHk6IDAuNTtcbiAgICAgICAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcbiAgICAgICAgfVxuICAgICAgYFxuICAgIH1cbiAgLz5cbik7XG5cbi8qKlxuICogVE9ETzogQ2hhbmdlIEplc3QgY29uZmlnIHNvIHRoaXMgZG9lc24ndCBoYXZlIHRvIGJlIGltcG9ydGVkIHJlbGF0aXZlbHkuLi5cbiAqIGh0dHBzOi8vdGVzdGluZy1saWJyYXJ5LmNvbS9kb2NzL3JlYWN0LXRlc3RpbmctbGlicmFyeS9zZXR1cC8jY29uZmlndXJpbmctamVzdC13aXRoLXRlc3QtdXRpbHNcbiAqXG4gKiBVc2UgdGhpcyB3cmFwcGVyIHdoZW4gdGVzdGluZyB0aGUgdGhlbWUgb3V0cHV0IGZvclxuICogYSBjb21wb25lbnQgdXNpbmcgLnRvSGF2ZVN0eWxlIG9yIC50b0hhdmVTdHlsZVJ1bGVcbiAqXG4gKiBTZWUgQnV0dG9uLnRlc3QuanMgYXMgYW4gZXhhbXBsZSBmb3IgaG93IHRvIGFwcGx5IGNvbmRpdGlvbmFsIGNsYXNzZXMgYW5kIHRoZW4gdGVzdGluZyB0aGF0XG4gKiB0aG9zZSBjbGFzc2VzIGhhdmUgdGhlIGFwcHJvcHJpYXRlIHN0eWxlcyB0aWVkIHRvIHRoZW0gaW4gdGhlIHRoZW1lLlxuICovXG5jb25zdCBXcmFwcGVyID0gKHsgY2hpbGRyZW4gfSkgPT4ge1xuICByZXR1cm4gKFxuICAgIDxUaGVtZVByb3ZpZGVyIHRoZW1lPXt0aGVtZX0+XG4gICAgICA8R2xvYmFsVGVzdFN0eWxlcyAvPlxuICAgICAge2NoaWxkcmVufVxuICAgIDwvVGhlbWVQcm92aWRlcj5cbiAgKTtcbn07XG5cbmNvbnN0IGN1c3RvbVJlbmRlciA9ICh1aSwgb3B0aW9ucykgPT4gcmVuZGVyKHVpLCB7IHdyYXBwZXI6IFdyYXBwZXIsIC4uLm9wdGlvbnMgfSk7XG5cbi8vIHJlLWV4cG9ydCBldmVyeXRoaW5nXG5leHBvcnQgKiBmcm9tICdAdGVzdGluZy1saWJyYXJ5L3JlYWN0JztcblxuLy8gb3ZlcnJpZGUgcmVuZGVyIG1ldGhvZFxuZXhwb3J0IHsgY3VzdG9tUmVuZGVyIGFzIHJlbmRlciB9O1xuIl19 */",
46
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy91dGlscy90ZXN0VXRpbHMvdGVzdFdyYXBwZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVVTIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy91dGlscy90ZXN0VXRpbHMvdGVzdFdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IFJlYWN0Tm9kZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGNzcywgR2xvYmFsIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgcmVuZGVyLCBSZW5kZXJPcHRpb25zIH0gZnJvbSAnQHRlc3RpbmctbGlicmFyeS9yZWFjdCc7XG5pbXBvcnQgeyBUaGVtZVByb3ZpZGVyIH0gZnJvbSAndGhlbWUtdWknO1xuXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vLi4vc3R5bGVzL3RoZW1lJztcblxuY29uc3QgR2xvYmFsVGVzdFN0eWxlczogUmVhY3QuRkMgPSAoKSA9PiAoXG4gIDxHbG9iYWxcbiAgICBzdHlsZXM9e1xuICAgICAgY3NzYFxuICAgICAgICAuaXMtZGlzYWJsZWQge1xuICAgICAgICAgIG9wYWNpdHk6IDAuNTtcbiAgICAgICAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcbiAgICAgICAgfVxuICAgICAgYFxuICAgIH1cbiAgLz5cbik7XG5cbi8qKlxuICogVE9ETzogQ2hhbmdlIEplc3QgY29uZmlnIHNvIHRoaXMgZG9lc24ndCBoYXZlIHRvIGJlIGltcG9ydGVkIHJlbGF0aXZlbHkuLi5cbiAqIGh0dHBzOi8vdGVzdGluZy1saWJyYXJ5LmNvbS9kb2NzL3JlYWN0LXRlc3RpbmctbGlicmFyeS9zZXR1cC8jY29uZmlndXJpbmctamVzdC13aXRoLXRlc3QtdXRpbHNcbiAqXG4gKiBVc2UgdGhpcyB3cmFwcGVyIHdoZW4gdGVzdGluZyB0aGUgdGhlbWUgb3V0cHV0IGZvclxuICogYSBjb21wb25lbnQgdXNpbmcgLnRvSGF2ZVN0eWxlIG9yIC50b0hhdmVTdHlsZVJ1bGVcbiAqXG4gKiBTZWUgQnV0dG9uLnRlc3QuanMgYXMgYW4gZXhhbXBsZSBmb3IgaG93IHRvIGFwcGx5IGNvbmRpdGlvbmFsIGNsYXNzZXMgYW5kIHRoZW4gdGVzdGluZyB0aGF0XG4gKiB0aG9zZSBjbGFzc2VzIGhhdmUgdGhlIGFwcHJvcHJpYXRlIHN0eWxlcyB0aWVkIHRvIHRoZW0gaW4gdGhlIHRoZW1lLlxuICovXG5cbmludGVyZmFjZSBXcmFwcGVyUHJvcHMge1xuICBjaGlsZHJlbjogUmVhY3ROb2RlO1xufVxuXG5jb25zdCBXcmFwcGVyOiBSZWFjdC5GQzxXcmFwcGVyUHJvcHM+ID0gKHsgY2hpbGRyZW4gfSkgPT4gKFxuICA8VGhlbWVQcm92aWRlciB0aGVtZT17dGhlbWV9PlxuICAgIDxHbG9iYWxUZXN0U3R5bGVzIC8+XG4gICAge2NoaWxkcmVufVxuICA8L1RoZW1lUHJvdmlkZXI+XG4pO1xuXG5jb25zdCBjdXN0b21SZW5kZXIgPSAodWk6IFJlYWN0LlJlYWN0RWxlbWVudCwgb3B0aW9ucz86IFJlbmRlck9wdGlvbnMpID0+IHJlbmRlcih1aSxcbiAgeyB3cmFwcGVyOiBXcmFwcGVyIGFzIFJlYWN0LkZDLCAuLi5vcHRpb25zIH0sXG4pO1xuXG4vLyByZS1leHBvcnQgZXZlcnl0aGluZyAtXG5leHBvcnQgKiBmcm9tICdAdGVzdGluZy1saWJyYXJ5L3JlYWN0JztcblxuLy8gb3ZlcnJpZGUgcmVuZGVyIG1ldGhvZFxuZXhwb3J0IHsgY3VzdG9tUmVuZGVyIGFzIHJlbmRlciB9O1xuIl19 */",
47
47
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
48
48
  };
49
49
  var GlobalTestStyles = function GlobalTestStyles() {
@@ -62,6 +62,7 @@ var GlobalTestStyles = function GlobalTestStyles() {
62
62
  * See Button.test.js as an example for how to apply conditional classes and then testing that
63
63
  * those classes have the appropriate styles tied to them in the theme.
64
64
  */
65
+
65
66
  var Wrapper = function Wrapper(_ref2) {
66
67
  var children = _ref2.children;
67
68
  return (0, _react2.jsx)(_themeUi.ThemeProvider, {
@@ -74,7 +75,7 @@ var customRender = function customRender(ui, options) {
74
75
  }, options));
75
76
  };
76
77
 
77
- // re-export everything
78
+ // re-export everything -
78
79
 
79
80
  // override render method
80
81
  exports.render = customRender;
@@ -0,0 +1,5 @@
1
+ export declare const universalComponentTests: ({ renderComponent, props, rules }: {
2
+ renderComponent: any;
3
+ props: any;
4
+ rules?: {} | undefined;
5
+ }) => Promise<void>;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
4
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
5
+ var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol");
6
+ var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create");
7
+ var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
8
+ var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
9
+ var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of");
10
+ var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise");
11
+ var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
12
+ var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
13
+ var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
14
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
15
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
16
+ _Object$defineProperty(exports, "__esModule", {
17
+ value: true
18
+ });
19
+ exports.universalComponentTests = void 0;
20
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
21
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
22
+ var _react = _interopRequireWildcard(require("react"));
23
+ var _react2 = require("@testing-library/react");
24
+ var _jestAxe = require("jest-axe");
25
+ var _react3 = require("@emotion/react");
26
+ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
28
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context3; _forEachInstanceProperty(_context3 = ["next", "throw", "return"]).call(_context3, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context4; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context4 = this.tryEntries).call(_context4, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
29
+ var HAS_REF = 'ref';
30
+ var ComponentWithRef = function ComponentWithRef(_ref) {
31
+ var renderComponent = _ref.renderComponent;
32
+ var _useState = (0, _react.useState)(null),
33
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
34
+ state = _useState2[0],
35
+ setState = _useState2[1];
36
+ var ref = (0, _react.useRef)();
37
+ (0, _react.useEffect)(function () {
38
+ if (!ref.current) return;
39
+ setState(ref.current);
40
+ }, []);
41
+ return (0, _react3.jsx)(_react["default"].Fragment, null, renderComponent({
42
+ ref: ref
43
+ }), state && HAS_REF);
44
+ };
45
+ var universalComponentTests = /*#__PURE__*/function () {
46
+ var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
47
+ var renderComponent, props, _ref2$rules, rules;
48
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
49
+ while (1) switch (_context2.prev = _context2.next) {
50
+ case 0:
51
+ renderComponent = _ref2.renderComponent, props = _ref2.props, _ref2$rules = _ref2.rules, rules = _ref2$rules === void 0 ? {} : _ref2$rules;
52
+ test('should have no accessibility violations', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
53
+ var _render, container, results;
54
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
55
+ while (1) switch (_context.prev = _context.next) {
56
+ case 0:
57
+ jest.useRealTimers();
58
+ _render = (0, _react2.render)(renderComponent(props)), container = _render.container;
59
+ _context.next = 4;
60
+ return (0, _jestAxe.axe)(container, rules);
61
+ case 4:
62
+ results = _context.sent;
63
+ expect(results).toHaveNoViolations();
64
+ case 6:
65
+ case "end":
66
+ return _context.stop();
67
+ }
68
+ }, _callee);
69
+ })));
70
+ test('should forward refs properly', function () {
71
+ (0, _react2.render)((0, _react3.jsx)(ComponentWithRef, {
72
+ renderComponent: renderComponent
73
+ }));
74
+ _react2.screen.getByText(HAS_REF);
75
+ });
76
+ case 3:
77
+ case "end":
78
+ return _context2.stop();
79
+ }
80
+ }, _callee2);
81
+ }));
82
+ return function universalComponentTests(_x) {
83
+ return _ref3.apply(this, arguments);
84
+ };
85
+ }();
86
+ exports.universalComponentTests = universalComponentTests;
@@ -5,7 +5,7 @@ import { Item } from 'react-stately';
5
5
  import { withDesign } from 'storybook-addon-designs';
6
6
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
7
7
  import { AccordionGroup, Badge, Box, Button, Text, TextField } from '../../index';
8
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
8
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
9
9
  import { validHeadingTags } from '../AccordionItem/AccordionItem';
10
10
  import AccordionReadme from './AccordionGroup.mdx';
11
11
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -10,7 +10,7 @@ import { withDesign } from 'storybook-addon-designs';
10
10
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
11
11
  import { Badge, Box, Icon, IconButton } from '../../index';
12
12
  import { flatColorList } from '../../styles/colors.js';
13
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
13
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
14
14
  import BadgeReadme from './Badge.mdx';
15
15
  import { jsx as ___EmotionJSX } from "@emotion/react";
16
16
  export default {
@@ -7,7 +7,7 @@ import React, { useState } from 'react';
7
7
  import { v4 as uuid } from 'uuid';
8
8
  import DocsLayout from '../../../../.storybook/storybookDocsLayout';
9
9
  import { Box, DefaultBadge, ErrorCalloutBadge, InfoCalloutBadge, RemovableBadge, SuccessCalloutBadge, WarningCalloutBadge } from '../../../index';
10
- import { FIGMA_LINKS } from '../../../utils/designUtils/figmaLinks.js';
10
+ import { FIGMA_LINKS } from '../../../utils/designUtils/figmaLinks.ts';
11
11
  import { jsx as ___EmotionJSX } from "@emotion/react";
12
12
  export default {
13
13
  title: 'Components/Badge/Convenience',
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
3
3
  import { Box, Bracket } from '../../index';
4
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
4
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
5
5
  import BracketReadme from './Bracket.mdx';
6
6
  import { jsx as ___EmotionJSX } from "@emotion/react";
7
7
  export default {
@@ -6,7 +6,7 @@ import { action } from '@storybook/addon-actions';
6
6
  import { withDesign } from 'storybook-addon-designs';
7
7
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
8
8
  import { Breadcrumbs } from '../../index';
9
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
9
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
10
10
  import BreadcrumbsReadme from './Breadcrumbs.mdx';
11
11
  import { jsx as ___EmotionJSX } from "@emotion/react";
12
12
  export default {
@@ -18,7 +18,7 @@ import PlusIcon from '@pingux/mdi-react/PlusIcon';
18
18
  import { withDesign } from 'storybook-addon-designs';
19
19
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
20
20
  import { Box, Button, Icon, Text } from '../../index';
21
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
21
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
22
22
  import ButtonReadme from './Button.mdx';
23
23
  import { buttonArgTypes } from './buttonAttributes';
24
24
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -16,7 +16,7 @@ import React, { useState } from 'react';
16
16
  import { parseDate } from '@internationalized/date';
17
17
  import { withDesign } from 'storybook-addon-designs';
18
18
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
19
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
19
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
20
20
  import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
21
21
  import Calendar from './Calendar';
22
22
  import CalendarReadme from './Calendar.mdx';
@@ -1,23 +1,11 @@
1
- import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
2
- import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
3
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context9; _forEachInstanceProperty(_context9 = ["next", "throw", "return"]).call(_context9, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context10; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context10 = this.tryEntries).call(_context10, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4
1
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
5
2
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
6
- import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
7
- import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
8
- import _Object$create from "@babel/runtime-corejs3/core-js-stable/object/create";
9
- import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/get-prototype-of";
10
- import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
11
- import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/set-prototype-of";
12
- import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
13
- import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
14
- import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
15
3
  import React from 'react';
16
4
  import { getLocalTimeZone, today } from '@internationalized/date';
17
5
  import userEvent from '@testing-library/user-event';
18
- import { axe } from 'jest-axe';
19
6
  import { isDateWithinRanges } from '../../utils/devUtils/props/isDateWithinRanges';
20
7
  import { act, fireEvent, render, screen, within } from '../../utils/testUtils/testWrapper';
8
+ import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
21
9
  import Calendar from './Calendar';
22
10
  import { jsx as ___EmotionJSX } from "@emotion/react";
23
11
  var unavailableRanges = [['2022-08-01', '2022-08-03'], ['2022-08-15', '2022-08-20']];
@@ -32,6 +20,13 @@ var getComponent = function getComponent() {
32
20
  renderFn = _ref$renderFn === void 0 ? render : _ref$renderFn;
33
21
  return renderFn(___EmotionJSX(Calendar, props));
34
22
  };
23
+
24
+ // Needs to be added to each components test file.
25
+ universalComponentTests({
26
+ renderComponent: function renderComponent(props) {
27
+ return ___EmotionJSX(Calendar, props);
28
+ }
29
+ });
35
30
  test('renders calendar component', function () {
36
31
  var _context, _context2;
37
32
  getComponent({
@@ -296,22 +291,4 @@ test('should autofocus on current day with hasAutoFocus', function () {
296
291
  return cell.getAttribute('aria-disabled') !== 'true';
297
292
  });
298
293
  expect(focusedDay[0]).toHaveTextContent(day);
299
- });
300
- test('should have no accessibility violations', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
301
- var _getComponent, container, results;
302
- return _regeneratorRuntime().wrap(function _callee$(_context8) {
303
- while (1) switch (_context8.prev = _context8.next) {
304
- case 0:
305
- jest.useRealTimers();
306
- _getComponent = getComponent(), container = _getComponent.container;
307
- _context8.next = 4;
308
- return axe(container);
309
- case 4:
310
- results = _context8.sent;
311
- expect(results).toHaveNoViolations();
312
- case 6:
313
- case "end":
314
- return _context8.stop();
315
- }
316
- }, _callee);
317
- })));
294
+ });
@@ -13,7 +13,7 @@ import React from 'react';
13
13
  import { withDesign } from 'storybook-addon-designs';
14
14
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
15
15
  import { Callout, Link, Text } from '../../index';
16
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
16
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
17
17
  import statuses from '../../utils/devUtils/constants/statuses';
18
18
  import { statusArgTypes } from '../../utils/docUtils/statusProp';
19
19
  import CalloutReadme from './Callout.mdx';
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { withDesign } from 'storybook-addon-designs';
4
4
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
5
5
  import { Box, Button, Card } from '../../index';
6
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
6
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
7
7
  import CardReadme from './Card.mdx';
8
8
  import { jsx as ___EmotionJSX } from "@emotion/react";
9
9
  export default {
@@ -5,7 +5,7 @@ import { withDesign } from 'storybook-addon-designs';
5
5
  import 'prismjs/components/prism-powershell';
6
6
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
7
7
  import { CodeView } from '../../index';
8
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
8
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
9
9
  import CodeViewReadme from './CodeView.mdx';
10
10
  import { jsx as ___EmotionJSX } from "@emotion/react";
11
11
  var code = "{\n \"_links\": {\n \"self\": {\n \"href\": \"https://api.pingone.com/v1/environments/94e3268d-847d-47aa-a45e-1ef8dd8f4df0/users/5a5d4c0c-8383-4796-9cdc-16b5a22f45ad\"\n },\n \"password\": {\n \"href\": \"https://api.pingone.com/v1/environments/94e3268d-847d-47aa-a45e-1ef8dd8f4df0/users/5a5d4c0c-8383-4796-9cdc-16b5a22f45ad/password\"\n },\n \"password.set\": {\n \"href\": \"https://api.pingone.com/v1/environments/94e3268d-847d-47aa-a45e-1ef8dd8f4df0/users/5a5d4c0c-8383-4796-9cdc-16b5a22f45ad/password\"\n },\n \"password.reset\": {\n \"href\": \"https://api.pingone.com/v1/environments/94e3268d-847d-47aa-a45e-1ef8dd8f4df0/users/5a5d4c0c-8383-4796-9cdc-16b5a22f45ad/password\"\n },\n \"password.check\": {\n \"href\": \"https://api.pingone.com/v1/environments/94e3268d-847d-47aa-a45e-1ef8dd8f4df0/users/5a5d4c0c-8383-4796-9cdc-16b5a22f45ad/password\"\n },\n \"password.recover\": {\n \"href\": \"https://api.pingone.com/v1/environments/94e3268d-847d-47aa-a45e-1ef8dd8f4df0/users/5a5d4c0c-8383-4796-9cdc-16b5a22f45ad/password\"\n },\n \"account.sendVerificationCode\": {\n \"href\": \"https://api.pingone.com/v1/environments/94e3268d-847d-47aa-a45e-1ef8dd8f4df0/users/5a5d4c0c-8383-4796-9cdc-16b5a22f45ad\"\n },\n \"linkedAccounts\": {\n \"href\": \"https://api.pingone.com/v1/environments/94e3268d-847d-47aa-a45e-1ef8dd8f4df0/users/5a5d4c0c-8383-4796-9cdc-16b5a22f45ad/linkedAccounts\"\n }\n },\n \"id\": \"5a5d4c0c-8383-4796-9cdc-16b5a22f45ad\",\n \"environment\": {\n \"id\": \"94e3268d-847d-47aa-a45e-1ef8dd8f4df0\"\n },\n \"account\": {\n \"canAuthenticate\": true,\n \"status\": \"OK\"\n },\n \"createdAt\": \"2021-09-03T15:01:43.555Z\",\n \"email\": \"allegraweldon@pingidentity.com\",\n \"enabled\": true,\n \"identityProvider\": {\n \"type\": \"PING_ONE\"\n },\n \"lifecycle\": {\n \"status\": \"ACCOUNT_OK\"\n },\n \"mfaEnabled\": false,\n \"population\": {\n \"id\": \"c1adbc29-f188-4ea6-a015-49bddd74bc84\"\n },\n \"updatedAt\": \"2021-09-03T15:01:43.555Z\",\n \"username\": \"allegraweldon@pingidentity.com\",\n \"verifyStatus\": \"NOT_INITIATED\"\n}";
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { withDesign } from 'storybook-addon-designs';
3
3
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
4
4
  import { CollapsiblePanel } from '../../index';
5
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
5
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
6
6
  import CollapsiblePanelReadme from './CollapsiblePanel.mdx';
7
7
  import { jsx as ___EmotionJSX } from "@emotion/react";
8
8
  export default {
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { withDesign } from 'storybook-addon-designs';
4
4
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
5
5
  import { Box, CopyText, Link, Text } from '../../index';
6
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
6
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
7
7
  import CopyTextReadme from './CopyText.mdx';
8
8
  import { jsx as ___EmotionJSX } from "@emotion/react";
9
9
  export default {
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { withDesign } from 'storybook-addon-designs';
4
4
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
5
5
  import { Box, HelpHint, Link, Text } from '../../index';
6
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
6
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
7
7
  import HelpHintReadme from './HelpHint.mdx';
8
8
  import { jsx as ___EmotionJSX } from "@emotion/react";
9
9
  export default {
@@ -13,7 +13,7 @@ import { v4 as uuid } from 'uuid';
13
13
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
14
14
  import { Box, Icon, Table, TableBody, TableCell, TableHead, TableRow, Text } from '../../index';
15
15
  import { flatColorList } from '../../styles/colors';
16
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
16
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
17
17
  import { tShirtSizes } from '../../utils/devUtils/constants/tShirtSizes';
18
18
  import IconReadme from './Icon.mdx';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -5,7 +5,7 @@ import ArrowIcon from '@pingux/mdi-react/ArrowTopRightThickIcon';
5
5
  import { withDesign } from 'storybook-addon-designs';
6
6
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
7
7
  import { Box, Icon, IconBadge } from '../../index';
8
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
8
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
9
9
  import IconBadgeReadme from './IconBadge.mdx';
10
10
  import { jsx as ___EmotionJSX } from "@emotion/react";
11
11
  export default {
@@ -8,7 +8,7 @@ import PlusIcon from '@pingux/mdi-react/PlusIcon';
8
8
  import { withDesign } from 'storybook-addon-designs';
9
9
  import DocsLayout from '../../../.storybook/storybookDocsLayout';
10
10
  import { Box, Icon, IconButton, Table, TableBody, TableCell, TableHead, TableRow, Text } from '../../index';
11
- import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.js';
11
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
12
12
  import IconButtonReadme from './IconButton.mdx';
13
13
  import { iconButtonArgs, iconButtonArgTypes } from './iconButtonAttributes';
14
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -1,7 +1,7 @@
1
1
  import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
2
2
  import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
3
3
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
4
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context8; _forEachInstanceProperty(_context8 = ["next", "throw", "return"]).call(_context8, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context9; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context9 = this.tryEntries).call(_context9, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context9; _forEachInstanceProperty(_context9 = ["next", "throw", "return"]).call(_context9, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context10; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context10 = this.tryEntries).call(_context10, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
5
5
  import _URL from "@babel/runtime-corejs3/core-js-stable/url";
6
6
  import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
7
7
  import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
@@ -336,10 +336,43 @@ test('loader size can be changed via the prop', function () {
336
336
  'font-size': "".concat(testLoaderSize, "px")
337
337
  });
338
338
  });
339
- test('should show the menu if label clicked when preview image exists with custom uploads', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
340
- var customUploadProp, customRemoveProp, imagePreview;
339
+ test('should show the menu if label clicked when preview image exists', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
340
+ var imageUploadButton, imagePreview, imageUploadLabel;
341
341
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
342
342
  while (1) switch (_context6.prev = _context6.next) {
343
+ case 0:
344
+ getComponent();
345
+ imageUploadButton = screen.getByTestId(testButtonId);
346
+ userEvent.click(imageUploadButton);
347
+ fireEvent.change(screen.getByTestId('image-upload-input'), {
348
+ target: {
349
+ files: [file]
350
+ }
351
+ });
352
+ _context6.next = 6;
353
+ return screen.findByTestId(imageUploadImagePreview);
354
+ case 6:
355
+ imagePreview = _context6.sent;
356
+ expect(imagePreview).toBeInTheDocument();
357
+ expect(imagePreview).toHaveAttribute('src');
358
+
359
+ // Click on the image preview button
360
+ imageUploadLabel = screen.getByText(testLabel);
361
+ fireEvent.click(imageUploadLabel);
362
+ expect(screen.getAllByRole('button')[0]).toHaveAttribute('aria-expanded', 'true');
363
+ expect(screen.getByRole('menu')).toBeInTheDocument();
364
+ expect(screen.getByText('Upload New Image')).toBeInTheDocument();
365
+ expect(screen.getByText('Remove Image')).toBeInTheDocument();
366
+ case 15:
367
+ case "end":
368
+ return _context6.stop();
369
+ }
370
+ }, _callee6);
371
+ })));
372
+ test('should show the menu if label clicked when preview image exists with custom uploads', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
373
+ var customUploadProp, customRemoveProp, imagePreview;
374
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
375
+ while (1) switch (_context7.prev = _context7.next) {
343
376
  case 0:
344
377
  customUploadProp = 'Custom Upload';
345
378
  customRemoveProp = 'Custom Remove';
@@ -352,10 +385,10 @@ test('should show the menu if label clicked when preview image exists with custo
352
385
  files: [file]
353
386
  }
354
387
  });
355
- _context6.next = 6;
388
+ _context7.next = 6;
356
389
  return screen.findByTestId(imageUploadImagePreview);
357
390
  case 6:
358
- imagePreview = _context6.sent;
391
+ imagePreview = _context7.sent;
359
392
  expect(imagePreview).toBeInTheDocument();
360
393
  expect(imagePreview).toHaveAttribute('src');
361
394
 
@@ -365,9 +398,9 @@ test('should show the menu if label clicked when preview image exists with custo
365
398
  expect(screen.getByText(customRemoveProp)).toBeInTheDocument();
366
399
  case 12:
367
400
  case "end":
368
- return _context6.stop();
401
+ return _context7.stop();
369
402
  }
370
- }, _callee6);
403
+ }, _callee7);
371
404
  })));
372
405
  test('should render node element if passed as default image', function () {
373
406
  getComponent({
@@ -379,10 +412,10 @@ test('should render node element if passed as default image', function () {
379
412
  expect(img).toBeInstanceOf(HTMLImageElement);
380
413
  expect(img).toBeInTheDocument();
381
414
  });
382
- test('should implement popover menu props', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
415
+ test('should implement popover menu props', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
383
416
  var imagePreview;
384
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
385
- while (1) switch (_context7.prev = _context7.next) {
417
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
418
+ while (1) switch (_context8.prev = _context8.next) {
386
419
  case 0:
387
420
  getComponent({
388
421
  popoverMenuProps: {
@@ -394,10 +427,10 @@ test('should implement popover menu props', /*#__PURE__*/_asyncToGenerator( /*#_
394
427
  files: [file]
395
428
  }
396
429
  });
397
- _context7.next = 4;
430
+ _context8.next = 4;
398
431
  return screen.findByTestId(imageUploadImagePreview);
399
432
  case 4:
400
- imagePreview = _context7.sent;
433
+ imagePreview = _context8.sent;
401
434
  expect(imagePreview).toBeInTheDocument();
402
435
  expect(imagePreview).toHaveAttribute('src');
403
436
 
@@ -408,7 +441,7 @@ test('should implement popover menu props', /*#__PURE__*/_asyncToGenerator( /*#_
408
441
  expect(screen.getByRole('presentation')).toHaveAttribute('data-popover-placement', 'right');
409
442
  case 11:
410
443
  case "end":
411
- return _context7.stop();
444
+ return _context8.stop();
412
445
  }
413
- }, _callee7);
446
+ }, _callee8);
414
447
  })));