@ndlib/component-library 0.0.74 → 0.0.78

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.
@@ -8,10 +8,10 @@ describe('NavMenu', () => {
8
8
  const { getByRole } = render(_jsx(DemoMenuImplementation, {}));
9
9
  const menu = getByRole('menu');
10
10
  const firstMenuItem = getByRole('menuitem', {
11
- name: 'test menu 1',
11
+ name: 'home',
12
12
  });
13
13
  const secondMenuItem = getByRole('menuitem', {
14
- name: 'test menu 2',
14
+ name: 'research',
15
15
  });
16
16
  fireEvent.focus(menu);
17
17
  expect(firstMenuItem).toHaveFocus();
@@ -67,7 +67,7 @@ describe('NavMenu', () => {
67
67
  it('can be navigated with keyboard events', () => {
68
68
  const { getByRole } = render(_jsx(DemoMenuImplementation, {}));
69
69
  const secondMenuItem = getByRole('menuitem', {
70
- name: 'test menu 2',
70
+ name: 'research',
71
71
  });
72
72
  fireEvent.mouseDown(secondMenuItem);
73
73
  fireEvent.click(secondMenuItem);
@@ -8,16 +8,16 @@ const demoMenu = {
8
8
  orientation: MENU_ORIENTATION.HORIZONTAL,
9
9
  items: [
10
10
  {
11
- id: 'test-menu-1',
12
- label: 'test menu 1',
11
+ id: 'home',
12
+ label: 'home',
13
13
  action: {
14
14
  type: MENU_ACTION_TYPE.LINK,
15
15
  to: '/',
16
16
  },
17
17
  },
18
18
  {
19
- id: 'test-menu-2',
20
- label: 'test menu 2',
19
+ id: 'research',
20
+ label: 'research',
21
21
  action: {
22
22
  type: MENU_ACTION_TYPE.SUBMENU,
23
23
  submenu: {
@@ -36,12 +36,12 @@ export const NavMenu = (props) => {
36
36
  }
37
37
  const leafMenuItems = submenuItem.action.submenu.items;
38
38
  const submenuPath = [topLevelMenuId, submenuItem.id];
39
- const category = topLevelMenuId[0].toUpperCase() + topLevelMenuId.slice(1);
39
+ const category = topLevelMenuId.charAt(1).toUpperCase() + topLevelMenuId.slice(2);
40
40
  return (_jsxs(Column, Object.assign({ sx: { flexBasis: '275px', p: 2, flexShrink: 0, flexGrow: 0 } }, { children: [_jsx(Heading, Object.assign({ standalone: true, size: HEADING_SIZE.SM, underline: true }, getMenuItemProps(submenuPath), { children: submenuItem.label })), _jsx(List, Object.assign({}, getMenuProps(submenuPath), { icon: ChevronRightIcon }, { children: leafMenuItems.map((leafMenuItem, i) => {
41
41
  const leafMenuPath = submenuPath.concat(leafMenuItem.id);
42
42
  return (_jsx(ListItem, Object.assign({ index: i, sx: { mt: 1 } }, getMenuItemProps(leafMenuPath), { children: _jsx(Link, Object.assign({ to: "/", sx: {
43
43
  fontWeight: FONT_WEIGHT.BOLD,
44
44
  }, tabIndex: -1 }, { children: leafMenuItem.label })) }), leafMenuItem.id));
45
- }) })), i < 1 && category === 'Research' && 'Services' ? (_jsxs(ArrowLink, Object.assign({ to: category, sx: { margin: '20px 10px 10px 10px' } }, { children: ["View More ", category] }))) : null] }), submenuItem.id));
45
+ }) })), i < 1 && (category === 'Research' || category === 'Services') ? (_jsxs(ArrowLink, Object.assign({ to: category, sx: { margin: '20px 10px 10px 10px' } }, { children: ["View More ", category] }))) : null] }), submenuItem.id));
46
46
  }), _jsx(Column, { sx: { flexGrow: 1 } })] })));
47
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndlib/component-library",
3
- "version": "0.0.74",
3
+ "version": "0.0.78",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [