@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.
Files changed (81) hide show
  1. package/assets/Images.d.ts +9 -0
  2. package/assets/Images.js +4 -1
  3. package/components/navigation/MobileNavigation/MobileNavigation.d.ts +39 -0
  4. package/components/navigation/MobileNavigation/MobileNavigation.js +183 -0
  5. package/components/navigation/MobileNavigation/MobileNavigationAvatar.d.ts +28 -0
  6. package/components/navigation/MobileNavigation/MobileNavigationAvatar.js +122 -0
  7. package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +827 -0
  8. package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +33 -0
  9. package/components/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +24 -0
  10. package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +148 -0
  11. package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +392 -0
  12. package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +44 -0
  13. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.d.ts +19 -0
  14. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +91 -0
  15. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.d.ts +15 -0
  16. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +26 -0
  17. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.d.ts +112 -0
  18. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +66 -0
  19. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.d.ts +126 -0
  20. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +71 -0
  21. package/components/navigation/MobileNavigation/MobileNavigationMotion.d.ts +141 -0
  22. package/components/navigation/MobileNavigation/MobileNavigationMotion.js +109 -0
  23. package/components/navigation/MobileNavigation/MobileNavigationSearch.d.ts +10 -0
  24. package/components/navigation/MobileNavigation/MobileNavigationSearch.js +52 -0
  25. package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +257 -0
  26. package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.js +20 -0
  27. package/components/navigation/MobileNavigation/MobileNavigationStyles.d.ts +405 -0
  28. package/components/navigation/MobileNavigation/MobileNavigationStyles.js +104 -0
  29. package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +2 -0
  30. package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +32 -0
  31. package/components/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +2 -0
  32. package/components/navigation/MobileNavigation/MobileNavigationToggleX.js +26 -0
  33. package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.d.ts +36 -0
  34. package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.js +10 -0
  35. package/components/navigation/VerticalNavigation/VerticalNavigation.d.ts +25 -10
  36. package/components/navigation/VerticalNavigation/VerticalNavigation.js +179 -92
  37. package/components/navigation/VerticalNavigation/VerticalNavigationAvatar.d.ts +4 -0
  38. package/components/navigation/VerticalNavigation/VerticalNavigationAvatar.js +84 -0
  39. package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +827 -0
  40. package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +31 -0
  41. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +4 -0
  42. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +91 -0
  43. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +15 -0
  44. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +29 -0
  45. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.d.ts +112 -0
  46. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +69 -0
  47. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.d.ts +126 -0
  48. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +70 -0
  49. package/components/navigation/VerticalNavigation/VerticalNavigationMotion.d.ts +141 -0
  50. package/components/navigation/VerticalNavigation/VerticalNavigationMotion.js +109 -0
  51. package/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +31 -90
  52. package/components/navigation/VerticalNavigation/VerticalNavigationStyles.js +73 -259
  53. package/components/stream/AppSwitcher/AppSwitcher.d.ts +36 -0
  54. package/components/stream/AppSwitcher/AppSwitcher.js +307 -0
  55. package/components/stream/AppSwitcher/AppSwitcherItem.d.ts +16 -0
  56. package/components/stream/AppSwitcher/AppSwitcherItem.js +51 -0
  57. package/components/stream/AppSwitcher/AppSwitcherStyles.d.ts +17 -0
  58. package/components/stream/AppSwitcher/AppSwitcherStyles.js +48 -0
  59. package/components/stream/AppSwitcher/constants.d.ts +34 -0
  60. package/components/stream/AppSwitcher/constants.js +27 -0
  61. package/index.d.ts +1 -0
  62. package/index.js +1 -0
  63. package/lang/en-us.d.ts +6 -0
  64. package/lang/en-us.js +6 -0
  65. package/package.json +6 -2
  66. package/types/components/navigation/VerticalNavigation.d.ts +48 -0
  67. package/types/components/navigation/VerticalNavigation.js +1 -0
  68. package/types/components/navigation/VerticalNavigationAvatar.d.ts +22 -0
  69. package/types/components/navigation/VerticalNavigationAvatar.js +1 -0
  70. package/types/components/stream/AppSwitcher.d.ts +9 -0
  71. package/types/components/stream/AppSwitcher.js +1 -0
  72. package/types/index.d.ts +3 -0
  73. package/types/index.js +3 -0
  74. package/utils/constants.d.ts +6 -0
  75. package/utils/constants.js +6 -0
  76. package/utils/helpers.d.ts +6 -0
  77. package/utils/helpers.js +17 -0
  78. package/utils/hooks.d.ts +1 -0
  79. package/utils/hooks.js +29 -0
  80. package/utils/theme.d.ts +4 -0
  81. 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,9 @@
1
+ export interface IApplication {
2
+ applicationId: number;
3
+ applicationName: string;
4
+ shortName: string;
5
+ internalName: string;
6
+ customName?: string;
7
+ url: string;
8
+ children?: object[];
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -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
@@ -0,0 +1,3 @@
1
+ // https://www.typescriptlang.org/play#example/types-vs-interfaces
2
+ // https://stackoverflow.com/questions/56018167/typescript-does-not-copy-d-ts-files-to-build
3
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const DEFAULT_REACT_APP_ID = "root";
2
+ export declare const MOBILE_NAV_PANEL_TYPES: {
3
+ DRAWER: string;
4
+ SEARCH: string;
5
+ AVATAR: string;
6
+ };
@@ -0,0 +1,6 @@
1
+ export var DEFAULT_REACT_APP_ID = 'root';
2
+ export var MOBILE_NAV_PANEL_TYPES = {
3
+ DRAWER: 'drawer',
4
+ SEARCH: 'search',
5
+ AVATAR: 'avatar'
6
+ };
@@ -0,0 +1,6 @@
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 declare const handleAvatarInitials: (avatarName: string) => string;
@@ -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
+ };
@@ -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
@@ -87,3 +87,7 @@ export declare const motion: {
87
87
  easeIn: string;
88
88
  easeInOut: string;
89
89
  };
90
+ export declare const tooltipDelay: {
91
+ start: number;
92
+ end: number;
93
+ };
package/utils/theme.js CHANGED
@@ -59,3 +59,7 @@ export var motion = {
59
59
  easeIn: 'cubic-bezier(0.4, 0.0, 1, 1)',
60
60
  easeInOut: 'cubic-bezier(0.4, 0.0, 0.6, 1)'
61
61
  };
62
+ export var tooltipDelay = {
63
+ start: 500,
64
+ end: 200
65
+ };