@pingux/astro 2.4.2-alpha.1 → 2.5.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.
Files changed (33) hide show
  1. package/lib/cjs/components/Button/Buttons.styles.js +14 -0
  2. package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +95 -48
  3. package/lib/cjs/components/NavBar/NavBar.js +22 -7
  4. package/lib/cjs/components/NavBar/NavBar.styles.js +126 -1
  5. package/lib/cjs/components/NavBarSection/NavBarItem.js +2 -2
  6. package/lib/cjs/components/NavBarSection/NavBarItemBody.js +3 -4
  7. package/lib/cjs/components/NavBarSection/NavBarItemBody.test.js +3 -2
  8. package/lib/cjs/components/NavBarSection/NavBarItemButton.js +2 -17
  9. package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +19 -11
  10. package/lib/cjs/components/NavBarSection/NavBarItemLink.js +1 -1
  11. package/lib/cjs/components/NavBarSection/NavBarSection.js +20 -7
  12. package/lib/cjs/hooks/useNavBarStyling/index.js +14 -0
  13. package/lib/cjs/hooks/useNavBarStyling/useNavBarStyling.js +49 -0
  14. package/lib/cjs/hooks/useNavBarStyling/useNavBarStyling.test.js +45 -0
  15. package/lib/cjs/recipes/MultipagePopup.stories.js +378 -0
  16. package/lib/cjs/styles/templates/Nav/HeaderBar.js +1 -1
  17. package/lib/components/Button/Buttons.styles.js +14 -0
  18. package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +93 -47
  19. package/lib/components/NavBar/NavBar.js +22 -7
  20. package/lib/components/NavBar/NavBar.styles.js +126 -1
  21. package/lib/components/NavBarSection/NavBarItem.js +2 -2
  22. package/lib/components/NavBarSection/NavBarItemBody.js +3 -4
  23. package/lib/components/NavBarSection/NavBarItemBody.test.js +3 -2
  24. package/lib/components/NavBarSection/NavBarItemButton.js +2 -18
  25. package/lib/components/NavBarSection/NavBarItemHeader.js +19 -11
  26. package/lib/components/NavBarSection/NavBarItemLink.js +1 -1
  27. package/lib/components/NavBarSection/NavBarSection.js +21 -8
  28. package/lib/hooks/useNavBarStyling/index.js +1 -0
  29. package/lib/hooks/useNavBarStyling/useNavBarStyling.js +41 -0
  30. package/lib/hooks/useNavBarStyling/useNavBarStyling.test.js +42 -0
  31. package/lib/recipes/MultipagePopup.stories.js +365 -0
  32. package/lib/styles/templates/Nav/HeaderBar.js +1 -1
  33. package/package.json +1 -1
