@pingux/astro 1.1.0-alpha.5 → 1.1.0-alpha.9

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/CHANGELOG.md CHANGED
@@ -3,6 +3,50 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.1.0-alpha.9](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.1.0-alpha.8...@pingux/astro@1.1.0-alpha.9) (2022-01-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * [UIP-5111] Deprecate List Component ([3cd9b69](https://gitlab.corp.pingidentity.com/ux/pingux/commit/3cd9b699c48ac43e34d9cfd61b07f33b4b7d4fc4))
12
+
13
+
14
+
15
+
16
+
17
+ # [1.1.0-alpha.8](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.1.0-alpha.7...@pingux/astro@1.1.0-alpha.8) (2022-01-24)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * [UIP-4995] TextArea Safari resize issue ([33c8af3](https://gitlab.corp.pingidentity.com/ux/pingux/commit/33c8af35fbe82820427b87bdd9ab0744039a6c18))
23
+
24
+
25
+
26
+
27
+
28
+ # [1.1.0-alpha.7](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.1.0-alpha.6...@pingux/astro@1.1.0-alpha.7) (2022-01-21)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * [UIP-5109] AccordionGroup OverlayPanel Compatibility Fix ([6a78b76](https://gitlab.corp.pingidentity.com/ux/pingux/commit/6a78b76a3c3ab7b9ac78a7dcd6ca74a6449d63c2))
34
+
35
+
36
+
37
+
38
+
39
+ # [1.1.0-alpha.6](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.1.0-alpha.5...@pingux/astro@1.1.0-alpha.6) (2022-01-21)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * [UIP-5070] Icons for warning and error messages are reversed ([36f0d6e](https://gitlab.corp.pingidentity.com/ux/pingux/commit/36f0d6e1b65662b3c64aa1599012a2967b59e56d))
45
+
46
+
47
+
48
+
49
+
6
50
  # [1.1.0-alpha.5](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.1.0-alpha.4...@pingux/astro@1.1.0-alpha.5) (2022-01-21)
7
51
 
8
52
 
@@ -39,6 +39,22 @@ var getComponent = function getComponent() {
39
39
  }, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Link, null, "Header Button"), (0, _react2.jsx)(_index.Link, null, "Second Header Button")), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Link, null, "Body Button"), (0, _react2.jsx)(_index.Link, null, "Second Body Button")))));
40
40
  };
41
41
 
42
+ var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
43
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
44
+ return (0, _testWrapper.render)((0, _react2.jsx)(_index.OverlayPanel, {
45
+ isOpen: true
46
+ }, (0, _react2.jsx)(_AccordionGridGroup["default"], (0, _extends2["default"])({}, defaultProps, props), (0, _react2.jsx)(_collections.Item, {
47
+ key: "first",
48
+ textValue: "Duplicate"
49
+ }, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Link, null, "Header Button"), (0, _react2.jsx)(_index.Link, null, "Second Header Button")), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Link, null, "Body Button"), (0, _react2.jsx)(_index.Link, null, "Second Body Button"))), (0, _react2.jsx)(_collections.Item, {
50
+ key: "second",
51
+ textValue: "Duplicate"
52
+ }, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Link, null, "Header Button"), (0, _react2.jsx)(_index.Link, null, "Second Header Button")), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Link, null, "Body Button"), (0, _react2.jsx)(_index.Link, null, "Second Body Button"))), (0, _react2.jsx)(_collections.Item, {
53
+ key: "third",
54
+ textValue: "Duplicate"
55
+ }, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Link, null, "Header Button"), (0, _react2.jsx)(_index.Link, null, "Second Header Button")), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Link, null, "Body Button"), (0, _react2.jsx)(_index.Link, null, "Second Body Button"))))));
56
+ };
57
+
42
58
  (0, _testAxe["default"])(getComponent, {
43
59
  // landmark-unique rule conflicts with react-aria role definition
44
60
  rules: {
@@ -230,4 +246,12 @@ test('default expanded keys expands an accordion item', function () {
230
246
 
231
247
  var selectedRow = row[0];
232
248
  expect(selectedRow).toHaveAttribute('aria-selected', 'true');
249
+ });
250
+ test('items do not automatically expand if wrapped in an open OverlayPanel', function () {
251
+ getComponentInOverlayPanel();
252
+
253
+ var row = _testWrapper.screen.getAllByRole('row');
254
+
255
+ var selectedRow = row[0];
256
+ expect(selectedRow).not.toHaveAttribute('aria-selected', 'true');
233
257
  });
@@ -20,6 +20,8 @@ var _Text = _interopRequireDefault(require("../Text"));
20
20
 
21
21
  var _AccordionGroup = _interopRequireDefault(require("../AccordionGroup"));
22
22
 
23
+ var _index = require("../../index");
24
+
23
25
  var _react2 = require("@emotion/react");
24
26
 
25
27
  var testId = 'test-accordion';
@@ -45,6 +47,25 @@ var getComponent = function getComponent() {
45
47
  "data-id": "third",
46
48
  label: "Accordion item"
47
49
  }, (0, _react2.jsx)(_Text["default"], null, "Render me!"))));
