@pingux/astro 1.31.0-alpha.0 → 1.31.0-alpha.2

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.
@@ -106,6 +106,8 @@ function useListLayout(state) {
106
106
  * view, or edit items in this list. This virtualized component supports
107
107
  * asynchronous data in infinitely scrollable lists.
108
108
  *
109
+ * Can be used as in recipe: https://uilibrary.ping-eng.com/astro/?path=/docs/recipes-list-with-panel--default
110
+ *
109
111
  * NOTE: be careful with putting focusable elements inside ListView.
110
112
  * It is using a grid (useList hook) with its own event listeners under the hood.
111
113
  * [react-specttrum-github-issue](https://github.com/adobe/react-spectrum/issues/2801)
@@ -229,6 +229,7 @@ var TabPicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
229
229
  ref: menuRef
230
230
  }, (0, _map["default"])(items).call(items, function (tab) {
231
231
  return (0, _react2.jsx)(_collections.Item, {
232
+ role: tab.role,
232
233
  key: tab.key
233
234
  }, tab.name);
234
235
  })));
@@ -298,11 +298,13 @@ var WithList = function WithList() {
298
298
  list: [{
299
299
  key: 'tab1list',
300
300
  name: 'Tab 1 list',
301
- children: 'Tab 1 from list'
301
+ children: 'Tab 1 from list',
302
+ role: 'listitem'
302
303
  }, {
303
304
  key: 'tab2list',
304
305
  name: 'Tab 2 list',
305
- children: 'Tab 2 from list'
306
+ children: 'Tab 2 from list',
307
+ role: 'listitem'
306
308
  }]
307
309
  }]);