@@ -29,7 +29,8 @@ var NavBarSectionItemHeader = function NavBarSectionItemHeader(props) {
29
29
  var navBarState = useNavBarContext();
30
30
  var selectedKey = navBarState.selectedKey,
31
31
  setExpandedKeys = navBarState.setExpandedKeys,
32
- expandedKeys = navBarState.expandedKeys;
32
+ expandedKeys = navBarState.expandedKeys,
33
+ navStyles = navBarState.navStyles;
33
34
  var isExpanded = _includesInstanceProperty(expandedKeys).call(expandedKeys, key);
34
35
  var array = _mapInstanceProperty(_context = item.children).call(_context, function (i) {
35
36
  return i.key;
@@ -45,9 +46,14 @@ var NavBarSectionItemHeader = function NavBarSectionItemHeader(props) {
45
46
  isSelected: childSelected && !isExpanded
46
47
  }),
47
48
  classNames = _useStatusClasses.classNames;
48
- var color = childSelected && !isExpanded ? 'white' : 'neutral.95';
49
+ var getIconColor = function getIconColor() {
50
+ if (navStyles.navBarItemHeader === 'navBar.popUpItemHeaderContainer') {
51
+ return childSelected && !isExpanded ? 'white' : 'text.primary';
52
+ }
53
+ return childSelected && !isExpanded ? 'white' : 'neutral.95';
54
+ };
49
55
  return ___EmotionJSX(Box, {
50
- variant: "navBar.itemHeaderContainer",
56
+ variant: navStyles.navBarItemHeader,
51
57
  className: classNames,
52
58
  isRow: true,
53
59
  "data-testid": heading
@@ -56,12 +62,12 @@ var NavBarSectionItemHeader = function NavBarSectionItemHeader(props) {
56
62
  size: "sm",
57
63
  sx: {
58
64
  mr: 'sm',
59
- color: color,
60
- fill: color
65
+ color: getIconColor(),
66
+ fill: getIconColor()
61
67
  },
62
68
  "aria-hidden": "true"
63
69
  }), ___EmotionJSX(Text, {
64
- variant: "variants.navBar.headerText"
70
+ variant: navStyles.navBarItemHeaderText
65
71
  }, heading), ___EmotionJSX(Box, {
66
72
  isRow: true,
67
73
  alignItems: "center",
@@ -70,10 +76,10 @@ var NavBarSectionItemHeader = function NavBarSectionItemHeader(props) {
70
76
  }
71
77
  }, ___EmotionJSX(Icon, {
72
78
  icon: isExpanded ? MenuUp : MenuDown,
73
- size: "sm",
79
+ size: navStyles.navBarItemHeaderIconSize,
74
80
  sx: {
75
- color: color,
76
- fill: color
81
+ color: getIconColor(),
82
+ fill: getIconColor()
77
83
  },
78
84
  "aria-label": isExpanded ? 'Menu up' : 'Menu down'
79
85
  })));
@@ -84,8 +90,10 @@ var NavBarPrimaryItemHeader = function NavBarPrimaryItemHeader(_ref) {
84
90
  className = item.className,
85
91
  heading = item.heading,
86
92
  customIcon = item.customIcon;
93
+ var navBarState = useNavBarContext();
94
+ var navStyles = navBarState.navStyles;
87
95
  return ___EmotionJSX(Box, {
88
- variant: "navBar.itemHeaderContainer",
96
+ variant: navStyles.navBarItemHeader,
89
97
  className: className,
90
98
  isRow: true,
91
99
  "data-testid": heading
@@ -99,7 +107,7 @@ var NavBarPrimaryItemHeader = function NavBarPrimaryItemHeader(_ref) {
99
107
  },
100
108
  "aria-hidden": "true"
101
109
  }), ___EmotionJSX(Text, {
102
- variant: "variants.navBar.headerText"
110
+ variant: navStyles.navBarItemHeaderText
103
111
  }, heading), ___EmotionJSX(Box, {
104
112
  isRow: true,
105
113
  alignItems: "center",
@@ -36,7 +36,7 @@ var NavBarItemLink = function NavBarItemLink(props) {
36
36
  classNames = _useStatusClasses.classNames;
37
37
  return ___EmotionJSX(Link, _extends({
38
38
  id: key,
39
- variant: "variants.navBar.itemButton",
39
+ variant: state.navStyles.navBarItemLink,
40
40
  className: classNames,
41
41
  onPress: onNavPress,
42
42
  color: isSelected ? 'white' : undefined
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["hasSeparator", "title", "items"],
3
+ var _excluded = ["hasSeparator", "title", "items", "onKeyDown"],
4
4
  _excluded2 = ["key", "children"];
5
5
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
6
6
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
@@ -10,7 +10,7 @@ import React, { useRef } from 'react';
10
10
  import { useFocusManager } from '@react-aria/focus';
11
11
  import { useKeyboard } from '@react-aria/interactions';
12
12
  import PropTypes from 'prop-types';
13
- import { Button, Link, Separator, Text } from '../..';
13
+ import { Box, Button, Link, Separator, Text } from '../..';
14
14
  import { useNavBarContext } from '../../context/NavBarContext';
15
15
  import NavBarItemBody from './NavBarItemBody';
16
16
  import NavBarItemHeader from './NavBarItemHeader';
@@ -25,11 +25,13 @@ var NavBarSection = function NavBarSection(_ref) {
25
25
  var hasSeparator = _ref.hasSeparator,
26
26
  title = _ref.title,
27
27
  items = _ref.items,
28
+ onKeyDown = _ref.onKeyDown,
28
29
  others = _objectWithoutProperties(_ref, _excluded);
29
30
  var ref = useRef();
30
31
  var childrenItems = _filterInstanceProperty(items).call(items, function (item) {
31
32
  return item.children || item.href;
32
33
  });
34
+ var state = useNavBarContext();
33
35
  return ___EmotionJSX(React.Fragment, null, hasSeparator && ___EmotionJSX(Separator, {
34
36
  variant: "separator.navBarSeparator"
35
37
  }), title && ___EmotionJSX(Text, {
@@ -43,19 +45,23 @@ var NavBarSection = function NavBarSection(_ref) {
43
45
  listStyle: 'none'
44
46
  }
45
47
  }, others), _mapInstanceProperty(childrenItems).call(childrenItems, function (item) {
46
- return ___EmotionJSX("li", {
47
- key: item.key
48
+ return ___EmotionJSX(Box, {
49
+ as: "li",
50
+ key: item.key,
51
+ variant: state.navStyles.navBarItemHeaderListItem
48
52
  }, !item.children && item.href ? ___EmotionJSX(PrimaryItem, {
49
53
  key: item.key,
50
54
  item: item
51
55
  }) : ___EmotionJSX(SectionItem, {
52
56
  key: item.key,
53
- item: item
57
+ item: item,
58
+ onKeyDown: onKeyDown
54
59
  }));
55
60
  })));
56
61
  };
57
62
  var SectionItem = function SectionItem(_ref2) {
58
- var item = _ref2.item;
63
+ var item = _ref2.item,
64
+ onKeyDownProp = _ref2.onKeyDown;
59
65
  var key = item.key,
60
66
  children = item.children,
61
67
  others = _objectWithoutProperties(item, _excluded2);
@@ -106,6 +112,9 @@ var SectionItem = function SectionItem(_ref2) {
106
112
  default:
107
113
  break;
108
114
  }
115
+ if (onKeyDownProp) {
116
+ onKeyDownProp(e);
117
+ }
109
118
  };
110
119
  var _useKeyboard = useKeyboard({
111
120
  onKeyDown: function onKeyDown(e) {
@@ -115,7 +124,7 @@ var SectionItem = function SectionItem(_ref2) {
115
124
  }),
116
125
  keyboardProps = _useKeyboard.keyboardProps;
117
126
  return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Button, _extends({
118
- variant: "variants.navBar.sectionButton",
127
+ variant: navBarState.navStyles.sectionItem,
119
128
  onPress: function onPress() {
120
129
  return onExpandedChange(!isExpanded);
121
130
  }
@@ -128,8 +137,9 @@ var SectionItem = function SectionItem(_ref2) {
128
137
  };
129
138
  var PrimaryItem = function PrimaryItem(_ref3) {
130
139
  var item = _ref3.item;
140
+ var state = useNavBarContext();
131
141
  return ___EmotionJSX(Link, {
132
- variant: "variants.navBar.sectionButton",
142
+ variant: state.navStyles.primaryItem,
133
143
  href: item.href,
134
144
  target: "_blank"
135
145
  }, ___EmotionJSX(NavBarItemHeader, {
@@ -142,6 +152,8 @@ NavBarSection.defaultProps = {
142
152
  NavBarSection.propTypes = {
143
153
  /** If true, a separator will render at the end of the section */
144
154
  hasSeparator: PropTypes.bool,
155
+ /** callback that runs on key down */
156
+ onKeyDown: PropTypes.func,
145
157
  /** If present, this string will render at the top of the section */
146
158
  title: PropTypes.string,
147
159
  /**
@@ -151,6 +163,7 @@ NavBarSection.propTypes = {
151
163
  items: PropTypes.arrayOf(PropTypes.shape({}))
152
164
  };
153
165
  SectionItem.propTypes = {
166
+ onKeyDown: PropTypes.func,
154
167
  item: PropTypes.shape({
155
168
  key: PropTypes.string,
156
169
  children: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),
@@ -0,0 +1 @@
1
+ export { default } from './useNavBarStyling';
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Generates the necessary props to be used in field components.
3
+ * @param {String} variant Variant for the overall NavBar
4
+ * @returns {Object} Prop object that distributes styling to various sub-components.
5
+ */
6
+
7
+ var useNavBarStyling = function useNavBarStyling(variant) {
8
+ switch (variant) {
9
+ case 'popupNav':
10
+ return {
11
+ navBar: 'navBar.popUpContainer',
12
+ primaryItem: 'variants.navBar.popUpSectionButton',
13
+ sectionItem: 'variants.navBar.popUpSectionButton',
14
+ navBarItemHeader: 'navBar.popUpItemHeaderContainer',
15
+ navBarItemHeaderText: 'variants.navBar.popUpHeaderText',
16
+ navBarItemButton: 'variants.navBar.popUpItemButton',
17
+ navBarItemLink: 'variants.navBar.popUpItemButton',
18
+ navBarItem: 'navBar.popUpItem',
19
+ navBarItemText: 'variants.navBar.popUpHeaderText',
20
+ navBarItemHeaderListItem: 'variants.navBar.popUpItemListItem',
21
+ navBarItemBody: 'variants.navBar.popUpNavBarItemBody',
22
+ navBarItemHeaderIconSize: 'xs'
23
+ };
24
+ default:
25
+ return {
26
+ navBar: 'navBar.container',
27
+ primaryItem: 'variants.navBar.sectionButton',
28
+ sectionItem: 'variants.navBar.sectionButton',
29
+ navBarItemHeader: 'navBar.itemHeaderContainer',
30
+ navBarItemHeaderText: 'variants.navBar.headerText',
31
+ navBarItemButton: 'variants.navBar.itemButton',
32
+ navBarItemLink: 'variants.navBar.itemButton',
33
+ navBarItem: 'navBar.item',
34
+ navBarItemText: 'variants.navBar.headerText',
35
+ navBarItemHeaderListItem: null,
36
+ navBarItemBody: 'variants.navBar.navBarItemBody',
37
+ navBarItemHeaderIconSize: 'sm'
38
+ };
39
+ }
40
+ };
41
+ export default useNavBarStyling;
@@ -0,0 +1,42 @@
1
+ import { renderHook } from '@testing-library/react-hooks';
2
+ import useNavBarStyling from '.';
3
+ test('popUpNav variant returns the correct variants', function () {
4
+ var _renderHook = renderHook(function () {
5
+ return useNavBarStyling('popupNav');
6
+ }),
7
+ result = _renderHook.result;
8
+ expect(result.current).toMatchObject({
9
+ navBar: 'navBar.popUpContainer',
10
+ primaryItem: 'variants.navBar.popUpSectionButton',
11
+ sectionItem: 'variants.navBar.popUpSectionButton',
12
+ navBarItemHeader: 'navBar.popUpItemHeaderContainer',
13
+ navBarItemHeaderText: 'variants.navBar.popUpHeaderText',
14
+ navBarItemButton: 'variants.navBar.popUpItemButton',
15
+ navBarItemLink: 'variants.navBar.popUpItemButton',
16
+ navBarItem: 'navBar.popUpItem',
17
+ navBarItemText: 'variants.navBar.popUpHeaderText',
18
+ navBarItemHeaderListItem: 'variants.navBar.popUpItemListItem',
19
+ navBarItemBody: 'variants.navBar.popUpNavBarItemBody',
20
+ navBarItemHeaderIconSize: 'xs'
21
+ });
22
+ });
23
+ test('default prop returns standard nav variants', function () {
24
+ var _renderHook2 = renderHook(function () {
25
+ return useNavBarStyling('');
26
+ }),
27
+ result = _renderHook2.result;
28
+ expect(result.current).toMatchObject({
29
+ navBar: 'navBar.container',
30
+ primaryItem: 'variants.navBar.sectionButton',
31
+ sectionItem: 'variants.navBar.sectionButton',
32
+ navBarItemHeader: 'navBar.itemHeaderContainer',
33
+ navBarItemHeaderText: 'variants.navBar.headerText',
34
+ navBarItemButton: 'variants.navBar.itemButton',
35
+ navBarItemLink: 'variants.navBar.itemButton',
36
+ navBarItem: 'navBar.item',
37
+ navBarItemText: 'variants.navBar.headerText',
38
+ navBarItemHeaderListItem: null,
39
+ navBarItemBody: 'variants.navBar.navBarItemBody',
40
+ navBarItemHeaderIconSize: 'sm'
41
+ });
42
+ });
@@ -0,0 +1,365 @@
1
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
2
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
4
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
5
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
6
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
7
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
8
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
10
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
11
+ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
12
+ 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; }
13
+ 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) { _defineProperty(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; }
14
+ import React, { useRef, useState } from 'react';
15
+ import { FocusScope, useOverlayPosition, useOverlayTrigger } from 'react-aria';
16
+ import { useOverlayTriggerState } from 'react-stately';
17
+ import { useLayoutEffect } from '@react-aria/utils';
18
+ import ExploreIcon from 'mdi-react/CompassOutlineIcon';
19
+ import GlobeIcon from 'mdi-react/GlobeIcon';
20
+ import HelpCircleOutlineIcon from 'mdi-react/HelpCircleOutlineIcon';
21
+ import MenuDownIcon from 'mdi-react/MenuDownIcon';
22
+ import MenuUpIcon from 'mdi-react/MenuUpIcon';
23
+ import { Box, Button, EnvironmentBreadcrumb, Icon, IconButton, Item, Link, Menu, NavBar, NavBarItem, NavBarItemButton, NavBarSection, OverlayProvider, PopoverContainer, PopoverMenu, Separator, Text } from '../index';
24
+ import { data, logo, PersonIcon, secondData, thirdData } from '../styles/templates/Nav/NavData';
25
+ import { jsx as ___EmotionJSX } from "@emotion/react";
26
+ export default {
27
+ title: 'Recipes/Multipage Popup',
28
+ parameters: {
29
+ backgrounds: {
30
+ "default": 'accent',
31
+ values: [{
32
+ name: 'accent',
33
+ value: 'accent.99'
34
+ }]
35
+ }
36
+ }
37
+ };
38
+ var dataPopUp = [{
39
+ 'data-id': 'orchestrate',
40
+ key: 'Orchestrate',
41
+ heading: 'Orchestrate',
42
+ children: [___EmotionJSX(NavBarItemButton, {
43
+ key: "PingOne DaVinci",
44
+ id: "PingOne DaVinci"
45
+ }, ___EmotionJSX("b", null, "PingOne "), "DaVinci")]
46
+ }];
47
+ var secondDataPopUp = [{
48
+ 'data-id': 'threat-protection',
49
+ key: 'Threat Protection',
50
+ heading: 'Threat Protection',
51
+ children: [___EmotionJSX(NavBarItemButton, {
52
+ key: "protect",
53
+ id: "protect"
54
+ }, ___EmotionJSX("b", null, "PingOne "), "Risk"), ___EmotionJSX(NavBarItemButton, {
55
+ key: "Api Intel",
56
+ id: "Api Intel"
57
+ }, ___EmotionJSX("b", null, "PingOne "), "API Intelligence"), ___EmotionJSX(NavBarItemButton, {
58
+ key: "Intel for Api",
59
+ id: "Intel for Api"
60
+ }, ___EmotionJSX("b", null, "Ping "), "Intelligence for APIs")]
61
+ }];
62
+ var thirdDataPopUp = [{
63
+ 'data-id': 'threat-protection',
64
+ key: 'Identity',
65
+ heading: 'Identity',
66
+ children: [___EmotionJSX(NavBarItemButton, {
67
+ key: "verify",
68
+ id: "verify"
69
+ }, ___EmotionJSX("b", null, "PingOne "), "Verify"), ___EmotionJSX(NavBarItemButton, {
70
+ key: "credentials",
71
+ id: "credentials"
72
+ }, ___EmotionJSX("b", null, "PingOne "), "Crendentials"), ___EmotionJSX(NavBarItemButton, {
73
+ key: "directory",
74
+ id: "directory"
75
+ }, ___EmotionJSX("b", null, "Ping"), "Directory"), ___EmotionJSX(NavBarItemButton, {
76
+ key: "sso1",
77
+ id: "sso1"
78
+ }, ___EmotionJSX("b", null, "Ping One "), "SSO")]
79
+ }];
80
+ var fourthDataPopUp = [{
81
+ 'data-id': 'threat-protection',
82
+ key: 'Authenticate',
83
+ heading: 'Authenticate',
84
+ children: [___EmotionJSX(NavBarItemButton, {
85
+ key: "sso",
86
+ id: "sso"
87
+ }, ___EmotionJSX("b", null, "PingOne "), "SSO"), ___EmotionJSX(NavBarItemButton, {
88
+ key: "federate",
89
+ id: "federate"
90
+ }, ___EmotionJSX("b", null, "Ping"), "Federate"), ___EmotionJSX(NavBarItemButton, {
91
+ key: "MFA",
92
+ id: "MFA"
93
+ }, ___EmotionJSX("b", null, "PingOne "), "MFA"), ___EmotionJSX(NavBarItemButton, {
94
+ key: "id",
95
+ id: "id"
96
+ }, ___EmotionJSX("b", null, "Ping"), "ID"), ___EmotionJSX(NavBarItemButton, {
97
+ key: "central",
98
+ id: "central"
99
+ }, ___EmotionJSX("b", null, "Ping"), "Central")]
100
+ }];
101
+ var fifthDataPopUp = [{
102
+ 'data-id': 'authorize',
103
+ key: 'Authorize',
104
+ heading: 'Authorize',
105
+ children: [___EmotionJSX(NavBarItemButton, {
106
+ key: "PingOne Authorize",
107
+ id: "PingOne Authorize"
108
+ }, ___EmotionJSX("b", null, "PingOne "), "Authorize"), ___EmotionJSX(NavBarItemButton, {
109
+ key: "Ping Authorize",
110
+ id: "Ping Authorize"
111
+ }, ___EmotionJSX("b", null, "Ping"), "Authorize"), ___EmotionJSX(NavBarItemButton, {
112
+ key: "Ping Access",
113
+ id: "Ping Access"
114
+ }, ___EmotionJSX("b", null, "Ping"), "Access")]
115
+ }];
116
+ var SideNav = function SideNav(_ref) {
117
+ var setSelectedKey = _ref.setSelectedKey,
118
+ selectedKey = _ref.selectedKey;
119
+ return ___EmotionJSX(NavBar, {
120
+ setSelectedKey: setSelectedKey,
121
+ selectedKey: selectedKey
122
+ }, ___EmotionJSX(Box, {
123
+ padding: "md",
124
+ key: "top-logo-parent"
125
+ }, ___EmotionJSX(Link, {
126
+ href: "https://pingidentity.com",
127
+ target: "_blank",
128
+ "aria-label": "home link"
129
+ }, logo)), ___EmotionJSX(Separator, {
130
+ marginTop: "lg",
131
+ marginBottom: "sm"
132
+ }), ___EmotionJSX(Box, {
133
+ variant: "navBar.sectionContainer",
134
+ paddingBottom: "xl",
135
+ key: "first-section-container"
136
+ }, ___EmotionJSX(NavBarItem, {
137
+ id: "Overview",
138
+ key: "Overview",
139
+ text: "Overview",
140
+ icon: GlobeIcon
141
+ }), ___EmotionJSX(NavBarSection, {
142
+ items: data,
143
+ hasSeparator: true
144
+ }), ___EmotionJSX(NavBarSection, {
145
+ items: secondData,
146
+ hasSeparator: true,
147
+ title: "PingOne Services"
148
+ }), ___EmotionJSX(NavBarSection, {
149
+ items: thirdData
150
+ })));
151
+ };
152
+ var CustomPopover = function CustomPopover() {
153
+ var _useState = useState('PingOne DaVinci'),
154
+ _useState2 = _slicedToArray(_useState, 2),
155
+ selectedKey = _useState2[0],
156
+ setSelectedKey = _useState2[1];
157
+ var triggerRef = useRef();
158
+ var overlayRef = useRef();
159
+ var state = useOverlayTriggerState({});
160
+ var _useOverlayTrigger = useOverlayTrigger({
161
+ type: 'dialog'
162
+ }, state, triggerRef),
163
+ triggerProps = _useOverlayTrigger.triggerProps,
164
+ overlayProps = _useOverlayTrigger.overlayProps;
165
+ var _useOverlayPosition = useOverlayPosition({
166
+ targetRef: triggerRef,
167
+ overlayRef: overlayRef,
168
+ placement: 'bottom right',
169
+ isOpen: state.isOpen,
170
+ offset: 6
171
+ }),
172
+ positionProps = _useOverlayPosition.overlayProps,
173
+ placement = _useOverlayPosition.placement,
174
+ updatePosition = _useOverlayPosition.updatePosition;
175
+ useLayoutEffect(function () {
176
+ requestAnimationFrame(function () {
177
+ updatePosition();
178
+ });
179
+ }, [updatePosition]);
180
+ var style = _objectSpread(_objectSpread({}, positionProps.style), {}, {
181
+ width: '760px',
182
+ minWidth: '760px',
183
+ height: '800px',
184
+ boxShadow: 'none !important'
185
+ });
186
+ var onEscCloseNav = function onEscCloseNav(e) {
187
+ if (e.key === 'Escape') {
188
+ state.close();
189
+ }
190
+ };
191
+ return ___EmotionJSX(Box, null, ___EmotionJSX(Button, _extends({
192
+ ref: triggerRef,
193
+ variant: "headerBar"
194
+ }, triggerProps), ___EmotionJSX(Box, {
195
+ isRow: true,
196
+ alignItems: "center"
197
+ }, ___EmotionJSX(Icon, {
198
+ icon: ExploreIcon,
199
+ size: "sm"
200
+ }), ___EmotionJSX(Text, {
201
+ color: "neutral.30",
202
+ fontSize: "md",
203
+ fontWeight: 1,
204
+ mx: 7,
205
+ variant: "textEllipsis"
206
+ }, "Explore"), ___EmotionJSX(Icon, {
207
+ icon: state.isOpen ? MenuUpIcon : MenuDownIcon,
208
+ mr: "sm",
209
+ size: "sm"
210
+ }))), ___EmotionJSX(PopoverContainer, _extends({}, overlayProps, positionProps, {
211
+ isOpen: state.isOpen,
212
+ hasNoArrow: true,
213
+ ref: overlayRef,
214
+ placement: placement,
215
+ style: style,
216
+ onClose: state.close,
217
+ isDismissable: true,
218
+ isNotClosedOnBlur: true
219
+ }), ___EmotionJSX(FocusScope, {
220
+ autoFocus: true,
221
+ contain: true,
222
+ restoreFocus: true
223
+ }, ___EmotionJSX(Box, {
224
+ sx: {
225
+ height: '100%'
226
+ }
227
+ }, ___EmotionJSX(NavBar, {
228
+ variant: "popupNav",
229
+ hasRestoreFocus: false,
230
+ setSelectedKey: setSelectedKey,
231
+ selectedKey: selectedKey
232
+ }, ___EmotionJSX(Box, {
233
+ variant: "navBar.popUpSectionContainer",
234
+ paddingBottom: "xl",
235
+ key: "first-section-container"
236
+ }, ___EmotionJSX(NavBarSection, {
237
+ items: dataPopUp,
238
+ "data-id": "third-nav-bar-section",
239
+ onKeyDown: onEscCloseNav
240
+ }), ___EmotionJSX(NavBarSection, {
241
+ items: secondDataPopUp,
242
+ "data-id": "third-nav-bar-section",
243
+ onKeyDown: onEscCloseNav
244
+ }), ___EmotionJSX(NavBarSection, {
245
+ items: thirdDataPopUp,
246
+ "data-id": "third-nav-bar-section",
247
+ onKeyDown: onEscCloseNav
248
+ }), ___EmotionJSX(NavBarSection, {
249
+ items: fourthDataPopUp,
250
+ "data-id": "third-nav-bar-section",
251
+ onKeyDown: onEscCloseNav
252
+ }), ___EmotionJSX(NavBarSection, {
253
+ items: fifthDataPopUp,
254
+ "data-id": "third-nav-bar-section",
255
+ onKeyDown: onEscCloseNav
256
+ }))), ___EmotionJSX(Box, {
257
+ sx: {
258
+ marginLeft: '185px',
259
+ height: '100%',
260
+ width: 'calc(100% - 185px)',
261
+ backgroundColor: 'white',
262
+ padding: 'lg'
263
+ }
264
+ }, ___EmotionJSX(Text, {
265
+ as: "h2",
266
+ variant: "H2"
267
+ }, selectedKey), ___EmotionJSX("br", null), ___EmotionJSX(Button, null, "Example of focusable element in the body"))))));
268
+ };
269
+ var CustomPopoverMenu = function CustomPopoverMenu() {
270
+ var _useState3 = useState(false),
271
+ _useState4 = _slicedToArray(_useState3, 2),
272
+ isOpen = _useState4[0],
273
+ setIsOpen = _useState4[1];
274
+ return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(PopoverMenu, {
275
+ onOpenChange: setIsOpen
276
+ }, ___EmotionJSX(IconButton, {
277
+ "aria-label": "default icon button"
278
+ }, ___EmotionJSX(Icon, {
279
+ icon: MenuDownIcon,
280
+ size: "xs",
281
+ color: "neutral.30",
282
+ sx: isOpen ? {
283
+ transform: 'rotate(180deg)'
284
+ } : null
285
+ })), ___EmotionJSX(Menu, null, ___EmotionJSX(Item, {
286
+ key: "option1"
287
+ }, "First Option"), ___EmotionJSX(Item, {
288
+ key: "option2"
289
+ }, "Second Option"), ___EmotionJSX(Item, {
290
+ key: "option3"
291
+ }, "Third Option"))));
292
+ };
293
+ var HeaderBar = function HeaderBar() {
294
+ var Rectangle = function Rectangle() {
295
+ return ___EmotionJSX(Box, {
296
+ width: "1px",
297
+ height: 30,
298
+ bg: "neutral.80",
299
+ mx: 25
300
+ });
301
+ };
302
+ return ___EmotionJSX(Box, {
303
+ ml: 230,
304
+ px: "md",
305
+ bg: "white",
306
+ height: "40px",
307
+ isRow: true,
308
+ alignItems: "center",
309
+ justifyContent: "space-between"
310
+ }, ___EmotionJSX(EnvironmentBreadcrumb, {
311
+ name: "Globochem"
312
+ }), ___EmotionJSX(Box, {
313
+ isRow: true
314
+ }, ___EmotionJSX(Box, {
315
+ isRow: true,
316
+ alignItems: "center"
317
+ }, ___EmotionJSX(Icon, {
318
+ icon: HelpCircleOutlineIcon,
319
+ size: 20,
320
+ color: "neutral.30"
321
+ }), ___EmotionJSX(CustomPopoverMenu, null)), ___EmotionJSX(Rectangle, null), ___EmotionJSX(Box, {
322
+ isRow: true,
323
+ color: "neutral.30",
324
+ alignItems: "center",
325
+ id: "customparent"
326
+ }, ___EmotionJSX(CustomPopover, null)), ___EmotionJSX(Rectangle, null), ___EmotionJSX(Box, {
327
+ isRow: true,
328
+ color: "neutral.30",
329
+ alignItems: "center"
330
+ }, ___EmotionJSX(Icon, {
331
+ icon: PersonIcon,
332
+ size: 20
333
+ }), ___EmotionJSX(Text, {
334
+ color: "neutral.30",
335
+ fontSize: "md",
336
+ fontWeight: 1,
337
+ mx: 7,
338
+ variant: "textEllipsis"
339
+ }, "Alyssa Chambers"), ___EmotionJSX(CustomPopoverMenu, null))));
340
+ };
341
+ export var Default = function Default() {
342
+ var _useState5 = useState('Overview'),
343
+ _useState6 = _slicedToArray(_useState5, 2),
344
+ selectedKey = _useState6[0],
345
+ setSelectedKey = _useState6[1];
346
+ return ___EmotionJSX(Box, {
347
+ bg: "accent.99",
348
+ height: "100vh"
349
+ }, ___EmotionJSX(SideNav, {
350
+ setSelectedKey: setSelectedKey,
351
+ selectedKey: selectedKey
352
+ }), ___EmotionJSX(HeaderBar, {
353
+ isOpen: false
354
+ }));
355
+ };
356
+ Default.decorators = [function (Story) {
357
+ return ___EmotionJSX(Box, {
358
+ sx: {
359
+ margin: '-50px'
360
+ }
361
+ }, ___EmotionJSX(Story, null));
362
+ }];
363
+ Default.parameters = {
364
+ layout: 'fullscreen'
365
+ };
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
3
3
  import ExploreIcon from 'mdi-react/CompassOutlineIcon';
4
4
  import HelpCircleOutlineIcon from 'mdi-react/HelpCircleOutlineIcon';
5
5
  import MenuDownIcon from 'mdi-react/MenuDownIcon';
6
- import { WithSections as EnvironmentBreadcrumb } from '../../../components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories';
6
+ import { DefaultClosed as EnvironmentBreadcrumb } from '../../../components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories';
7
7
  import { Box, Icon, IconButton, Item, Menu, OverlayProvider, PopoverMenu, Text } from '../../../index';
8
8
  import { PersonIcon } from './NavData';
9
9
  import { jsx as ___EmotionJSX } from "@emotion/react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.4.2-alpha.1",
3
+ "version": "2.5.0-alpha.0",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",