50
+ };
51
+
52
+ var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
53
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
54
+ return (0, _testWrapper.render)((0, _react2.jsx)(_index.OverlayPanel, {
55
+ isOpen: true
56
+ }, (0, _react2.jsx)(_AccordionGroup["default"], (0, _extends2["default"])({}, defaultProps, props), (0, _react2.jsx)(_collections.Item, {
57
+ key: "first",
58
+ textValue: "Duplicate",
59
+ "data-id": "first"
60
+ }, (0, _react2.jsx)(_Text["default"], null, "Render me!")), (0, _react2.jsx)(_collections.Item, {
61
+ key: "second",
62
+ textValue: "Duplicate",
63
+ "data-id": "second"
64
+ }, (0, _react2.jsx)(_Text["default"], null, "Render me!")), (0, _react2.jsx)(_collections.Item, {
65
+ key: "third",
66
+ textValue: "Duplicate",
67
+ "data-id": "third"
68
+ }, (0, _react2.jsx)(_Text["default"], null, "Render me!")))));
48
69
  }; // Need to be added to each test file to test accessibility using axe.
49
70
 
50
71
 
@@ -267,4 +288,12 @@ test('Item accepts a data-id and the data-id can be found in the DOM', function
267
288
  var selectedItem = buttons[0];
268
289
  var parentElement = selectedItem.parentElement;
269
290
  expect(parentElement).toHaveAttribute('data-id', 'first');
291
+ });
292
+ test('items do not automatically expand if wrapped in an open OverlayPanel', function () {
293
+ getComponentInOverlayPanel();
294
+
295
+ var buttons = _testWrapper.screen.getAllByRole('button');
296
+
297
+ var selectedItem = buttons[0];
298
+ expect(selectedItem).not.toHaveAttribute('aria-expanded', 'true');
270
299
  });
@@ -121,9 +121,11 @@ var AccordionItem = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
121
121
  ml: "5px"
122
122
  }, (0, _react2.jsx)(_index.Icon, {
123
123
  icon: isOpen ? _MenuUpIcon["default"] : _MenuDownIcon["default"]
124
- }))), (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
124
+ }))), isOpen && (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
125
125
  variant: "accordion.accordionBody"
126
- }, accordionRegionProps, regionProps), item.rendered));
126
+ }, accordionRegionProps, regionProps, {
127
+ className: itemClasses
128
+ }), item.rendered));
127
129
  });
