@elliemae/ds-global-header 1.60.0 → 2.0.0-alpha.12
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/cjs/GlobalHeader.js +16 -36
- package/cjs/GlobalHeaderContainer.js +10 -10
- package/cjs/GlobalHeaderContext.js +3 -6
- package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js +40 -39
- package/cjs/components/Breadcrumb/PureBreadcrumb.js +17 -14
- package/cjs/components/Breadcrumb/styles.js +34 -21
- package/cjs/components/Title/GlobalHeaderTitle.js +12 -12
- package/cjs/components/Toolbar/GlobalHeaderToolbar.js +10 -20
- package/cjs/components/Toolbar/ToolbarItems.js +65 -71
- package/cjs/components/Toolbar/styles.js +13 -8
- package/cjs/config/useGetPropsWithDefaults.js +14 -10
- package/cjs/config/useGlobalHeader.js +22 -36
- package/cjs/config/useValidateProps.js +35 -32
- package/cjs/config/validateHelpers.js +12 -23
- package/cjs/defaultProps.js +5 -4
- package/cjs/index.d.js +0 -1
- package/cjs/index.js +1 -34
- package/cjs/outOfTheBox/AppPicker/AppPicker.js +66 -65
- package/cjs/outOfTheBox/PopupMenu/PopupMenu.js +44 -73
- package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js +67 -50
- package/cjs/outOfTheBox/PopupMenu/styles.js +8 -7
- package/cjs/outOfTheBox/index.js +4 -16
- package/cjs/propTypes.js +3 -4
- package/cjs/styles.js +5 -4
- package/esm/GlobalHeader.js +9 -29
- package/esm/GlobalHeaderContainer.js +9 -9
- package/esm/GlobalHeaderContext.js +3 -6
- package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js +38 -37
- package/esm/components/Breadcrumb/PureBreadcrumb.js +15 -13
- package/esm/components/Breadcrumb/styles.js +34 -21
- package/esm/components/Title/GlobalHeaderTitle.js +12 -12
- package/esm/components/Toolbar/GlobalHeaderToolbar.js +9 -19
- package/esm/components/Toolbar/ToolbarItems.js +61 -68
- package/esm/components/Toolbar/styles.js +13 -8
- package/esm/config/useGetPropsWithDefaults.js +13 -9
- package/esm/config/useGlobalHeader.js +20 -32
- package/esm/config/useValidateProps.js +15 -12
- package/esm/config/validateHelpers.js +12 -19
- package/esm/defaultProps.js +5 -4
- package/esm/index.d.js +0 -1
- package/esm/index.js +0 -33
- package/esm/outOfTheBox/AppPicker/AppPicker.js +65 -63
- package/esm/outOfTheBox/PopupMenu/PopupMenu.js +42 -69
- package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js +65 -50
- package/esm/outOfTheBox/PopupMenu/styles.js +8 -7
- package/esm/outOfTheBox/index.js +0 -12
- package/esm/propTypes.js +3 -4
- package/esm/styles.js +5 -4
- package/package.json +123 -16
- package/types/GlobalHeader.d.ts +39 -0
- package/types/GlobalHeaderContainer.d.ts +3 -0
- package/types/GlobalHeaderContext.d.ts +3 -0
- package/types/components/Breadcrumb/GlobalHeaderBreadcrumb.d.ts +2 -0
- package/types/components/Breadcrumb/PureBreadcrumb.d.ts +3 -0
- package/types/components/Breadcrumb/styles.d.ts +5 -0
- package/types/components/Title/GlobalHeaderTitle.d.ts +2 -0
- package/types/components/Toolbar/GlobalHeaderToolbar.d.ts +2 -0
- package/types/components/Toolbar/ToolbarItems.d.ts +2 -0
- package/types/components/Toolbar/styles.d.ts +1 -0
- package/types/config/useGetPropsWithDefaults.d.ts +2 -0
- package/types/config/useGlobalHeader.d.ts +2 -0
- package/types/config/useValidateProps.d.ts +2 -0
- package/types/config/validateHelpers.d.ts +27 -0
- package/types/defaultProps.d.ts +2 -0
- package/types/index.d.d.ts +68 -0
- package/types/index.d.ts +2 -0
- package/types/outOfTheBox/AppPicker/AppPicker.d.ts +8 -0
- package/types/outOfTheBox/PopupMenu/PopupMenu.d.ts +3 -0
- package/types/outOfTheBox/PopupMenu/PopupMenuContent.d.ts +3 -0
- package/types/outOfTheBox/PopupMenu/styles.d.ts +4 -0
- package/types/outOfTheBox/index.d.ts +2 -0
- package/types/propTypes.d.ts +29 -0
- package/types/styles.d.ts +2 -0
- package/GlobalHeader/package.json +0 -10
- package/GlobalHeaderContainer/package.json +0 -10
- package/GlobalHeaderContext/package.json +0 -10
- package/cjs/GlobalHeader.js.map +0 -1
- package/cjs/GlobalHeaderContainer.js.map +0 -1
- package/cjs/GlobalHeaderContext.js.map +0 -1
- package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +0 -1
- package/cjs/components/Breadcrumb/PureBreadcrumb.js.map +0 -1
- package/cjs/components/Breadcrumb/styles.js.map +0 -1
- package/cjs/components/Title/GlobalHeaderTitle.js.map +0 -1
- package/cjs/components/Toolbar/GlobalHeaderToolbar.js.map +0 -1
- package/cjs/components/Toolbar/ToolbarItems.js.map +0 -1
- package/cjs/components/Toolbar/styles.js.map +0 -1
- package/cjs/config/useGetPropsWithDefaults.js.map +0 -1
- package/cjs/config/useGlobalHeader.js.map +0 -1
- package/cjs/config/useValidateProps.js.map +0 -1
- package/cjs/config/validateHelpers.js.map +0 -1
- package/cjs/defaultProps.js.map +0 -1
- package/cjs/index.d.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/outOfTheBox/AppPicker/AppPicker.js.map +0 -1
- package/cjs/outOfTheBox/PopupMenu/PopupMenu.js.map +0 -1
- package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js.map +0 -1
- package/cjs/outOfTheBox/PopupMenu/styles.js.map +0 -1
- package/cjs/outOfTheBox/index.js.map +0 -1
- package/cjs/propTypes.js.map +0 -1
- package/cjs/styles.js.map +0 -1
- package/components/Breadcrumb/GlobalHeaderBreadcrumb/package.json +0 -10
- package/components/Breadcrumb/PureBreadcrumb/package.json +0 -10
- package/components/Breadcrumb/styles/package.json +0 -10
- package/components/Title/GlobalHeaderTitle/package.json +0 -10
- package/components/Toolbar/GlobalHeaderToolbar/package.json +0 -10
- package/components/Toolbar/ToolbarItems/package.json +0 -10
- package/components/Toolbar/styles/package.json +0 -10
- package/config/useGetPropsWithDefaults/package.json +0 -10
- package/config/useGlobalHeader/package.json +0 -10
- package/config/useValidateProps/package.json +0 -10
- package/config/validateHelpers/package.json +0 -10
- package/defaultProps/package.json +0 -10
- package/esm/GlobalHeader.js.map +0 -1
- package/esm/GlobalHeaderContainer.js.map +0 -1
- package/esm/GlobalHeaderContext.js.map +0 -1
- package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +0 -1
- package/esm/components/Breadcrumb/PureBreadcrumb.js.map +0 -1
- package/esm/components/Breadcrumb/styles.js.map +0 -1
- package/esm/components/Title/GlobalHeaderTitle.js.map +0 -1
- package/esm/components/Toolbar/GlobalHeaderToolbar.js.map +0 -1
- package/esm/components/Toolbar/ToolbarItems.js.map +0 -1
- package/esm/components/Toolbar/styles.js.map +0 -1
- package/esm/config/useGetPropsWithDefaults.js.map +0 -1
- package/esm/config/useGlobalHeader.js.map +0 -1
- package/esm/config/useValidateProps.js.map +0 -1
- package/esm/config/validateHelpers.js.map +0 -1
- package/esm/defaultProps.js.map +0 -1
- package/esm/index.d.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/outOfTheBox/AppPicker/AppPicker.js.map +0 -1
- package/esm/outOfTheBox/PopupMenu/PopupMenu.js.map +0 -1
- package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js.map +0 -1
- package/esm/outOfTheBox/PopupMenu/styles.js.map +0 -1
- package/esm/outOfTheBox/index.js.map +0 -1
- package/esm/propTypes.js.map +0 -1
- package/esm/styles.js.map +0 -1
- package/outOfTheBox/AppPicker/AppPicker/package.json +0 -10
- package/outOfTheBox/PopupMenu/PopupMenu/package.json +0 -10
- package/outOfTheBox/PopupMenu/PopupMenuContent/package.json +0 -10
- package/outOfTheBox/PopupMenu/styles/package.json +0 -10
- package/outOfTheBox/package.json +0 -10
- package/propTypes/package.json +0 -10
- package/styles/package.json +0 -10
|
@@ -1,26 +1,28 @@
|
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ChevronSmallRight } from '@elliemae/ds-icons';
|
|
3
4
|
import { BreadcrumbItem, LabelButton, Label } from './styles.js';
|
|
4
|
-
import 'styled-components';
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
var _ChevronSmallRight;
|
|
7
|
+
const PureBreadcrumb = /*#__PURE__*/React.memo(_ref => {
|
|
8
|
+
let {
|
|
9
|
+
onClick,
|
|
10
|
+
isSelected,
|
|
11
|
+
length,
|
|
12
|
+
label,
|
|
13
|
+
hasNext
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/_jsx(BreadcrumbItem, {}, void 0, /*#__PURE__*/_jsx(LabelButton, {
|
|
13
16
|
onClick: onClick,
|
|
14
17
|
"aria-selected": isSelected,
|
|
15
18
|
"data-testid": "gh-breadcrumb-btn"
|
|
16
|
-
}, /*#__PURE__*/
|
|
17
|
-
isSelected: isSelected,
|
|
19
|
+
}, void 0, /*#__PURE__*/_jsx(Label, {
|
|
20
|
+
isSelected: !!isSelected,
|
|
18
21
|
isOnlyItem: length === 1
|
|
19
|
-
}, label)), hasNext && /*#__PURE__*/
|
|
22
|
+
}, void 0, label)), hasNext && (_ChevronSmallRight || (_ChevronSmallRight = /*#__PURE__*/_jsx(ChevronSmallRight, {
|
|
20
23
|
size: "m",
|
|
21
24
|
fill: "#FFF"
|
|
22
|
-
}));
|
|
25
|
+
}))));
|
|
23
26
|
});
|
|
24
27
|
|
|
25
28
|
export { PureBreadcrumb };
|
|
26
|
-
//# sourceMappingURL=PureBreadcrumb.js.map
|
|
@@ -1,40 +1,53 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const Pipe = /*#__PURE__*/styled.span.withConfig({
|
|
4
4
|
componentId: "sc-1n5l527-0"
|
|
5
|
-
})(["margin:0 7px 0 0;border-left:", ";height:20px;"],
|
|
6
|
-
|
|
5
|
+
})(["margin:0 7px 0 0;border-left:", ";height:20px;"], _ref => {
|
|
6
|
+
let {
|
|
7
|
+
showIconOnly
|
|
8
|
+
} = _ref;
|
|
7
9
|
return showIconOnly ? 'none' : '1px solid #fff';
|
|
8
10
|
});
|
|
9
|
-
|
|
11
|
+
const BreadcrumbItem = /*#__PURE__*/styled.div.withConfig({
|
|
10
12
|
componentId: "sc-1n5l527-1"
|
|
11
13
|
})(["display:flex;align-items:center;height:100%;"]);
|
|
12
|
-
|
|
14
|
+
const LabelButton = /*#__PURE__*/styled.button.withConfig({
|
|
13
15
|
componentId: "sc-1n5l527-2"
|
|
14
|
-
})(["width:fit-content;height:100%;margin:0;padding:0;border:1px solid transparent;background-color:transparent;outline:none;cursor:pointer;position:relative;&:focus{:after{content:'';position:absolute;top:0;left:-7px;width:calc(100% + 14px);height:100%;border:4px solid ", ";border-radius:6px;}:before{content:'';position:absolute;z-index:2;top:2px;left:-5px;width:calc(100% + 10px);height:calc(100% - 4px);border:2px solid ", ";border-radius:4px;}}"],
|
|
15
|
-
|
|
16
|
+
})(["width:fit-content;height:100%;margin:0;padding:0;border:1px solid transparent;background-color:transparent;outline:none;cursor:pointer;position:relative;&:focus{:after{content:'';position:absolute;top:0;left:-7px;width:calc(100% + 14px);height:100%;border:4px solid ", ";border-radius:6px;}:before{content:'';position:absolute;z-index:2;top:2px;left:-5px;width:calc(100% + 10px);height:calc(100% - 4px);border:2px solid ", ";border-radius:4px;}}"], _ref2 => {
|
|
17
|
+
let {
|
|
18
|
+
theme
|
|
19
|
+
} = _ref2;
|
|
16
20
|
return theme.colors.brand[700];
|
|
17
|
-
},
|
|
18
|
-
|
|
21
|
+
}, _ref3 => {
|
|
22
|
+
let {
|
|
23
|
+
theme
|
|
24
|
+
} = _ref3;
|
|
19
25
|
return theme.colors.neutral['000'];
|
|
20
26
|
});
|
|
21
|
-
|
|
27
|
+
const Label = /*#__PURE__*/styled.p.withConfig({
|
|
22
28
|
componentId: "sc-1n5l527-3"
|
|
23
|
-
})(["color:", ";", ";font-size:16px;text-transform:uppercase;border-bottom:", ";margin:3px 5px 0 5px;:hover{", ";}"],
|
|
24
|
-
|
|
29
|
+
})(["color:", ";", ";font-size:16px;text-transform:uppercase;border-bottom:", ";margin:3px 5px 0 5px;:hover{", ";}"], _ref4 => {
|
|
30
|
+
let {
|
|
31
|
+
theme
|
|
32
|
+
} = _ref4;
|
|
25
33
|
return theme.colors.neutral['000'];
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
}, _ref5 => {
|
|
35
|
+
let {
|
|
36
|
+
theme,
|
|
37
|
+
isSelected
|
|
38
|
+
} = _ref5;
|
|
29
39
|
return "-webkit-text-stroke: 0.4px ".concat(isSelected ? theme.colors.neutral['000'] : 'transparent');
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
}, _ref6 => {
|
|
41
|
+
let {
|
|
42
|
+
isSelected,
|
|
43
|
+
isOnlyItem
|
|
44
|
+
} = _ref6;
|
|
33
45
|
return "2px solid ".concat(isSelected && !isOnlyItem ? '#FFF' : 'transparent');
|
|
34
|
-
},
|
|
35
|
-
|
|
46
|
+
}, _ref7 => {
|
|
47
|
+
let {
|
|
48
|
+
theme
|
|
49
|
+
} = _ref7;
|
|
36
50
|
return "-webkit-text-stroke: 0.4px ".concat(theme.colors.neutral['000']);
|
|
37
51
|
});
|
|
38
52
|
|
|
39
53
|
export { BreadcrumbItem, Label, LabelButton, Pipe };
|
|
40
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import { useContext } from 'react';
|
|
2
3
|
import { Grid } from '@elliemae/ds-grid';
|
|
3
4
|
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
4
|
-
import '../../defaultProps.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Logo
|
|
10
|
-
LogoWithBrand
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const GlobalHeaderTitle = () => {
|
|
7
|
+
const {
|
|
8
|
+
props: {
|
|
9
|
+
Logo,
|
|
10
|
+
LogoWithBrand
|
|
11
|
+
},
|
|
12
|
+
showIconOnly
|
|
13
|
+
} = useContext(GlobalHeaderContext);
|
|
14
|
+
return /*#__PURE__*/_jsx(Grid, {
|
|
14
15
|
alignItems: "center",
|
|
15
16
|
pr: showIconOnly ? '0px' : '36px',
|
|
16
17
|
cols: showIconOnly ? ['auto'] : ['auto', '1fr']
|
|
17
|
-
}, Logo && showIconOnly && /*#__PURE__*/
|
|
18
|
+
}, void 0, Logo && showIconOnly && /*#__PURE__*/_jsx(Logo, {}), LogoWithBrand && !showIconOnly && /*#__PURE__*/_jsx(LogoWithBrand, {}));
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
export { GlobalHeaderTitle };
|
|
21
|
-
//# sourceMappingURL=GlobalHeaderTitle.js.map
|
|
@@ -1,32 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import { useContext } from 'react';
|
|
2
3
|
import { Grid } from '@elliemae/ds-grid';
|
|
3
4
|
import { ToolbarItems } from './ToolbarItems.js';
|
|
4
5
|
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
5
|
-
import '../../outOfTheBox/AppPicker/AppPicker.js';
|
|
6
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
7
|
-
import '@elliemae/ds-app-picker';
|
|
8
|
-
import '@elliemae/ds-icons';
|
|
9
|
-
import './styles.js';
|
|
10
|
-
import 'styled-components';
|
|
11
|
-
import '../../outOfTheBox/PopupMenu/PopupMenu.js';
|
|
12
|
-
import '@elliemae/ds-popover';
|
|
13
|
-
import '../../outOfTheBox/PopupMenu/PopupMenuContent.js';
|
|
14
|
-
import '../../outOfTheBox/PopupMenu/styles.js';
|
|
15
|
-
import '../../defaultProps.js';
|
|
16
6
|
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
var _ToolbarItems;
|
|
8
|
+
const GlobalHeaderToolbar = () => {
|
|
9
|
+
const {
|
|
10
|
+
globalHeaderToolbarGrid
|
|
11
|
+
} = useContext(GlobalHeaderContext);
|
|
12
|
+
return /*#__PURE__*/_jsx(Grid, {
|
|
22
13
|
height: "100%",
|
|
23
14
|
alignItems: "center",
|
|
24
15
|
justifyContent: "center",
|
|
25
16
|
gutter: "xxs",
|
|
26
17
|
cols: globalHeaderToolbarGrid,
|
|
27
18
|
role: "toolbar"
|
|
28
|
-
}, /*#__PURE__*/
|
|
19
|
+
}, void 0, _ToolbarItems || (_ToolbarItems = /*#__PURE__*/_jsx(ToolbarItems, {})));
|
|
29
20
|
};
|
|
30
21
|
|
|
31
22
|
export { GlobalHeaderToolbar };
|
|
32
|
-
//# sourceMappingURL=GlobalHeaderToolbar.js.map
|
|
@@ -1,80 +1,73 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
+
import { useContext, useMemo } from 'react';
|
|
2
11
|
import { AppPicker } from '../../outOfTheBox/AppPicker/AppPicker.js';
|
|
3
12
|
import { PopupMenu } from '../../outOfTheBox/PopupMenu/PopupMenu.js';
|
|
4
13
|
import { Button } from './styles.js';
|
|
5
14
|
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
6
|
-
import '
|
|
7
|
-
import '@elliemae/ds-app-picker';
|
|
8
|
-
import '@elliemae/ds-icons';
|
|
9
|
-
import 'styled-components';
|
|
10
|
-
import '@elliemae/ds-popover';
|
|
11
|
-
import '../../outOfTheBox/PopupMenu/PopupMenuContent.js';
|
|
12
|
-
import '../../outOfTheBox/PopupMenu/styles.js';
|
|
13
|
-
import '../../defaultProps.js';
|
|
15
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
var ToolbarItems = function ToolbarItems() {
|
|
17
|
-
var _useContext = useContext(GlobalHeaderContext),
|
|
18
|
-
toolbar = _useContext.props.toolbar,
|
|
19
|
-
instanceUID = _useContext.instanceUID;
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20
|
+
const ToolbarItems = () => {
|
|
21
|
+
const {
|
|
22
|
+
props: {
|
|
23
|
+
toolbar
|
|
24
|
+
},
|
|
25
|
+
instanceUID
|
|
26
|
+
} = useContext(GlobalHeaderContext);
|
|
27
|
+
const itemsList = useMemo(() => toolbar === null || toolbar === void 0 ? void 0 : toolbar.map(item => {
|
|
28
|
+
var _Icon;
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
title: label,
|
|
37
|
-
Icon: Icon,
|
|
38
|
-
options: options,
|
|
39
|
-
closeOnClick: closeOnClick,
|
|
40
|
-
key: "".concat(instanceUID, "-ds-popup-menu-").concat(label)
|
|
41
|
-
});
|
|
30
|
+
const {
|
|
31
|
+
Icon,
|
|
32
|
+
type,
|
|
33
|
+
onClick,
|
|
34
|
+
componentProps,
|
|
35
|
+
label
|
|
36
|
+
} = item;
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
sectionTitle: sectionTitle,
|
|
57
|
-
customSectionTitle: customSectionTitle,
|
|
58
|
-
actionRef: actionRef,
|
|
59
|
-
key: "".concat(instanceUID, "-ds-app-picker-").concat(label),
|
|
60
|
-
onKeyDown: onKeyDown
|
|
61
|
-
});
|
|
38
|
+
switch (type) {
|
|
39
|
+
case 'ds-popup-menu':
|
|
40
|
+
const {
|
|
41
|
+
options,
|
|
42
|
+
closeOnClick
|
|
43
|
+
} = componentProps;
|
|
44
|
+
return /*#__PURE__*/_jsx(PopupMenu, {
|
|
45
|
+
onClick: onClick,
|
|
46
|
+
title: label,
|
|
47
|
+
Icon: Icon,
|
|
48
|
+
options: options,
|
|
49
|
+
closeOnClick: closeOnClick
|
|
50
|
+
}, "".concat(instanceUID, "-ds-popup-menu-").concat(label));
|
|
62
51
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
52
|
+
case 'ds-app-picker':
|
|
53
|
+
return /*#__PURE__*/jsx(AppPicker, _objectSpread({
|
|
54
|
+
label: label
|
|
55
|
+
}, componentProps), "".concat(instanceUID, "-ds-app-picker-").concat(label));
|
|
56
|
+
|
|
57
|
+
default:
|
|
58
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
59
|
+
onClick: onClick,
|
|
60
|
+
title: label,
|
|
61
|
+
"data-testid": "gh-toolbar-item"
|
|
62
|
+
}, "".concat(instanceUID, "-ds-toolbar-button-").concat(label), _Icon || (_Icon = /*#__PURE__*/_jsx(Icon, {
|
|
63
|
+
fill: "#FFF",
|
|
64
|
+
size: "m"
|
|
65
|
+
})));
|
|
66
|
+
}
|
|
67
|
+
}), [toolbar, instanceUID]);
|
|
68
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
69
|
+
children: itemsList
|
|
70
|
+
});
|
|
77
71
|
};
|
|
78
72
|
|
|
79
73
|
export { ToolbarItems };
|
|
80
|
-
//# sourceMappingURL=ToolbarItems.js.map
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const Button = /*#__PURE__*/styled.button.withConfig({
|
|
4
4
|
componentId: "sc-1gqj0i3-0"
|
|
5
|
-
})(["height:40px;width:40px;border:none;background-color:transparent;cursor:pointer;position:relative;outline:none;&:hover:not(:focus){background-color:", ";outline:none;}&:focus{:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;border:4px solid ", ";border-radius:4px;}:before{content:'';position:absolute;z-index:2;top:2px;left:2px;width:calc(100% - 4px);height:calc(100% - 4px);border:2px solid ", ";border-radius:4px;}}"],
|
|
6
|
-
|
|
5
|
+
})(["height:40px;width:40px;border:none;background-color:transparent;cursor:pointer;position:relative;outline:none;&:hover:not(:focus){background-color:", ";outline:none;}&:focus{:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;border:4px solid ", ";border-radius:4px;}:before{content:'';position:absolute;z-index:2;top:2px;left:2px;width:calc(100% - 4px);height:calc(100% - 4px);border:2px solid ", ";border-radius:4px;}}"], _ref => {
|
|
6
|
+
let {
|
|
7
|
+
theme
|
|
8
|
+
} = _ref;
|
|
7
9
|
return theme.colors.brand[700];
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
+
}, _ref2 => {
|
|
11
|
+
let {
|
|
12
|
+
theme
|
|
13
|
+
} = _ref2;
|
|
10
14
|
return theme.colors.brand[700];
|
|
11
|
-
},
|
|
12
|
-
|
|
15
|
+
}, _ref3 => {
|
|
16
|
+
let {
|
|
17
|
+
theme
|
|
18
|
+
} = _ref3;
|
|
13
19
|
return theme.colors.neutral['000'];
|
|
14
20
|
});
|
|
15
21
|
|
|
16
22
|
export { Button };
|
|
17
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import { useMemo } from 'react';
|
|
3
8
|
import { defaultProps } from '../defaultProps.js';
|
|
@@ -5,15 +10,14 @@ import { defaultProps } from '../defaultProps.js';
|
|
|
5
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6
11
|
|
|
7
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, [toolbar, breadcrumb, Logo, LogoWithBrand]);
|
|
13
|
+
const useGetPropsWithDefaults = props => {
|
|
14
|
+
const {
|
|
15
|
+
toolbar,
|
|
16
|
+
breadcrumb,
|
|
17
|
+
Logo,
|
|
18
|
+
LogoWithBrand
|
|
19
|
+
} = props;
|
|
20
|
+
return useMemo(() => _objectSpread(_objectSpread({}, defaultProps), props), [toolbar, breadcrumb, Logo, LogoWithBrand]);
|
|
16
21
|
};
|
|
17
22
|
|
|
18
23
|
export { useGetPropsWithDefaults };
|
|
19
|
-
//# sourceMappingURL=useGetPropsWithDefaults.js.map
|
|
@@ -1,43 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
2
|
import React, { useState, useMemo } from 'react';
|
|
4
3
|
import { uid } from 'uid';
|
|
5
4
|
import { useGetPropsWithDefaults } from './useGetPropsWithDefaults.js';
|
|
6
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import '../defaultProps.js';
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const useGlobalHeader = props => {
|
|
7
|
+
const [showIconOnly, setShowIconOnly] = useState(false);
|
|
8
|
+
const instanceUID = useMemo(() => uid(5), []);
|
|
9
|
+
const globalHeaderToolbarGrid = useMemo(() => {
|
|
10
|
+
var _props$toolbar$length, _props$toolbar;
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
return uid(5);
|
|
17
|
-
}, []);
|
|
18
|
-
var globalHeaderToolbarGrid = useMemo(function () {
|
|
19
|
-
return props.toolbar.map(function () {
|
|
20
|
-
return '1fr';
|
|
21
|
-
});
|
|
12
|
+
return new Array((_props$toolbar$length = props === null || props === void 0 ? void 0 : (_props$toolbar = props.toolbar) === null || _props$toolbar === void 0 ? void 0 : _props$toolbar.length) !== null && _props$toolbar$length !== void 0 ? _props$toolbar$length : 0).fill('1fr');
|
|
22
13
|
}, [props.toolbar]);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
const globalHeaderBreadcrumbGrid = useMemo(() => {
|
|
15
|
+
var _props$breadcrumb$len, _props$breadcrumb;
|
|
16
|
+
|
|
17
|
+
return ['auto', ...new Array((_props$breadcrumb$len = props === null || props === void 0 ? void 0 : (_props$breadcrumb = props.breadcrumb) === null || _props$breadcrumb === void 0 ? void 0 : _props$breadcrumb.length) !== null && _props$breadcrumb$len !== void 0 ? _props$breadcrumb$len : 0).fill('auto'), '1fr'];
|
|
27
18
|
}, [props.breadcrumb]);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
}, [propsWithDefaults, showIconOnly, instanceUID, globalHeaderToolbarGrid, globalHeaderBreadcrumbGrid]);
|
|
19
|
+
const propsWithDefaults = useGetPropsWithDefaults(props);
|
|
20
|
+
const ctx = React.useMemo(() => ({
|
|
21
|
+
props: propsWithDefaults,
|
|
22
|
+
showIconOnly,
|
|
23
|
+
setShowIconOnly,
|
|
24
|
+
instanceUID,
|
|
25
|
+
globalHeaderToolbarGrid,
|
|
26
|
+
globalHeaderBreadcrumbGrid
|
|
27
|
+
}), [propsWithDefaults, showIconOnly, instanceUID, globalHeaderToolbarGrid, globalHeaderBreadcrumbGrid]);
|
|
39
28
|
return ctx;
|
|
40
29
|
};
|
|
41
30
|
|
|
42
31
|
export { useGlobalHeader };
|
|
43
|
-
//# sourceMappingURL=useGlobalHeader.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
4
|
import { throwLogoError, throwBreadcrumbItemError, isValidToolbarType, throwToolbarItemGenericError, isObject, throwToolbarPopupItemError, throwToolbarAppPickerItemError } from './validateHelpers.js';
|
|
2
|
-
import '@babel/runtime/helpers/esm/typeof';
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
const validatePopupItem = componentProps => {
|
|
5
7
|
if (componentProps.options && !Array.isArray(componentProps.options)) {
|
|
6
8
|
throwToolbarPopupItemError('options', componentProps.options);
|
|
7
9
|
}
|
|
@@ -11,7 +13,7 @@ var validatePopupItem = function validatePopupItem(componentProps) {
|
|
|
11
13
|
}
|
|
12
14
|
};
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
const validateAppPickerItem = componentProps => {
|
|
15
17
|
if (componentProps.apps && !Array.isArray(componentProps.apps)) {
|
|
16
18
|
throwToolbarAppPickerItemError('apps', componentProps.apps);
|
|
17
19
|
}
|
|
@@ -29,7 +31,7 @@ var validateAppPickerItem = function validateAppPickerItem(componentProps) {
|
|
|
29
31
|
}
|
|
30
32
|
};
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
const validateGenericToolbarItem = item => {
|
|
33
35
|
if (item.label && typeof item.label !== 'string') {
|
|
34
36
|
throwToolbarItemGenericError('label', item.label);
|
|
35
37
|
}
|
|
@@ -44,11 +46,13 @@ var validateGenericToolbarItem = function validateGenericToolbarItem(item) {
|
|
|
44
46
|
}
|
|
45
47
|
};
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const useValidateProps = props => {
|
|
50
|
+
const {
|
|
51
|
+
breadcrumb,
|
|
52
|
+
toolbar,
|
|
53
|
+
Logo,
|
|
54
|
+
LogoWithBrand
|
|
55
|
+
} = props;
|
|
52
56
|
|
|
53
57
|
if (Logo && typeof Logo !== 'function') {
|
|
54
58
|
throwLogoError('Logo', Logo);
|
|
@@ -58,7 +62,7 @@ var useValidateProps = function useValidateProps(props) {
|
|
|
58
62
|
throwLogoError('LogoWithBrand', LogoWithBrand);
|
|
59
63
|
}
|
|
60
64
|
|
|
61
|
-
breadcrumb.forEach(
|
|
65
|
+
breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.forEach(breadcrumbItem => {
|
|
62
66
|
if (breadcrumbItem.label && typeof breadcrumbItem.label !== 'string') {
|
|
63
67
|
throwBreadcrumbItemError('label', breadcrumbItem.label);
|
|
64
68
|
}
|
|
@@ -75,7 +79,7 @@ var useValidateProps = function useValidateProps(props) {
|
|
|
75
79
|
throwBreadcrumbItemError('isSelected', breadcrumbItem.isSelected);
|
|
76
80
|
}
|
|
77
81
|
});
|
|
78
|
-
toolbar.forEach(
|
|
82
|
+
toolbar === null || toolbar === void 0 ? void 0 : toolbar.forEach(toolbarItem => {
|
|
79
83
|
validateGenericToolbarItem(toolbarItem);
|
|
80
84
|
|
|
81
85
|
if (toolbarItem.type) {
|
|
@@ -97,4 +101,3 @@ var useValidateProps = function useValidateProps(props) {
|
|
|
97
101
|
};
|
|
98
102
|
|
|
99
103
|
export { useValidateProps };
|
|
100
|
-
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var breadcrumbProps = {
|
|
1
|
+
const breadcrumbProps = {
|
|
4
2
|
label: 'string',
|
|
5
3
|
onClick: 'function',
|
|
6
4
|
hasNext: 'boolean',
|
|
7
5
|
isSelected: 'boolean'
|
|
8
6
|
};
|
|
9
|
-
|
|
7
|
+
const toolbarProps = {
|
|
10
8
|
label: 'string',
|
|
11
9
|
type: '"ds-app-picker" or "ds-popup-menu"',
|
|
12
10
|
componentProps: 'object',
|
|
@@ -19,33 +17,28 @@ var toolbarProps = {
|
|
|
19
17
|
sectionTitle: 'string',
|
|
20
18
|
customSectionTitle: 'string'
|
|
21
19
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
var getVariableType = function getVariableType(arg) {
|
|
20
|
+
const isObject = obj => typeof obj === 'object' && !!obj && !Array.isArray(obj);
|
|
21
|
+
const getVariableType = arg => {
|
|
26
22
|
if (Array.isArray(arg)) return 'array';
|
|
27
23
|
if (arg === null) return 'null';
|
|
28
24
|
if (arg === undefined) return 'undefined';
|
|
29
|
-
return
|
|
30
|
-
};
|
|
31
|
-
var isValidToolbarType = function isValidToolbarType(string) {
|
|
32
|
-
return string === 'ds-app-picker' || string === 'ds-popup-menu';
|
|
25
|
+
return typeof arg;
|
|
33
26
|
};
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
const isValidToolbarType = string => string === 'ds-app-picker' || string === 'ds-popup-menu';
|
|
28
|
+
const throwBreadcrumbItemError = (validPropKey, invalidProp) => {
|
|
29
|
+
throw new Error("You are trying to pass a not valid \"".concat(validPropKey, "\" property for a breadcrumb item, please provide a valid type.\n\n Received: ").concat(invalidProp, " (").concat(typeof invalidProp, ")\n Expected: (").concat(breadcrumbProps[validPropKey], ")\n "));
|
|
36
30
|
};
|
|
37
|
-
|
|
31
|
+
const throwToolbarPopupItemError = (validPropKey, invalidProp) => {
|
|
38
32
|
throw new Error("You are trying to pass a not valid \"".concat(validPropKey, "\" property inside componentProps for a ds-popup-menu \n toolbar item, please provide a valid type.\n\n Received: ").concat(invalidProp, " (").concat(getVariableType(invalidProp), ")\n Expected: (").concat(toolbarProps[validPropKey], ")\n "));
|
|
39
33
|
};
|
|
40
|
-
|
|
34
|
+
const throwToolbarAppPickerItemError = (validPropKey, invalidProp) => {
|
|
41
35
|
throw new Error("You are trying to pass a not valid \"".concat(validPropKey, "\" property inside componentProps for a ds-app-picker \n toolbar item, please provide a valid type.\n\n Received: ").concat(invalidProp, " (").concat(getVariableType(invalidProp), ")\n Expected: (").concat(toolbarProps[validPropKey], ")\n "));
|
|
42
36
|
};
|
|
43
|
-
|
|
37
|
+
const throwToolbarItemGenericError = (validPropKey, invalidProp) => {
|
|
44
38
|
throw new Error("You are trying to pass a not valid \"".concat(validPropKey, "\" property for a toolbar item, please provide a valid type.\n\n Received: ").concat(invalidProp, " (").concat(getVariableType(invalidProp), ")\n Expected: (").concat(toolbarProps[validPropKey], ")\n "));
|
|
45
39
|
};
|
|
46
|
-
|
|
40
|
+
const throwLogoError = (validPropKey, invalidProp) => {
|
|
47
41
|
throw new Error("You are trying to pass a not valid \"".concat(validPropKey, "\" property for a global header, \n remember to provide both Logo and LogoWithBrand properties with a valid type.\n\n Received: ").concat(invalidProp, " (").concat(getVariableType(invalidProp), ").\n Expected: (react component).\n "));
|
|
48
42
|
};
|
|
49
43
|
|
|
50
44
|
export { breadcrumbProps, getVariableType, isObject, isValidToolbarType, throwBreadcrumbItemError, throwLogoError, throwToolbarAppPickerItemError, throwToolbarItemGenericError, throwToolbarPopupItemError, toolbarProps };
|
|
51
|
-
//# sourceMappingURL=validateHelpers.js.map
|
package/esm/defaultProps.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const emptyComp = () => null;
|
|
2
|
+
|
|
3
|
+
const defaultProps = {
|
|
2
4
|
breadcrumb: [],
|
|
3
5
|
toolbar: [],
|
|
4
|
-
LogoWithBrand:
|
|
5
|
-
Logo:
|
|
6
|
+
LogoWithBrand: emptyComp,
|
|
7
|
+
Logo: emptyComp
|
|
6
8
|
};
|
|
7
9
|
|
|
8
10
|
export { defaultProps };
|
|
9
|
-
//# sourceMappingURL=defaultProps.js.map
|
package/esm/index.d.js
CHANGED