@pingux/astro 1.34.0-alpha.3 → 1.35.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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
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.34.0](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.33.1...@pingux/astro@1.34.0) (2022-11-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * [UIP-5830] Prevent form submitting when adding custom value to MultivalueField on enter press ([71dee3c](https://gitlab.corp.pingidentity.com/ux/pingux/commit/71dee3cd85c3b49e9dd199f07fc55d0212bff50b))
12
+
13
+
14
+ ### Features
15
+
16
+ * [UIP-5702] Icon & IconButton - Adding tshirt sizing, sizing story, and commonly used story ([51a3677](https://gitlab.corp.pingidentity.com/ux/pingux/commit/51a367710a739f0576e36179fbdea7ae736b2f32))
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.33.1](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.33.0...@pingux/astro@1.33.1) (2022-11-01)
7
23
 
8
24
 
@@ -257,9 +257,9 @@ var Default = function Default() {
257
257
  }, (0, _react2.jsx)(_index.Box, {
258
258
  padding: "md"
259
259
  }, (0, _react2.jsx)(_index.Link, {
260
+ "aria-label": "home link",
260
261
  href: "https://pingidentity.com",
261
- target: "_blank",
262
- "aria-label": "home link"
262
+ target: "_blank"
263
263
  }, logo)), (0, _react2.jsx)(_index.Separator, {
264
264
  marginTop: "lg",
265
265
  marginBottom: "0px",
@@ -268,19 +268,23 @@ var Default = function Default() {
268
268
  variant: "navBar.sectionContainer",
269
269
  paddingBottom: "xl"
270
270
  }, (0, _react2.jsx)(_index.NavBarItem, {
271
+ "data-id": "nav-bar-item",
272
+ icon: _GlobeIcon["default"],
271
273
  id: "Overview",
272
274
  key: "Overview",
273
- text: "Overview",
274
- icon: _GlobeIcon["default"]
275
+ text: "Overview"
275
276
  }), (0, _react2.jsx)(_index.NavBarSection, {
276
277
  items: data,
277
- hasSeparator: true
278
+ hasSeparator: true,
279
+ "data-id": "nav-bar-section"
278
280
  }), (0, _react2.jsx)(_index.NavBarSection, {
279
281
  items: secondData,
280
282
  hasSeparator: true,
281
- title: "PingOne Services"
283
+ title: "PingOne Services",
284
+ "data-id": "second-nav-bar-section"
282
285
  }), (0, _react2.jsx)(_index.NavBarSection, {
283
- items: thirdData
286
+ items: thirdData,
287
+ "data-id": "third-nav-bar-section"
284
288
  })));
285
289
  };
286
290
 
@@ -34,6 +34,7 @@ var _index = require("../../index");
34
34
 
35
35
  var _react2 = require("@emotion/react");
36
36
 
37
+ var DATA_ID = 'data-id';
37
38
  var data = [{
38
39
  icon: _GlobeIcon["default"],
39
40
  key: 'Overview',
@@ -98,7 +99,9 @@ var getComponent = function getComponent() {
98
99
  }
99
100
  }, (0, _react2.jsx)(_index.NavBarSection, {
100
101
  items: data,
101
- hasSeparator: true
102
+ hasSeparator: true,
103
+ "data-testid": DATA_ID,
104
+ "data-id": DATA_ID
102
105
  }), (0, _react2.jsx)(_index.NavBarSection, {
103
106
  items: secondData,
104
107
  title: "test_title"
@@ -111,7 +114,7 @@ var getComponent = function getComponent() {
111
114
  }))));
112
115
  };
113
116
 
114
- var getComponentWithMultipleChildrens = function getComponentWithMultipleChildrens() {
117
+ var getComponentWithMultipleChildren = function getComponentWithMultipleChildren() {
115
118
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
116
119
  return (0, _testWrapper.render)((0, _react2.jsx)(_NavBar["default"], props, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Link, {
117
120
  href: "https://pingidentity.com",
@@ -134,25 +137,16 @@ var clickHeaderButtons = function clickHeaderButtons() {
134
137
  (0, _testAxe["default"])(getComponent);
135
138
  test('should render basic nav with children', function () {
136
139
  getComponent();
137
-
138
- var nav = _testWrapper.screen.queryByRole('navigation');
139
-
140
- expect(nav).toBeInTheDocument();
140
+ expect(_testWrapper.screen.queryByRole('navigation')).toBeInTheDocument();
141
141
  });
142
142
  test('should render title for sections that have titles', function () {
143
143
  getComponent();
144
-
145
- var title = _testWrapper.screen.getByText('test_title');
146
-
147
- expect(title).toBeInTheDocument();
144
+ expect(_testWrapper.screen.getByText('test_title')).toBeInTheDocument();
148
145
  });
149
146
  test('should render title for itemBodies that have subTitles', function () {
150
147
  getComponent();
151
148
  clickHeaderButtons();
152
-
153
- var subTitle = _testWrapper.screen.getByText('PingOne Services');
154
-
155
- expect(subTitle).toBeInTheDocument();
149
+ expect(_testWrapper.screen.getByText('PingOne Services')).toBeInTheDocument();
156
150
  });
157
151
  test('should select NavItemLink', function () {
158
152
  getComponent();
@@ -307,15 +301,12 @@ test('should not change focus from NavItemBody to NavBarItemHeader on arrow key
307
301
 
308
302
  expect(_testWrapper.screen.getByTestId('navItemLink')).toHaveClass('is-focused');
309
303
  });
310
- test('should render nav with multiple childrens', function () {
311
- getComponentWithMultipleChildrens();
312
-
313
- var nav = _testWrapper.screen.queryByRole('navigation');
314
-
315
- expect(nav).toBeInTheDocument();
304
+ test('should render nav with multiple children', function () {
305
+ getComponentWithMultipleChildren();
306
+ expect(_testWrapper.screen.queryByRole('navigation')).toBeInTheDocument();
316
307
  });
317
- test('should change focus between nav childrens on arrow key press', function () {
318
- getComponentWithMultipleChildrens();
308
+ test('should change focus between nav children on arrow key press', function () {
309
+ getComponentWithMultipleChildren();
319
310
 
320
311
  var link = _testWrapper.screen.getByTestId('navLink');
321
312
 
@@ -366,4 +357,8 @@ test('should change focus between nav childrens on arrow key press', function ()
366
357
  });
367
358
 
368
359
  expect(link).toHaveClass('is-focused');
360
+ });
361
+ test('should render NavBarSection with data-id', function () {
362
+ getComponent();
363
+ expect(_testWrapper.screen.getByTestId(DATA_ID)).toHaveAttribute(DATA_ID);
369
364
  });
@@ -16,32 +16,36 @@ _Object$defineProperty(exports, "__esModule", {
16
16
 
17
17
  exports["default"] = void 0;
18
18
 
19
- var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
20
-
21
19
  var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set"));
22
20
 
21
+ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
22
+
23
23
  var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
24
24
 
25
25
  var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
26
26
 
27
- var _react = _interopRequireWildcard(require("react"));
27
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
28
28
 
29
- var _propTypes = _interopRequireDefault(require("prop-types"));
29
+ var _react = _interopRequireWildcard(require("react"));
30
30
 
31
31
  var _focus = require("@react-aria/focus");
32
32
 
33
33
  var _interactions = require("@react-aria/interactions");
34
34
 
35
- var _index = require("../../index");
35
+ var _propTypes = _interopRequireDefault(require("prop-types"));
36
+
37
+ var _ = require("../../");
38
+
39
+ var _NavBarContext = require("../../context/NavBarContext");
36
40
 
37
41
  var _NavBarItemBody = _interopRequireDefault(require("./NavBarItemBody"));
38
42
 
39
43
  var _NavBarItemHeader = _interopRequireDefault(require("./NavBarItemHeader"));
40
44
 
41
- var _NavBarContext = require("../../context/NavBarContext");
42
-
43
45
  var _react2 = require("@emotion/react");
44
46
 
47
+ var _excluded = ["hasSeparator", "title", "items"];
48
+
45
49
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
46
50
 
47
51
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -51,31 +55,32 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
51
55
  * with title, and separator options.
52
56
  *
53
57
  */
54
- var NavBarSection = function NavBarSection(props) {
55
- var hasSeparator = props.hasSeparator,
56
- title = props.title,
57
- items = props.items;
58
+ var NavBarSection = function NavBarSection(_ref) {
59
+ var hasSeparator = _ref.hasSeparator,
60
+ title = _ref.title,
61
+ items = _ref.items,
62
+ others = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
58
63
  var ref = (0, _react.useRef)();
59
64
  var childrenItems = (0, _filter["default"])(items).call(items, function (i) {
60
65
  return i.children;
61
66
  });
62
- return (0, _react2.jsx)(_react["default"].Fragment, null, title && (0, _react2.jsx)(_index.Text, {
67
+ return (0, _react2.jsx)(_react["default"].Fragment, null, title && (0, _react2.jsx)(_.Text, {
63
68
  variant: "text.navBarSubtitle"
64
- }, title), (0, _react2.jsx)("ul", {
69
+ }, title), (0, _react2.jsx)("ul", (0, _extends2["default"])({
65
70
  ref: ref,
66
71
  style: {
67
72
  margin: 0,
68
73
  padding: 0,
69
74
  listStyle: 'none'
70
75
  }
71
- }, (0, _map["default"])(childrenItems).call(childrenItems, function (item) {
76
+ }, others), (0, _map["default"])(childrenItems).call(childrenItems, function (item) {
72
77
  return (0, _react2.jsx)("li", {
73
78
  key: item.key
74
79
  }, (0, _react2.jsx)(SectionItem, {
75
80
  key: item.key,
76
81
  item: item
77
82
  }));
78
- })), hasSeparator && (0, _react2.jsx)(_index.Box, {
83
+ })), hasSeparator && (0, _react2.jsx)(_.Box, {
79
84
  sx: {
80
85
  pl: '15px',
81
86
  pr: '15px',
@@ -83,13 +88,13 @@ var NavBarSection = function NavBarSection(props) {
83
88
  mt: '15px',
84
89
  mb: '15px'
85
90
  }
86
- }, (0, _react2.jsx)(_index.Separator, {
91
+ }, (0, _react2.jsx)(_.Separator, {
87
92
  variant: "separator.navBarSeparator"
88
93
  })));
89
94
  };
90
95
 
91
- var SectionItem = function SectionItem(_ref) {
92
- var item = _ref.item;
96
+ var SectionItem = function SectionItem(_ref2) {
97
+ var item = _ref2.item;
93
98
  var key = item.key,
94
99
  children = item.children;
95
100
  var headerButtonRef = (0, _react.useRef)();
@@ -160,7 +165,7 @@ var SectionItem = function SectionItem(_ref) {
160
165
  }),
161
166
  keyboardProps = _useKeyboard.keyboardProps;
162
167
 
163
- return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.Button, (0, _extends2["default"])({
168
+ return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_.Button, (0, _extends2["default"])({
164
169
  ref: headerButtonRef,
165
170
  variant: "navBarSectionButton",
166
171
  onPress: function onPress() {
@@ -232,9 +232,9 @@ export var Default = function Default() {
232
232
  }, ___EmotionJSX(Box, {
233
233
  padding: "md"
234
234
  }, ___EmotionJSX(Link, {
235
+ "aria-label": "home link",
235
236
  href: "https://pingidentity.com",
236
- target: "_blank",
237
- "aria-label": "home link"
237
+ target: "_blank"
238
238
  }, logo)), ___EmotionJSX(Separator, {
239
239
  marginTop: "lg",
240
240
  marginBottom: "0px",
@@ -243,18 +243,22 @@ export var Default = function Default() {
243
243
  variant: "navBar.sectionContainer",
244
244
  paddingBottom: "xl"
245
245
  }, ___EmotionJSX(NavBarItem, {
246
+ "data-id": "nav-bar-item",
247
+ icon: GlobeIcon,
246
248
  id: "Overview",
247
249
  key: "Overview",
248
- text: "Overview",
249
- icon: GlobeIcon
250
+ text: "Overview"
250
251
  }), ___EmotionJSX(NavBarSection, {
251
252
  items: data,
252
- hasSeparator: true
253
+ hasSeparator: true,
254
+ "data-id": "nav-bar-section"
253
255
  }), ___EmotionJSX(NavBarSection, {
254
256
  items: secondData,
255
257
  hasSeparator: true,
256
- title: "PingOne Services"
258
+ title: "PingOne Services",
259
+ "data-id": "second-nav-bar-section"
257
260
  }), ___EmotionJSX(NavBarSection, {
258
- items: thirdData
261
+ items: thirdData,
262
+ "data-id": "third-nav-bar-section"
259
263
  })));
260
264
  };
@@ -14,6 +14,7 @@ import axeTest from '../../utils/testUtils/testAxe';
14
14
  import { render, screen, fireEvent } from '../../utils/testUtils/testWrapper';
15
15
  import { Box, NavBarSection, NavBarItem, NavBarItemButton, NavBarItemLink, Link, Button } from '../../index';
16
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
17
+ var DATA_ID = 'data-id';
17
18
  var data = [{
18
19
  icon: GlobeIcon,
19
20
  key: 'Overview',
@@ -78,7 +79,9 @@ var getComponent = function getComponent() {
78
79
  }
79
80
  }, ___EmotionJSX(NavBarSection, {
80
81
  items: data,
81
- hasSeparator: true
82
+ hasSeparator: true,
83
+ "data-testid": DATA_ID,
84
+ "data-id": DATA_ID
82
85
  }), ___EmotionJSX(NavBarSection, {
83
86
  items: secondData,
84
87
  title: "test_title"
@@ -91,7 +94,7 @@ var getComponent = function getComponent() {
91
94
  }))));
92
95
  };
93
96
 
94
- var getComponentWithMultipleChildrens = function getComponentWithMultipleChildrens() {
97
+ var getComponentWithMultipleChildren = function getComponentWithMultipleChildren() {
95
98
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
96
99
  return render(___EmotionJSX(NavBar, props, ___EmotionJSX(Box, null, ___EmotionJSX(Link, {
97
100
  href: "https://pingidentity.com",
@@ -114,19 +117,16 @@ var clickHeaderButtons = function clickHeaderButtons() {
114
117
  axeTest(getComponent);
115
118
  test('should render basic nav with children', function () {
116
119
  getComponent();
117
- var nav = screen.queryByRole('navigation');
118
- expect(nav).toBeInTheDocument();
120
+ expect(screen.queryByRole('navigation')).toBeInTheDocument();
119
121
  });
120
122
  test('should render title for sections that have titles', function () {
121
123
  getComponent();
122
- var title = screen.getByText('test_title');
123
- expect(title).toBeInTheDocument();
124
+ expect(screen.getByText('test_title')).toBeInTheDocument();
124
125
  });
125
126
  test('should render title for itemBodies that have subTitles', function () {
126
127
  getComponent();
127
128
  clickHeaderButtons();
128
- var subTitle = screen.getByText('PingOne Services');
129
- expect(subTitle).toBeInTheDocument();
129
+ expect(screen.getByText('PingOne Services')).toBeInTheDocument();
130
130
  });
131
131
  test('should select NavItemLink', function () {
132
132
  getComponent();
@@ -243,13 +243,12 @@ test('should not change focus from NavItemBody to NavBarItemHeader on arrow key
243
243
  });
244
244
  expect(screen.getByTestId('navItemLink')).toHaveClass('is-focused');
245
245
  });
246
- test('should render nav with multiple childrens', function () {
247
- getComponentWithMultipleChildrens();
248
- var nav = screen.queryByRole('navigation');
249
- expect(nav).toBeInTheDocument();
246
+ test('should render nav with multiple children', function () {
247
+ getComponentWithMultipleChildren();
248
+ expect(screen.queryByRole('navigation')).toBeInTheDocument();
250
249
  });
251
- test('should change focus between nav childrens on arrow key press', function () {
252
- getComponentWithMultipleChildrens();
250
+ test('should change focus between nav children on arrow key press', function () {
251
+ getComponentWithMultipleChildren();
253
252
  var link = screen.getByTestId('navLink');
254
253
  var button = screen.getByTestId('navButton');
255
254
  expect(link).toBeInTheDocument();
@@ -285,4 +284,8 @@ test('should change focus between nav childrens on arrow key press', function ()
285
284
  keyCode: 32
286
285
  });
287
286
  expect(link).toHaveClass('is-focused');
287
+ });
288
+ test('should render NavBarSection with data-id', function () {
289
+ getComponent();
290
+ expect(screen.getByTestId(DATA_ID)).toHaveAttribute(DATA_ID);
288
291
  });
@@ -1,15 +1,17 @@
1
- import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
1
  import _Set from "@babel/runtime-corejs3/core-js-stable/set";
2
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
3
3
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
4
4
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
5
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
6
+ var _excluded = ["hasSeparator", "title", "items"];
5
7
  import React, { useRef } from 'react';
6
- import PropTypes from 'prop-types';
7
8
  import { useFocusManager } from '@react-aria/focus';
8
9
  import { useKeyboard } from '@react-aria/interactions';
9
- import { Separator, Text, Box, Button } from '../../index';
10
+ import PropTypes from 'prop-types';
11
+ import { Box, Button, Separator, Text } from '../../';
12
+ import { useNavBarContext } from '../../context/NavBarContext';
10
13
  import NavBarItemBody from './NavBarItemBody';
11
14
  import NavBarItemHeader from './NavBarItemHeader';
12
- import { useNavBarContext } from '../../context/NavBarContext';
13
15
  /**
14
16
  * Composed component that creates a group
15
17
  * with title, and separator options.
@@ -18,10 +20,12 @@ import { useNavBarContext } from '../../context/NavBarContext';
18
20
 
19
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
22
 
21
- var NavBarSection = function NavBarSection(props) {
22
- var hasSeparator = props.hasSeparator,
23
- title = props.title,
24
- items = props.items;
23
+ var NavBarSection = function NavBarSection(_ref) {
24
+ var hasSeparator = _ref.hasSeparator,
25
+ title = _ref.title,
26
+ items = _ref.items,
27
+ others = _objectWithoutProperties(_ref, _excluded);
28
+
25
29
  var ref = useRef();
26
30
 
27
31
  var childrenItems = _filterInstanceProperty(items).call(items, function (i) {
@@ -30,14 +34,14 @@ var NavBarSection = function NavBarSection(props) {
30
34
 
31
35
  return ___EmotionJSX(React.Fragment, null, title && ___EmotionJSX(Text, {
32
36
  variant: "text.navBarSubtitle"
33
- }, title), ___EmotionJSX("ul", {
37
+ }, title), ___EmotionJSX("ul", _extends({
34
38
  ref: ref,
35
39
  style: {
36
40
  margin: 0,
37
41
  padding: 0,
38
42
  listStyle: 'none'
39
43
  }
40
- }, _mapInstanceProperty(childrenItems).call(childrenItems, function (item) {
44
+ }, others), _mapInstanceProperty(childrenItems).call(childrenItems, function (item) {
41
45
  return ___EmotionJSX("li", {
42
46
  key: item.key
43
47
  }, ___EmotionJSX(SectionItem, {
@@ -57,8 +61,8 @@ var NavBarSection = function NavBarSection(props) {
57
61
  })));
58
62
  };
59
63
 
60
- var SectionItem = function SectionItem(_ref) {
61
- var item = _ref.item;
64
+ var SectionItem = function SectionItem(_ref2) {
65
+ var item = _ref2.item;
62
66
  var key = item.key,
63
67
  children = item.children;
64
68
  var headerButtonRef = useRef();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.34.0-alpha.3",
3
+ "version": "1.35.0-alpha.0",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",