@pingux/astro 2.194.0 → 2.195.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/Badge/Badge.styles.d.ts +8 -3
- package/lib/cjs/components/Badge/Badge.styles.js +9 -1
- package/lib/cjs/components/IconWrapper/IconWrapper.js +3 -1
- package/lib/cjs/components/IconWrapper/IconWrapper.stories.js +82 -1
- package/lib/cjs/components/MultivaluesField/BadgeLabelTooltip.js +72 -0
- package/lib/cjs/components/MultivaluesField/DefaultMultivaluesField.js +8 -29
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +30 -1
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +154 -94
- package/lib/cjs/hooks/useGetTheme/useGetTheme.d.ts +7 -3
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.d.ts +5 -3
- package/lib/cjs/styles/themes/astro/customProperties/index.d.ts +2 -0
- package/lib/cjs/styles/themes/astro/customProperties/tShirtSizes.d.ts +2 -0
- package/lib/cjs/styles/themes/astro/customProperties/tShirtSizes.js +3 -1
- package/lib/cjs/styles/themes/next-gen/customProperties/index.d.ts +5 -3
- package/lib/cjs/styles/themes/next-gen/customProperties/tShirtSizes.d.ts +5 -3
- package/lib/cjs/styles/themes/next-gen/customProperties/tShirtSizes.js +7 -3
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +27 -3
- package/lib/cjs/styles/themes/next-gen/sizes.d.ts +2 -0
- package/lib/cjs/styles/themes/next-gen/sizes.js +9 -7
- package/lib/cjs/styles/themes/next-gen/variants/iconWrapper.d.ts +25 -3
- package/lib/cjs/styles/themes/next-gen/variants/iconWrapper.js +35 -18
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +25 -3
- package/lib/components/Badge/Badge.styles.js +9 -1
- package/lib/components/IconWrapper/IconWrapper.js +3 -1
- package/lib/components/IconWrapper/IconWrapper.stories.js +82 -1
- package/lib/components/MultivaluesField/BadgeLabelTooltip.js +60 -0
- package/lib/components/MultivaluesField/DefaultMultivaluesField.js +9 -30
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +29 -0
- package/lib/components/MultivaluesField/MultivaluesField.test.js +154 -94
- package/lib/styles/themes/astro/customProperties/tShirtSizes.js +3 -1
- package/lib/styles/themes/next-gen/customProperties/tShirtSizes.js +6 -3
- package/lib/styles/themes/next-gen/sizes.js +9 -7
- package/lib/styles/themes/next-gen/variants/iconWrapper.js +35 -18
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerat
|
|
|
20
20
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
21
21
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
22
22
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
23
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context57, _context58; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context57 = ownKeys(Object(t), !0)).call(_context57, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context58 = ownKeys(Object(t))).call(_context58, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
24
|
function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (_Object$getPrototypeOf ? _Object$getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && _reverseInstanceProperty(o).call(o)); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
|
25
25
|
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof _Symbol && _Symbol$iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
26
26
|
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
|
|
@@ -79,6 +79,15 @@ var withSection = [{
|
|
|
79
79
|
key: 'Option B3'
|
|
80
80
|
}]
|
|
81
81
|
}];
|
|
82
|
+
var longLabelItems = [{
|
|
83
|
+
id: 10,
|
|
84
|
+
name: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit,',
|
|
85
|
+
key: 'LongLabelItem'
|
|
86
|
+
}, {
|
|
87
|
+
id: 11,
|
|
88
|
+
name: 'Short',
|
|
89
|
+
key: 'ShortLabelItem'
|
|
90
|
+
}];
|
|
82
91
|
var labelText = 'Field Label';
|
|
83
92
|
var defaultProps = {
|
|
84
93
|
items: items,
|
|
@@ -137,6 +146,21 @@ var getSectionsComponent = function getSectionsComponent() {
|
|
|
137
146
|
});
|
|
138
147
|
})));
|
|
139
148
|
};
|
|
149
|
+
var getLongLabelComponent = function getLongLabelComponent() {
|
|
150
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
151
|
+
var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
152
|
+
_ref4$renderFn = _ref4.renderFn,
|
|
153
|
+
renderFn = _ref4$renderFn === void 0 ? render : _ref4$renderFn;
|
|
154
|
+
return renderFn(___EmotionJSX(OverlayProvider, null, ___EmotionJSX(MultivaluesField, _extends({
|
|
155
|
+
items: longLabelItems,
|
|
156
|
+
label: "Field Label",
|
|
157
|
+
defaultSelectedKeys: ['LongLabelItem', 'ShortLabelItem']
|
|
158
|
+
}, props), function (item) {
|
|
159
|
+
return ___EmotionJSX(Item, {
|
|
160
|
+
key: item.key
|
|
161
|
+
}, item.name);
|
|
162
|
+
})));
|
|
163
|
+
};
|
|
140
164
|
var ComponentOnPrevLoad = function ComponentOnPrevLoad(props) {
|
|
141
165
|
var _context, _context2;
|
|
142
166
|
var initialItems = _mapInstanceProperty(_context = _fillInstanceProperty(_context2 = new Array(10)).call(_context2, {
|
|
@@ -149,13 +173,12 @@ var ComponentOnPrevLoad = function ComponentOnPrevLoad(props) {
|
|
|
149
173
|
id: index
|
|
150
174
|
};
|
|
151
175
|
});
|
|
152
|
-
// eslint-disable-next-line no-unused-vars
|
|
153
176
|
var _useState = useState(initialItems),
|
|
154
177
|
_useState2 = _slicedToArray(_useState, 2),
|
|
155
178
|
listItems = _useState2[0],
|
|
156
179
|
setListItems = _useState2[1];
|
|
157
180
|
var onLoadMore = /*#__PURE__*/function () {
|
|
158
|
-
var
|
|
181
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
159
182
|
return _regeneratorRuntime().wrap(function _callee$(_context3) {
|
|
160
183
|
while (1) switch (_context3.prev = _context3.next) {
|
|
161
184
|
case 0:
|
|
@@ -167,11 +190,11 @@ var ComponentOnPrevLoad = function ComponentOnPrevLoad(props) {
|
|
|
167
190
|
}, _callee);
|
|
168
191
|
}));
|
|
169
192
|
return function onLoadMore() {
|
|
170
|
-
return
|
|
193
|
+
return _ref5.apply(this, arguments);
|
|
171
194
|
};
|
|
172
195
|
}();
|
|
173
196
|
var onLoadPrev = /*#__PURE__*/function () {
|
|
174
|
-
var
|
|
197
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
175
198
|
return _regeneratorRuntime().wrap(function _callee2$(_context4) {
|
|
176
199
|
while (1) switch (_context4.prev = _context4.next) {
|
|
177
200
|
case 0:
|
|
@@ -183,7 +206,7 @@ var ComponentOnPrevLoad = function ComponentOnPrevLoad(props) {
|
|
|
183
206
|
}, _callee2);
|
|
184
207
|
}));
|
|
185
208
|
return function onLoadPrev() {
|
|
186
|
-
return
|
|
209
|
+
return _ref6.apply(this, arguments);
|
|
187
210
|
};
|
|
188
211
|
}();
|
|
189
212
|
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(MultivaluesField, _extends({
|
|
@@ -1031,11 +1054,11 @@ test('read only keys', function () {
|
|
|
1031
1054
|
var firstBadge = screen.getByText(items[1].name);
|
|
1032
1055
|
var deleteButton1 = firstBadge.nextSibling;
|
|
1033
1056
|
expect(firstBadge).toBeInTheDocument();
|
|
1034
|
-
expect(deleteButton1).
|
|
1057
|
+
expect(deleteButton1).not.toBeInTheDocument();
|
|
1035
1058
|
var secondBadge = screen.getByText(items[2].name);
|
|
1036
1059
|
expect(secondBadge).toBeInTheDocument();
|
|
1037
1060
|
var deleteButton2 = firstBadge.nextSibling;
|
|
1038
|
-
expect(deleteButton2).
|
|
1061
|
+
expect(deleteButton2).not.toBeInTheDocument();
|
|
1039
1062
|
});
|
|
1040
1063
|
test('passing helper text should display it and correct aria attributes on input', function () {
|
|
1041
1064
|
var testHelperText = 'testHelperText';
|
|
@@ -1641,23 +1664,7 @@ test('default selected keys in condensed mode ', function () {
|
|
|
1641
1664
|
expect(listbox).not.toBeInTheDocument();
|
|
1642
1665
|
expect(screen.getByText('2 Selected')).toBeInTheDocument();
|
|
1643
1666
|
});
|
|
1644
|
-
test('when filtered to one item in condensed mode, it still shows the correct amount of selected items ', function () {
|
|
1645
|
-
var onInputChange = jest.fn();
|
|
1646
|
-
getComponent({
|
|
1647
|
-
mode: 'condensed',
|
|
1648
|
-
defaultSelectedKeys: [items[1].key, items[2].key],
|
|
1649
|
-
onInputChange: onInputChange
|
|
1650
|
-
});
|
|
1651
|
-
var input = screen.getByRole('combobox');
|
|
1652
|
-
var value = 'Aardvark';
|
|
1653
|
-
userEvent.type(input, value);
|
|
1654
|
-
var listbox = screen.getByRole('listbox');
|
|
1655
|
-
expect(listbox).toBeInTheDocument();
|
|
1656
|
-
var options = within(listbox).getAllByRole('option');
|
|
1657
|
-
expect(options.length).toBe(1);
|
|
1658
|
-
expect(screen.getByText('2 Selected')).toBeInTheDocument();
|
|
1659
|
-
});
|
|
1660
|
-
test('onInputChange is called in condensed mode ', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43() {
|
|
1667
|
+
test('when filtered to one item in condensed mode, it still shows the correct amount of selected items ', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43() {
|
|
1661
1668
|
var onInputChange, input, value, listbox, options;
|
|
1662
1669
|
return _regeneratorRuntime().wrap(function _callee43$(_context45) {
|
|
1663
1670
|
while (1) switch (_context45.prev = _context45.next) {
|
|
@@ -1665,6 +1672,7 @@ test('onInputChange is called in condensed mode ', /*#__PURE__*/_asyncToGenerato
|
|
|
1665
1672
|
onInputChange = jest.fn();
|
|
1666
1673
|
getComponent({
|
|
1667
1674
|
mode: 'condensed',
|
|
1675
|
+
defaultSelectedKeys: [items[1].key, items[2].key],
|
|
1668
1676
|
onInputChange: onInputChange
|
|
1669
1677
|
});
|
|
1670
1678
|
input = screen.getByRole('combobox');
|
|
@@ -1676,18 +1684,44 @@ test('onInputChange is called in condensed mode ', /*#__PURE__*/_asyncToGenerato
|
|
|
1676
1684
|
expect(listbox).toBeInTheDocument();
|
|
1677
1685
|
options = within(listbox).getAllByRole('option');
|
|
1678
1686
|
expect(options.length).toBe(1);
|
|
1679
|
-
expect(
|
|
1680
|
-
|
|
1681
|
-
case 12:
|
|
1687
|
+
expect(screen.getByText('2 Selected')).toBeInTheDocument();
|
|
1688
|
+
case 11:
|
|
1682
1689
|
case "end":
|
|
1683
1690
|
return _context45.stop();
|
|
1684
1691
|
}
|
|
1685
1692
|
}, _callee43);
|
|
1686
1693
|
})));
|
|
1687
|
-
test('
|
|
1688
|
-
var
|
|
1694
|
+
test('onInputChange is called in condensed mode ', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44() {
|
|
1695
|
+
var onInputChange, input, value, listbox, options;
|
|
1689
1696
|
return _regeneratorRuntime().wrap(function _callee44$(_context46) {
|
|
1690
1697
|
while (1) switch (_context46.prev = _context46.next) {
|
|
1698
|
+
case 0:
|
|
1699
|
+
onInputChange = jest.fn();
|
|
1700
|
+
getComponent({
|
|
1701
|
+
mode: 'condensed',
|
|
1702
|
+
onInputChange: onInputChange
|
|
1703
|
+
});
|
|
1704
|
+
input = screen.getByRole('combobox');
|
|
1705
|
+
value = 'Aardvark';
|
|
1706
|
+
_context46.next = 6;
|
|
1707
|
+
return userEvent.type(input, value);
|
|
1708
|
+
case 6:
|
|
1709
|
+
listbox = screen.getByRole('listbox');
|
|
1710
|
+
expect(listbox).toBeInTheDocument();
|
|
1711
|
+
options = within(listbox).getAllByRole('option');
|
|
1712
|
+
expect(options.length).toBe(1);
|
|
1713
|
+
expect(onInputChange).toBeCalledTimes(value.length);
|
|
1714
|
+
expect(onInputChange).toHaveBeenCalledWith(value);
|
|
1715
|
+
case 12:
|
|
1716
|
+
case "end":
|
|
1717
|
+
return _context46.stop();
|
|
1718
|
+
}
|
|
1719
|
+
}, _callee44);
|
|
1720
|
+
})));
|
|
1721
|
+
test('opens listbox on focus and fires "onFocus', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45() {
|
|
1722
|
+
var onFocus, input, options;
|
|
1723
|
+
return _regeneratorRuntime().wrap(function _callee45$(_context47) {
|
|
1724
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
1691
1725
|
case 0:
|
|
1692
1726
|
onFocus = jest.fn();
|
|
1693
1727
|
getComponent({
|
|
@@ -1695,7 +1729,7 @@ test('opens listbox on focus and fires "onFocus', /*#__PURE__*/_asyncToGenerator
|
|
|
1695
1729
|
onFocus: onFocus
|
|
1696
1730
|
});
|
|
1697
1731
|
input = screen.getByRole('combobox');
|
|
1698
|
-
|
|
1732
|
+
_context47.next = 5;
|
|
1699
1733
|
return userEvent.tab();
|
|
1700
1734
|
case 5:
|
|
1701
1735
|
expect(input).toHaveFocus();
|
|
@@ -1706,14 +1740,14 @@ test('opens listbox on focus and fires "onFocus', /*#__PURE__*/_asyncToGenerator
|
|
|
1706
1740
|
expect(onFocus).toBeCalled();
|
|
1707
1741
|
case 11:
|
|
1708
1742
|
case "end":
|
|
1709
|
-
return
|
|
1743
|
+
return _context47.stop();
|
|
1710
1744
|
}
|
|
1711
|
-
},
|
|
1745
|
+
}, _callee45);
|
|
1712
1746
|
})));
|
|
1713
|
-
test('closes listbox on blur and fires "onBlur"', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1747
|
+
test('closes listbox on blur and fires "onBlur"', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46() {
|
|
1714
1748
|
var onBlur, input;
|
|
1715
|
-
return _regeneratorRuntime().wrap(function
|
|
1716
|
-
while (1) switch (
|
|
1749
|
+
return _regeneratorRuntime().wrap(function _callee46$(_context48) {
|
|
1750
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
1717
1751
|
case 0:
|
|
1718
1752
|
onBlur = jest.fn();
|
|
1719
1753
|
getComponent({
|
|
@@ -1721,7 +1755,7 @@ test('closes listbox on blur and fires "onBlur"', /*#__PURE__*/_asyncToGenerator
|
|
|
1721
1755
|
onBlur: onBlur
|
|
1722
1756
|
});
|
|
1723
1757
|
input = screen.getByRole('combobox');
|
|
1724
|
-
|
|
1758
|
+
_context48.next = 5;
|
|
1725
1759
|
return userEvent.tab();
|
|
1726
1760
|
case 5:
|
|
1727
1761
|
expect(input).toHaveFocus();
|
|
@@ -1733,19 +1767,19 @@ test('closes listbox on blur and fires "onBlur"', /*#__PURE__*/_asyncToGenerator
|
|
|
1733
1767
|
expect(onBlur).toBeCalled();
|
|
1734
1768
|
case 10:
|
|
1735
1769
|
case "end":
|
|
1736
|
-
return
|
|
1770
|
+
return _context48.stop();
|
|
1737
1771
|
}
|
|
1738
|
-
},
|
|
1772
|
+
}, _callee46);
|
|
1739
1773
|
})));
|
|
1740
|
-
test('list and button are keyboard accessible', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1774
|
+
test('list and button are keyboard accessible', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47() {
|
|
1741
1775
|
var listbox, options, firstOption, secondOption, buttons, button;
|
|
1742
|
-
return _regeneratorRuntime().wrap(function
|
|
1743
|
-
while (1) switch (
|
|
1776
|
+
return _regeneratorRuntime().wrap(function _callee47$(_context49) {
|
|
1777
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
1744
1778
|
case 0:
|
|
1745
1779
|
getComponent({
|
|
1746
1780
|
mode: 'condensed'
|
|
1747
1781
|
});
|
|
1748
|
-
|
|
1782
|
+
_context49.next = 3;
|
|
1749
1783
|
return userEvent.tab();
|
|
1750
1784
|
case 3:
|
|
1751
1785
|
listbox = screen.getByRole('listbox');
|
|
@@ -1754,15 +1788,15 @@ test('list and button are keyboard accessible', /*#__PURE__*/_asyncToGenerator(/
|
|
|
1754
1788
|
secondOption = options[1];
|
|
1755
1789
|
buttons = screen.getAllByRole('button');
|
|
1756
1790
|
button = buttons[1];
|
|
1757
|
-
|
|
1791
|
+
_context49.next = 11;
|
|
1758
1792
|
return userEvent.tab();
|
|
1759
1793
|
case 11:
|
|
1760
1794
|
expect(button).toHaveFocus();
|
|
1761
|
-
|
|
1795
|
+
_context49.next = 14;
|
|
1762
1796
|
return userEvent.tab();
|
|
1763
1797
|
case 14:
|
|
1764
1798
|
expect(firstOption).toHaveFocus();
|
|
1765
|
-
|
|
1799
|
+
_context49.next = 17;
|
|
1766
1800
|
return userEvent.type(firstOption, '{arrowdown}', {
|
|
1767
1801
|
skipClick: true
|
|
1768
1802
|
});
|
|
@@ -1770,14 +1804,14 @@ test('list and button are keyboard accessible', /*#__PURE__*/_asyncToGenerator(/
|
|
|
1770
1804
|
expect(secondOption).toHaveFocus();
|
|
1771
1805
|
case 18:
|
|
1772
1806
|
case "end":
|
|
1773
|
-
return
|
|
1807
|
+
return _context49.stop();
|
|
1774
1808
|
}
|
|
1775
|
-
},
|
|
1809
|
+
}, _callee47);
|
|
1776
1810
|
})));
|
|
1777
|
-
test('popover closes on input blur', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1811
|
+
test('popover closes on input blur', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48() {
|
|
1778
1812
|
var input, listbox, options, checkboxes, secondOption, value;
|
|
1779
|
-
return _regeneratorRuntime().wrap(function
|
|
1780
|
-
while (1) switch (
|
|
1813
|
+
return _regeneratorRuntime().wrap(function _callee48$(_context50) {
|
|
1814
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
1781
1815
|
case 0:
|
|
1782
1816
|
getComponent({
|
|
1783
1817
|
mode: 'condensed'
|
|
@@ -1785,7 +1819,7 @@ test('popover closes on input blur', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*
|
|
|
1785
1819
|
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
|
1786
1820
|
expect(screen.queryByRole('option')).not.toBeInTheDocument();
|
|
1787
1821
|
input = screen.getByRole('combobox');
|
|
1788
|
-
|
|
1822
|
+
_context50.next = 6;
|
|
1789
1823
|
return userEvent.click(input);
|
|
1790
1824
|
case 6:
|
|
1791
1825
|
listbox = screen.getByRole('listbox');
|
|
@@ -1793,54 +1827,54 @@ test('popover closes on input blur', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*
|
|
|
1793
1827
|
checkboxes = within(listbox).getAllByRole('img');
|
|
1794
1828
|
expect(checkboxes.length).toBe(3);
|
|
1795
1829
|
secondOption = options[1];
|
|
1796
|
-
|
|
1830
|
+
_context50.next = 13;
|
|
1797
1831
|
return userEvent.click(secondOption);
|
|
1798
1832
|
case 13:
|
|
1799
1833
|
value = 'Aardvark';
|
|
1800
|
-
|
|
1834
|
+
_context50.next = 16;
|
|
1801
1835
|
return userEvent.type(input, value);
|
|
1802
1836
|
case 16:
|
|
1803
|
-
|
|
1837
|
+
_context50.next = 18;
|
|
1804
1838
|
return userEvent.click(document.body);
|
|
1805
1839
|
case 18:
|
|
1806
1840
|
expect(input).toHaveValue('');
|
|
1807
1841
|
expect(listbox).not.toBeInTheDocument();
|
|
1808
1842
|
case 20:
|
|
1809
1843
|
case "end":
|
|
1810
|
-
return
|
|
1844
|
+
return _context50.stop();
|
|
1811
1845
|
}
|
|
1812
|
-
},
|
|
1846
|
+
}, _callee48);
|
|
1813
1847
|
})));
|
|
1814
|
-
test('trigger button handles popover open and close in condensed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1848
|
+
test('trigger button handles popover open and close in condensed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49() {
|
|
1815
1849
|
var input;
|
|
1816
|
-
return _regeneratorRuntime().wrap(function
|
|
1817
|
-
while (1) switch (
|
|
1850
|
+
return _regeneratorRuntime().wrap(function _callee49$(_context51) {
|
|
1851
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
1818
1852
|
case 0:
|
|
1819
1853
|
getComponent({
|
|
1820
1854
|
mode: 'condensed'
|
|
1821
1855
|
});
|
|
1822
1856
|
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
|
1823
1857
|
input = screen.getByRole('combobox');
|
|
1824
|
-
|
|
1858
|
+
_context51.next = 5;
|
|
1825
1859
|
return userEvent.click(screen.getAllByRole('button')[0]);
|
|
1826
1860
|
case 5:
|
|
1827
1861
|
expect(screen.queryByRole('listbox')).toBeInTheDocument();
|
|
1828
1862
|
expect(input).toHaveFocus();
|
|
1829
|
-
|
|
1863
|
+
_context51.next = 9;
|
|
1830
1864
|
return userEvent.tab();
|
|
1831
1865
|
case 9:
|
|
1832
1866
|
fireEvent.click(screen.getAllByRole('button')[0]);
|
|
1833
1867
|
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
|
1834
1868
|
case 11:
|
|
1835
1869
|
case "end":
|
|
1836
|
-
return
|
|
1870
|
+
return _context51.stop();
|
|
1837
1871
|
}
|
|
1838
|
-
},
|
|
1872
|
+
}, _callee49);
|
|
1839
1873
|
})));
|
|
1840
|
-
test('renders items with duplicate keys', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1874
|
+
test('renders items with duplicate keys', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50() {
|
|
1841
1875
|
var input, options;
|
|
1842
|
-
return _regeneratorRuntime().wrap(function
|
|
1843
|
-
while (1) switch (
|
|
1876
|
+
return _regeneratorRuntime().wrap(function _callee50$(_context52) {
|
|
1877
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
1844
1878
|
case 0:
|
|
1845
1879
|
getComponent({
|
|
1846
1880
|
items: _mapInstanceProperty(items).call(items, function (item) {
|
|
@@ -1851,7 +1885,7 @@ test('renders items with duplicate keys', /*#__PURE__*/_asyncToGenerator(/*#__PU
|
|
|
1851
1885
|
mode: 'condensed'
|
|
1852
1886
|
});
|
|
1853
1887
|
input = screen.getByRole('combobox');
|
|
1854
|
-
|
|
1888
|
+
_context52.next = 4;
|
|
1855
1889
|
return userEvent.tab();
|
|
1856
1890
|
case 4:
|
|
1857
1891
|
expect(input).toHaveFocus();
|
|
@@ -1860,20 +1894,20 @@ test('renders items with duplicate keys', /*#__PURE__*/_asyncToGenerator(/*#__PU
|
|
|
1860
1894
|
expect(options.length).toBe(1);
|
|
1861
1895
|
case 8:
|
|
1862
1896
|
case "end":
|
|
1863
|
-
return
|
|
1897
|
+
return _context52.stop();
|
|
1864
1898
|
}
|
|
1865
|
-
},
|
|
1899
|
+
}, _callee50);
|
|
1866
1900
|
})));
|
|
1867
|
-
test('should render items with sections passed in props', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1901
|
+
test('should render items with sections passed in props', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51() {
|
|
1868
1902
|
var input;
|
|
1869
|
-
return _regeneratorRuntime().wrap(function
|
|
1870
|
-
while (1) switch (
|
|
1903
|
+
return _regeneratorRuntime().wrap(function _callee51$(_context53) {
|
|
1904
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
1871
1905
|
case 0:
|
|
1872
1906
|
getSectionsComponent();
|
|
1873
1907
|
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
|
1874
1908
|
expect(screen.queryByRole('option')).not.toBeInTheDocument();
|
|
1875
1909
|
input = screen.getByRole('combobox');
|
|
1876
|
-
|
|
1910
|
+
_context53.next = 6;
|
|
1877
1911
|
return userEvent.click(input);
|
|
1878
1912
|
case 6:
|
|
1879
1913
|
expect(screen.getAllByRole('group')).toHaveLength(2);
|
|
@@ -1881,18 +1915,18 @@ test('should render items with sections passed in props', /*#__PURE__*/_asyncToG
|
|
|
1881
1915
|
expect(screen.queryAllByRole('option')).toHaveLength(5);
|
|
1882
1916
|
case 9:
|
|
1883
1917
|
case "end":
|
|
1884
|
-
return
|
|
1918
|
+
return _context53.stop();
|
|
1885
1919
|
}
|
|
1886
|
-
},
|
|
1920
|
+
}, _callee51);
|
|
1887
1921
|
})));
|
|
1888
|
-
test('should render the separators', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1922
|
+
test('should render the separators', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52() {
|
|
1889
1923
|
var input, groups;
|
|
1890
|
-
return _regeneratorRuntime().wrap(function
|
|
1891
|
-
while (1) switch (
|
|
1924
|
+
return _regeneratorRuntime().wrap(function _callee52$(_context54) {
|
|
1925
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
1892
1926
|
case 0:
|
|
1893
1927
|
getSectionsComponent();
|
|
1894
1928
|
input = screen.getByRole('combobox');
|
|
1895
|
-
|
|
1929
|
+
_context54.next = 4;
|
|
1896
1930
|
return userEvent.click(input);
|
|
1897
1931
|
case 4:
|
|
1898
1932
|
expect(screen.queryAllByRole('separator')).toHaveLength(3);
|
|
@@ -1915,14 +1949,14 @@ test('should render the separators', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*
|
|
|
1915
1949
|
});
|
|
1916
1950
|
case 10:
|
|
1917
1951
|
case "end":
|
|
1918
|
-
return
|
|
1952
|
+
return _context54.stop();
|
|
1919
1953
|
}
|
|
1920
|
-
},
|
|
1954
|
+
}, _callee52);
|
|
1921
1955
|
})));
|
|
1922
|
-
test('renders duplicate groups for duplicate keys on items group ', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1956
|
+
test('renders duplicate groups for duplicate keys on items group ', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee53() {
|
|
1923
1957
|
var input;
|
|
1924
|
-
return _regeneratorRuntime().wrap(function
|
|
1925
|
-
while (1) switch (
|
|
1958
|
+
return _regeneratorRuntime().wrap(function _callee53$(_context55) {
|
|
1959
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
1926
1960
|
case 0:
|
|
1927
1961
|
getSectionsComponent({
|
|
1928
1962
|
items: _mapInstanceProperty(withSection).call(withSection, function (item) {
|
|
@@ -1932,23 +1966,23 @@ test('renders duplicate groups for duplicate keys on items group ', /*#__PURE__*
|
|
|
1932
1966
|
})
|
|
1933
1967
|
});
|
|
1934
1968
|
input = screen.getByRole('combobox');
|
|
1935
|
-
|
|
1969
|
+
_context55.next = 4;
|
|
1936
1970
|
return userEvent.click(input);
|
|
1937
1971
|
case 4:
|
|
1938
1972
|
expect(screen.getAllByRole('group')).not.toHaveLength(2);
|
|
1939
1973
|
case 5:
|
|
1940
1974
|
case "end":
|
|
1941
|
-
return
|
|
1975
|
+
return _context55.stop();
|
|
1942
1976
|
}
|
|
1943
|
-
},
|
|
1977
|
+
}, _callee53);
|
|
1944
1978
|
})));
|
|
1945
|
-
test('onLoadMore and onLoadPrev callbacks are called', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1979
|
+
test('onLoadMore and onLoadPrev callbacks are called', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee54() {
|
|
1946
1980
|
var listBox;
|
|
1947
|
-
return _regeneratorRuntime().wrap(function
|
|
1948
|
-
while (1) switch (
|
|
1981
|
+
return _regeneratorRuntime().wrap(function _callee54$(_context56) {
|
|
1982
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
1949
1983
|
case 0:
|
|
1950
1984
|
render(___EmotionJSX(ComponentOnPrevLoad, null));
|
|
1951
|
-
|
|
1985
|
+
_context56.next = 3;
|
|
1952
1986
|
return userEvent.tab();
|
|
1953
1987
|
case 3:
|
|
1954
1988
|
listBox = screen.getAllByRole('listbox');
|
|
@@ -1966,10 +2000,36 @@ test('onLoadMore and onLoadPrev callbacks are called', /*#__PURE__*/_asyncToGene
|
|
|
1966
2000
|
expect(onLoadPrevFunc).toHaveBeenCalled();
|
|
1967
2001
|
case 8:
|
|
1968
2002
|
case "end":
|
|
1969
|
-
return
|
|
2003
|
+
return _context56.stop();
|
|
1970
2004
|
}
|
|
1971
|
-
},
|
|
2005
|
+
}, _callee54);
|
|
1972
2006
|
})));
|
|
2007
|
+
test('selected badge with a long label renders a tooltip with the full text on hover', function () {
|
|
2008
|
+
getLongLabelComponent();
|
|
2009
|
+
var badge = screen.getByText('Lorem ipsum dolor sit amet, consectetur adipiscing elit,');
|
|
2010
|
+
expect(badge).toBeInTheDocument();
|
|
2011
|
+
fireEvent.mouseMove(badge);
|
|
2012
|
+
fireEvent.mouseEnter(badge);
|
|
2013
|
+
var tooltip = screen.getByRole('tooltip');
|
|
2014
|
+
expect(tooltip).toBeInTheDocument();
|
|
2015
|
+
expect(tooltip).toHaveTextContent('Lorem ipsum dolor sit amet, consectetur adipiscing elit,');
|
|
2016
|
+
});
|
|
2017
|
+
test('selected badge with a short label does not show a tooltip on hover', function () {
|
|
2018
|
+
getLongLabelComponent();
|
|
2019
|
+
var badge = screen.getByText('Short');
|
|
2020
|
+
expect(badge).toBeInTheDocument();
|
|
2021
|
+
fireEvent.mouseMove(badge);
|
|
2022
|
+
fireEvent.mouseEnter(badge);
|
|
2023
|
+
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();
|
|
2024
|
+
});
|
|
2025
|
+
test('hovering delete button does not show tooltip for long label badge', function () {
|
|
2026
|
+
getLongLabelComponent();
|
|
2027
|
+
var deleteButton = screen.getByLabelText('delete Lorem ipsum dolor sit amet, consectetur adipiscing elit,');
|
|
2028
|
+
expect(deleteButton).toBeInTheDocument();
|
|
2029
|
+
fireEvent.mouseMove(deleteButton);
|
|
2030
|
+
fireEvent.mouseEnter(deleteButton);
|
|
2031
|
+
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();
|
|
2032
|
+
});
|
|
1973
2033
|
|
|
1974
2034
|
// Needs to be added to each components test file
|
|
1975
2035
|
universalComponentTests({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import sizes from '../sizes';
|
|
1
2
|
export default {
|
|
2
3
|
'icon-50': '10px',
|
|
3
4
|
xxs: '10px',
|
|
@@ -16,7 +17,9 @@ export default {
|
|
|
16
17
|
xsm: '16px'
|
|
17
18
|
};
|
|
18
19
|
export var iconWrapperSizes = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
xs: sizes.avatarFontSize.xs,
|
|
21
|
+
sm: sizes.avatarFontSize.sm,
|
|
22
|
+
md: sizes.avatarFontSize.md,
|
|
23
|
+
lg: sizes.avatarFontSize.lg,
|
|
24
|
+
xl: sizes.avatarFontSize.xl
|
|
22
25
|
};
|
|
@@ -5,13 +5,6 @@ var sideNav = {
|
|
|
5
5
|
halfWidth: "".concat(halfSidenavWidth, "px")
|
|
6
6
|
};
|
|
7
7
|
var fontSizes = astroTokens["default"]['font-size'];
|
|
8
|
-
var avatar = {
|
|
9
|
-
sm: "".concat(astroTokens.size.avatar.sm, "px"),
|
|
10
|
-
md: '32px',
|
|
11
|
-
xmd: '44px',
|
|
12
|
-
lg: "".concat(astroTokens.size.avatar.lg, "px"),
|
|
13
|
-
xl: "".concat(astroTokens.size.avatar.xl, "px")
|
|
14
|
-
};
|
|
15
8
|
var avatarLogo = {
|
|
16
9
|
sm: '14px',
|
|
17
10
|
md: '20px',
|
|
@@ -19,7 +12,16 @@ var avatarLogo = {
|
|
|
19
12
|
lg: '44px',
|
|
20
13
|
xl: '54px'
|
|
21
14
|
};
|
|
15
|
+
var avatar = {
|
|
16
|
+
xs: "".concat(astroTokens.size.avatar.xs, "px"),
|
|
17
|
+
sm: "".concat(astroTokens.size.avatar.sm, "px"),
|
|
18
|
+
md: "".concat(astroTokens.size.avatar.md, "px"),
|
|
19
|
+
xmd: '44px',
|
|
20
|
+
lg: "".concat(astroTokens.size.avatar.lg, "px"),
|
|
21
|
+
xl: "".concat(astroTokens.size.avatar.xl, "px")
|
|
22
|
+
};
|
|
22
23
|
var avatarFontSize = {
|
|
24
|
+
xs: fontSizes.avatar.xs,
|
|
23
25
|
sm: fontSizes.avatar.sm,
|
|
24
26
|
md: fontSizes.avatar.md,
|
|
25
27
|
xmd: '18px',
|
|
@@ -9,35 +9,52 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
|
9
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
10
10
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
import sizes from '../sizes';
|
|
12
13
|
var circle = {
|
|
13
14
|
'&.is-circle': {
|
|
14
15
|
borderRadius: '50%'
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
18
|
var iconWrapper = {
|
|
19
|
+
xs: _objectSpread({
|
|
20
|
+
borderRadius: '.25rem',
|
|
21
|
+
minHeight: sizes.avatar.xs,
|
|
22
|
+
minWidth: sizes.avatar.xs,
|
|
23
|
+
height: sizes.avatar.xs,
|
|
24
|
+
width: sizes.avatar.xs,
|
|
25
|
+
fontSize: sizes.avatarFontSize.xs
|
|
26
|
+
}, circle),
|
|
18
27
|
sm: _objectSpread({
|
|
19
|
-
borderRadius: '
|
|
20
|
-
minHeight:
|
|
21
|
-
minWidth:
|
|
22
|
-
height:
|
|
23
|
-
width:
|
|
24
|
-
|
|
28
|
+
borderRadius: '.25rem',
|
|
29
|
+
minHeight: sizes.avatar.sm,
|
|
30
|
+
minWidth: sizes.avatar.sm,
|
|
31
|
+
height: sizes.avatar.sm,
|
|
32
|
+
width: sizes.avatar.sm,
|
|
33
|
+
fontSize: sizes.avatarFontSize.sm
|
|
25
34
|
}, circle),
|
|
26
35
|
md: _objectSpread({
|
|
27
|
-
borderRadius: '
|
|
28
|
-
minHeight:
|
|
29
|
-
minWidth:
|
|
30
|
-
height:
|
|
31
|
-
width:
|
|
32
|
-
|
|
36
|
+
borderRadius: '.25rem',
|
|
37
|
+
minHeight: sizes.avatar.md,
|
|
38
|
+
minWidth: sizes.avatar.md,
|
|
39
|
+
height: sizes.avatar.md,
|
|
40
|
+
width: sizes.avatar.md,
|
|
41
|
+
fontSize: sizes.avatarFontSize.md
|
|
33
42
|
}, circle),
|
|
34
43
|
lg: _objectSpread({
|
|
35
|
-
borderRadius: '
|
|
36
|
-
minHeight:
|
|
37
|
-
minWidth:
|
|
38
|
-
height:
|
|
39
|
-
width:
|
|
40
|
-
|
|
44
|
+
borderRadius: '.25rem',
|
|
45
|
+
minHeight: sizes.avatar.lg,
|
|
46
|
+
minWidth: sizes.avatar.lg,
|
|
47
|
+
height: sizes.avatar.lg,
|
|
48
|
+
width: sizes.avatar.lg,
|
|
49
|
+
fontSize: sizes.avatarFontSize.lg
|
|
50
|
+
}, circle),
|
|
51
|
+
xl: _objectSpread({
|
|
52
|
+
borderRadius: '.25rem',
|
|
53
|
+
minHeight: sizes.avatar.xl,
|
|
54
|
+
minWidth: sizes.avatar.xl,
|
|
55
|
+
height: sizes.avatar.xl,
|
|
56
|
+
width: sizes.avatar.xl,
|
|
57
|
+
fontSize: sizes.avatarFontSize.xl
|
|
41
58
|
}, circle)
|
|
42
59
|
};
|
|
43
60
|
export default _objectSpread({}, iconWrapper);
|