128
130
  AccordionItem.propTypes = {
129
131
  'aria-label': _propTypes["default"].string,
@@ -20,6 +20,8 @@ var _react = _interopRequireWildcard(require("react"));
20
20
 
21
21
  var _Box = _interopRequireDefault(require("../Box/Box"));
22
22
 
23
+ var _hooks = require("../../hooks");
24
+
23
25
  var _react2 = require("@emotion/react");
24
26
 
25
27
  /**
@@ -29,6 +31,7 @@ var _react2 = require("@emotion/react");
29
31
  var List = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
30
32
  var children = props.children,
31
33
  others = (0, _objectWithoutProperties2["default"])(props, ["children"]);
34
+ (0, _hooks.useDeprecationWarning)('The List component will be deprecated in Astro-UI 2.0.0, use ListView instead.');
32
35
  return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
33
36
  ref: ref,
34
37
  role: "list",
@@ -20,11 +20,16 @@ var _Text = _interopRequireDefault(require("../Text"));
20
20
 
21
21
  var _Separator = _interopRequireDefault(require("../Separator"));
22
22
 
23
+ var _withDeprecationWarning = _interopRequireDefault(require("../../utils/devUtils/decorators/withDeprecationWarning"));
24
+
23
25
  var _react2 = require("@emotion/react");
24
26
 
25
27
  var _default = {
26
- title: 'List',
27
- component: [_["default"], _ListItem["default"]]
28
+ title: 'Deprecated/List',
29
+ component: [_["default"], _ListItem["default"]],
30
+ decorators: [function (Story, context) {
31
+ return (0, _withDeprecationWarning["default"])(Story, context, 'The `List` component will be deprecated in Astro-UI 2.0.0, use `ListView` instead.');
32
+ }]
28
33
  };
29
34
  exports["default"] = _default;
30
35
 
@@ -53,8 +53,8 @@ var _react2 = require("@emotion/react");
53
53
  var icons = {
54
54
  "default": _AlertCircleOutlineIcon["default"],
55
55
  success: _CheckCircleIcon["default"],
56
- error: _AlertCircleOutlineIcon["default"],
57
- warning: _AlertCircleIcon["default"]
56
+ error: _AlertCircleIcon["default"],
57
+ warning: _AlertCircleOutlineIcon["default"]
58
58
  };
59
59
  exports.icons = icons;
60
60
 
@@ -22,8 +22,6 @@ var _collections = require("@react-stately/collections");
22
22
 
23
23
  var _hooks = require("../../hooks");
24
24
 
25
- var _Button = _interopRequireDefault(require("../Button/Button"));
26
-
27
25
  var _OverlayPanel = _interopRequireDefault(require("./OverlayPanel"));
28
26
 
29
27
  var _index = require("../../index");
@@ -66,15 +64,18 @@ var Default = function Default(_ref) {
66
64
  var state = (0, _hooks.useOverlayPanelState)();
67
65
  return (// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
68
66
  // readers when an overlay opens.
69
- (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_Button["default"], {
67
+ (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
70
68
  onPress: state.open
71
69
  }, "Open Panel"), (0, _react2.jsx)(_OverlayPanel["default"], (0, _extends2["default"])({
72
70
  isOpen: state.isOpen
73
- }, args), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_Button["default"], {
71
+ }, args), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
74
72
  onPress: state.close
75
- }, "Close Panel"), (0, _react2.jsx)(_index.Text, {
76
- pt: "md"
77
- }, "Children render here."))))
73
+ }, "Close Panel"), (0, _react2.jsx)(_index.AccordionGroup, args, (0, _react2.jsx)(_collections.Item, {
74
+ key: "accordionKey",
75
+ textValue: "accordionKey",
76
+ label: "Accordion Label",
77
+ "data-id": "accordionItem"
78
+ }, (0, _react2.jsx)(_index.Text, null, "Render me!"))))))
78
79
  );
79
80
  };
80
81
 
@@ -106,7 +107,7 @@ var InnerPanel = function InnerPanel(_ref2) {
106
107
  variant: "overlayPanel.overlayPanelInner" // applies higher z-index
107
108
  ,
108
109
  isOpen: innerState.isOpen
109
- }, args), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_Button["default"], {
110
+ }, args), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
110
111
  onPress: innerState.close
111
112
  }, "Close Inner Panel"), (0, _react2.jsx)(_index.Text, {
112
113
  pt: "md"
@@ -121,7 +122,7 @@ var InnerPanel = function InnerPanel(_ref2) {
121
122
  sx: {
122
123
  p: '12px'
123
124
  }
124
- }, (0, _react2.jsx)(_Button["default"], {
125
+ }, (0, _react2.jsx)(_index.Button, {
125
126
  onPress: closeOuterPanel
126
127
  }, "Close Panel"), (0, _react2.jsx)(_index.Text, {
127
128
  pt: "md",
@@ -164,14 +165,14 @@ var InnerPanel = function InnerPanel(_ref2) {
164
165
  mr: "auto"
165
166
  }, "Form 5")), (0, _react2.jsx)(_index.Separator, {
166
167
  margin: "0"
167
- })), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_Button["default"], {
168
+ })), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
168
169
  onPress: toggleMessagesOpen
169
- }, "Toggle Messages"), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_Button["default"], {
170
+ }, "Toggle Messages"), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
170
171
  onPress: innerState.open
171
172
  }, "Open Inner Panel"), inner)));
172
173
  return (// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
173
174
  // readers when an overlay opens.
174
- (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_Button["default"], {
175
+ (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
175
176
  onPress: state.open
176
177
  }, "Open Panel"), outer), messagesOpen && (0, _react2.jsx)(_index.Messages, {
177
178
  sx: {
@@ -192,14 +193,14 @@ var CustomWidth = function CustomWidth() {
192
193
  // readers when an overlay opens.
193
194
  //
194
195
  // For a custom width, provide the width via the 'sx' prop
195
- (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_Button["default"], {
196
+ (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
196
197
  onPress: state.open
197
198
  }, "Open Panel"), (0, _react2.jsx)(_OverlayPanel["default"], {
198
199
  isOpen: state.isOpen,
199
200
  sx: {
200
201
  width: '720px'
201
202
  }
202
- }, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_Button["default"], {
203
+ }, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
203
204
  onPress: state.close
204
205
  }, "Close Panel"), (0, _react2.jsx)(_index.Text, {
205
206
  pt: "md"
@@ -17,6 +17,13 @@ var _react2 = require("@emotion/react");
17
17
  var getComponent = function getComponent() {
18
18
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
19
19
  return (0, _testWrapper.render)((0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_PopoverContainer["default"], props, (0, _react2.jsx)(_index.Box, null, "I am in a popover"))));
20
+ };
21
+
22
+ var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
23
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
24
+ return (0, _testWrapper.render)((0, _react2.jsx)(_index.OverlayPanel, {
25
+ isOpen: true
26
+ }, (0, _react2.jsx)(_PopoverContainer["default"], props, (0, _react2.jsx)(_index.Box, null, "I am in a popover"))));
20
27
  }; // Need to be added to each test file to test accessibility using axe.
21
28
 
22
29
 
@@ -39,4 +46,12 @@ test('should render a popover with no arrow', function () {
39
46
  var arrow = _testWrapper.screen.queryByTestId('popover-arrow');
40
47
 
41
48
  expect(arrow).not.toBeInTheDocument();
49
+ });
50
+ test('popover will not open if wrapped in an overlayPanel', function () {
51
+ getComponentInOverlayPanel({
52
+ popoverProps: {
53
+ 'data-test-id': 'popover-test'
54
+ }
55
+ });
56
+ expect(_testWrapper.screen.queryByTestId('popover-test')).not.toBeInTheDocument();
42
57
  });
@@ -29,7 +29,11 @@ var _react2 = require("@emotion/react");
29
29
  */
30
30
  var TextArea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
31
31
  return (0, _react2.jsx)(_themeUi.Textarea, (0, _extends2["default"])({
32
- ref: ref
32
+ ref: ref // this requires to fix safari resizing issue (UIP-4995)
33
+ ,
34
+ sx: {
35
+ position: 'relative'
36
+ }
33
37
  }, props));
34
38
  });
