@learningpool/ui 1.6.1 → 1.6.3
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/CHANGELOG.md +14 -0
- package/dist/components/navigation/VerticalNavigation/VerticalNavigation.js +1 -0
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +1 -1
- package/dist/components/navigation/VerticalNavigation/VerticalNavigationStyles.js +1 -1
- package/dist/components/stream/AppSwitcher/AppSwitcher.js +0 -10
- package/dist/components/stream/AppSwitcher/AppSwitcherItem.d.ts +1 -0
- package/dist/components/stream/AppSwitcher/AppSwitcherItem.js +14 -14
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigation.tsx +1 -0
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.tsx +1 -1
- package/src/lib/components/navigation/VerticalNavigation/VerticalNavigationStyles.tsx +0 -1
- package/src/lib/components/stream/AppSwitcher/AppSwitcher.tsx +0 -11
- package/src/lib/components/stream/AppSwitcher/AppSwitcherItem.tsx +22 -21
- package/src/stories/Components/Navigation/VerticalNavigation/Examples.stories.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.6.3](https://github.com/HT2-Labs/design-system/compare/v1.6.2...v1.6.3) (2023-02-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **AppSwitcher:** Uses 'customName' for applications (if set) [HOME-1121] ([#150](https://github.com/HT2-Labs/design-system/issues/150)) ([5b84774](https://github.com/HT2-Labs/design-system/commit/5b84774f34ffe5bbcc67a9bc92f85419f089340b))
|
|
7
|
+
|
|
8
|
+
## [1.6.2](https://github.com/HT2-Labs/design-system/compare/v1.6.1...v1.6.2) (2023-02-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **VerticalNavigatioin:** - Fix overflow of long flyoutmenu items [DS-605] ([#149](https://github.com/HT2-Labs/design-system/issues/149)) ([bd1f88b](https://github.com/HT2-Labs/design-system/commit/bd1f88b36067af093ccf1dc8deb0deb061b34a82))
|
|
14
|
+
|
|
1
15
|
## [1.6.1](https://github.com/HT2-Labs/design-system/compare/v1.6.0...v1.6.1) (2023-02-07)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -191,6 +191,7 @@ var VerticalNavigation = function (props) {
|
|
|
191
191
|
? theme.palette.primary.main
|
|
192
192
|
: theme.palette.background.paper,
|
|
193
193
|
flex: '1 1px',
|
|
194
|
+
marginTop: '-1px',
|
|
194
195
|
overflow: 'auto',
|
|
195
196
|
position: 'relative'
|
|
196
197
|
} }, { children: _jsx(StyledNav, __assign({ tabIndex: -1, "aria-label": 'Primary' }, { children: _jsx(List, __assign({ style: {
|
|
@@ -11,7 +11,7 @@ export var DRAWER_WIDTH = {
|
|
|
11
11
|
};
|
|
12
12
|
export var FlyoutMenuPaper = styled(Paper, {
|
|
13
13
|
shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen' && prop !== 'open' && prop !== 'anchorEl'; }
|
|
14
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: transparent none;\n box-shadow: none;\n left: ", ";\n perspective: 800px;\n pointer-events: ", ";\n position: fixed;\n /* Check against height of browser should be top or bottom positioned */\n top: ", ";\n width: 200px;\n z-index: 2;\n"], ["\n background: transparent none;\n box-shadow: none;\n left: ", ";\n perspective: 800px;\n pointer-events: ", ";\n position: fixed;\n /* Check against height of browser should be top or bottom positioned */\n top: ", ";\n width: 200px;\n z-index: 2;\n"])), function (props) { return props.isDrawerOpen ? "".concat(DRAWER_WIDTH.Expanded, "px") : "".concat(DRAWER_WIDTH.Collapsed - 3, "px"); }, function (props) { return props.open ? 'auto' : 'none'; }, function (props) { return props.anchorEl
|
|
14
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: transparent none;\n box-shadow: none;\n left: ", ";\n perspective: 800px;\n pointer-events: ", ";\n position: fixed;\n /* Check against height of browser should be top or bottom positioned */\n top: ", ";\n min-width: 200px;\n z-index: 2;\n"], ["\n background: transparent none;\n box-shadow: none;\n left: ", ";\n perspective: 800px;\n pointer-events: ", ";\n position: fixed;\n /* Check against height of browser should be top or bottom positioned */\n top: ", ";\n min-width: 200px;\n z-index: 2;\n"])), function (props) { return props.isDrawerOpen ? "".concat(DRAWER_WIDTH.Expanded, "px") : "".concat(DRAWER_WIDTH.Collapsed - 3, "px"); }, function (props) { return props.open ? 'auto' : 'none'; }, function (props) { return props.anchorEl
|
|
15
15
|
? "".concat(props.anchorEl.getBoundingClientRect().top, "px")
|
|
16
16
|
: 'auto'; });
|
|
17
17
|
export var FlyoutMenuWrap = styled('div', {
|
|
@@ -30,7 +30,7 @@ export var DrawerToggleHitboxContent = styled('span')(templateObject_3 || (templ
|
|
|
30
30
|
? props.theme.palette.primary.main
|
|
31
31
|
: props.theme.palette.background.paper; }, function (props) { return props.theme.spacing(0.5); });
|
|
32
32
|
export var StyledAside = styled('aside')(templateObject_4 || (templateObject_4 = __makeTemplateObject([""], [""])));
|
|
33
|
-
export var StyledNav = styled('nav')(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n display: flex;\n flex: 1 auto;\n flex-direction: column;\n justify-content: flex-start;\n
|
|
33
|
+
export var StyledNav = styled('nav')(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n display: flex;\n flex: 1 auto;\n flex-direction: column;\n justify-content: flex-start;\n overflow-x: hidden;\n overflow-y: auto;\n\n // Firefox and future scrollbars\n * & {\n scrollbar-width: thin;\n scrollbar-color: ", ";\n transition: backgroundColor\n ", "ms\n ", ";\n }\n\n * &:hover {\n scrollbar-color: ", ";\n }\n\n // Webkit and fall back scrollbars\n ::-webkit-scrollbar {\n width: 8px;\n }\n\n ::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 55px;\n transition: backgroundColor\n ", "ms\n ", ";\n }\n\n ::-webkit-scrollbar-thumb:hover {\n background-color: ", ";\n }\n"], ["\n background-color: ", ";\n display: flex;\n flex: 1 auto;\n flex-direction: column;\n justify-content: flex-start;\n overflow-x: hidden;\n overflow-y: auto;\n\n // Firefox and future scrollbars\n * & {\n scrollbar-width: thin;\n scrollbar-color: ", ";\n transition: backgroundColor\n ", "ms\n ", ";\n }\n\n * &:hover {\n scrollbar-color: ", ";\n }\n\n // Webkit and fall back scrollbars\n ::-webkit-scrollbar {\n width: 8px;\n }\n\n ::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 55px;\n transition: backgroundColor\n ", "ms\n ", ";\n }\n\n ::-webkit-scrollbar-thumb:hover {\n background-color: ", ";\n }\n"])), function (props) { return props.theme.palette.mode === 'dark'
|
|
34
34
|
? props.theme.palette.primary.main
|
|
35
35
|
: props.theme.palette.background.paper; }, function (props) {
|
|
36
36
|
return props.theme.palette.mode === 'dark'
|
|
@@ -59,8 +59,6 @@ var AppSwitcher = function (props) {
|
|
|
59
59
|
var _a;
|
|
60
60
|
var isAppSwitcherOpen = props.isAppSwitcherOpen, setIsAppSwitcherOpen = props.setIsAppSwitcherOpen, isDrawerOpen = props.isDrawerOpen, localization = props.localization, _b = props.apiKey, apiKey = _b === void 0 ? '' : _b, baseUrl = props.baseUrl;
|
|
61
61
|
var token = props.token;
|
|
62
|
-
// Controls whether the application panel is open or not.
|
|
63
|
-
// const [isOpen, setIsOpen] = useState(isAppSwitcherOpen)
|
|
64
62
|
// Holds the applications which are displayed.
|
|
65
63
|
var _c = useState([]), applications = _c[0], setApplications = _c[1];
|
|
66
64
|
// Controls which tab is active.
|
|
@@ -73,18 +71,10 @@ var AppSwitcher = function (props) {
|
|
|
73
71
|
var _g = useState(''), searchString = _g[0], setSearchString = _g[1];
|
|
74
72
|
var messages = __assign(__assign({}, localization), defaultMessages);
|
|
75
73
|
var userId = (_a = props.userId) !== null && _a !== void 0 ? _a : '';
|
|
76
|
-
/**
|
|
77
|
-
* Toggles display of the Stream suite application dialog.
|
|
78
|
-
* @param event {React.MouseEvent} - Click event.
|
|
79
|
-
*/
|
|
80
|
-
// const handleToggleAppsClick = (event: React.MouseEvent<HTMLButtonElement>): void => {
|
|
81
|
-
// setIsOpen(!isOpen)
|
|
82
|
-
// }
|
|
83
74
|
/**
|
|
84
75
|
* Handles closing of the application dialog.
|
|
85
76
|
*/
|
|
86
77
|
var handleDialogClose = function () {
|
|
87
|
-
// setIsOpen(false)
|
|
88
78
|
setIsAppSwitcherOpen(false);
|
|
89
79
|
setTimeout(function () {
|
|
90
80
|
setSearchString('');
|
|
@@ -19,20 +19,20 @@ export var LogoVariants = {
|
|
|
19
19
|
Outlined: 'icon-outlined',
|
|
20
20
|
White: 'icon-white'
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Renders an application logo.
|
|
24
|
+
* @param internalName {string | null | undefined } - Internal name of the application.
|
|
25
|
+
* @returns {ReactElement | null } SVG containing the application logo retrieved from the CDN.
|
|
26
|
+
*/
|
|
27
|
+
var renderApplicationLogo = function (internalName, logoVariant) {
|
|
28
|
+
if (!internalName) {
|
|
29
|
+
return _jsx(_Fragment, {});
|
|
30
|
+
}
|
|
31
|
+
var urlToIcon = "".concat(Constants.AssetsUrl).concat(internalName, "/logo/latest/").concat(logoVariant !== null && logoVariant !== void 0 ? logoVariant : LogoVariants.Default, ".svg");
|
|
32
|
+
return (_jsx(StyledLogoSVG, { children: _jsx("image", { xlinkHref: urlToIcon, width: "60", height: "60" }) }));
|
|
33
|
+
};
|
|
22
34
|
var AppSwitcherItem = function (props) {
|
|
23
|
-
var applicationId = props.applicationId, internalName = props.internalName, shortName = props.shortName, url = props.url, handleGoToAppClick = props.handleGoToAppClick;
|
|
24
|
-
/**
|
|
25
|
-
* Renders an application logo.
|
|
26
|
-
* @param internalName {string | null | undefined } - Internal name of the application.
|
|
27
|
-
* @returns {ReactElement | null } SVG containing the application logo retrieved from the CDN.
|
|
28
|
-
*/
|
|
29
|
-
var renderApplicationLogo = function (internalName, logoVariant) {
|
|
30
|
-
if (!internalName) {
|
|
31
|
-
return _jsx(_Fragment, {});
|
|
32
|
-
}
|
|
33
|
-
var urlToIcon = "".concat(Constants.AssetsUrl).concat(internalName, "/logo/latest/").concat(logoVariant !== null && logoVariant !== void 0 ? logoVariant : LogoVariants.Default, ".svg");
|
|
34
|
-
return (_jsx(StyledLogoSVG, { children: _jsx("image", { xlinkHref: urlToIcon, width: "60", height: "60" }) }));
|
|
35
|
-
};
|
|
35
|
+
var applicationId = props.applicationId, internalName = props.internalName, shortName = props.shortName, customName = props.customName, url = props.url, handleGoToAppClick = props.handleGoToAppClick;
|
|
36
36
|
var solidLogo = renderApplicationLogo(internalName, LogoVariants.Solid);
|
|
37
37
|
return (_jsxs(AppLink, __assign({ href: url !== null && url !== void 0 ? url : '#', target: "_blank", onClick: function (event) { return applicationId ? handleGoToAppClick(event, applicationId) : null; } }, { children: [applicationId && (
|
|
38
38
|
// Create a stack effect to indicate multiple
|
|
@@ -46,6 +46,6 @@ var AppSwitcherItem = function (props) {
|
|
|
46
46
|
top: '10px',
|
|
47
47
|
transform: 'scale(0.9)',
|
|
48
48
|
zIndex: 0
|
|
49
|
-
} }, { children: solidLogo }))] })), solidLogo, _jsx(AppName, { children: shortName })] })));
|
|
49
|
+
} }, { children: solidLogo }))] })), solidLogo, _jsx(AppName, { children: customName !== null && customName !== void 0 ? customName : shortName })] })));
|
|
50
50
|
};
|
|
51
51
|
export default AppSwitcherItem;
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -35,8 +35,6 @@ const AppSwitcher = (props: IProps): ReactElement | null => {
|
|
|
35
35
|
} = props
|
|
36
36
|
let { token } = props
|
|
37
37
|
|
|
38
|
-
// Controls whether the application panel is open or not.
|
|
39
|
-
// const [isOpen, setIsOpen] = useState(isAppSwitcherOpen)
|
|
40
38
|
// Holds the applications which are displayed.
|
|
41
39
|
const [applications, setApplications] = useState<IApplication[]>([])
|
|
42
40
|
// Controls which tab is active.
|
|
@@ -52,19 +50,10 @@ const AppSwitcher = (props: IProps): ReactElement | null => {
|
|
|
52
50
|
|
|
53
51
|
let userId = props.userId ?? ''
|
|
54
52
|
|
|
55
|
-
/**
|
|
56
|
-
* Toggles display of the Stream suite application dialog.
|
|
57
|
-
* @param event {React.MouseEvent} - Click event.
|
|
58
|
-
*/
|
|
59
|
-
// const handleToggleAppsClick = (event: React.MouseEvent<HTMLButtonElement>): void => {
|
|
60
|
-
// setIsOpen(!isOpen)
|
|
61
|
-
// }
|
|
62
|
-
|
|
63
53
|
/**
|
|
64
54
|
* Handles closing of the application dialog.
|
|
65
55
|
*/
|
|
66
56
|
const handleDialogClose = (): void => {
|
|
67
|
-
// setIsOpen(false)
|
|
68
57
|
setIsAppSwitcherOpen(false)
|
|
69
58
|
|
|
70
59
|
setTimeout(() => {
|
|
@@ -13,36 +13,37 @@ export const LogoVariants = {
|
|
|
13
13
|
interface IAppSwitcherItemProps {
|
|
14
14
|
internalName: string
|
|
15
15
|
shortName: string
|
|
16
|
+
customName?: string
|
|
16
17
|
handleGoToAppClick: Function
|
|
17
18
|
applicationId?: number
|
|
18
19
|
url?: string
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Renders an application logo.
|
|
24
|
+
* @param internalName {string | null | undefined } - Internal name of the application.
|
|
25
|
+
* @returns {ReactElement | null } SVG containing the application logo retrieved from the CDN.
|
|
26
|
+
*/
|
|
27
|
+
const renderApplicationLogo = (internalName: string | null | undefined, logoVariant: string): ReactElement | null => {
|
|
28
|
+
if (!internalName) {
|
|
29
|
+
return <></>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const urlToIcon = `${Constants.AssetsUrl}${internalName}/logo/latest/${logoVariant ?? LogoVariants.Default}.svg`
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<StyledLogoSVG>
|
|
36
|
+
<image xlinkHref={urlToIcon} width="60" height="60" />
|
|
37
|
+
</StyledLogoSVG>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
21
41
|
const AppSwitcherItem = (props: IAppSwitcherItemProps): ReactElement => {
|
|
22
42
|
const {
|
|
23
|
-
applicationId, internalName, shortName,
|
|
43
|
+
applicationId, internalName, shortName, customName,
|
|
24
44
|
url, handleGoToAppClick
|
|
25
45
|
} = props
|
|
26
46
|
|
|
27
|
-
/**
|
|
28
|
-
* Renders an application logo.
|
|
29
|
-
* @param internalName {string | null | undefined } - Internal name of the application.
|
|
30
|
-
* @returns {ReactElement | null } SVG containing the application logo retrieved from the CDN.
|
|
31
|
-
*/
|
|
32
|
-
const renderApplicationLogo = (internalName: string | null | undefined, logoVariant: string): ReactElement | null => {
|
|
33
|
-
if (!internalName) {
|
|
34
|
-
return <></>
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const urlToIcon = `${Constants.AssetsUrl}${internalName}/logo/latest/${logoVariant ?? LogoVariants.Default}.svg`
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<StyledLogoSVG>
|
|
41
|
-
<image xlinkHref={urlToIcon} width="60" height="60" />
|
|
42
|
-
</StyledLogoSVG>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
47
|
const solidLogo = renderApplicationLogo(internalName, LogoVariants.Solid)
|
|
47
48
|
|
|
48
49
|
return (
|
|
@@ -74,7 +75,7 @@ const AppSwitcherItem = (props: IAppSwitcherItemProps): ReactElement => {
|
|
|
74
75
|
)}
|
|
75
76
|
{solidLogo}
|
|
76
77
|
<AppName>
|
|
77
|
-
{shortName}
|
|
78
|
+
{customName ?? shortName}
|
|
78
79
|
</AppName>
|
|
79
80
|
</AppLink>
|
|
80
81
|
)
|
|
@@ -43,7 +43,7 @@ export const Default: ComponentStory<typeof VerticalNavigation> = (args) => {
|
|
|
43
43
|
onClick: () => console.log('Action: First sub item clicked')
|
|
44
44
|
},
|
|
45
45
|
{ label: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do' },
|
|
46
|
-
{ label: '
|
|
46
|
+
{ label: 'Longstringoftextthatdoesntwrap Item' },
|
|
47
47
|
{ label: 'Forth Item' }
|
|
48
48
|
]
|
|
49
49
|
},
|