@pingux/astro 2.32.0-alpha.1 → 2.32.0-alpha.11

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 (143) 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/OverlayPanel/OverlayPanel.stories.js +3 -17
  30. package/lib/cjs/components/PanelHeader/PanelHeader.stories.js +1 -1
  31. package/lib/cjs/components/PanelHeader/PanelHeader.test.js +7 -3
  32. package/lib/cjs/components/PopoverMenu/PopoverMenu.stories.js +1 -1
  33. package/lib/cjs/components/RequirementsList/RequirementsList.stories.js +1 -1
  34. package/lib/cjs/components/ScrollBox/ScrollBox.stories.js +1 -1
  35. package/lib/cjs/components/Separator/Separator.stories.js +1 -1
  36. package/lib/cjs/components/Stepper/Stepper.stories.js +1 -1
  37. package/lib/cjs/components/TreeView/TreeView.js +99 -11
  38. package/lib/cjs/components/TreeView/TreeView.stories.js +23 -10
  39. package/lib/cjs/components/TreeView/TreeView.styles.js +22 -2
  40. package/lib/cjs/components/TreeView/TreeView.test.js +91 -11
  41. package/lib/cjs/components/TreeView/TreeViewItem.js +112 -14
  42. package/lib/cjs/components/TreeView/TreeViewKeyboardDelegate.js +200 -0
  43. package/lib/cjs/components/TreeView/TreeViewKeyboardDelegate.test.js +511 -0
  44. package/lib/cjs/components/TreeView/TreeViewRow.js +20 -5
  45. package/lib/cjs/components/TreeView/TreeViewSection.js +164 -16
  46. package/lib/cjs/components/TreeView/TreeViewWrapper.js +40 -0
  47. package/lib/cjs/hooks/useComponentToggle/index.d.ts +1 -0
  48. package/lib/cjs/hooks/useComponentToggle/useComponentToggle.d.ts +32 -0
  49. package/lib/cjs/hooks/useComponentToggle/useComponentToggle.js +4 -20
  50. package/lib/cjs/hooks/useComponentToggle/useComponentToggle.test.d.ts +1 -0
  51. package/lib/cjs/hooks/useComponentToggle/useComponentToggle.test.js +8 -9
  52. package/lib/cjs/hooks/useFallbackImage/index.d.ts +1 -0
  53. package/lib/cjs/hooks/useFallbackImage/useFallbackImage.d.ts +10 -0
  54. package/lib/cjs/hooks/useFallbackImage/useFallbackImage.js +1 -2
  55. package/lib/cjs/hooks/useFallbackImage/useFallbackImage.test.d.ts +1 -0
  56. package/lib/cjs/hooks/useFallbackImage/useFallbackImage.test.js +9 -9
  57. package/lib/cjs/hooks/useImageUploadState/index.d.ts +1 -0
  58. package/lib/cjs/hooks/useImageUploadState/useImageUploadState.d.ts +28 -0
  59. package/lib/cjs/hooks/useImageUploadState/useImageUploadState.js +9 -6
  60. package/lib/cjs/hooks/useModalState/index.d.ts +1 -0
  61. package/lib/cjs/hooks/useModalState/useModalState.d.ts +21 -0
  62. package/lib/cjs/hooks/useModalState/useModalState.js +0 -9
  63. package/lib/cjs/hooks/useModalState/useModalState.test.d.ts +1 -0
  64. package/lib/cjs/recipes/AttributeMapping.stories.js +1 -1
  65. package/lib/cjs/recipes/ConditionFilter.stories.js +1 -1
  66. package/lib/cjs/recipes/MaskedValue.stories.js +1 -1
  67. package/lib/cjs/recipes/MultipagePopup.stories.js +1 -1
  68. package/lib/cjs/recipes/OneWayToBidirectionalArrow.stories.js +1 -1
  69. package/lib/cjs/recipes/PanelContent.stories.js +1 -1
  70. package/lib/cjs/recipes/Slider.stories.js +1 -1
  71. package/lib/cjs/recipes/TrialExperienceIndustryButtons.stories.js +1 -1
  72. package/lib/cjs/recipes/TrialExperienceStatusBar.stories.js +1 -1
  73. package/lib/cjs/utils/designUtils/figmaLinks.d.ts +7 -0
  74. package/lib/cjs/utils/testUtils/setupTests.d.ts +4 -0
  75. package/lib/cjs/utils/testUtils/testAxe.d.ts +2 -0
  76. package/lib/cjs/utils/testUtils/testTheme.d.ts +21 -0
  77. package/lib/cjs/utils/testUtils/testWrapper.d.ts +5 -0
  78. package/lib/cjs/utils/testUtils/testWrapper.js +3 -2
  79. package/lib/cjs/utils/testUtils/universalComponentTest.d.ts +5 -0
  80. package/lib/cjs/utils/testUtils/universalComponentTest.js +86 -0
  81. package/lib/components/AccordionGroup/AccordionGroup.stories.js +1 -1
  82. package/lib/components/Badge/Badge.stories.js +1 -1
  83. package/lib/components/Badge/Convenience/ConvenienceBadges.stories.js +1 -1
  84. package/lib/components/Bracket/Bracket.stories.js +1 -1
  85. package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +1 -1
  86. package/lib/components/Button/Button.stories.js +1 -1
  87. package/lib/components/Calendar/Calendar.stories.js +1 -1
  88. package/lib/components/Calendar/Calendar.test.js +9 -32
  89. package/lib/components/Callout/Callout.stories.js +1 -1
  90. package/lib/components/Card/Card.stories.js +1 -1
  91. package/lib/components/CodeView/CodeView.stories.js +1 -1
  92. package/lib/components/CollapsiblePanel/CollapsiblePanel.stories.js +1 -1
  93. package/lib/components/CopyText/CopyText.stories.js +1 -1
  94. package/lib/components/HelpHint/HelpHint.stories.js +1 -1
  95. package/lib/components/Icon/Icon.stories.js +1 -1
  96. package/lib/components/IconBadge/IconBadge.stories.js +1 -1
  97. package/lib/components/IconButton/IconButton.stories.js +1 -1
  98. package/lib/components/ImageUploadField/ImageUploadField.test.js +47 -14
  99. package/lib/components/Label/Label.test.js +8 -5
  100. package/lib/components/Link/Link.stories.js +1 -1
  101. package/lib/components/Loader/Loader.stories.js +1 -1
  102. package/lib/components/Menu/Menu.stories.js +1 -1
  103. package/lib/components/Messages/Messages.js +47 -15
  104. package/lib/components/Messages/Messages.stories.js +1 -1
  105. package/lib/components/Messages/Messages.test.js +7 -4
  106. package/lib/components/Modal/Modal.stories.js +1 -1
  107. package/lib/components/NavBar/NavBar.stories.js +1 -1
  108. package/lib/components/OverlayPanel/OverlayPanel.stories.js +4 -18
  109. package/lib/components/PanelHeader/PanelHeader.stories.js +1 -1
  110. package/lib/components/PanelHeader/PanelHeader.test.js +7 -3
  111. package/lib/components/PopoverMenu/PopoverMenu.stories.js +1 -1
  112. package/lib/components/RequirementsList/RequirementsList.stories.js +1 -1
  113. package/lib/components/ScrollBox/ScrollBox.stories.js +1 -1
  114. package/lib/components/Separator/Separator.stories.js +1 -1
  115. package/lib/components/Stepper/Stepper.stories.js +1 -1
  116. package/lib/components/TreeView/TreeView.js +100 -12
  117. package/lib/components/TreeView/TreeView.stories.js +23 -10
  118. package/lib/components/TreeView/TreeView.styles.js +22 -2
  119. package/lib/components/TreeView/TreeView.test.js +92 -12
  120. package/lib/components/TreeView/TreeViewItem.js +111 -14
  121. package/lib/components/TreeView/TreeViewKeyboardDelegate.js +176 -0
  122. package/lib/components/TreeView/TreeViewKeyboardDelegate.test.js +496 -0
  123. package/lib/components/TreeView/TreeViewRow.js +20 -5
  124. package/lib/components/TreeView/TreeViewSection.js +161 -16
  125. package/lib/components/TreeView/TreeViewWrapper.js +31 -0
  126. package/lib/hooks/useComponentToggle/useComponentToggle.js +4 -21
  127. package/lib/hooks/useComponentToggle/useComponentToggle.test.js +8 -9
  128. package/lib/hooks/useFallbackImage/useFallbackImage.js +1 -2
  129. package/lib/hooks/useFallbackImage/useFallbackImage.test.js +6 -6
  130. package/lib/hooks/useImageUploadState/useImageUploadState.js +9 -6
  131. package/lib/hooks/useModalState/useModalState.js +0 -10
  132. package/lib/recipes/AttributeMapping.stories.js +1 -1
  133. package/lib/recipes/ConditionFilter.stories.js +1 -1
  134. package/lib/recipes/MaskedValue.stories.js +1 -1
  135. package/lib/recipes/MultipagePopup.stories.js +1 -1
  136. package/lib/recipes/OneWayToBidirectionalArrow.stories.js +1 -1
  137. package/lib/recipes/PanelContent.stories.js +1 -1
  138. package/lib/recipes/Slider.stories.js +1 -1
  139. package/lib/recipes/TrialExperienceIndustryButtons.stories.js +1 -1
  140. package/lib/recipes/TrialExperienceStatusBar.stories.js +1 -1
  141. package/lib/utils/testUtils/testWrapper.js +3 -2
  142. package/lib/utils/testUtils/universalComponentTest.js +74 -0
  143. package/package.json +5 -1