35
39
  TextArea.displayName = 'TextArea';
@@ -27,11 +27,11 @@ var accordion = {
27
27
  alignItems: 'flex-start'
28
28
  };
29
29
  var accordionBody = {
30
- display: 'none !important',
30
+ display: 'none',
31
31
  pt: 'md',
32
32
  width: '100%',
33
33
  '.is-open &': {
34
- display: 'flex !important'
34
+ display: 'flex'
35
35
  }
36
36
  };
37
37
  var accordionGridHeader = {
@@ -4,7 +4,7 @@ import { Item } from '@react-stately/collections';
4
4
  import userEvent from '@testing-library/user-event';
5
5
  import axeTest from '../../utils/testUtils/testAxe';
6
6
  import { act, fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
7
- import { Link, Box } from '../../index';
7
+ import { Link, Box, OverlayPanel } from '../../index';
8
8
  import AccordionGridGroup from '../AccordionGridGroup';
9
9
  import { jsx as ___EmotionJSX } from "@emotion/react";
10
10
  var testId = 'test-accordion';
@@ -26,6 +26,22 @@ var getComponent = function getComponent() {
26
26
  }, ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Header Button"), ___EmotionJSX(Link, null, "Second Header Button")), ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Body Button"), ___EmotionJSX(Link, null, "Second Body Button")))));
