@pingux/astro 2.33.0-alpha.1 → 2.33.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.
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +8 -9
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +8 -11
- package/lib/cjs/components/ArrayField/ArrayField.js +5 -3
- package/lib/cjs/components/ArrayField/ArrayField.test.js +13 -4
- package/lib/cjs/components/Avatar/Avatar.test.js +7 -4
- package/lib/cjs/components/Badge/Badge.test.js +7 -3
- package/lib/cjs/components/Box/Box.test.js +7 -4
- package/lib/cjs/components/Bracket/Bracket.js +3 -1
- package/lib/cjs/components/Bracket/Bracket.test.js +7 -3
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.test.js +7 -3
- package/lib/cjs/components/ButtonBar/ButtonBar.js +9 -3
- package/lib/cjs/components/ButtonBar/ButtonBar.stories.js +61 -5
- package/lib/cjs/components/ButtonBar/ButtonBar.test.js +13 -3
- package/lib/cjs/components/Callout/Callout.js +8 -3
- package/lib/cjs/components/Callout/Callout.test.js +8 -0
- package/lib/cjs/components/Card/Card.test.js +7 -4
- package/lib/cjs/components/Checkbox/Checkbox.test.js +7 -4
- package/lib/cjs/components/CodeView/CodeView.js +1 -0
- package/lib/cjs/components/CodeView/CodeView.test.js +7 -3
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.test.js +5 -10
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelBadge.js +9 -3
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js +7 -3
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelContainer.test.js +7 -3
- package/lib/cjs/components/CollapsiblePanelItem/CollapsiblePanelItem.test.js +7 -3
- package/lib/cjs/components/ColorField/ColorField.test.js +7 -3
- package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +11 -21
- package/lib/cjs/components/CopyText/CopyText.test.js +15 -5
- package/lib/cjs/components/DataTable/DataTableBadge.test.js +8 -0
- package/lib/cjs/components/DataTable/DataTableMenu.test.js +8 -0
- package/lib/cjs/components/DataTable/DataTableMultiLine.test.js +16 -5
- package/lib/cjs/components/DatePicker/DatePicker.test.js +11 -20
- package/lib/cjs/components/EditButton/EditButton.test.js +8 -2
- package/lib/cjs/components/FieldHelperText/FieldHelperText.test.js +7 -3
- package/lib/cjs/components/FileInputField/FileInputField.test.js +8 -2
- package/lib/cjs/components/HelpHint/HelpHint.test.js +7 -3
- package/lib/cjs/components/IconBadge/IconBadge.js +8 -3
- package/lib/cjs/components/IconBadge/IconBadge.test.js +9 -3
- package/lib/cjs/components/IconButton/IconButton.test.js +7 -3
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.js +11 -6
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.test.js +7 -3
- package/lib/cjs/components/ImageUploadField/ImageUploadField.test.js +7 -3
- package/lib/cjs/components/Input/Input.test.js +7 -3
- package/lib/cjs/components/Link/Link.test.js +7 -3
- package/lib/cjs/components/LinkSelectField/LinkSelectField.test.js +12 -31
- package/lib/cjs/components/ListItem/ListItem.test.js +5 -8
- package/lib/cjs/components/ListView/ListView.test.js +19 -0
- package/lib/cjs/components/ListViewItem/ListViewItem.test.js +7 -3
- package/lib/cjs/components/ListViewItem/controls/ListViewItemEditButton.js +11 -4
- package/lib/cjs/components/ListViewItem/controls/ListViewItemEditButton.test.js +7 -3
- package/lib/cjs/components/ListViewItem/controls/ListViewItemMenu.js +10 -4
- package/lib/cjs/components/ListViewItem/controls/ListViewItemMenu.test.js +7 -4
- package/lib/cjs/components/ListViewItem/controls/ListViewItemSwitchField.js +9 -3
- package/lib/cjs/components/ListViewItem/controls/ListViewItemSwitchField.test.js +7 -3
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.js +4 -3
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.test.js +7 -3
- package/lib/cjs/components/Loader/Loader.test.js +7 -3
- package/lib/cjs/components/Menu/Menu.test.js +11 -3
- package/lib/cjs/components/MenuItem/MenuItem.test.js +15 -3
- package/lib/cjs/components/Messages/Messages.test.js +9 -3
- package/lib/cjs/components/Modal/tests/Modal.unit.test.js +7 -3
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +14 -20
- package/lib/cjs/components/NavBar/NavBar.js +3 -2
- package/lib/cjs/components/NavBar/NavBar.test.js +10 -2
- package/lib/cjs/components/NumberField/NumberField.test.js +5 -8
- package/lib/cjs/components/OverlayPanel/OverlayPanel.test.js +7 -3
- package/lib/cjs/components/PageHeader/PageHeader.test.js +11 -2
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderCloseButton.js +9 -3
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderCloseButton.test.js +7 -3
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderMenu.js +12 -4
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderMenu.test.js +7 -3
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderSwitchField.js +12 -4
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderSwitchField.test.js +7 -3
- package/lib/cjs/components/PasswordField/PasswordField.test.js +7 -3
- package/lib/cjs/components/RadioField/RadioField.test.js +9 -3
- package/lib/cjs/components/RadioGroupField/RadioGroupField.test.js +10 -3
- package/lib/cjs/components/RequirementsList/RequirementsList.test.js +7 -3
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.test.js +11 -3
- package/lib/cjs/components/ScrollBox/ScrollBox.test.js +8 -0
- package/lib/cjs/components/SearchField/SearchField.test.js +7 -3
- package/lib/cjs/components/SelectField/SelectField.test.js +11 -3
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.test.js +14 -30
- package/lib/cjs/components/Separator/Separator.test.js +7 -3
- package/lib/cjs/components/Stepper/Stepper.test.js +12 -14
- package/lib/cjs/components/SwitchField/SwitchField.test.js +7 -3
- package/lib/cjs/components/Table/Table.js +9 -3
- package/lib/cjs/components/Table/Table.test.js +26 -3
- package/lib/cjs/components/TableBody/TableBody.js +9 -3
- package/lib/cjs/components/TableBody/TableBody.test.d.ts +1 -0
- package/lib/cjs/components/TableBody/TableBody.test.js +13 -0
- package/lib/cjs/components/TableCaption/TableCaption.js +9 -3
- package/lib/cjs/components/TableCaption/TableCaption.test.js +13 -0
- package/lib/cjs/components/TableCell/TableCell.d.ts +2 -2
- package/lib/cjs/components/TableCell/TableCell.js +9 -3
- package/lib/cjs/components/TableCell/TableCell.test.js +7 -3
- package/lib/cjs/components/TableHead/TableHead.js +9 -3
- package/lib/cjs/components/TableHead/TableHead.test.js +13 -0
- package/lib/cjs/components/TableRow/TableRow.js +9 -3
- package/lib/cjs/components/TableRow/TableRow.test.js +13 -0
- package/lib/cjs/components/Tabs/Tabs.stories.js +2 -2
- package/lib/cjs/components/Tabs/Tabs.style.js +0 -1
- package/lib/cjs/components/Tabs/Tabs.test.js +10 -3
- package/lib/cjs/components/Text/Text.test.js +7 -3
- package/lib/cjs/components/TextArea/TextArea.test.js +8 -3
- package/lib/cjs/components/TextAreaField/TextAreaField.test.js +7 -3
- package/lib/cjs/components/TextField/TextField.test.js +7 -3
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.test.js +8 -0
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.test.js +7 -3
- package/lib/cjs/hooks/useComponentToggle/useComponentToggle.js +1 -3
- package/lib/cjs/hooks/useField/useField.d.ts +33 -35
- package/lib/cjs/hooks/useField/useField.js +1 -1
- package/lib/cjs/hooks/useProgressiveState/index.d.ts +1 -0
- package/lib/cjs/hooks/useProgressiveState/useProgressiveState.d.ts +11 -0
- package/lib/cjs/hooks/useProgressiveState/useProgressiveState.js +3 -6
- package/lib/cjs/hooks/useProgressiveState/useProgressiveState.test.d.ts +1 -0
- package/lib/cjs/hooks/useProgressiveState/useProgressiveState.test.js +7 -16
- package/lib/cjs/hooks/usePropWarning/index.d.ts +1 -0
- package/lib/cjs/hooks/usePropWarning/usePropWarning.d.ts +13 -0
- package/lib/cjs/hooks/usePropWarning/usePropWarning.js +0 -8
- package/lib/cjs/hooks/usePropWarning/usePropWarning.test.d.ts +1 -0
- package/lib/cjs/hooks/usePropWarning/usePropWarning.test.js +13 -9
- package/lib/cjs/hooks/useRockerButton/index.d.ts +1 -0
- package/lib/cjs/hooks/useRockerButton/useRockerButton.d.ts +241 -0
- package/lib/cjs/hooks/useSelectField/index.d.ts +1 -0
- package/lib/cjs/hooks/useSelectField/useSelectField.d.ts +55 -0
- package/lib/cjs/hooks/useSelectField/useSelectField.js +10 -10
- package/lib/cjs/types/item.d.ts +4 -7
- package/lib/cjs/types/popoverContainer.d.ts +1 -0
- package/lib/cjs/types/shared/style.d.ts +6 -0
- package/lib/cjs/utils/designUtils/figmaLinks.js +4 -2
- package/lib/cjs/utils/testUtils/universalComponentTest.d.ts +1 -2
- package/lib/cjs/utils/testUtils/universalComponentTest.js +6 -4
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +8 -9
- package/lib/components/AccordionGroup/AccordionGroup.test.js +8 -11
- package/lib/components/ArrayField/ArrayField.js +6 -4
- package/lib/components/ArrayField/ArrayField.test.js +13 -4
- package/lib/components/Avatar/Avatar.test.js +7 -4
- package/lib/components/Badge/Badge.test.js +7 -3
- package/lib/components/Box/Box.test.js +7 -4
- package/lib/components/Bracket/Bracket.js +3 -1
- package/lib/components/Bracket/Bracket.test.js +7 -3
- package/lib/components/Breadcrumbs/Breadcrumbs.test.js +7 -3
- package/lib/components/ButtonBar/ButtonBar.js +4 -3
- package/lib/components/ButtonBar/ButtonBar.stories.js +57 -3
- package/lib/components/ButtonBar/ButtonBar.test.js +13 -3
- package/lib/components/Callout/Callout.js +4 -3
- package/lib/components/Callout/Callout.test.js +8 -0
- package/lib/components/Card/Card.test.js +7 -4
- package/lib/components/Checkbox/Checkbox.test.js +7 -4
- package/lib/components/CodeView/CodeView.js +1 -0
- package/lib/components/CodeView/CodeView.test.js +7 -3
- package/lib/components/CollapsiblePanel/CollapsiblePanel.test.js +5 -10
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelBadge.js +4 -3
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js +7 -3
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelContainer.test.js +7 -3
- package/lib/components/CollapsiblePanelItem/CollapsiblePanelItem.test.js +7 -3
- package/lib/components/ColorField/ColorField.test.js +7 -3
- package/lib/components/ComboBoxField/ComboBoxField.test.js +11 -21
- package/lib/components/CopyText/CopyText.test.js +15 -5
- package/lib/components/DataTable/DataTableBadge.test.js +8 -0
- package/lib/components/DataTable/DataTableMenu.test.js +8 -0
- package/lib/components/DataTable/DataTableMultiLine.test.js +16 -5
- package/lib/components/DatePicker/DatePicker.test.js +11 -20
- package/lib/components/EditButton/EditButton.test.js +8 -2
- package/lib/components/FieldHelperText/FieldHelperText.test.js +7 -3
- package/lib/components/FileInputField/FileInputField.test.js +8 -2
- package/lib/components/HelpHint/HelpHint.test.js +7 -3
- package/lib/components/IconBadge/IconBadge.js +4 -3
- package/lib/components/IconBadge/IconBadge.test.js +9 -3
- package/lib/components/IconButton/IconButton.test.js +7 -3
- package/lib/components/IconButtonToggle/IconButtonToggle.js +6 -6
- package/lib/components/IconButtonToggle/IconButtonToggle.test.js +7 -3
- package/lib/components/ImageUploadField/ImageUploadField.test.js +7 -3
- package/lib/components/Input/Input.test.js +7 -3
- package/lib/components/Link/Link.test.js +7 -3
- package/lib/components/LinkSelectField/LinkSelectField.test.js +12 -31
- package/lib/components/ListItem/ListItem.test.js +5 -8
- package/lib/components/ListView/ListView.test.js +19 -0
- package/lib/components/ListViewItem/ListViewItem.test.js +7 -3
- package/lib/components/ListViewItem/controls/ListViewItemEditButton.js +6 -4
- package/lib/components/ListViewItem/controls/ListViewItemEditButton.test.js +7 -3
- package/lib/components/ListViewItem/controls/ListViewItemMenu.js +5 -4
- package/lib/components/ListViewItem/controls/ListViewItemMenu.test.js +7 -4
- package/lib/components/ListViewItem/controls/ListViewItemSwitchField.js +4 -3
- package/lib/components/ListViewItem/controls/ListViewItemSwitchField.test.js +7 -3
- package/lib/components/ListViewItem/controls/chart/ListViewItemChart.js +5 -4
- package/lib/components/ListViewItem/controls/chart/ListViewItemChart.test.js +7 -3
- package/lib/components/Loader/Loader.test.js +7 -3
- package/lib/components/Menu/Menu.test.js +11 -3
- package/lib/components/MenuItem/MenuItem.test.js +15 -3
- package/lib/components/Messages/Messages.test.js +9 -3
- package/lib/components/Modal/tests/Modal.unit.test.js +7 -3
- package/lib/components/MultivaluesField/MultivaluesField.test.js +14 -20
- package/lib/components/NavBar/NavBar.js +4 -3
- package/lib/components/NavBar/NavBar.test.js +10 -2
- package/lib/components/NumberField/NumberField.test.js +5 -8
- package/lib/components/OverlayPanel/OverlayPanel.test.js +7 -3
- package/lib/components/PageHeader/PageHeader.test.js +11 -2
- package/lib/components/PanelHeader/controls/PanelHeaderCloseButton.js +4 -3
- package/lib/components/PanelHeader/controls/PanelHeaderCloseButton.test.js +7 -3
- package/lib/components/PanelHeader/controls/PanelHeaderMenu.js +7 -4
- package/lib/components/PanelHeader/controls/PanelHeaderMenu.test.js +7 -3
- package/lib/components/PanelHeader/controls/PanelHeaderSwitchField.js +7 -4
- package/lib/components/PanelHeader/controls/PanelHeaderSwitchField.test.js +7 -3
- package/lib/components/PasswordField/PasswordField.test.js +7 -3
- package/lib/components/RadioField/RadioField.test.js +9 -3
- package/lib/components/RadioGroupField/RadioGroupField.test.js +10 -3
- package/lib/components/RequirementsList/RequirementsList.test.js +7 -3
- package/lib/components/RockerButtonGroup/RockerButtonGroup.test.js +11 -3
- package/lib/components/ScrollBox/ScrollBox.test.js +8 -0
- package/lib/components/SearchField/SearchField.test.js +7 -3
- package/lib/components/SelectField/SelectField.test.js +11 -3
- package/lib/components/SelectFieldBase/SelectFieldBase.test.js +13 -31
- package/lib/components/Separator/Separator.test.js +7 -3
- package/lib/components/Stepper/Stepper.test.js +12 -14
- package/lib/components/SwitchField/SwitchField.test.js +7 -3
- package/lib/components/Table/Table.js +4 -3
- package/lib/components/Table/Table.test.js +26 -3
- package/lib/components/TableBody/TableBody.js +4 -3
- package/lib/components/TableBody/TableBody.test.js +11 -0
- package/lib/components/TableCaption/TableCaption.js +4 -3
- package/lib/components/TableCaption/TableCaption.test.js +11 -0
- package/lib/components/TableCell/TableCell.js +4 -3
- package/lib/components/TableCell/TableCell.test.js +7 -3
- package/lib/components/TableHead/TableHead.js +4 -3
- package/lib/components/TableHead/TableHead.test.js +11 -0
- package/lib/components/TableRow/TableRow.js +4 -3
- package/lib/components/TableRow/TableRow.test.js +11 -0
- package/lib/components/Tabs/Tabs.stories.js +3 -3
- package/lib/components/Tabs/Tabs.style.js +0 -1
- package/lib/components/Tabs/Tabs.test.js +10 -3
- package/lib/components/Text/Text.test.js +7 -3
- package/lib/components/TextArea/TextArea.test.js +8 -3
- package/lib/components/TextAreaField/TextAreaField.test.js +7 -3
- package/lib/components/TextField/TextField.test.js +7 -3
- package/lib/components/TimeZonePicker/TimeZonePicker.test.js +8 -0
- package/lib/components/TooltipTrigger/TooltipTrigger.test.js +7 -3
- package/lib/hooks/useComponentToggle/useComponentToggle.js +1 -3
- package/lib/hooks/useField/useField.js +2 -0
- package/lib/hooks/useProgressiveState/useProgressiveState.js +3 -7
- package/lib/hooks/useProgressiveState/useProgressiveState.test.js +7 -16
- package/lib/hooks/usePropWarning/usePropWarning.js +0 -8
- package/lib/hooks/usePropWarning/usePropWarning.test.js +13 -9
- package/lib/hooks/useSelectField/useSelectField.js +11 -9
- package/lib/utils/designUtils/figmaLinks.js +4 -2
- package/lib/utils/testUtils/universalComponentTest.js +6 -4
- package/package.json +1 -1
@@ -1,25 +1,13 @@
|
|
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
1
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
13
2
|
import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/esm/objectDestructuringEmpty";
|
14
3
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
15
|
-
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 _context2; _forEachInstanceProperty(_context2 = ["next", "throw", "return"]).call(_context2, 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 _context3; 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(_context3 = this.tryEntries).call(_context3, 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; }
|
16
4
|
import React, { forwardRef } from 'react';
|
17
5
|
import userEvent from '@testing-library/user-event';
|
18
|
-
import { axe } from 'jest-axe';
|
19
6
|
import { useSelectField } from '../../hooks';
|
20
7
|
import { Item } from '../../index';
|
21
8
|
import statuses from '../../utils/devUtils/constants/statuses';
|
22
9
|
import { render, screen, within } from '../../utils/testUtils/testWrapper';
|
10
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
23
11
|
import { modes } from '../Label/constants';
|
24
12
|
import SelectFieldBase from './SelectFieldBase';
|
25
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -386,24 +374,6 @@ test('passing helper text should display it and correct aria attributes on input
|
|
386
374
|
var helperTextID = helper.getAttribute('id');
|
387
375
|
expect(visibleInput).toHaveAttribute('aria-describedby', helperTextID);
|
388
376
|
});
|
389
|
-
test('should have no accessibility violations', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
390
|
-
var _getComponent3, container, results;
|
391
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
392
|
-
while (1) switch (_context.prev = _context.next) {
|
393
|
-
case 0:
|
394
|
-
jest.useRealTimers();
|
395
|
-
_getComponent3 = getComponent(), container = _getComponent3.container;
|
396
|
-
_context.next = 4;
|
397
|
-
return axe(container);
|
398
|
-
case 4:
|
399
|
-
results = _context.sent;
|
400
|
-
expect(results).toHaveNoViolations();
|
401
|
-
case 6:
|
402
|
-
case "end":
|
403
|
-
return _context.stop();
|
404
|
-
}
|
405
|
-
}, _callee);
|
406
|
-
})));
|
407
377
|
test('popover closes on button blur', function () {
|
408
378
|
getComponent();
|
409
379
|
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
@@ -418,4 +388,16 @@ test('popover closes on button blur', function () {
|
|
418
388
|
userEvent.click(document.body);
|
419
389
|
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
420
390
|
expect(screen.queryByRole('option')).not.toBeInTheDocument();
|
391
|
+
});
|
392
|
+
|
393
|
+
// Needs to be added to each components test file
|
394
|
+
universalComponentTests({
|
395
|
+
renderComponent: function renderComponent(props) {
|
396
|
+
return ___EmotionJSX(SelectFieldWrapper, _extends({}, defaultProps, props), function (item) {
|
397
|
+
return ___EmotionJSX(Item, {
|
398
|
+
key: item.name,
|
399
|
+
"data-id": item.name
|
400
|
+
}, item.name);
|
401
|
+
});
|
402
|
+
}
|
421
403
|
});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import React from 'react';
|
3
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
4
3
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
4
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
5
5
|
import Separator from './Separator';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
var testId = 'test-separator';
|
@@ -13,8 +13,12 @@ var getComponent = function getComponent() {
|
|
13
13
|
return render(___EmotionJSX(Separator, _extends({}, defaultProps, props)));
|
14
14
|
};
|
15
15
|
|
16
|
-
//
|
17
|
-
|
16
|
+
// Needs to be added to each components test file
|
17
|
+
universalComponentTests({
|
18
|
+
renderComponent: function renderComponent(props) {
|
19
|
+
return ___EmotionJSX(Separator, _extends({}, defaultProps, props));
|
20
|
+
}
|
21
|
+
});
|
18
22
|
test('renders Separator component', function () {
|
19
23
|
getComponent();
|
20
24
|
var separator = screen.getByTestId(testId);
|
@@ -19,8 +19,8 @@ import { Item } from 'react-stately';
|
|
19
19
|
import createCache from '@emotion/cache';
|
20
20
|
import { CacheProvider } from '@emotion/react';
|
21
21
|
import userEvent from '@testing-library/user-event';
|
22
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
23
22
|
import { fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
|
23
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
24
24
|
import Text from '../Text';
|
25
25
|
import Stepper from './Stepper';
|
26
26
|
|
@@ -68,19 +68,17 @@ var getComponent = function getComponent() {
|
|
68
68
|
})));
|
69
69
|
};
|
70
70
|
|
71
|
-
//
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
enabled: false
|
83
|
-
}
|
71
|
+
// Needs to be added to each components test file
|
72
|
+
universalComponentTests({
|
73
|
+
renderComponent: function renderComponent(props) {
|
74
|
+
return ___EmotionJSX(Stepper, _extends({}, defaultProps, props), function (_ref3) {
|
75
|
+
var name = _ref3.name,
|
76
|
+
children = _ref3.children;
|
77
|
+
return ___EmotionJSX(Item, {
|
78
|
+
key: name || children,
|
79
|
+
textValue: name || children
|
80
|
+
}, ___EmotionJSX(Text, null, children));
|
81
|
+
});
|
84
82
|
}
|
85
83
|
});
|
86
84
|
test('renders Stepper component in the default state', function () {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import React from 'react';
|
3
3
|
import userEvent from '@testing-library/user-event';
|
4
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
5
4
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
5
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
6
6
|
import SwitchField from './SwitchField';
|
7
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
8
|
var TEST_LABEL = 'test label';
|
@@ -14,8 +14,12 @@ var getComponent = function getComponent() {
|
|
14
14
|
return render(___EmotionJSX(SwitchField, _extends({}, defaultProps, props)));
|
15
15
|
};
|
16
16
|
|
17
|
-
//
|
18
|
-
|
17
|
+
// Needs to be added to each components test file
|
18
|
+
universalComponentTests({
|
19
|
+
renderComponent: function renderComponent(props) {
|
20
|
+
return ___EmotionJSX(SwitchField, _extends({}, defaultProps, props));
|
21
|
+
}
|
22
|
+
});
|
19
23
|
test('renders Switch component', function () {
|
20
24
|
getComponent({
|
21
25
|
'aria-label': 'test'
|
@@ -1,15 +1,16 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
3
|
var _excluded = ["children"];
|
4
|
-
import React from 'react';
|
4
|
+
import React, { forwardRef } from 'react';
|
5
5
|
import Box from '../Box';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
|
-
var Table = function
|
7
|
+
var Table = /*#__PURE__*/forwardRef(function (props, ref) {
|
8
8
|
var children = props.children,
|
9
9
|
others = _objectWithoutProperties(props, _excluded);
|
10
10
|
return ___EmotionJSX(Box, _extends({
|
11
|
+
ref: ref,
|
11
12
|
as: "table",
|
12
13
|
variant: "table.container"
|
13
14
|
}, others), children);
|
14
|
-
};
|
15
|
+
});
|
15
16
|
export default Table;
|
@@ -3,7 +3,7 @@ import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values"
|
|
3
3
|
import React from 'react';
|
4
4
|
import { render, screen } from '@testing-library/react';
|
5
5
|
import { Text } from '../../index';
|
6
|
-
import
|
6
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
7
7
|
import TableBody from '../TableBody';
|
8
8
|
import TableCaption from '../TableCaption';
|
9
9
|
import TableCell from '../TableCell';
|
@@ -57,8 +57,31 @@ var getComponent = function getComponent() {
|
|
57
57
|
}))));
|
58
58
|
};
|
59
59
|
|
60
|
-
//
|
61
|
-
|
60
|
+
// Needs to be added to each components test file
|
61
|
+
universalComponentTests({
|
62
|
+
renderComponent: function renderComponent(props) {
|
63
|
+
return ___EmotionJSX(Table, props, ___EmotionJSX(TableCaption, null, ___EmotionJSX(Text, {
|
64
|
+
fontWeight: 3,
|
65
|
+
fontSize: "lg"
|
66
|
+
}, caption)), ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
|
67
|
+
key: "head"
|
68
|
+
}, _mapInstanceProperty(headers).call(headers, function (head) {
|
69
|
+
return ___EmotionJSX(TableCell, {
|
70
|
+
isHeading: true,
|
71
|
+
key: head
|
72
|
+
}, head);
|
73
|
+
}))), ___EmotionJSX(TableBody, null, _mapInstanceProperty(objects).call(objects, function (object) {
|
74
|
+
var _context2;
|
75
|
+
return ___EmotionJSX(TableRow, {
|
76
|
+
key: object.country
|
77
|
+
}, _mapInstanceProperty(_context2 = _Object$values(object)).call(_context2, function (value) {
|
78
|
+
return ___EmotionJSX(TableCell, {
|
79
|
+
key: value
|
80
|
+
}, value);
|
81
|
+
}));
|
82
|
+
})));
|
83
|
+
}
|
84
|
+
});
|
62
85
|
test('default table', function () {
|
63
86
|
getComponent();
|
64
87
|
var table = screen.getByTestId(testId);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
3
|
var _excluded = ["children"];
|
4
|
-
import React from 'react';
|
4
|
+
import React, { forwardRef } from 'react';
|
5
5
|
import Box from '../Box';
|
6
6
|
|
7
7
|
/**
|
@@ -13,12 +13,13 @@ import Box from '../Box';
|
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
16
|
-
var TableBody = function
|
16
|
+
var TableBody = /*#__PURE__*/forwardRef(function (props, ref) {
|
17
17
|
var children = props.children,
|
18
18
|
others = _objectWithoutProperties(props, _excluded);
|
19
19
|
return ___EmotionJSX(Box, _extends({
|
20
|
+
ref: ref,
|
20
21
|
variant: "table.body",
|
21
22
|
as: "tbody"
|
22
23
|
}, others), children);
|
23
|
-
};
|
24
|
+
});
|
24
25
|
export default TableBody;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Table, TableBody } from '../../index';
|
3
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
4
|
+
|
5
|
+
// Needs to be added to each components test file
|
6
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
|
+
universalComponentTests({
|
8
|
+
renderComponent: function renderComponent(props) {
|
9
|
+
return ___EmotionJSX(Table, null, ___EmotionJSX(TableBody, props));
|
10
|
+
}
|
11
|
+
});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
3
|
var _excluded = ["children"];
|
4
|
-
import React from 'react';
|
4
|
+
import React, { forwardRef } from 'react';
|
5
5
|
import Box from '../Box';
|
6
6
|
|
7
7
|
/**
|
@@ -13,12 +13,13 @@ import Box from '../Box';
|
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
16
|
-
var TableCaption = function
|
16
|
+
var TableCaption = /*#__PURE__*/forwardRef(function (props, ref) {
|
17
17
|
var children = props.children,
|
18
18
|
others = _objectWithoutProperties(props, _excluded);
|
19
19
|
return ___EmotionJSX(Box, _extends({
|
20
|
+
ref: ref,
|
20
21
|
variant: "table.caption",
|
21
22
|
as: "caption"
|
22
23
|
}, others), children);
|
23
|
-
};
|
24
|
+
});
|
24
25
|
export default TableCaption;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Table, TableCaption } from '../../index';
|
3
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
4
|
+
|
5
|
+
// Needs to be added to each components test file
|
6
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
|
+
universalComponentTests({
|
8
|
+
renderComponent: function renderComponent(props) {
|
9
|
+
return ___EmotionJSX(Table, null, ___EmotionJSX(TableCaption, props));
|
10
|
+
}
|
11
|
+
});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
3
|
var _excluded = ["children", "isHeading"];
|
4
|
-
import React from 'react';
|
4
|
+
import React, { forwardRef } from 'react';
|
5
5
|
import Box from '../Box';
|
6
6
|
|
7
7
|
/**
|
@@ -13,13 +13,14 @@ import Box from '../Box';
|
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
16
|
-
var TableCell = function
|
16
|
+
var TableCell = /*#__PURE__*/forwardRef(function (props, ref) {
|
17
17
|
var children = props.children,
|
18
18
|
isHeading = props.isHeading,
|
19
19
|
others = _objectWithoutProperties(props, _excluded);
|
20
20
|
return ___EmotionJSX(Box, _extends({
|
21
|
+
ref: ref,
|
21
22
|
variant: isHeading ? 'table.head' : 'table.data',
|
22
23
|
as: isHeading ? 'th' : 'td'
|
23
24
|
}, others), children);
|
24
|
-
};
|
25
|
+
});
|
25
26
|
export default TableCell;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import React from 'react';
|
3
3
|
import { render, screen } from '@testing-library/react';
|
4
|
-
import
|
4
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
5
5
|
import Table from '../Table';
|
6
6
|
import TableBody from '../TableBody';
|
7
7
|
import TableRow from '../TableRow';
|
@@ -16,8 +16,12 @@ var getComponent = function getComponent() {
|
|
16
16
|
return render(___EmotionJSX(Table, null, ___EmotionJSX(TableBody, null, ___EmotionJSX(TableRow, null, ___EmotionJSX(TableCell, _extends({}, props, defaultProps), "Here is text.")))));
|
17
17
|
};
|
18
18
|
|
19
|
-
//
|
20
|
-
|
19
|
+
// Needs to be added to each components test file
|
20
|
+
universalComponentTests({
|
21
|
+
renderComponent: function renderComponent(props) {
|
22
|
+
return ___EmotionJSX(Table, null, ___EmotionJSX(TableBody, null, ___EmotionJSX(TableRow, null, ___EmotionJSX(TableCell, props, "Here is text."))));
|
23
|
+
}
|
24
|
+
});
|
21
25
|
test('isHeading = true', function () {
|
22
26
|
var props = {
|
23
27
|
isHeading: true
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
3
|
var _excluded = ["children"];
|
4
|
-
import React from 'react';
|
4
|
+
import React, { forwardRef } from 'react';
|
5
5
|
import Box from '../Box';
|
6
6
|
|
7
7
|
/**
|
@@ -13,11 +13,12 @@ import Box from '../Box';
|
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
16
|
-
var TableHead = function
|
16
|
+
var TableHead = /*#__PURE__*/forwardRef(function (props, ref) {
|
17
17
|
var children = props.children,
|
18
18
|
others = _objectWithoutProperties(props, _excluded);
|
19
19
|
return ___EmotionJSX(Box, _extends({
|
20
|
+
ref: ref,
|
20
21
|
as: "thead"
|
21
22
|
}, others), children);
|
22
|
-
};
|
23
|
+
});
|
23
24
|
export default TableHead;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Table, TableHead } from '../../index';
|
3
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
4
|
+
|
5
|
+
// Needs to be added to each components test file
|
6
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
|
+
universalComponentTests({
|
8
|
+
renderComponent: function renderComponent(props) {
|
9
|
+
return ___EmotionJSX(Table, null, ___EmotionJSX(TableHead, props));
|
10
|
+
}
|
11
|
+
});
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
3
|
var _excluded = ["children"];
|
4
|
-
import React from 'react';
|
4
|
+
import React, { forwardRef } from 'react';
|
5
5
|
import Box from '../Box';
|
6
6
|
|
7
7
|
/**
|
@@ -13,12 +13,13 @@ import Box from '../Box';
|
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
16
|
-
var TableRow = function
|
16
|
+
var TableRow = /*#__PURE__*/forwardRef(function (props, ref) {
|
17
17
|
var children = props.children,
|
18
18
|
others = _objectWithoutProperties(props, _excluded);
|
19
19
|
return ___EmotionJSX(Box, _extends({
|
20
|
+
ref: ref,
|
20
21
|
variant: "table.row",
|
21
22
|
as: "tr"
|
22
23
|
}, others), children);
|
23
|
-
};
|
24
|
+
});
|
24
25
|
export default TableRow;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Table, TableBody, TableRow } from '../../index';
|
3
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
4
|
+
|
5
|
+
// Needs to be added to each components test file
|
6
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
|
+
universalComponentTests({
|
8
|
+
renderComponent: function renderComponent(props) {
|
9
|
+
return ___EmotionJSX(Table, null, ___EmotionJSX(TableBody, null, ___EmotionJSX(TableRow, props)));
|
10
|
+
}
|
11
|
+
});
|
@@ -4,7 +4,7 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/insta
|
|
4
4
|
import React, { useState } from 'react';
|
5
5
|
import LockIcon from '@pingux/mdi-react/LockIcon';
|
6
6
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
7
|
-
import { Badge, Icon, Tab, Tabs, Text } from '../../index';
|
7
|
+
import { Badge, Box, Icon, Tab, Tabs, Text } from '../../index';
|
8
8
|
import TabsReadme from './Tabs.mdx';
|
9
9
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
10
10
|
export default {
|
@@ -174,11 +174,11 @@ export var ContentSlots = function ContentSlots() {
|
|
174
174
|
marginLeft: 6,
|
175
175
|
marginTop: 10
|
176
176
|
};
|
177
|
-
var afterTabNode = ___EmotionJSX(Badge, {
|
177
|
+
var afterTabNode = ___EmotionJSX(Box, null, ___EmotionJSX(Badge, {
|
178
178
|
variant: "countNeutral",
|
179
179
|
sx: nodeSx,
|
180
180
|
label: "14"
|
181
|
-
});
|
181
|
+
}));
|
182
182
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Tabs, {
|
183
183
|
items: tabs,
|
184
184
|
mb: 50
|
@@ -21,8 +21,8 @@ import React from 'react';
|
|
21
21
|
import createCache from '@emotion/cache';
|
22
22
|
import { CacheProvider } from '@emotion/react';
|
23
23
|
import userEvent from '@testing-library/user-event';
|
24
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
25
24
|
import { fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
|
25
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
26
26
|
import Tab from '../Tab';
|
27
27
|
import Tabs from './Tabs';
|
28
28
|
|
@@ -133,8 +133,15 @@ afterEach(function () {
|
|
133
133
|
jest.restoreAllMocks();
|
134
134
|
});
|
135
135
|
|
136
|
-
//
|
137
|
-
|
136
|
+
// Needs to be added to each components test file
|
137
|
+
universalComponentTests({
|
138
|
+
renderComponent: function renderComponent(props) {
|
139
|
+
return ___EmotionJSX(Tabs, props, ___EmotionJSX(Tab, {
|
140
|
+
key: "key",
|
141
|
+
title: "title"
|
142
|
+
}, "Content"));
|
143
|
+
}
|
144
|
+
});
|
138
145
|
test('default tabs', function () {
|
139
146
|
getComponent();
|
140
147
|
var tabList = screen.getByRole('tablist');
|
@@ -12,9 +12,9 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
12
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
13
13
|
import React from 'react';
|
14
14
|
import { ThemeProvider } from 'theme-ui';
|
15
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
16
15
|
import testTheme from '../../utils/testUtils/testTheme';
|
17
16
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
17
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
18
18
|
import Text from '.';
|
19
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
20
20
|
var testId = 'test-text';
|
@@ -29,8 +29,12 @@ var getComponent = function getComponent() {
|
|
29
29
|
}, ___EmotionJSX(Text, _extends({}, defaultProps, props), children)));
|
30
30
|
};
|
31
31
|
|
32
|
-
//
|
33
|
-
|
32
|
+
// Needs to be added to each components test file
|
33
|
+
universalComponentTests({
|
34
|
+
renderComponent: function renderComponent(props) {
|
35
|
+
return ___EmotionJSX(Text, props, "text");
|
36
|
+
}
|
37
|
+
});
|
34
38
|
test('default text', function () {
|
35
39
|
getComponent();
|
36
40
|
var text = screen.getByTestId(testId);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import React from 'react';
|
3
3
|
import { render, screen } from '@testing-library/react';
|
4
|
-
import
|
4
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
5
5
|
import TextArea from '.';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
var testId = 'textAreaField';
|
@@ -13,8 +13,13 @@ var getComponent = function getComponent() {
|
|
13
13
|
return render(___EmotionJSX(TextArea, _extends({}, defaultProps, props)));
|
14
14
|
};
|
15
15
|
|
16
|
-
//
|
17
|
-
|
16
|
+
// Needs to be added to each components test file
|
17
|
+
universalComponentTests({
|
18
|
+
renderComponent: function renderComponent(props) {
|
19
|
+
return ___EmotionJSX(TextArea, _extends({
|
20
|
+
label: "label"
|
21
|
+
}, props));
|
22
|
+
},
|
18
23
|
// TextArea with label provided by TextAreaField
|
19
24
|
rules: {
|
20
25
|
'label': {
|
@@ -6,8 +6,8 @@ import React from 'react';
|
|
6
6
|
import { fireEvent } from '@testing-library/react';
|
7
7
|
import userEvent from '@testing-library/user-event';
|
8
8
|
import statuses from '../../utils/devUtils/constants/statuses';
|
9
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
10
9
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
10
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
11
11
|
import TextAreaField from '.';
|
12
12
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
13
13
|
var testId = 'test-textAreaField';
|
@@ -21,8 +21,12 @@ var getComponent = function getComponent() {
|
|
21
21
|
};
|
22
22
|
var mockfunction = jest.fn();
|
23
23
|
|
24
|
-
//
|
25
|
-
|
24
|
+
// Needs to be added to each components test file
|
25
|
+
universalComponentTests({
|
26
|
+
renderComponent: function renderComponent(props) {
|
27
|
+
return ___EmotionJSX(TextAreaField, _extends({}, defaultProps, props));
|
28
|
+
}
|
29
|
+
});
|
26
30
|
test('disabled prop disables input', function () {
|
27
31
|
getComponent({
|
28
32
|
isDisabled: true
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
6
6
|
import { render, screen } from '@testing-library/react';
|
7
7
|
import userEvent from '@testing-library/user-event';
|
8
8
|
import statuses from '../../utils/devUtils/constants/statuses';
|
9
|
-
import
|
9
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
10
10
|
import TextField from '.';
|
11
11
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
12
12
|
var testId = 'test-text-field';
|
@@ -20,8 +20,12 @@ var getComponent = function getComponent() {
|
|
20
20
|
return render(___EmotionJSX(TextField, _extends({}, defaultProps, props)));
|
21
21
|
};
|
22
22
|
|
23
|
-
//
|
24
|
-
|
23
|
+
// Needs to be added to each components test file
|
24
|
+
universalComponentTests({
|
25
|
+
renderComponent: function renderComponent(props) {
|
26
|
+
return ___EmotionJSX(TextField, _extends({}, defaultProps, props));
|
27
|
+
}
|
28
|
+
});
|
25
29
|
test('default text field', function () {
|
26
30
|
getComponent();
|
27
31
|
var field = screen.getByTestId(testId);
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
4
4
|
import { OverlayProvider, TimeZonePicker } from '../../index';
|
5
5
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
6
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
6
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
8
|
var testTimeZoneJuba = 'Africa/Juba';
|
8
9
|
var testTimeZoneApia = 'Pacific/Apia';
|
@@ -73,4 +74,11 @@ test('shows custom empty search state text when no items are found', function ()
|
|
73
74
|
var input = screen.queryByRole('combobox');
|
74
75
|
userEvent.type(input, 'awdasrf213');
|
75
76
|
expect(screen.getByText(testEmptyText)).toBeInTheDocument();
|
77
|
+
});
|
78
|
+
|
79
|
+
// Needs to be added to each components test file
|
80
|
+
universalComponentTests({
|
81
|
+
renderComponent: function renderComponent(props) {
|
82
|
+
return ___EmotionJSX(TimeZonePicker, _extends({}, defaultProps, props));
|
83
|
+
}
|
76
84
|
});
|