@@ -5,7 +5,7 @@ import React, { useState } from 'react';
5
5
  import CheckCircleIcon from '@pingux/mdi-react/CheckCircleIcon';
6
6
  import { v4 as uuid } from 'uuid';
7
7
  import { Box, Icon, IconButton, Link, Separator, Text } from '../index';
8
- import { FIGMA_LINKS } from '../utils/designUtils/figmaLinks.js';
8
+ import { FIGMA_LINKS } from '../utils/designUtils/figmaLinks.ts';
9
9
  import { jsx as ___EmotionJSX } from "@emotion/react";
10
10
  export default {
11
11
  title: 'Recipes/Trial Experience Nav'
@@ -22,7 +22,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
22
22
  } : {
23
23
  name: "zxbwtf-GlobalTestStyles",
24
24
  styles: ".is-disabled{opacity:0.5;pointer-events:none;};label:GlobalTestStyles;",
25
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy91dGlscy90ZXN0VXRpbHMvdGVzdFdyYXBwZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBVVMiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL3V0aWxzL3Rlc3RVdGlscy90ZXN0V3JhcHBlci5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBjc3MsIEdsb2JhbCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHJlbmRlciB9IGZyb20gJ0B0ZXN0aW5nLWxpYnJhcnkvcmVhY3QnO1xuaW1wb3J0IHsgVGhlbWVQcm92aWRlciB9IGZyb20gJ3RoZW1lLXVpJztcblxuaW1wb3J0IHRoZW1lIGZyb20gJy4uLy4uL3N0eWxlcy90aGVtZSc7XG5cbmNvbnN0IEdsb2JhbFRlc3RTdHlsZXMgPSAoKSA9PiAoXG4gIDxHbG9iYWxcbiAgICBzdHlsZXM9e1xuICAgICAgY3NzYFxuICAgICAgICAuaXMtZGlzYWJsZWQge1xuICAgICAgICAgIG9wYWNpdHk6IDAuNTtcbiAgICAgICAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcbiAgICAgICAgfVxuICAgICAgYFxuICAgIH1cbiAgLz5cbik7XG5cbi8qKlxuICogVE9ETzogQ2hhbmdlIEplc3QgY29uZmlnIHNvIHRoaXMgZG9lc24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9tUmVuZGVyIGFzIHJlbmRlciB9O1xuIl19 */",
26
26
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
27
27
  };
