@learningpool/ui 1.15.5 → 1.16.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/assets/Images.js +7 -18
- package/components/atoms/Autocomplete/Autocomplete.js +3 -14
- package/components/atoms/Button/Button.js +2 -13
- package/components/atoms/Checkbox/Checkbox.js +3 -26
- package/components/atoms/IconButton/IconButton.js +2 -13
- package/components/atoms/Radio/Radio.js +3 -26
- package/components/atoms/Select/Select.js +3 -26
- package/components/atoms/Slider/Slider.js +3 -26
- package/components/atoms/Switch/Switch.js +3 -26
- package/components/atoms/TextField/TextField.js +2 -13
- package/components/atoms/ToggleButton/ToggleButton.js +3 -26
- package/components/datadisplay/Avatar/Avatar.js +13 -28
- package/components/datadisplay/Chip/Chip.js +3 -26
- package/components/datadisplay/List/List.js +2 -13
- package/components/feedback/Alert/Alert.js +3 -26
- package/components/landmarks/Header/Header.js +15 -41
- package/components/landmarks/Header/HeaderActionButtons.d.ts +1 -2
- package/components/landmarks/Header/HeaderActionButtons.js +22 -33
- package/components/landmarks/Header/HeaderStyles.js +54 -11
- package/components/navigation/Drawer/Drawer.js +5 -31
- package/components/navigation/MobileNavigation/MobileNavigation.js +70 -82
- package/components/navigation/MobileNavigation/MobileNavigationAvatar.js +75 -83
- package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +102 -52
- package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +71 -13
- package/components/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +1 -1
- package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +41 -68
- package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +34 -18
- package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +133 -20
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +22 -45
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +8 -19
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +151 -52
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +171 -50
- package/components/navigation/MobileNavigation/MobileNavigationMotion.js +11 -11
- package/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.js +11 -15
- package/components/navigation/MobileNavigation/MobileNavigationSearch.d.ts +1 -2
- package/components/navigation/MobileNavigation/MobileNavigationSearch.js +25 -34
- package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +34 -18
- package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.js +47 -9
- package/components/navigation/MobileNavigation/MobileNavigationStyles.js +262 -66
- package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +21 -20
- package/components/navigation/MobileNavigation/MobileNavigationToggleX.js +21 -20
- package/components/navigation/VerticalNavigation/VerticalNavigation.js +150 -185
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatar.js +50 -61
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +102 -52
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +86 -14
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +27 -51
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +15 -28
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +135 -39
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +167 -29
- package/components/navigation/VerticalNavigation/VerticalNavigationMotion.js +11 -11
- package/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +34 -18
- package/components/navigation/VerticalNavigation/VerticalNavigationStyles.js +236 -42
- package/components/navigation/helpers.d.ts +1 -2
- package/components/navigation/helpers.js +28 -32
- package/components/pages/ErrorPage/ErrorPage.js +6 -17
- package/components/pages/ErrorPage/ErrorPageStyles.js +13 -18
- package/components/pages/SideInSide/SideInSide.js +12 -23
- package/components/pages/SideInSide/SideInSideStyles.js +6 -6
- package/components/stream/AppHub/AppHub.js +13 -42
- package/components/stream/AppHub/AppHubAdvertStyles.js +24 -8
- package/components/stream/AppHub/AppHubBannerAdvert.d.ts +1 -2
- package/components/stream/AppHub/AppHubBannerAdvert.js +9 -20
- package/components/stream/AppHub/AppHubCustom.js +8 -19
- package/components/stream/AppHub/AppHubCustomStyles.d.ts +1 -1
- package/components/stream/AppHub/AppHubCustomStyles.js +78 -18
- package/components/stream/AppHub/AppHubProduct.js +26 -48
- package/components/stream/AppHub/AppHubProductStyles.js +104 -19
- package/components/stream/AppHub/AppHubStyles.js +31 -11
- package/components/stream/AppHub/constants.d.ts +1 -2
- package/components/stream/AppHub/constants.js +14 -14
- package/components/stream/AppSwitcher/AppSwitcher.js +225 -316
- package/components/stream/AppSwitcher/AppSwitcherItem.js +11 -22
- package/components/stream/AppSwitcher/AppSwitcherStyles.js +337 -42
- package/components/stream/AppSwitcher/AppSwitcherStylesStandalone.js +255 -21
- package/components/stream/AppSwitcher/PromotionalCampaignItem.js +7 -19
- package/components/stream/AppSwitcher/constants.js +3 -3
- package/lang/en-us.js +1 -1
- package/package.json +7 -2
- package/utils/constants.d.ts +7 -0
- package/utils/constants.js +11 -4
- package/utils/dataAttributes.js +1 -1
- package/utils/helpers.js +33 -40
- package/utils/hooks.js +10 -11
- package/utils/theme.js +26 -19
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
24
2
|
import { defaultMessages } from '../../../lang/en-us';
|
|
25
3
|
import AppHubItem from './AppHubProduct';
|
|
26
4
|
import AppHubCustom from './AppHubCustom';
|
|
@@ -28,12 +6,11 @@ import { AppHubPanel, AppHubTitle, AppHubHeader, AppHubRow } from './AppHubStyle
|
|
|
28
6
|
import Grid from '@mui/material/Unstable_Grid2';
|
|
29
7
|
import { Constants } from './constants';
|
|
30
8
|
import { renderBannerAdvertRow } from './AppHubBannerAdvert';
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var type = rowData.type, items = rowData.items, title = rowData.title, addButton = rowData.addButton;
|
|
9
|
+
const AppHub = (props) => {
|
|
10
|
+
const { isPageLayout, localization, customLinkBgColor, data } = props;
|
|
11
|
+
const messages = { ...defaultMessages, ...localization };
|
|
12
|
+
const renderRow = (rowData, rowIndex) => {
|
|
13
|
+
const { type, items, title, addButton } = rowData;
|
|
37
14
|
switch (type) {
|
|
38
15
|
case Constants.DataRowType.BannerAdvert: {
|
|
39
16
|
return (renderBannerAdvertRow(rowData, rowIndex));
|
|
@@ -41,22 +18,16 @@ var AppHub = function (props) {
|
|
|
41
18
|
case Constants.DataRowType.Product: {
|
|
42
19
|
return (_jsxs(AppHubRow, { children: [title && _jsx(AppHubHeader
|
|
43
20
|
// @ts-ignore
|
|
44
|
-
,
|
|
21
|
+
, {
|
|
45
22
|
// @ts-ignore
|
|
46
|
-
component: isPageLayout ? 'h2' : 'div'
|
|
47
|
-
var subtitle = _a.subtitle, shortName = _a.shortName, internalName = _a.internalName, url = _a.url, children = _a.children, rest = __rest(_a, ["subtitle", "shortName", "internalName", "url", "children"]);
|
|
48
|
-
return (_jsxs(Grid, __assign({ xs: 12, sm: 6, md: 4 }, { children: [url && (_jsx(AppHubItem, __assign({ internalName: internalName, shortName: shortName, subtitle: subtitle, url: url }, rest))), children && (_jsx(AppHubItem, { internalName: internalName, shortName: shortName, subtitle: subtitle, options: children }))] }), "".concat(shortName, "_").concat(rowIndex, "_").concat(index)));
|
|
49
|
-
}) }))] }, "row_".concat(rowIndex)));
|
|
23
|
+
component: isPageLayout ? 'h2' : 'div', children: title }), _jsx(Grid, { container: true, spacing: { xs: 2, md: 3 }, rowSpacing: { xs: 3, md: 4 }, columns: { xs: 12 }, children: items.map(({ subtitle, shortName, internalName, url, children, ...rest }, index) => (_jsxs(Grid, { xs: 12, sm: 6, md: 4, children: [url && (_jsx(AppHubItem, { internalName: internalName, shortName: shortName, subtitle: subtitle, url: url, ...rest })), children && (_jsx(AppHubItem, { internalName: internalName, shortName: shortName, subtitle: subtitle, options: children }))] }, `${shortName}_${rowIndex}_${index}`))) })] }, `row_${rowIndex}`));
|
|
50
24
|
}
|
|
51
25
|
case Constants.DataRowType.CustomLink: {
|
|
52
26
|
return (_jsxs(AppHubRow, { children: [title && _jsx(AppHubHeader
|
|
53
27
|
// @ts-ignore
|
|
54
|
-
,
|
|
28
|
+
, {
|
|
55
29
|
// @ts-ignore
|
|
56
|
-
component: isPageLayout ? 'h2' : 'div'
|
|
57
|
-
var name = _a.name, url = _a.url, icon = _a.icon;
|
|
58
|
-
return (_jsx(Grid, __assign({ xs: 6, sm: 4, md: 2 }, { children: url && (_jsx(AppHubCustom, { name: name, customLinkBgColor: customLinkBgColor, url: url, icon: icon })) }), "".concat(name, "_").concat(rowIndex, "_").concat(index)));
|
|
59
|
-
}), addButton && addButton.order === Constants.AddButtonOrder.End && (_jsx(Grid, __assign({ xs: 6, sm: 4, md: 2 }, { children: _jsx(AppHubCustom, { isAddButton: true, name: (_b = addButton.title) !== null && _b !== void 0 ? _b : messages['add-item'], customLinkBgColor: customLinkBgColor, url: addButton.url, icon: addButton.icon }) })))] }))] }, "row_".concat(rowIndex)));
|
|
30
|
+
component: isPageLayout ? 'h2' : 'div', children: title }), _jsxs(Grid, { container: true, spacing: { xs: 2, md: 3 }, children: [addButton && addButton.order === Constants.AddButtonOrder.Start && (_jsx(Grid, { xs: 6, sm: 4, md: 2, children: _jsx(AppHubCustom, { isAddButton: true, name: addButton.title ?? messages['add-item'], customLinkBgColor: customLinkBgColor, url: addButton.url, icon: addButton.icon }) })), items.map(({ name, url, icon }, index) => (_jsx(Grid, { xs: 6, sm: 4, md: 2, children: url && (_jsx(AppHubCustom, { name: name, customLinkBgColor: customLinkBgColor, url: url, icon: icon })) }, `${name}_${rowIndex}_${index}`))), addButton && addButton.order === Constants.AddButtonOrder.End && (_jsx(Grid, { xs: 6, sm: 4, md: 2, children: _jsx(AppHubCustom, { isAddButton: true, name: addButton.title ?? messages['add-item'], customLinkBgColor: customLinkBgColor, url: addButton.url, icon: addButton.icon }) }))] })] }, `row_${rowIndex}`));
|
|
60
31
|
}
|
|
61
32
|
default: {
|
|
62
33
|
console.log('no items');
|
|
@@ -68,10 +39,10 @@ var AppHub = function (props) {
|
|
|
68
39
|
console.log('No data available');
|
|
69
40
|
return null;
|
|
70
41
|
}
|
|
71
|
-
return (_jsxs(AppHubPanel,
|
|
42
|
+
return (_jsxs(AppHubPanel, { role: isPageLayout ? 'main' : '', children: [_jsx(AppHubTitle
|
|
72
43
|
// @ts-ignore
|
|
73
|
-
,
|
|
44
|
+
, {
|
|
74
45
|
// @ts-ignore
|
|
75
|
-
component: isPageLayout ? 'h1' : 'div'
|
|
46
|
+
component: isPageLayout ? 'h1' : 'div', children: messages['stream-hub-welcome'] }), data && data.map((row, rowIndex) => renderRow(row, rowIndex))] }));
|
|
76
47
|
};
|
|
77
48
|
export default AppHub;
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
import { styled } from '@mui/material/styles';
|
|
6
2
|
import { Paper } from '@mui/material';
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
export const StyledAdvertPaper = styled(Paper) `
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 138px;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
position: relative;
|
|
8
|
+
box-shadow: 0 0 0 1px #ddd;
|
|
9
|
+
border-radius: 10px;
|
|
10
|
+
border: #ddd;
|
|
11
|
+
transition: all 180ms ease;
|
|
12
|
+
`;
|
|
13
|
+
export const StyledAdvertLink = styled('a') `
|
|
14
|
+
display: block;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
`;
|
|
18
|
+
export const StyledAdvertImage = styled('img') `
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 50%;
|
|
21
|
+
left: 50%;
|
|
22
|
+
transform: translate(-50%, -50%);
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
object-fit: cover;
|
|
26
|
+
`;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { IApplicationHubRowProps } from '../../../types/components/stream/AppHub';
|
|
3
|
-
export declare const renderBannerAdvertRow: (rowData: IApplicationHubRowProps, rowIndex: number) => JSX.Element | null;
|
|
2
|
+
export declare const renderBannerAdvertRow: (rowData: IApplicationHubRowProps, rowIndex: number) => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
13
2
|
import { useState } from 'react';
|
|
14
3
|
import { AppHubRow } from './AppHubStyles';
|
|
15
4
|
import Grid from '@mui/material/Unstable_Grid2';
|
|
16
5
|
import { StyledAdvertPaper, StyledAdvertLink, StyledAdvertImage } from './AppHubAdvertStyles';
|
|
17
6
|
import { defaultMessages } from '../../../lang/en-us';
|
|
18
|
-
|
|
7
|
+
const addUtmParams = (baseUrl, source, medium, campaign) => {
|
|
19
8
|
try {
|
|
20
|
-
|
|
9
|
+
const url = new URL(baseUrl);
|
|
21
10
|
url.searchParams.append('utm_source', source);
|
|
22
11
|
url.searchParams.append('utm_medium', medium);
|
|
23
12
|
url.searchParams.append('utm_campaign', campaign);
|
|
@@ -28,14 +17,14 @@ var addUtmParams = function (baseUrl, source, medium, campaign) {
|
|
|
28
17
|
return baseUrl;
|
|
29
18
|
}
|
|
30
19
|
};
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
export const renderBannerAdvertRow = (rowData, rowIndex) => {
|
|
21
|
+
const { items } = rowData;
|
|
22
|
+
const [hasValidImage, setHasValidImage] = useState(true);
|
|
23
|
+
const handleImageError = () => {
|
|
35
24
|
setHasValidImage(false);
|
|
36
25
|
};
|
|
37
|
-
|
|
26
|
+
const validItems = items.filter((item) => item.hubImageUrl && item.basePromoUrl);
|
|
38
27
|
if (!hasValidImage || validItems.length === 0)
|
|
39
28
|
return null;
|
|
40
|
-
return (_jsx(AppHubRow, { children: _jsx(Grid,
|
|
29
|
+
return (_jsx(AppHubRow, { children: _jsx(Grid, { container: true, spacing: 2, children: validItems.map((item, index) => (_jsx(Grid, { xs: 12, children: _jsx(StyledAdvertPaper, { elevation: 0, children: _jsx(StyledAdvertLink, { href: addUtmParams(item.basePromoUrl, 'hub', 'hub_dashboard_banner_advert', item.name), target: "_blank", children: _jsx(StyledAdvertImage, { src: item.hubImageUrl, alt: item.altText || defaultMessages['banner-image-alt-text'], onError: handleImageError }) }) }) }, index))) }) }, `row_${rowIndex}`));
|
|
41
30
|
};
|
|
@@ -1,31 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
13
2
|
import { StyledPaper, StyledBoxWrap, StyledTypography, StyledAvatar, StyledLink, StyledAddCircleOutlineIcon } from './AppHubCustomStyles';
|
|
14
3
|
import { handleAvatarInitials } from '../../../utils/helpers';
|
|
15
4
|
// Bug in the naming of the icons on the CDN
|
|
16
|
-
export
|
|
5
|
+
export const LogoVariants = {
|
|
17
6
|
Default: 'icon',
|
|
18
7
|
Solid: 'icon-solid',
|
|
19
8
|
Outlined: 'icon-outlined',
|
|
20
9
|
White: 'icon-white'
|
|
21
10
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return (_jsx(StyledPaper,
|
|
11
|
+
const AppHubCustom = (props) => {
|
|
12
|
+
const { name, url, isAddButton, customLinkBgColor, icon } = props;
|
|
13
|
+
const addIcon = icon ?? _jsx(StyledAddCircleOutlineIcon, {});
|
|
14
|
+
return (_jsx(StyledPaper, { elevation: 0, children: _jsx(StyledLink, { href: url, target: !isAddButton ? '_blank' : '_self', underline: 'none', children: _jsxs(StyledBoxWrap, { children: [!isAddButton && (_jsx(StyledAvatar, { children: icon ?? (name ? handleAvatarInitials(name) : null), customLinkBgColor: customLinkBgColor })), isAddButton && addIcon, _jsx(StyledTypography
|
|
26
15
|
// @ts-ignore
|
|
27
|
-
,
|
|
16
|
+
, {
|
|
28
17
|
// @ts-ignore
|
|
29
|
-
component: 'div'
|
|
18
|
+
component: 'div', children: name })] }) }) }));
|
|
30
19
|
};
|
|
31
20
|
export default AppHubCustom;
|
|
@@ -20,7 +20,7 @@ export declare const StyledBoxWrap: import("@emotion/styled").StyledComponent<im
|
|
|
20
20
|
export declare const StyledLink: import("@emotion/styled").StyledComponent<Omit<import("@mui/material/Link").LinkBaseProps, "classes"> & {
|
|
21
21
|
children?: import("react").ReactNode;
|
|
22
22
|
classes?: Partial<import("@mui/material/Link").LinkClasses> | undefined;
|
|
23
|
-
color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined> | ((theme: import("@mui/material/styles").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined>);
|
|
23
|
+
color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.Color | undefined> | ((theme: import("@mui/material/styles").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<readonly string[] | import("csstype").Property.Color | undefined>);
|
|
24
24
|
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
25
25
|
TypographyClasses?: (Partial<import("@mui/material/Typography").TypographyClasses> & Partial<import("@mui/material/styles").ClassNameMap<never>>) | undefined;
|
|
26
26
|
underline?: "none" | "always" | "hover" | undefined;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
import { styled } from '@mui/material/styles';
|
|
6
2
|
import Paper from '@mui/material/Paper';
|
|
7
3
|
import Box from '@mui/material/Box';
|
|
@@ -9,22 +5,86 @@ import Avatar from '@mui/material/Avatar';
|
|
|
9
5
|
import Typography from '@mui/material/Typography';
|
|
10
6
|
import Link from '@mui/material/Link';
|
|
11
7
|
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline';
|
|
12
|
-
export
|
|
8
|
+
export const StyledPaper = styled(Paper) `
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
background: transparent;
|
|
13
|
+
border-radius: 10px;
|
|
14
|
+
border: none;
|
|
15
|
+
transition: all 180ms ease;
|
|
16
|
+
|
|
17
|
+
&:hover {
|
|
18
|
+
background: ${props => props.theme.palette.mode === 'dark'
|
|
13
19
|
? 'rgba(0,0,0,.3)'
|
|
14
|
-
: '#f5f5f5';
|
|
20
|
+
: '#f5f5f5'};
|
|
21
|
+
box-shadow: 0 0 0 1px ${props => props.theme.palette.mode === 'dark'
|
|
15
22
|
? 'rgba(255,255,255,.2)'
|
|
16
|
-
: '#ccc'
|
|
23
|
+
: '#ccc'}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:focus-within {
|
|
27
|
+
background: ${props => props.theme.palette.mode === 'dark'
|
|
17
28
|
? 'rgba(0,0,0,.3)'
|
|
18
|
-
: '#f5f5f5'
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
: '#f5f5f5'};
|
|
30
|
+
box-shadow: none;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
export const StyledBoxWrap = styled(Box) `
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
padding: .5rem;
|
|
39
|
+
text-align: center;
|
|
40
|
+
`;
|
|
41
|
+
export const StyledLink = styled(Link) `
|
|
42
|
+
height: 100%;
|
|
43
|
+
display: block;
|
|
44
|
+
border-radius: 10px;
|
|
45
|
+
box-shadow: 0 0 0 0 transparent;
|
|
46
|
+
transition: all 180ms ease;
|
|
47
|
+
|
|
48
|
+
&:focus-visible {
|
|
49
|
+
outline: none;
|
|
50
|
+
box-shadow: 0 0 0 4px ${props => props.theme.palette.mode === 'dark'
|
|
21
51
|
? 'rgba(255,255,255,.5)'
|
|
22
|
-
: props.theme.palette.primary.main
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
52
|
+
: props.theme.palette.primary.main};
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
export const StyledAvatar = styled(Avatar, {
|
|
56
|
+
shouldForwardProp: (prop) => prop !== 'customLinkBgColor'
|
|
57
|
+
}) `
|
|
58
|
+
width: 85px;
|
|
59
|
+
height: 85px;
|
|
60
|
+
font-size: 2rem;
|
|
61
|
+
font-weight: 700;
|
|
62
|
+
background: ${props => props.customLinkBgColor || props.theme.palette.primary.dark};
|
|
63
|
+
color: ${props => props.customLinkBgColor
|
|
26
64
|
? props.theme.palette.getContrastText(props.customLinkBgColor)
|
|
27
|
-
: props.theme.palette.getContrastText(props.theme.palette.primary.dark)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
65
|
+
: props.theme.palette.getContrastText(props.theme.palette.primary.dark)};
|
|
66
|
+
|
|
67
|
+
.MuiSvgIcon-root {
|
|
68
|
+
height: 2.5rem;
|
|
69
|
+
width: 2.5rem;
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
export const StyledAddCircleOutlineIcon = styled(AddCircleOutlineIcon) `
|
|
73
|
+
width: 85px;
|
|
74
|
+
height: auto;
|
|
75
|
+
color: #aaa;
|
|
76
|
+
`;
|
|
77
|
+
export const StyledTypography = styled(Typography) `
|
|
78
|
+
color: ${props => props.theme.palette.text.primary};
|
|
79
|
+
font-size: 1rem;
|
|
80
|
+
font-weight: 500;
|
|
81
|
+
line-height: 1.3;
|
|
82
|
+
margin-top: .5rem;
|
|
83
|
+
|
|
84
|
+
/* Truncate text to 2 lines */
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
text-overflow: ellipsis;
|
|
87
|
+
display: -webkit-box;
|
|
88
|
+
-webkit-line-clamp: 2;
|
|
89
|
+
-webkit-box-orient: vertical;
|
|
90
|
+
`;
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
24
2
|
import { ListItemButton, Link, TextField, Tooltip } from '../../../index';
|
|
25
3
|
import LaunchIcon from '@mui/icons-material/Launch';
|
|
26
4
|
import { visuallyHidden } from '@mui/utils';
|
|
@@ -29,7 +7,7 @@ import { defaultMessages } from '../../../lang/en-us';
|
|
|
29
7
|
import { StyledPaper, StyledBoxWrap, StyledBoxText, StyledAutocomplete, StyledTypography, StyledTypographySubtitle, StyledButton } from './AppHubProductStyles';
|
|
30
8
|
import { useTheme } from '@mui/material';
|
|
31
9
|
// Bug in the naming of the icons on the CDN
|
|
32
|
-
export
|
|
10
|
+
export const LogoVariants = {
|
|
33
11
|
Default: 'icon',
|
|
34
12
|
Solid: 'icon-solid',
|
|
35
13
|
Outlined: 'icon-outlined',
|
|
@@ -40,42 +18,42 @@ export var LogoVariants = {
|
|
|
40
18
|
* @param internalName {string | null | undefined } - Internal name of the application.
|
|
41
19
|
* @returns {ReactElement | null } SVG containing the application logo retrieved from the CDN.
|
|
42
20
|
*/
|
|
43
|
-
|
|
21
|
+
const renderApplicationLogo = (internalName, logoVariant) => {
|
|
44
22
|
if (!internalName) {
|
|
45
23
|
return _jsx(_Fragment, {});
|
|
46
24
|
}
|
|
47
|
-
|
|
48
|
-
return (_jsx("img", { src: urlToIcon, width: "90", height: "90", alt: internalName
|
|
25
|
+
const urlToIcon = `${Constants.AssetsUrl}${internalName}/logo/latest/${logoVariant ?? LogoVariants.Default}.svg`;
|
|
26
|
+
return (_jsx("img", { src: urlToIcon, width: "90", height: "90", alt: internalName ?? '' }));
|
|
49
27
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return (_jsx(StyledPaper,
|
|
28
|
+
const AppHubItem = (props) => {
|
|
29
|
+
const { internalName, shortName, customName, url, subtitle, localization, options, ...rest } = props;
|
|
30
|
+
const initialOptions = { ...options };
|
|
31
|
+
const solidLogo = renderApplicationLogo(internalName, LogoVariants.Solid);
|
|
32
|
+
const messages = { ...defaultMessages, ...localization };
|
|
33
|
+
return (_jsx(StyledPaper, { elevation: 0, children: _jsxs(StyledBoxWrap, { children: [solidLogo, _jsxs(StyledBoxText, { children: [subtitle && (_jsx(StyledTypographySubtitle
|
|
56
34
|
// @ts-ignore
|
|
57
|
-
,
|
|
35
|
+
, {
|
|
58
36
|
// @ts-ignore
|
|
59
|
-
component: 'div'
|
|
37
|
+
component: 'div', children: subtitle })), _jsx(Tooltip, { placement: 'top', title: customName ?? shortName, children: _jsx(StyledTypography
|
|
60
38
|
// @ts-ignore
|
|
61
|
-
,
|
|
39
|
+
, {
|
|
62
40
|
// @ts-ignore
|
|
63
|
-
component: 'div', className: 'appHubCardTitle'
|
|
64
|
-
// @ts-
|
|
65
|
-
component: Link,
|
|
41
|
+
component: 'div', className: 'appHubCardTitle', children: customName ?? shortName }) }), url && (_jsxs(StyledButton, { href: url,
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
component: Link,
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
target: '_blank', variant: 'outlined', ...rest, children: [messages.open, _jsxs("span", { style: visuallyHidden, children: [", ", messages['open-in-new-window']] })] })), options && options.length > 0 && (_jsx(StyledAutocomplete, { disablePortal: true, size: 'small', options: options.map((option) => option.applicationName),
|
|
66
46
|
// TODO: Add link, icon and screen reader text here:
|
|
67
|
-
renderOption:
|
|
47
|
+
renderOption: (option) => {
|
|
68
48
|
// Autocomplete only uses applicationName and we need more properties
|
|
69
49
|
// Careful of this if we do any sorting or grouping in future
|
|
70
|
-
// @ts-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
const index = option['data-option-index'];
|
|
52
|
+
const optionItem = initialOptions[index];
|
|
53
|
+
const handleClick = (event) => {
|
|
74
54
|
optionItem.onClick && optionItem.onClick(event);
|
|
75
55
|
};
|
|
76
|
-
return (_jsxs(ListItemButton,
|
|
77
|
-
}, renderInput:
|
|
78
|
-
return _jsx(TextField, __assign({}, params, { placeholder: messages['select-org'] }));
|
|
79
|
-
} }))] })] }) })));
|
|
56
|
+
return (_jsxs(ListItemButton, { onClick: event => handleClick(event), children: [option.key, _jsx(LaunchIcon, { sx: { marginInlineStart: '1rem', transform: useTheme().direction === 'rtl' ? 'scaleX(-1)' : 'none' } }), _jsxs("span", { style: visuallyHidden, children: [", ", messages['open-in-new-window']] })] }, `${option.key}_${option.id}`));
|
|
57
|
+
}, renderInput: (params) => _jsx(TextField, { ...params, placeholder: messages['select-org'] }) }))] })] }) }));
|
|
80
58
|
};
|
|
81
59
|
export default AppHubItem;
|
|
@@ -1,28 +1,113 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
import { styled } from '@mui/material/styles';
|
|
6
2
|
import { Paper, Box, Typography, Autocomplete, Button } from '../../../index';
|
|
7
|
-
export
|
|
3
|
+
export const StyledPaper = styled(Paper) `
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
background: transparent;
|
|
7
|
+
box-shadow: 0 0 0 1px ${props => props.theme.palette.mode === 'dark'
|
|
8
8
|
? 'rgba(255,255,255,.1)'
|
|
9
|
-
: '#ddd';
|
|
9
|
+
: '#ddd'};
|
|
10
|
+
border-radius: 10px;
|
|
11
|
+
border: none;
|
|
12
|
+
transition: all 180ms ease;
|
|
13
|
+
|
|
14
|
+
&:hover,
|
|
15
|
+
&:focus-within {
|
|
16
|
+
background: ${props => props.theme.palette.mode === 'dark'
|
|
10
17
|
? 'rgba(0,0,0,.3)'
|
|
11
|
-
: '#f5f5f5';
|
|
18
|
+
: '#f5f5f5'};
|
|
19
|
+
box-shadow: 0 0 0 1px ${props => props.theme.palette.mode === 'dark'
|
|
12
20
|
? 'rgba(255,255,255,.2)'
|
|
13
|
-
: '#ccc'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
: '#ccc'}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
export const StyledBoxWrap = styled(Box) `
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
padding: .5rem;
|
|
28
|
+
`;
|
|
29
|
+
export const StyledBoxText = styled(Box) `
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: flex-start;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
margin-inline-start: 1rem;
|
|
35
|
+
width: 100%;
|
|
36
|
+
`;
|
|
37
|
+
export const StyledTypography = styled(Typography) `
|
|
38
|
+
color: ${props => props.theme.palette.text.primary};
|
|
39
|
+
font-size: 1rem;
|
|
40
|
+
font-weight: 500;
|
|
41
|
+
line-height: 1.3;
|
|
42
|
+
|
|
43
|
+
/* Truncate text to 2 lines */
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
display: -webkit-box;
|
|
47
|
+
-webkit-line-clamp: 2;
|
|
48
|
+
-webkit-box-orient: vertical;
|
|
49
|
+
`;
|
|
50
|
+
export const StyledTypographySubtitle = styled(Typography) `
|
|
51
|
+
color: ${props => props.theme.palette.text.secondary};
|
|
52
|
+
font-size: .85rem;
|
|
53
|
+
font-weight: 400;
|
|
54
|
+
line-height: 1.3;
|
|
55
|
+
`;
|
|
56
|
+
export const StyledButton = styled(Button) `
|
|
57
|
+
background: ${props => props.theme.palette.mode === 'dark'
|
|
19
58
|
? 'rgba(0,0,0,.2)'
|
|
20
|
-
: '#fff';
|
|
59
|
+
: '#fff'};
|
|
60
|
+
box-shadow: 0 0 0 0 transparent;
|
|
61
|
+
transition: all 180ms ease;
|
|
62
|
+
|
|
63
|
+
&:focus-visible {
|
|
64
|
+
outline: none;
|
|
65
|
+
box-shadow: 0 0 0 4px ${props => props.theme.palette.mode === 'dark'
|
|
21
66
|
? 'rgba(255,255,255,.5)'
|
|
22
|
-
: props.theme.palette.primary.main
|
|
23
|
-
|
|
67
|
+
: props.theme.palette.primary.main};
|
|
68
|
+
|
|
69
|
+
& .MuiTouchRipple-root {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
74
|
+
export const StyledAutocomplete = styled(Autocomplete) `
|
|
75
|
+
width: 100%;
|
|
76
|
+
|
|
77
|
+
.MuiInputBase-root {
|
|
78
|
+
background: ${props => props.theme.palette.mode === 'dark'
|
|
24
79
|
? 'rgba(0,0,0,.2)'
|
|
25
|
-
: '#fff'
|
|
80
|
+
: '#fff'};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
& input {
|
|
84
|
+
width: 100%;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
& input::placeholder {
|
|
88
|
+
color: ${props => props.theme.palette.text.secondary};
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.MuiOutlinedInput-root .MuiAutocomplete-endAdornment {
|
|
93
|
+
left: ${props => props.theme.direction === 'rtl' ? '9px' : 'auto'};
|
|
94
|
+
right: ${props => props.theme.direction === 'ltr' ? '9px' : 'auto'};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Handle custom focus state */
|
|
98
|
+
& .MuiInputBase-root {
|
|
99
|
+
box-shadow: 0 0 0 0 transparent;
|
|
100
|
+
transition: all 180ms ease;
|
|
101
|
+
}
|
|
102
|
+
& .MuiInputBase-root.Mui-focused fieldset {
|
|
103
|
+
box-shadow: none !important;
|
|
104
|
+
border: none !important;
|
|
105
|
+
outline: none !important;
|
|
106
|
+
}
|
|
107
|
+
& .MuiInputBase-root.Mui-focused {
|
|
108
|
+
outline: none;
|
|
109
|
+
box-shadow: 0 0 0 4px ${props => props.theme.palette.mode === 'dark'
|
|
26
110
|
? 'rgba(255,255,255,.5)'
|
|
27
|
-
: props.theme.palette.primary.main
|
|
28
|
-
|
|
111
|
+
: props.theme.palette.primary.main};
|
|
112
|
+
}
|
|
113
|
+
`;
|