@pingux/astro 1.25.1-alpha.0 → 1.25.1-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 (26) hide show
  1. package/README.md +4 -9
  2. package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +19 -0
  3. package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +0 -1
  4. package/lib/cjs/components/MultivaluesField/MultivaluesField.js +28 -6
  5. package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +46 -2
  6. package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +14 -0
  7. package/lib/cjs/components/PasswordField/PasswordField.js +55 -52
  8. package/lib/cjs/components/PopoverContainer/PopoverContainer.js +1 -1
  9. package/lib/cjs/recipes/ListAndPanel.stories.js +36 -13
  10. package/lib/cjs/recipes/OneWayToBidirectionalArrow.stories.js +125 -30
  11. package/lib/cjs/styles/theme.js +3 -1
  12. package/lib/cjs/styles/variants/bidirectionalIconButton.js +54 -0
  13. package/lib/cjs/styles/variants/index.js +10 -0
  14. package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +11 -0
  15. package/lib/components/AccordionGridItem/AccordionGridItemBody.js +0 -1
  16. package/lib/components/MultivaluesField/MultivaluesField.js +26 -7
  17. package/lib/components/MultivaluesField/MultivaluesField.stories.js +40 -0
  18. package/lib/components/MultivaluesField/MultivaluesField.test.js +11 -0
  19. package/lib/components/PasswordField/PasswordField.js +53 -49
  20. package/lib/components/PopoverContainer/PopoverContainer.js +1 -1
  21. package/lib/recipes/ListAndPanel.stories.js +36 -14
  22. package/lib/recipes/OneWayToBidirectionalArrow.stories.js +124 -30
  23. package/lib/styles/theme.js +4 -2
  24. package/lib/styles/variants/bidirectionalIconButton.js +34 -0
  25. package/lib/styles/variants/index.js +1 -0
  26. package/package.json +1 -1