27
27
  };
28
28
 
29
+ var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
30
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
31
+ return render(___EmotionJSX(OverlayPanel, {
32
+ isOpen: true
33
+ }, ___EmotionJSX(AccordionGridGroup, _extends({}, defaultProps, props), ___EmotionJSX(Item, {
34
+ key: "first",
35
+ textValue: "Duplicate"
36
+ }, ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Header Button"), ___EmotionJSX(Link, null, "Second Header Button")), ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Body Button"), ___EmotionJSX(Link, null, "Second Body Button"))), ___EmotionJSX(Item, {
37
+ key: "second",
38
+ textValue: "Duplicate"
39
+ }, ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Header Button"), ___EmotionJSX(Link, null, "Second Header Button")), ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Body Button"), ___EmotionJSX(Link, null, "Second Body Button"))), ___EmotionJSX(Item, {
40
+ key: "third",
41
+ textValue: "Duplicate"
42
+ }, ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Header Button"), ___EmotionJSX(Link, null, "Second Header Button")), ___EmotionJSX(Box, null, ___EmotionJSX(Link, null, "Body Button"), ___EmotionJSX(Link, null, "Second Body Button"))))));
43
+ };
44
+
29
45
  axeTest(getComponent, {
30
46
  // landmark-unique rule conflicts with react-aria role definition
31
47
  rules: {
@@ -166,4 +182,10 @@ test('default expanded keys expands an accordion item', function () {
166
182
  var row = screen.getAllByRole('row');
167
183
  var selectedRow = row[0];
168
184
  expect(selectedRow).toHaveAttribute('aria-selected', 'true');
185
+ });
186
+ test('items do not automatically expand if wrapped in an open OverlayPanel', function () {
187
+ getComponentInOverlayPanel();
188
+ var row = screen.getAllByRole('row');
189
+ var selectedRow = row[0];
190
+ expect(selectedRow).not.toHaveAttribute('aria-selected', 'true');
169
191
  });
@@ -7,6 +7,7 @@ import axeTest from '../../utils/testUtils/testAxe';
7
7
  import { act, fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
8
8
  import Text from '../Text';
9
9
  import AccordionGroup from '../AccordionGroup';
10
+ import { OverlayPanel } from '../../index';
10
11
  import { jsx as ___EmotionJSX } from "@emotion/react";
11
12
  var testId = 'test-accordion';
12
13
  var defaultProps = {
@@ -31,6 +32,25 @@ var getComponent = function getComponent() {
31
32
  "data-id": "third",
32
33
  label: "Accordion item"
33
34
  }, ___EmotionJSX(Text, null, "Render me!"))));
35
+ };
36
+
37
+ var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
38
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
39
+ return render(___EmotionJSX(OverlayPanel, {
40
+ isOpen: true
41
+ }, ___EmotionJSX(AccordionGroup, _extends({}, defaultProps, props), ___EmotionJSX(Item, {
42
+ key: "first",
43
+ textValue: "Duplicate",
44
+ "data-id": "first"
45
+ }, ___EmotionJSX(Text, null, "Render me!")), ___EmotionJSX(Item, {
46
+ key: "second",
47
+ textValue: "Duplicate",
48
+ "data-id": "second"
49
+ }, ___EmotionJSX(Text, null, "Render me!")), ___EmotionJSX(Item, {
50
+ key: "third",
51
+ textValue: "Duplicate",
52
+ "data-id": "third"
53
+ }, ___EmotionJSX(Text, null, "Render me!")))));
34
54
  }; // Need to be added to each test file to test accessibility using axe.