308
310
  return (0, _react2.jsx)(_Tabs["default"], {
@@ -63,11 +63,13 @@ var tabsWithList = [{
63
63
  list: [{
64
64
  key: 'tab1list',
65
65
  name: 'Tab 1 list',
66
- children: 'Tab 1 from list'
66
+ children: 'Tab 1 from list',
67
+ role: 'listitem'
67
68
  }, {
68
69
  key: 'tab2list',
69
70
  name: 'Tab 2 list',
70
- children: 'Tab 2 from list'
71
+ children: 'Tab 2 from list',
72
+ role: 'listitem'
71
73
  }]
72
74
  }];
73
75
  var defaultProps = {
@@ -545,7 +547,7 @@ test('will render tab with list if provided', /*#__PURE__*/(0, _asyncToGenerator
545
547
 
546
548
  expect(_testWrapper.screen.queryByRole('menu')).toBeInTheDocument();
547
549
  testTabPanel(0);
548
- menuItems = _testWrapper.screen.queryAllByRole('menuitemradio');
550
+ menuItems = _testWrapper.screen.queryAllByRole('listitem');
549
551
  expect(menuItems).toHaveLength(tabsWithList[1].list.length);
550
552
  expect(menuItems[0]).not.toHaveFocus();
551
553
 
@@ -596,7 +598,7 @@ test('tab list is accessible via keyboard', function () {
596
598
  expect(_testWrapper.screen.queryByRole('menu')).toBeInTheDocument();
597
599
  testTabPanel(0);
598
600
 
599
- var menuItems = _testWrapper.screen.queryAllByRole('menuitemradio');
601
+ var menuItems = _testWrapper.screen.queryAllByRole('listitem');
600
602
 
601
603
  expect(menuItems).toHaveLength(tabsWithList[1].list.length);
602
604
  expect(menuItems[0]).toHaveFocus();
@@ -34,6 +34,8 @@ var _MoreVertIcon = _interopRequireDefault(require("mdi-react/MoreVertIcon"));
34
34
 
35
35
  var _PencilIcon = _interopRequireDefault(require("mdi-react/PencilIcon"));
36
36
 
37
+ var _PlusIcon = _interopRequireDefault(require("mdi-react/PlusIcon"));
38
+
37
39
  var _index = require("../index");
38
40
 
39
41
  var _hooks = require("../hooks");
@@ -264,6 +266,8 @@ var Default = function Default() {
264
266
  onPanelClose = _useOverlayPanelState.onClose;
265
267
 
266
268
  var panelTriggerRef = (0, _react.useRef)();
269
+ var heading = 'Title of the Page';
270
+ var description = 'The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page.';
267
271
 
268
272
  var closePanelHandler = function closePanelHandler() {
269
273
  onPanelClose(panelState, panelTriggerRef);
@@ -285,7 +289,34 @@ var Default = function Default() {
285
289
 
286
290
  return (0, _react2.jsx)(_index.Box, {
287
291
  sx: sx.wrapper
288
- }, (0, _react2.jsx)(_index.SearchField, {
292
+ }, (0, _react2.jsx)(_index.Box, {
293
+ mb: "md"
294
+ }, (0, _react2.jsx)(_index.Box, {
295
+ align: "center",
296
+ isRow: true,
297
+ mb: "xs",
298
+ role: "heading",
299
+ "aria-level": "1"
300
+ }, (0, _react2.jsx)(_index.Text, {
301
+ variant: "title",
302
+ fontWeight: 3
303
+ }, heading), (0, _react2.jsx)(_index.IconButton, {
304
+ "aria-label": "icon button",
305
+ ml: "sm",
306
+ mt: "3px",
307
+ variant: "inverted"
308
+ }, (0, _react2.jsx)(_index.Icon, {
309
+ icon: _PlusIcon["default"],
310
+ color: "white",
311
+ size: 13
312
+ }))), (0, _react2.jsx)(_index.Text, {
313
+ variant: "bodyWeak"
314
+ }, description, (0, _react2.jsx)(_index.Link, {
315
+ href: "https://uilibrary.ping-eng.com/",
316
+ sx: {
317
+ fontSize: '13px'
318
+ }
319
+ }, " Learn more"))), (0, _react2.jsx)(_index.SearchField, {
289
320
  position: "fixed",
290
321
  mb: "sm",
291
322
  width: "400px",
@@ -60,6 +60,8 @@ export function useListLayout(state) {
60
60
  * view, or edit items in this list. This virtualized component supports
61
61
  * asynchronous data in infinitely scrollable lists.
62
62
  *
63
+ * Can be used as in recipe: https://uilibrary.ping-eng.com/astro/?path=/docs/recipes-list-with-panel--default
64
+ *
63
65
  * NOTE: be careful with putting focusable elements inside ListView.
64
66
  * It is using a grid (useList hook) with its own event listeners under the hood.
65
67
  * [react-specttrum-github-issue](https://github.com/adobe/react-spectrum/issues/2801)
@@ -190,6 +190,7 @@ var TabPicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
190
190
  ref: menuRef
191
191
  }, _mapInstanceProperty(items).call(items, function (tab) {
192
192
  return ___EmotionJSX(Tab, {
193
+ role: tab.role,
193
194
  key: tab.key
194
195
  }, tab.name);
195
196
  })));
@@ -235,11 +235,13 @@ export var WithList = function WithList() {
235
235
  list: [{
236
236
  key: 'tab1list',
237
237
  name: 'Tab 1 list',
238
- children: 'Tab 1 from list'
238
+ children: 'Tab 1 from list',
239
+ role: 'listitem'
239
240
  }, {
240
241
  key: 'tab2list',
241
242
  name: 'Tab 2 list',
242
- children: 'Tab 2 from list'
243
+ children: 'Tab 2 from list',
244
+ role: 'listitem'
243
245
  }]
244
246
  }]);
245
247
 
@@ -43,11 +43,13 @@ var tabsWithList = [{
43
43
  list: [{
44
44
  key: 'tab1list',
45
45
  name: 'Tab 1 list',
46
- children: 'Tab 1 from list'
46
+ children: 'Tab 1 from list',
47
+ role: 'listitem'
47
48
  }, {
48
49
  key: 'tab2list',
49
50
  name: 'Tab 2 list',
50
- children: 'Tab 2 from list'
51
+ children: 'Tab 2 from list',
52
+ role: 'listitem'
51
53
  }]
52
54
  }];
53
55
  var defaultProps = {
@@ -495,7 +497,7 @@ test('will render tab with list if provided', /*#__PURE__*/_asyncToGenerator( /*
495
497
  userEvent.click(menuBtn);
496
498
  expect(screen.queryByRole('menu')).toBeInTheDocument();
497
499
  testTabPanel(0);
498
- menuItems = screen.queryAllByRole('menuitemradio');
500
+ menuItems = screen.queryAllByRole('listitem');
499
501
  expect(menuItems).toHaveLength(tabsWithList[1].list.length);
500
502
  expect(menuItems[0]).not.toHaveFocus();
501
503
  userEvent.click(menuItems[0]);
@@ -538,7 +540,7 @@ test('tab list is accessible via keyboard', function () {
538
540
  });
539
541
  expect(screen.queryByRole('menu')).toBeInTheDocument();
540
542
  testTabPanel(0);
541
- var menuItems = screen.queryAllByRole('menuitemradio');
543
+ var menuItems = screen.queryAllByRole('listitem');
542
544
  expect(menuItems).toHaveLength(tabsWithList[1].list.length);
543
545
  expect(menuItems[0]).toHaveFocus();
544
546
  fireEvent.keyDown(menuItems[0], {
@@ -7,7 +7,8 @@ import AccountIcon from 'mdi-react/AccountIcon';
7
7
  import CloseIcon from 'mdi-react/CloseIcon';
8
8
  import MoreVertIcon from 'mdi-react/MoreVertIcon';
9
9
  import PencilIcon from 'mdi-react/PencilIcon';
10
- import { Avatar, Box, Icon, IconButton, ListView, Menu, OverlayPanel, PopoverMenu, SearchField, Separator, SwitchField, Tab, Tabs, Text } from '../index';
10
+ import PlusIcon from 'mdi-react/PlusIcon';
11
+ import { Avatar, Box, Icon, IconButton, Link, ListView, Menu, OverlayPanel, PopoverMenu, SearchField, Separator, SwitchField, Tab, Tabs, Text } from '../index';
11
12
  import { useOverlayPanelState } from '../hooks';
12
13
  import { pingImg } from '../utils/devUtils/constants/images';
13
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -228,6 +229,8 @@ export var Default = function Default() {
228
229
  onPanelClose = _useOverlayPanelState.onClose;
229
230
 
230
231
  var panelTriggerRef = useRef();
232
+ var heading = 'Title of the Page';
233
+ var description = 'The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page. The description of the page.';
231
234
 
232
235
  var closePanelHandler = function closePanelHandler() {
233
236
  onPanelClose(panelState, panelTriggerRef);
@@ -249,7 +252,34 @@ export var Default = function Default() {
249
252
 
250
253
  return ___EmotionJSX(Box, {
251
254
  sx: sx.wrapper
252
- }, ___EmotionJSX(SearchField, {
255
+ }, ___EmotionJSX(Box, {
256
+ mb: "md"
257
+ }, ___EmotionJSX(Box, {
258
+ align: "center",
259
+ isRow: true,
260
+ mb: "xs",
261
+ role: "heading",
262
+ "aria-level": "1"
263
+ }, ___EmotionJSX(Text, {
264
+ variant: "title",
265
+ fontWeight: 3
266
+ }, heading), ___EmotionJSX(IconButton, {
267
+ "aria-label": "icon button",
268
+ ml: "sm",
269
+ mt: "3px",
270
+ variant: "inverted"
271
+ }, ___EmotionJSX(Icon, {
272
+ icon: PlusIcon,
273
+ color: "white",
274
+ size: 13
275
+ }))), ___EmotionJSX(Text, {
276
+ variant: "bodyWeak"
277
+ }, description, ___EmotionJSX(Link, {
278
+ href: "https://uilibrary.ping-eng.com/",
279
+ sx: {
280
+ fontSize: '13px'
281
+ }
282
+ }, " Learn more"))), ___EmotionJSX(SearchField, {
253
283
  position: "fixed",
254
284
  mb: "sm",
255
285
  width: "400px",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.31.0-alpha.0",
3
+ "version": "1.31.0-alpha.2",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",