@@ -10,6 +10,8 @@ _Object$defineProperty(exports, "__esModule", {
10
10
 
11
11
  exports["default"] = exports.Default = void 0;
12
12
 
13
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
14
+
13
15
  var _react = _interopRequireDefault(require("react"));
14
16
 
15
17
  var _DragVerticalIcon = _interopRequireDefault(require("mdi-react/DragVerticalIcon"));
@@ -40,42 +42,52 @@ var items = [{
40
42
  }];
41
43
 
42
44
  var Default = function Default() {
43
- var CustomOnSvg = function CustomOnSvg() {
44
- return (0, _react2.jsx)("svg", {
45
- width: "24",
46
- height: "24",
47
- viewBox: "0 0 24 24",
45
+ var CustomOnSvg = function CustomOnSvg(props) {
46
+ return (0, _react2.jsx)("svg", (0, _extends2["default"])({
47
+ width: "16",
48
+ height: "16",
49
+ viewBox: "0 0 16 16",
48
50
  fill: "none",
49
51
  xmlns: "http://www.w3.org/2000/svg"
50
- }, (0, _react2.jsx)("path", {
51
- d: "M8 10V13H14V18H8V21L2 15.5L8 10Z",
52
- fill: "#CACED3"
53
- }), (0, _react2.jsx)("path", {
54
- d: "M9.83325 10.6251V6.37511H15.4999V2.94678L21.0533 8.50011L15.4999 14.0534V10.6251H9.83325Z",
55
- fill: "#4462ED"
52
+ }, props), (0, _react2.jsx)("path", {
53
+ d: "M5.33325 6.66666V8.66666H9.33325V12H5.33325V14L1.33325 10.3333L5.33325 6.66666Z",
54
+ fill: "currentColor"
56
55
  }), (0, _react2.jsx)("path", {
57
- d: "M8 10V13H14V18H8V21L2 15.5L8 10ZM22 8.5L16 3V6H10V11H16V14L22 8.5Z",
58
- fill: "#515F6B"
56
+ d: "M14.6666 5.66667L10.6666 2V4H6.66658V7.33333H10.6666V9.33333L14.6666 5.66667Z",
57
+ fill: "currentColor"
59
58
  }));
60
59
  };
61
60
 
62
- var CustomOffSvg = function CustomOffSvg() {
63
- return (0, _react2.jsx)("svg", {
64
- width: "24",
65
- height: "24",
66
- viewBox: "0 0 24 24",
61
+ var CustomOffSvg = function CustomOffSvg(props) {
62
+ return (0, _react2.jsx)("svg", (0, _extends2["default"])({
63
+ width: "16",
64
+ height: "16",
65
+ viewBox: "0 0 16 16",
67
66
  fill: "none",
68
67
  xmlns: "http://www.w3.org/2000/svg"
69
- }, (0, _react2.jsx)("path", {
70
- d: "M8 10V13H14V18H8V21L2 15.5L8 10Z",
68
+ }, props), (0, _react2.jsx)("path", {
69
+ d: "M5.33325 6.66667V8.66667H9.33325V12H5.33325V14L1.33325 10.3333L5.33325 6.66667Z",
71
70
  fill: "#CACED3"
72
71
  }), (0, _react2.jsx)("path", {
73
- d: "M9.83331 10.6251V6.37511H15.5V2.94678L21.0533 8.50011L15.5 14.0534V10.6251H9.83331Z",
74
- fill: "#4462ED"
72
+ d: "M14.6666 5.66667L10.6666 2V4H6.66658V7.33333H10.6666V9.33333L14.6666 5.66667Z",
73
+ fill: "currentColor"
74
+ }));
75
+ };
76
+
77
+ var CustomRightSvg = function CustomRightSvg(props) {
78
+ return (0, _react2.jsx)("svg", (0, _extends2["default"])({
79
+ width: "8",
80
+ height: "8",
81
+ viewBox: "0 0 8 8",
82
+ fill: "none",
83
+ xmlns: "http://www.w3.org/2000/svg"
84
+ }, props), (0, _react2.jsx)("path", {
85
+ d: "M8 4L4 0V2.18182H0V5.81818H4V8L8 4Z",
86
+ fill: "currentColor"
75
87
  }));
76
88
  };
77
89
 
78
- return (0, _react2.jsx)(_Box["default"], {
90
+ return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_Box["default"], {
79
91
  sx: {
80
92
  alignItems: 'center'
81
93
  },
@@ -104,8 +116,7 @@ var Default = function Default() {
104
116
  }, item.name);
105
117
  }), (0, _react2.jsx)(_Box["default"], {
106
118
  sx: {
107
- ml: '5px',
108
- mr: '5px',
119
+ mx: 'sm',
109
120
  flexShrink: 0
110
121
  }
111
122
  }, (0, _react2.jsx)(_index.IconButtonToggle, {
@@ -113,10 +124,10 @@ var Default = function Default() {
113
124
  defaultIcon: CustomOffSvg,
114
125
  title: "Bidirectional/ Outbound toggle",
115
126
  iconProps: {
116
- size: 20
127
+ size: 16
117
128
  },
118
129
  buttonProps: {
119
- variant: 'svgIconButton'
130
+ variant: 'bidirectionalIconButton'
120
131
  }
121
132
  })), (0, _react2.jsx)(_index.ComboBoxField, {
122
133
  items: items,
@@ -142,19 +153,103 @@ var Default = function Default() {
142
153
  marginLeft: '12px',
143
154
  marginRight: '12px'
144
155
  }
145
- }, (0, _react2.jsx)(_index.IconButton, null, (0, _react2.jsx)(_index.Icon, {
156
+ }, (0, _react2.jsx)(_index.IconButton, {
157
+ "aria-label": "Edit"
158
+ }, (0, _react2.jsx)(_index.Icon, {
159
+ icon: _CogsIcon["default"],
160
+ color: "neutral.30",
161
+ size: 20,
162
+ title: "edit icon"
163
+ })), (0, _react2.jsx)(_index.IconButton, {
164
+ ml: "5px",
165
+ "aria-label": "Delete"
166
+ }, (0, _react2.jsx)(_index.Icon, {
167
+ icon: _DeleteIcon["default"],
168
+ color: "neutral.30",
169
+ size: 20,
170
+ title: "delete icon"
171
+ })))), (0, _react2.jsx)(_Box["default"], {
172
+ sx: {
173
+ alignItems: 'center'
174
+ },
175
+ isRow: true
176
+ }, (0, _react2.jsx)(_index.Icon, {
177
+ icon: _DragVerticalIcon["default"],
178
+ size: 25,
179
+ color: "neutral.50"
180
+ }), (0, _react2.jsx)(_index.ComboBoxField, {
181
+ items: items,
182
+ defaultSelectedKey: "Last Name",
183
+ containerProps: {
184
+ width: '275px'
185
+ },
186
+ labelProps: {
187
+ mb: 0
188
+ },
189
+ "aria-label": "Row one value",
190
+ controlProps: {
191
+ 'aria-label': 'test'
192
+ }
193
+ }, function (item) {
194
+ return (0, _react2.jsx)(_index.Item, {
195
+ key: item.name,
196
+ "data-id": item.name
197
+ }, item.name);
198
+ }), (0, _react2.jsx)(_Box["default"], {
199
+ sx: {
200
+ mx: 'sm',
201
+ flexShrink: 0
202
+ }
203
+ }, (0, _react2.jsx)(_index.IconButtonToggle, {
204
+ toggledIcon: CustomRightSvg,
205
+ defaultIcon: CustomRightSvg,
206
+ title: "This attribute does not support write-back.",
207
+ iconProps: {
208
+ size: 8
209
+ },
210
+ buttonProps: {
211
+ variant: 'bidirectionalIconButton'
212
+ }
213
+ })), (0, _react2.jsx)(_index.ComboBoxField, {
214
+ items: items,
215
+ defaultSelectedKey: "First Name",
216
+ containerProps: {
217
+ width: '275px'
218
+ },
219
+ labelProps: {
220
+ mb: 0
221
+ },
222
+ controlProps: {
223
+ 'aria-label': 'Row one Pingone value'
224
+ }
225
+ }, function (item) {
226
+ return (0, _react2.jsx)(_index.Item, {
227
+ key: item.name,
228
+ "data-id": item.name
229
+ }, item.name);
230
+ }), (0, _react2.jsx)(_Box["default"], {
231
+ isRow: true,
232
+ alignItems: "center",
233
+ sx: {
234
+ marginLeft: '12px',
235
+ marginRight: '12px'
236
+ }
237
+ }, (0, _react2.jsx)(_index.IconButton, {
238
+ "aria-label": "Edit"
239
+ }, (0, _react2.jsx)(_index.Icon, {
146
240
  icon: _CogsIcon["default"],
147
241
  color: "neutral.30",
148
242
  size: 20,
149
243
  title: "edit icon"
150
244
  })), (0, _react2.jsx)(_index.IconButton, {
151
- ml: "5px"
245
+ ml: "5px",
246
+ "aria-label": "Delete"
152
247
  }, (0, _react2.jsx)(_index.Icon, {
153
248
  icon: _DeleteIcon["default"],
154
249
  color: "neutral.30",
155
250
  size: 20,
156
251
  title: "delete icon"
157
- }))));
252
+ })))));
158
253
  };
159
254
 
160
255
  exports.Default = Default;
@@ -84,7 +84,9 @@ var _default = {
84
84
  forms: _forms["default"],
85
85
  text: _variants.text,
86
86
  images: _variants.images,
87
- buttons: _variants.buttons,
87
+ buttons: _objectSpread(_objectSpread({}, _variants.buttons), {}, {
88
+ bidirectionalIconButton: _variants.bidirectionalIconButton
89
+ }),
88
90
  textColors: _text.textColors,
89
91
  links: _variants.links,
90
92
  variants: _variants.variants
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+
5
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
+
7
+ var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
8
+
9
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
10
+
11
+ var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
12
+
13
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
14
+
15
+ var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
16
+
17
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
18
+
19
+ var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
20
+
21
+ _Object$defineProperty(exports, "__esModule", {
22
+ value: true
23
+ });
24
+
25
+ exports["default"] = void 0;
26
+
27
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
28
+
29
+ var _buttons = require("./buttons");
30
+
31
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
32
+
33
+ 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) { (0, _defineProperty2["default"])(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; }
34
+
35
+ var bidirectionalIconButton = {
36
+ border: '1px solid',
37
+ outline: 'none',
38
+ height: '24px',
39
+ width: '24px',
40
+ color: 'active',
41
+ borderRadius: '12px',
42
+ borderColor: 'active',
43
+ '&.is-hovered': {
44
+ color: 'accent.40',
45
+ borderColor: 'accent.40'
46
+ },
47
+ '&.is-pressed': {
48
+ color: 'accent.20',
49
+ borderColor: 'accent.20'
50
+ },
51
+ '&.is-focused': _objectSpread({}, _buttons.defaultFocus)
52
+ };
53
+ var _default = bidirectionalIconButton;
54
+ exports["default"] = _default;
@@ -17,10 +17,18 @@ _Object$defineProperty(exports, "__esModule", {
17
17
  var _exportNames = {
18
18
  variants: true,
19
19
  buttons: true,
20
+ bidirectionalIconButton: true,
20
21
  images: true,
21
22
  links: true
22
23
  };
23
24
 
25
+ _Object$defineProperty(exports, "bidirectionalIconButton", {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _bidirectionalIconButton["default"];
29
+ }
30
+ });
31
+
24
32
  _Object$defineProperty(exports, "buttons", {
25
33
  enumerable: true,
26
34
  get: function get() {
@@ -53,6 +61,8 @@ var _variants = _interopRequireDefault(require("./variants"));
53
61
 
54
62
  var _buttons = _interopRequireDefault(require("./buttons"));
55
63
 
64
+ var _bidirectionalIconButton = _interopRequireDefault(require("./bidirectionalIconButton"));
65
+
56
66
  var _images = _interopRequireDefault(require("./images"));
57
67
 
58
68
  var _links = _interopRequireDefault(require("./links"));
@@ -212,4 +212,15 @@ test('adds focus to inputs', function () {
212
212
  userEvent.click(secondInput);
213
213
  expect(firstInput).not.toHaveFocus();
214
214
  expect(secondInput).toHaveFocus();
215
+ });
216
+ test('adds focus to input on a single click after onBlur', function () {
217
+ getComponentWithTextFields();
218
+ var firstInput = screen.getAllByRole('gridcell')[0];
219
+ var secondInput = screen.getAllByRole('gridcell')[1];
220
+ expect(secondInput).not.toHaveFocus();
221
+ userEvent.click(firstInput);
222
+ userEvent.click(secondInput);
223
+ secondInput.blur();
224
+ userEvent.click(secondInput);
225
+ expect(secondInput).toHaveFocus();
215
226
  });
@@ -55,7 +55,6 @@ var AccordionGridItemBody = /*#__PURE__*/forwardRef(function (props, ref) {
55
55
  var ariaLabel = props['aria-label'];
56
56
  delete mergedProps.onMouseDown;
57
57
  delete mergedProps.onPointerDown;
58
- delete mergedProps.onClick;
59
58
  return ___EmotionJSX(Box, _extends({
60
59
  as: "div",
61
60
  variant: "accordion.accordionGridBody",
@@ -5,6 +5,7 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
5
5
  import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
6
6
  import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
7
7
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
8
+ import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
8
9
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
9
10
  import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
10
11
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
@@ -27,10 +28,12 @@ import { FocusScope } from '@react-aria/focus';
27
28
  import { useListState } from '@react-stately/list';
28
29
  import { DismissButton, useOverlayPosition } from '@react-aria/overlays';
29
30
  import { useLayoutEffect, useResizeObserver } from '@react-aria/utils';
30
- import { Chip, Icon, IconButton, PopoverContainer, ScrollBox, TextField } from '../..';
31
+ import { Box, Chip, Icon, IconButton, PopoverContainer, ScrollBox, TextField } from '../..';
31
32
  import ListBox from '../ListBox';
32
33
  import { isIterableProp } from '../../utils/devUtils/props/isIterable';
33
34
  import { usePropWarning } from '../../hooks';
35
+ import statuses from '../../utils/devUtils/constants/statuses';
36
+ import FieldHelperText from '../FieldHelperText';
34
37
  /**
35
38
  * Complex control that lets you choose several tags from the dropdown list.
36
39
  * Or to add your own values in non-restrictive mode.
@@ -49,8 +52,10 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
49
52
  direction = props.direction,
50
53
  _props$disabledKeys = props.disabledKeys,
51
54
  disabledKeys = _props$disabledKeys === void 0 ? [] : _props$disabledKeys,
55
+ containerProps = props.containerProps,
52
56
  hasAutoFocus = props.hasAutoFocus,
53
57
  hasNoStatusIndicator = props.hasNoStatusIndicator,
58
+ helperText = props.helperText,
54
59
  customInputProps = props.inputProps,
55
60
  isDisabled = props.isDisabled,
56
61
  isNotFlippable = props.isNotFlippable,
@@ -70,7 +75,8 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
70
75
  _props$readOnlyKeys = props.readOnlyKeys,
71
76
  readOnlyKeys = _props$readOnlyKeys === void 0 ? [] : _props$readOnlyKeys,
72
77
  selectedKeys = props.selectedKeys,
73
- scrollBoxProps = props.scrollBoxProps;
78
+ scrollBoxProps = props.scrollBoxProps,
79
+ status = props.status;
74
80
  var hasCustomValue = mode === 'non-restrictive';
75
81
  usePropWarning(props, 'disabled', 'isDisabled');
76
82
 
@@ -350,10 +356,11 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
350
356
  wrapperProps: {
351
357
  ref: inputRef,
352
358
  variant: 'forms.input.multivaluesWrapper'
353
- }
359
+ },
360
+ status: status
354
361
  });
355
362
 
356
- return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(TextField, _extends({
363
+ return ___EmotionJSX(Box, containerProps, ___EmotionJSX(TextField, _extends({
357
364
  onBlur: function onBlur(e) {
358
365
  setIsOpen(false);
359
366
  if (_onBlur) _onBlur(e.nativeEvent);
@@ -375,7 +382,9 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
375
382
  beforeInput: ___EmotionJSX(React.Fragment, null, readOnlyItems, " ", selectedItems)
376
383
  },
377
384
  value: filterString
378
- }, inputProps)), ___EmotionJSX(PopoverContainer, {
385
+ }, inputProps)), helperText && ___EmotionJSX(FieldHelperText, {
386
+ status: status
387
+ }, helperText), ___EmotionJSX(PopoverContainer, {
379
388
  ref: popoverRef,
380
389
  hasNoArrow: true,
381
390
  isNonModal: true,
@@ -385,6 +394,9 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
385
394
  }, listbox));
386
395
  });
387
396
  MultivaluesField.propTypes = {
397
+ /** Props object that is spread directly into the root (top-level) Box component. */
398
+ containerProps: PropTypes.shape({}),
399
+
388
400
  /** The initial selected keys in the collection (uncontrolled). */
389
401
  defaultSelectedKeys: isIterableProp,
390
402
 
@@ -402,6 +414,9 @@ MultivaluesField.propTypes = {
402
414
  /** Whether the field has a status indicator. */
403
415
  hasNoStatusIndicator: PropTypes.bool,
404
416
 
417
+ /** Text rendered below the input. */
418
+ helperText: PropTypes.node,
419
+
405
420
  /**
406
421
  * Props that get passed as-is to the underlying TextField element
407
422
  */
@@ -500,13 +515,17 @@ MultivaluesField.propTypes = {
500
515
  /** @ignore */
501
516
  scrollBoxProps: PropTypes.shape({
502
517
  maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.number])
503
- })
518
+ }),
519
+
520
+ /** Determines the input status indicator and helper text styling. */
521
+ status: PropTypes.oneOf(_Object$values(statuses))
504
522
  };
505
523
  MultivaluesField.defaultProps = {
506
524
  direction: 'bottom',
507
525
  mode: 'restrictive',
508
526
  scrollBoxProps: {
509
527
  maxHeight: 300
510
- }
528
+ },
529
+ status: statuses.DEFAULT
511
530
  };
512
531
  export default MultivaluesField;
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
3
3
  import React, { useState } from 'react';
4
4
  import { Box, Item, MultivaluesField, OverlayProvider } from '../..';
5
+ import statuses from '../../utils/devUtils/constants/statuses';
5
6
  import { jsx as ___EmotionJSX } from "@emotion/react";
6
7
  export default {
7
8
  title: 'Form/MultivaluesField',
@@ -40,6 +41,18 @@ export default {
40
41
  control: {
41
42
  type: 'none'
42
43
  }
44
+ },
45
+ status: {
46
+ control: {
47
+ type: 'select',
48
+ options: statuses
49
+ },
50
+ defaultValue: statuses.DEFAULT
51
+ },
52
+ helperText: {
53
+ control: {
54
+ type: 'text'
55
+ }
43
56
  }
44
57
  },
45
58
  parameters: {
@@ -306,4 +319,31 @@ export var WithReadOnlyValues = function WithReadOnlyValues(args) {
306
319
  "data-id": item.name
307
320
  }, item.name);
308
321
  }));
322
+ };
323
+ export var Error = function Error(args) {
324
+ var _useState17 = useState(false),
325
+ _useState18 = _slicedToArray(_useState17, 2),
326
+ isOpen = _useState18[0],
327
+ setIsOpen = _useState18[1];
328
+
329
+ var direction = args.direction;
330
+
331
+ var onOpenChange = function onOpenChange() {
332
+ setIsOpen(true);
333
+ };
334
+
335
+ return ___EmotionJSX(OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
336
+ , {
337
+ style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
338
+ }, ___EmotionJSX(MultivaluesField, _extends({}, args, {
339
+ items: items,
340
+ helperText: "Here is some helpful text...",
341
+ status: "error",
342
+ onOpenChange: onOpenChange
343
+ }), function (item) {
344
+ return ___EmotionJSX(Item, {
345
+ key: item.key,
346
+ "data-id": item.name
347
+ }, item.name);
348
+ }));
309
349
  };
@@ -6,6 +6,7 @@ import userEvent from '@testing-library/user-event';
6
6
  import { axe } from 'jest-axe';
7
7
  import { Item, MultivaluesField, OverlayProvider } from '../../index';
8
8
  import { render, screen, within } from '../../utils/testUtils/testWrapper';
9
+ import statuses from '../../utils/devUtils/constants/statuses';
9
10
  import { jsx as ___EmotionJSX } from "@emotion/react";
10
11
  var items = [{
11
12
  id: 1,
@@ -357,4 +358,14 @@ test('read only keys', function () {
357
358
  expect(secondChip).toBeInTheDocument();
358
359
  var deleteButton2 = firstChip.nextSibling;
359
360
  expect(deleteButton2).toBeNull();
361
+ });
362
+ test(' multivalue field with helper text', function () {
363
+ var helperText = 'helper text';
364
+ getComponent({
365
+ helperText: helperText,
366
+ status: statuses.ERROR
367
+ });
368
+ var helper = screen.getByText(helperText);
369
+ expect(helper).toBeInTheDocument();
370
+ expect(helper).toHaveClass("is-".concat(statuses.ERROR));
360
371
  });