35
55
 
36
56
 
@@ -200,4 +220,10 @@ test('Item accepts a data-id and the data-id can be found in the DOM', function
200
220
  var selectedItem = buttons[0];
201
221
  var parentElement = selectedItem.parentElement;
202
222
  expect(parentElement).toHaveAttribute('data-id', 'first');
223
+ });
224
+ test('items do not automatically expand if wrapped in an open OverlayPanel', function () {
225
+ getComponentInOverlayPanel();
226
+ var buttons = screen.getAllByRole('button');
227
+ var selectedItem = buttons[0];
228
+ expect(selectedItem).not.toHaveAttribute('aria-expanded', 'true');
203
229
  });
@@ -93,9 +93,11 @@ var AccordionItem = /*#__PURE__*/forwardRef(function (props, ref) {
93
93
  ml: "5px"
94
94
  }, ___EmotionJSX(Icon, {
95
95
  icon: isOpen ? MenuUp : MenuDown
96
- }))), ___EmotionJSX(Box, _extends({
96
+ }))), isOpen && ___EmotionJSX(Box, _extends({
97
97
  variant: "accordion.accordionBody"
98
- }, accordionRegionProps, regionProps), item.rendered));
98
+ }, accordionRegionProps, regionProps, {
99
+ className: itemClasses
100
+ }), item.rendered));
99
101
  });
100
102
  AccordionItem.propTypes = {
101
103
  'aria-label': PropTypes.string,
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
3
3
  import React, { forwardRef } from 'react';
4
4
  import Box from '../Box/Box';
5
+ import { useDeprecationWarning } from '../../hooks';
5
6
  /**
6
7
  * The intended use of List is to hold a collection of <ListItem/> components.
7
8
  * Accepts most of the styling props from [styled-system](https://styled-system.com/table).
@@ -12,6 +13,7 @@ var List = /*#__PURE__*/forwardRef(function (props, ref) {
12
13
  var children = props.children,
13
14
  others = _objectWithoutProperties(props, ["children"]);
14
15
 
16
+ useDeprecationWarning('The List component will be deprecated in Astro-UI 2.0.0, use ListView instead.');
15
17
  return ___EmotionJSX(Box, _extends({
16
18
  ref: ref,
17
19
  role: "list",
@@ -3,10 +3,14 @@ import List from '.';
3
3
  import ListItem from '../ListItem';
4
4
  import Text from '../Text';
5
5
  import Separator from '../Separator';
6
+ import withDeprecationWarning from '../../utils/devUtils/decorators/withDeprecationWarning';
6
7
  import { jsx as ___EmotionJSX } from "@emotion/react";
7
8
  export default {
8
- title: 'List',
9
- component: [List, ListItem]
9
+ title: 'Deprecated/List',
10
+ component: [List, ListItem],
11
+ decorators: [function (Story, context) {
12
+ return withDeprecationWarning(Story, context, 'The `List` component will be deprecated in Astro-UI 2.0.0, use `ListView` instead.');
13
+ }]
10
14
  };
11
15
  export var Default = function Default() {
12
16
  return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Text, {
@@ -20,8 +20,8 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
20
20
  export var icons = {
21
21
  "default": AlertCircleOutlineIcon,
22
22
  success: CheckCircleIcon,
23
- error: AlertCircleOutlineIcon,
24
- warning: AlertCircleIcon
23
+ error: AlertCircleIcon,
24
+ warning: AlertCircleOutlineIcon
25
25
  };
26
26
 
27
27
  var CloseButton = function CloseButton(_ref) {
@@ -3,9 +3,8 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
3
3
  import React, { useState } from 'react';
4
4
  import { Item } from '@react-stately/collections';
5
5
  import { useOverlayPanelState } from '../../hooks';
6
- import Button from '../Button/Button';
7
6
  import OverlayPanel from './OverlayPanel';
8
- import { OverlayProvider, Box, Text, List, ListItem, Separator, Messages } from '../../index';
7
+ import { OverlayProvider, Box, Text, List, ListItem, Separator, Messages, Button, AccordionGroup } from '../../index';
9
8
  import { panelSizes } from '../../utils/devUtils/constants/panelSizes';
10
9
  import { jsx as ___EmotionJSX } from "@emotion/react";
11
10
  export default {
@@ -47,9 +46,12 @@ export var Default = function Default(_ref) {
47
46
  isOpen: state.isOpen
48
47
  }, args), ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
49
48
  onPress: state.close
50
- }, "Close Panel"), ___EmotionJSX(Text, {
51
- pt: "md"
52
- }, "Children render here."))))
49
+ }, "Close Panel"), ___EmotionJSX(AccordionGroup, args, ___EmotionJSX(Item, {
50
+ key: "accordionKey",
51
+ textValue: "accordionKey",
52
+ label: "Accordion Label",
53
+ "data-id": "accordionItem"
54
+ }, ___EmotionJSX(Text, null, "Render me!"))))))
53
55
  );