28
28
  var GlobalTestStyles = function GlobalTestStyles() {
@@ -41,6 +41,7 @@ var GlobalTestStyles = function GlobalTestStyles() {
41
41
  * See Button.test.js as an example for how to apply conditional classes and then testing that
42
42
  * those classes have the appropriate styles tied to them in the theme.
43
43
  */
44
+
44
45
  var Wrapper = function Wrapper(_ref2) {
45
46
  var children = _ref2.children;
46
47
  return ___EmotionJSX(ThemeProvider, {
@@ -53,7 +54,7 @@ var customRender = function customRender(ui, options) {
53
54
  }, options));
54
55
  };
55
56
 
56
- // re-export everything
57
+ // re-export everything -
57
58
  export * from '@testing-library/react';
58
59
 
59
60
  // override render method
@@ -0,0 +1,74 @@
1
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
2
+ import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
3
+ import _Object$create from "@babel/runtime-corejs3/core-js-stable/object/create";
4
+ import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/get-prototype-of";
5
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
6
+ import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/set-prototype-of";
7
+ import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
8
+ import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
9
+ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
10
+ import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
11
+ import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
12
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
13
+ 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; }
14
+ import React, { useEffect, useRef, useState } from 'react';
15
+ import { render, screen } from '@testing-library/react';
16
+ import { axe } from 'jest-axe';
17
+ import { jsx as ___EmotionJSX } from "@emotion/react";
18
+ var HAS_REF = 'ref';
19
+ var ComponentWithRef = function ComponentWithRef(_ref) {
20
+ var renderComponent = _ref.renderComponent;
21
+ var _useState = useState(null),
22
+ _useState2 = _slicedToArray(_useState, 2),
23
+ state = _useState2[0],
24
+ setState = _useState2[1];
25
+ var ref = useRef();
26
+ useEffect(function () {
27
+ if (!ref.current) return;
28
+ setState(ref.current);
29
+ }, []);
30
+ return ___EmotionJSX(React.Fragment, null, renderComponent({
31
+ ref: ref
32
+ }), state && HAS_REF);
33
+ };
34
+ export var universalComponentTests = /*#__PURE__*/function () {
35
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
36
+ var renderComponent, props, _ref2$rules, rules;
37
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
38
+ while (1) switch (_context2.prev = _context2.next) {
39
+ case 0:
40
+ renderComponent = _ref2.renderComponent, props = _ref2.props, _ref2$rules = _ref2.rules, rules = _ref2$rules === void 0 ? {} : _ref2$rules;
41
+ test('should have no accessibility violations', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
42
+ var _render, container, results;
43
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
44
+ while (1) switch (_context.prev = _context.next) {
45
+ case 0:
46
+ jest.useRealTimers();
47
+ _render = render(renderComponent(props)), container = _render.container;
48
+ _context.next = 4;
49
+ return axe(container, rules);
50
+ case 4:
51
+ results = _context.sent;
52
+ expect(results).toHaveNoViolations();
53
+ case 6:
54
+ case "end":
55
+ return _context.stop();
56
+ }
57
+ }, _callee);
58
+ })));
59
+ test('should forward refs properly', function () {
60
+ render(___EmotionJSX(ComponentWithRef, {
61
+ renderComponent: renderComponent
62
+ }));
63
+ screen.getByText(HAS_REF);
64
+ });
65
+ case 3:
66
+ case "end":
67
+ return _context2.stop();
68
+ }
69
+ }, _callee2);
70
+ }));
71
+ return function universalComponentTests(_x) {
72
+ return _ref3.apply(this, arguments);
73
+ };
74
+ }();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.32.0-alpha.1",
3
+ "version": "2.32.0-alpha.11",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",
@@ -123,6 +123,7 @@
123
123
  "@emotion/babel-preset-css-prop": "^11.2.0",
124
124
  "@emotion/cache": "^11.4.0",
125
125
  "@emotion/eslint-plugin": "^11.2.0",
126
+ "@react-stately/collections": "^3.10.2",
126
127
  "@storybook/addon-a11y": "^7.1.0",
127
128
  "@storybook/addon-console": "^2.0.0",
128
129
  "@storybook/addon-docs": "^7.1.0",
@@ -139,9 +140,12 @@
139
140
  "@testing-library/react-hooks": "^8.0.1",
140
141
  "@testing-library/user-event": "^12.8.3",
141
142
  "@types/jest": "^29.5.3",
143
+ "@types/jest-axe": "^3.5.8",
142
144
  "@types/mdx": "^2.0.5",
145
+ "@types/regenerator-runtime": "^0.13.5",
143
146
  "@types/testing-library__jest-dom": "^5.14.9",
144
147
  "@types/uuid": "^8.3.2",
148
+ "@types/whatwg-fetch": "^0.0.33",
145
149
  "@typescript-eslint/eslint-plugin": "^5.61.0",
146
150
  "@typescript-eslint/parser": "^5.61.0",
147
151
  "babel-loader": "^8.1.0",