@learningpool/ui 1.5.0 → 1.6.0-beta.10
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.d.ts +9 -0
- package/assets/Images.js +4 -1
- package/components/navigation/MobileNavigation/MobileNavigation.d.ts +39 -0
- package/components/navigation/MobileNavigation/MobileNavigation.js +183 -0
- package/components/navigation/MobileNavigation/MobileNavigationAvatar.d.ts +28 -0
- package/components/navigation/MobileNavigation/MobileNavigationAvatar.js +122 -0
- package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +827 -0
- package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +33 -0
- package/components/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +24 -0
- package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +148 -0
- package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +392 -0
- package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +44 -0
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.d.ts +19 -0
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +91 -0
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.d.ts +15 -0
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +26 -0
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.d.ts +112 -0
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +66 -0
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.d.ts +126 -0
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +71 -0
- package/components/navigation/MobileNavigation/MobileNavigationMotion.d.ts +141 -0
- package/components/navigation/MobileNavigation/MobileNavigationMotion.js +109 -0
- package/components/navigation/MobileNavigation/MobileNavigationSearch.d.ts +10 -0
- package/components/navigation/MobileNavigation/MobileNavigationSearch.js +52 -0
- package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +257 -0
- package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.js +20 -0
- package/components/navigation/MobileNavigation/MobileNavigationStyles.d.ts +405 -0
- package/components/navigation/MobileNavigation/MobileNavigationStyles.js +104 -0
- package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +2 -0
- package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +32 -0
- package/components/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +2 -0
- package/components/navigation/MobileNavigation/MobileNavigationToggleX.js +26 -0
- package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.d.ts +36 -0
- package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.js +10 -0
- package/components/navigation/VerticalNavigation/VerticalNavigation.d.ts +25 -10
- package/components/navigation/VerticalNavigation/VerticalNavigation.js +179 -92
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatar.d.ts +4 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatar.js +84 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +827 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +31 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +4 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +91 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +15 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +29 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.d.ts +112 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +69 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.d.ts +126 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +70 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationMotion.d.ts +141 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationMotion.js +109 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +31 -90
- package/components/navigation/VerticalNavigation/VerticalNavigationStyles.js +73 -259
- package/components/stream/AppSwitcher/AppSwitcher.d.ts +36 -0
- package/components/stream/AppSwitcher/AppSwitcher.js +307 -0
- package/components/stream/AppSwitcher/AppSwitcherItem.d.ts +16 -0
- package/components/stream/AppSwitcher/AppSwitcherItem.js +51 -0
- package/components/stream/AppSwitcher/AppSwitcherStyles.d.ts +17 -0
- package/components/stream/AppSwitcher/AppSwitcherStyles.js +48 -0
- package/components/stream/AppSwitcher/constants.d.ts +34 -0
- package/components/stream/AppSwitcher/constants.js +27 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/lang/en-us.d.ts +6 -0
- package/lang/en-us.js +6 -0
- package/package.json +6 -2
- package/types/components/navigation/VerticalNavigation.d.ts +48 -0
- package/types/components/navigation/VerticalNavigation.js +1 -0
- package/types/components/navigation/VerticalNavigationAvatar.d.ts +22 -0
- package/types/components/navigation/VerticalNavigationAvatar.js +1 -0
- package/types/components/stream/AppSwitcher.d.ts +9 -0
- package/types/components/stream/AppSwitcher.js +1 -0
- package/types/index.d.ts +3 -0
- package/types/index.js +3 -0
- package/utils/constants.d.ts +6 -0
- package/utils/constants.js +6 -0
- package/utils/helpers.d.ts +6 -0
- package/utils/helpers.js +17 -0
- package/utils/hooks.d.ts +1 -0
- package/utils/hooks.js +29 -0
- package/utils/theme.d.ts +4 -0
- package/utils/theme.js +4 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface IAvatarMenuItemProps {
|
|
2
|
+
label: string;
|
|
3
|
+
icon: any;
|
|
4
|
+
onClick: any;
|
|
5
|
+
}
|
|
6
|
+
export interface IAvatarPanelProps {
|
|
7
|
+
avatarName: string;
|
|
8
|
+
editProfileText?: string;
|
|
9
|
+
logoutText?: string;
|
|
10
|
+
avatarPanelOnClickSwitchDirection?: any;
|
|
11
|
+
avatarPanelOnClickLogout?: any;
|
|
12
|
+
avatarPanelOnClickViewProfile?: any;
|
|
13
|
+
avatarPanelViewProfileString?: string;
|
|
14
|
+
avatarPanelOnClickEditProfile?: any;
|
|
15
|
+
avatarPanelEditProfileString?: string;
|
|
16
|
+
avatarPanelMenuItems?: Array<IAvatarMenuItemProps>;
|
|
17
|
+
avatarPanelOnClickMainAction?: any;
|
|
18
|
+
avatarPanelMainActionString?: string;
|
|
19
|
+
avatarPanelSettingItems?: Array<IAvatarMenuItemProps>;
|
|
20
|
+
avatarPanelInvertNavString?: string;
|
|
21
|
+
avatarPanelFootnote?: any;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { IVerticalNavigationItemProps, IVerticalNavigationProps } from './components/navigation/VerticalNavigation';
|
|
2
|
+
export type { IAvatarMenuItemProps, IAvatarPanelProps } from './components/navigation/VerticalNavigationAvatar';
|
|
3
|
+
export type { IApplication } from './components/stream/AppSwitcher';
|
package/types/index.js
ADDED
package/utils/helpers.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accepts a string and returns 2 characters (max) as initials e.g. AN from Avatar Name
|
|
3
|
+
* @param avatarName string - Expected full name but accepts any string
|
|
4
|
+
* @returns string
|
|
5
|
+
*/
|
|
6
|
+
export var handleAvatarInitials = function (avatarName) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
var firstInitial = avatarName.split('')[0] || '';
|
|
9
|
+
var secondInitial = '';
|
|
10
|
+
if (((_a = avatarName.split(' ')) === null || _a === void 0 ? void 0 : _a.length) > 1) {
|
|
11
|
+
firstInitial = avatarName.split(' ')[0][0];
|
|
12
|
+
if (((_b = avatarName.split(' ')[1]) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
13
|
+
secondInitial = avatarName === null || avatarName === void 0 ? void 0 : avatarName.split(' ')[1][0];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return "".concat(firstInitial).concat(secondInitial);
|
|
17
|
+
};
|
package/utils/hooks.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useCurrentWidth: () => number;
|
package/utils/hooks.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
var getWidth = function () {
|
|
3
|
+
var _a, _b;
|
|
4
|
+
return (_b = (_a = window.innerWidth) !== null && _a !== void 0 ? _a : document.documentElement.clientWidth) !== null && _b !== void 0 ? _b : document.body.clientWidth;
|
|
5
|
+
};
|
|
6
|
+
export var useCurrentWidth = function () {
|
|
7
|
+
// save current window width in the state object
|
|
8
|
+
var _a = useState(getWidth()), width = _a[0], setWidth = _a[1];
|
|
9
|
+
// in this case useEffect will execute only once because
|
|
10
|
+
// it does not have any dependencies.
|
|
11
|
+
useEffect(function () {
|
|
12
|
+
// timeoutId for debounce mechanism
|
|
13
|
+
var timeoutId;
|
|
14
|
+
var resizeListener = function () {
|
|
15
|
+
// prevent execution of previous setTimeout
|
|
16
|
+
clearTimeout(timeoutId);
|
|
17
|
+
// change width from the state object after 150 milliseconds
|
|
18
|
+
timeoutId = setTimeout(function () { return setWidth(getWidth()); }, 150);
|
|
19
|
+
};
|
|
20
|
+
// set resize listener
|
|
21
|
+
window.addEventListener('resize', resizeListener);
|
|
22
|
+
// clean up function
|
|
23
|
+
return function () {
|
|
24
|
+
// remove resize listener
|
|
25
|
+
window.removeEventListener('resize', resizeListener);
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
return width;
|
|
29
|
+
};
|
package/utils/theme.d.ts
CHANGED