54
56
  };
55
57
  export var InnerPanel = function InnerPanel(_ref2) {
@@ -1,13 +1,20 @@
1
1
  import React from 'react';
2
2
  import axeTest from '../../utils/testUtils/testAxe';
3
3
  import { render, screen } from '../../utils/testUtils/testWrapper';
4
- import { Box } from '../../index';
4
+ import { Box, OverlayPanel } from '../../index';
5
5
  import PopoverContainer from './PopoverContainer';
6
6
  import { jsx as ___EmotionJSX } from "@emotion/react";
7
7
 
8
8
  var getComponent = function getComponent() {
9
9
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10
10
  return render(___EmotionJSX(React.Fragment, null, ___EmotionJSX(PopoverContainer, props, ___EmotionJSX(Box, null, "I am in a popover"))));
11
+ };
12
+
13
+ var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
14
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15
+ return render(___EmotionJSX(OverlayPanel, {
16
+ isOpen: true
17
+ }, ___EmotionJSX(PopoverContainer, props, ___EmotionJSX(Box, null, "I am in a popover"))));
11
18
  }; // Need to be added to each test file to test accessibility using axe.
12
19
 
13
20
 
@@ -26,4 +33,12 @@ test('should render a popover with no arrow', function () {
26
33
  });
27
34
  var arrow = screen.queryByTestId('popover-arrow');
28
35
  expect(arrow).not.toBeInTheDocument();
36
+ });
37
+ test('popover will not open if wrapped in an overlayPanel', function () {
38
+ getComponentInOverlayPanel({
39
+ popoverProps: {
40
+ 'data-test-id': 'popover-test'
41
+ }
42
+ });
43
+ expect(screen.queryByTestId('popover-test')).not.toBeInTheDocument();
29
44
  });
@@ -12,7 +12,11 @@ import { Textarea as ThemeUITextArea } from 'theme-ui';
12
12
  import { jsx as ___EmotionJSX } from "@emotion/react";
13
13
  var TextArea = /*#__PURE__*/forwardRef(function (props, ref) {
14
14
  return ___EmotionJSX(ThemeUITextArea, _extends({
15
- ref: ref
15
+ ref: ref // this requires to fix safari resizing issue (UIP-4995)
16
+ ,
17
+ sx: {
18
+ position: 'relative'
19
+ }
16
20
  }, props));
17
21
  });
18
22
  TextArea.displayName = 'TextArea';
@@ -18,11 +18,11 @@ var accordion = {
18
18
  alignItems: 'flex-start'
19
19
  };
20
20
  var accordionBody = {
21
- display: 'none !important',
21
+ display: 'none',
22
22
  pt: 'md',
23
23
  width: '100%',
24
24
  '.is-open &': {
25
- display: 'flex !important'
25
+ display: 'flex'
26
26
  }
27
27
  };
28
28
  var accordionGridHeader = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.1.0-alpha.5",
3
+ "version": "1.1.0-alpha.9",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "uxdev@pingidentity.com",
6
6
  "license": "Apache-2.0",