@learningpool/ui 1.8.6 → 1.8.8
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/components/landmarks/Header/Header.d.ts +1 -0
- package/components/landmarks/Header/Header.js +7 -5
- package/components/navigation/MobileNavigation/MobileNavigation.d.ts +1 -0
- package/components/navigation/MobileNavigation/MobileNavigation.js +8 -6
- package/components/navigation/MobileNavigation/MobileNavigationAvatar.d.ts +1 -0
- package/components/navigation/MobileNavigation/MobileNavigationAvatar.js +51 -34
- package/components/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +1 -0
- package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +52 -29
- package/components/navigation/MobileNavigation/MobileNavigationSearch.d.ts +1 -0
- package/components/navigation/MobileNavigation/MobileNavigationSearch.js +5 -3
- package/components/navigation/VerticalNavigation/VerticalNavigation.d.ts +1 -0
- package/components/navigation/VerticalNavigation/VerticalNavigation.js +135 -107
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatar.js +46 -20
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +1 -0
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +6 -4
- package/components/stream/AppSwitcher/AppSwitcher.d.ts +1 -0
- package/components/stream/AppSwitcher/AppSwitcher.js +9 -7
- package/package.json +1 -1
- package/types/components/navigation/VerticalNavigationAvatar.d.ts +1 -0
- package/utils/dataAttributes.d.ts +57 -0
- package/utils/dataAttributes.js +61 -0
- package/utils/helpers.d.ts +12 -9
- package/utils/helpers.js +41 -21
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const defaultAttributes: {
|
|
2
|
+
VerticalNavigationContainer: string;
|
|
3
|
+
VerticalNavigationBrand: string;
|
|
4
|
+
VerticalNavigationToggle: string;
|
|
5
|
+
VerticalNavigationPrimary: string;
|
|
6
|
+
VerticalNavigationPrimaryList: string;
|
|
7
|
+
VerticalNavigationPrimaryListItem: string;
|
|
8
|
+
VerticalNavigationSecondary: string;
|
|
9
|
+
VerticalNavigationSecondaryList: string;
|
|
10
|
+
VerticalNavigationSecondaryListItem: string;
|
|
11
|
+
VerticalNavigationFlyout: string;
|
|
12
|
+
VerticalNavigationFlyoutList: string;
|
|
13
|
+
VerticalNavigationFlyoutListItem: string;
|
|
14
|
+
VerticalNavigationAppSwitcherToggle: string;
|
|
15
|
+
VerticalNavigationAvatarToggle: string;
|
|
16
|
+
VerticalNavigationAvatarPanel: string;
|
|
17
|
+
VerticalNavigationAvatarProfile: string;
|
|
18
|
+
VerticalNavigationAvatarList: string;
|
|
19
|
+
VerticalNavigationAvatarListItem: string;
|
|
20
|
+
VerticalNavigationAvatarFootnote: string;
|
|
21
|
+
MobileNavContainer: string;
|
|
22
|
+
MobileNavDrawerToggle: string;
|
|
23
|
+
MobileNavDrawerPanel: string;
|
|
24
|
+
MobileNavDrawerBrand: string;
|
|
25
|
+
MobileNavDrawerPrimaryList: string;
|
|
26
|
+
MobileNavDrawerPrimaryItem: string;
|
|
27
|
+
MobileNavDrawerPrimaryChildList: string;
|
|
28
|
+
MobileNavDrawerPrimaryChildItem: string;
|
|
29
|
+
MobileNavDrawerSecondaryList: string;
|
|
30
|
+
MobileNavDrawerSecondaryItem: string;
|
|
31
|
+
MobileNavSearchToggle: string;
|
|
32
|
+
MobileNavSearchPanel: string;
|
|
33
|
+
MobileNavSearchForm: string;
|
|
34
|
+
MobileNavAvatarToggle: string;
|
|
35
|
+
MobileNavAvatarPanel: string;
|
|
36
|
+
MobileNavAvatarProfile: string;
|
|
37
|
+
MobileNavAvatarList: string;
|
|
38
|
+
MobileNavAvatarItem: string;
|
|
39
|
+
AppSwitcherContainer: string;
|
|
40
|
+
AppSwitcherHeader: string;
|
|
41
|
+
AppSwitcherList: string;
|
|
42
|
+
AppSwitcherItem: string;
|
|
43
|
+
AppSwitcherOrgCount: string;
|
|
44
|
+
AppSwitcherOrgPanel: string;
|
|
45
|
+
AppSwitcherOrgBackButton: string;
|
|
46
|
+
AppSwitcherOrgHeader: string;
|
|
47
|
+
AppSwitcherOrgSearch: string;
|
|
48
|
+
AppSwitcherOrgList: string;
|
|
49
|
+
AppSwitcherOrgItem: string;
|
|
50
|
+
HeaderContainer: string;
|
|
51
|
+
HeaderBreadcrumb: string;
|
|
52
|
+
HeaderTitle: string;
|
|
53
|
+
HeaderSubtitle: string;
|
|
54
|
+
HeaderActions: string;
|
|
55
|
+
HeaderActionsMain: string;
|
|
56
|
+
HeaderActionsSecondary: string;
|
|
57
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export var defaultAttributes = {
|
|
2
|
+
// VerticalNavigation data IDs
|
|
3
|
+
VerticalNavigationContainer: 'vertnav-container',
|
|
4
|
+
VerticalNavigationBrand: 'vertnav-brand',
|
|
5
|
+
VerticalNavigationToggle: 'vertnav-toggle',
|
|
6
|
+
VerticalNavigationPrimary: 'vertnav-primary',
|
|
7
|
+
VerticalNavigationPrimaryList: 'vertnav-primary-list',
|
|
8
|
+
VerticalNavigationPrimaryListItem: 'vertnav-primary-list-item',
|
|
9
|
+
VerticalNavigationSecondary: 'vertnav-secondary',
|
|
10
|
+
VerticalNavigationSecondaryList: 'vertnav-secondary-list',
|
|
11
|
+
VerticalNavigationSecondaryListItem: 'vertnav-secondary-list-item',
|
|
12
|
+
VerticalNavigationFlyout: 'vertnav-flyout',
|
|
13
|
+
VerticalNavigationFlyoutList: 'vertnav-flyout-list',
|
|
14
|
+
VerticalNavigationFlyoutListItem: 'vertnav-flyout-list-item',
|
|
15
|
+
VerticalNavigationAppSwitcherToggle: 'vertnav-appSwitcher-toggle',
|
|
16
|
+
VerticalNavigationAvatarToggle: 'vertnav-avatar-toggle',
|
|
17
|
+
VerticalNavigationAvatarPanel: 'vertnav-avatar-panel',
|
|
18
|
+
VerticalNavigationAvatarProfile: 'vertnav-avatar-profile',
|
|
19
|
+
VerticalNavigationAvatarList: 'vertnav-avatar-list',
|
|
20
|
+
VerticalNavigationAvatarListItem: 'vertnav-avatar-list-item',
|
|
21
|
+
VerticalNavigationAvatarFootnote: 'vertnav-avatar-footnote',
|
|
22
|
+
// MobileNavigation data IDs
|
|
23
|
+
MobileNavContainer: 'mobilenav-container',
|
|
24
|
+
MobileNavDrawerToggle: 'mobilenav-drawer-toggle',
|
|
25
|
+
MobileNavDrawerPanel: 'mobilenav-drawer-panel',
|
|
26
|
+
MobileNavDrawerBrand: 'mobilenav-drawer-brand',
|
|
27
|
+
MobileNavDrawerPrimaryList: 'mobilenav-drawer-primary-list',
|
|
28
|
+
MobileNavDrawerPrimaryItem: 'mobilenav-drawer-primary-item',
|
|
29
|
+
MobileNavDrawerPrimaryChildList: 'mobilenav-drawer-primary-child-list',
|
|
30
|
+
MobileNavDrawerPrimaryChildItem: 'mobilenav-drawer-primary-child-item',
|
|
31
|
+
MobileNavDrawerSecondaryList: 'mobilenav-drawer-secondary-list',
|
|
32
|
+
MobileNavDrawerSecondaryItem: 'mobilenav-drawer-secondary-item',
|
|
33
|
+
MobileNavSearchToggle: 'mobilenav-search-toggle',
|
|
34
|
+
MobileNavSearchPanel: 'mobilenav-search-panel',
|
|
35
|
+
MobileNavSearchForm: 'mobilenav-search-form',
|
|
36
|
+
MobileNavAvatarToggle: 'mobilenav-avatar-toggle',
|
|
37
|
+
MobileNavAvatarPanel: 'mobilenav-avatar-panel',
|
|
38
|
+
MobileNavAvatarProfile: 'mobilenav-avatar-profile',
|
|
39
|
+
MobileNavAvatarList: 'mobilenav-avatar-list',
|
|
40
|
+
MobileNavAvatarItem: 'mobilenav-avatar-item',
|
|
41
|
+
// AppSwitcher data IDs
|
|
42
|
+
AppSwitcherContainer: 'appswitcher-container',
|
|
43
|
+
AppSwitcherHeader: 'appswitcher-header',
|
|
44
|
+
AppSwitcherList: 'appswitcher-list',
|
|
45
|
+
AppSwitcherItem: 'appswitcher-item',
|
|
46
|
+
AppSwitcherOrgCount: 'appswitcher-org-count',
|
|
47
|
+
AppSwitcherOrgPanel: 'appswitcher-org-panel',
|
|
48
|
+
AppSwitcherOrgBackButton: 'appswitcher-org-back-button',
|
|
49
|
+
AppSwitcherOrgHeader: 'appswitcher-org-header',
|
|
50
|
+
AppSwitcherOrgSearch: 'appswitcher-org-search',
|
|
51
|
+
AppSwitcherOrgList: 'appswitcher-org-list',
|
|
52
|
+
AppSwitcherOrgItem: 'appswitcher-org-item',
|
|
53
|
+
// Header data IDs
|
|
54
|
+
HeaderContainer: 'header-container',
|
|
55
|
+
HeaderBreadcrumb: 'header-breadcrumb',
|
|
56
|
+
HeaderTitle: 'header-title',
|
|
57
|
+
HeaderSubtitle: 'header-subtitle',
|
|
58
|
+
HeaderActions: 'header-actions',
|
|
59
|
+
HeaderActionsMain: 'header-actions-main',
|
|
60
|
+
HeaderActionsSecondary: 'header-actions-secondary'
|
|
61
|
+
};
|
package/utils/helpers.d.ts
CHANGED
|
@@ -17,17 +17,20 @@ export declare const stringToColor: (string: string) => string;
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const stringAvatar: (name: string) => any;
|
|
19
19
|
/**
|
|
20
|
-
* Accepts
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @param
|
|
20
|
+
* Accepts an order, optional in/out toggle and returns
|
|
21
|
+
* a react-spring style object from useSpring that fades an item
|
|
22
|
+
* in based on it's order
|
|
23
|
+
* @param delayOrder number - Order for delaying items
|
|
24
|
+
* @param reverse boolean - Toggles the direction of the animation
|
|
24
25
|
* @returns Object
|
|
25
26
|
*/
|
|
26
|
-
export declare const
|
|
27
|
+
export declare const useFadeIn: (delayOrder: number, reverse?: boolean) => Object;
|
|
27
28
|
/**
|
|
28
|
-
* Accepts
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* Accepts an order, optional in/out toggle and returns
|
|
30
|
+
* a react-spring style object from useSpring that fades and moves
|
|
31
|
+
* an item in based on it's order
|
|
32
|
+
* @param delayOrder number - Order for delaying items
|
|
33
|
+
* @param reverse boolean - Toggles the direction of the animation
|
|
31
34
|
* @returns Object
|
|
32
35
|
*/
|
|
33
|
-
export declare const
|
|
36
|
+
export declare const useFadeAndMoveIn: (delayOrder: number, reverse?: boolean) => Object;
|
package/utils/helpers.js
CHANGED
|
@@ -9,6 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
import { useEffect, useRef } from 'react';
|
|
12
13
|
import { useSpring, config } from '@react-spring/web';
|
|
13
14
|
/**
|
|
14
15
|
* Accepts a string and returns 2 characters (max) as initials e.g. AN from Avatar Name
|
|
@@ -62,36 +63,55 @@ export var stringAvatar = function (name) {
|
|
|
62
63
|
};
|
|
63
64
|
var STAGGER_ITEMS_DELAY = 70;
|
|
64
65
|
/**
|
|
65
|
-
* Accepts
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* @param
|
|
66
|
+
* Accepts an order, optional in/out toggle and returns
|
|
67
|
+
* a react-spring style object from useSpring based on the
|
|
68
|
+
* animation configuration provided
|
|
69
|
+
* @param animationConfig object - Config for useSpring animation (react-spring object)
|
|
70
|
+
* @param delayOrder number - Order for delaying items
|
|
71
|
+
* @param reverse boolean - Toggles the direction of the animation
|
|
69
72
|
* @returns Object
|
|
70
73
|
*/
|
|
71
|
-
|
|
74
|
+
var useStaggerIn = function (animationConfig, delayOrder, reverse) {
|
|
72
75
|
var defaultAnimationConfig = {
|
|
73
|
-
|
|
74
|
-
to: { opacity: 1, y: 0 },
|
|
75
|
-
reverse: !trigger,
|
|
76
|
+
reverse: reverse,
|
|
76
77
|
config: __assign(__assign({}, config.default), { mass: 1 })
|
|
77
78
|
};
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
var animationCountRef = useRef(0);
|
|
80
|
+
var staggerInAnimation = useSpring(__assign(__assign(__assign({}, defaultAnimationConfig), animationConfig), { delay: STAGGER_ITEMS_DELAY * delayOrder }));
|
|
81
|
+
useEffect(function () {
|
|
82
|
+
animationCountRef.current += 1;
|
|
83
|
+
});
|
|
84
|
+
return staggerInAnimation;
|
|
81
85
|
};
|
|
82
86
|
/**
|
|
83
|
-
* Accepts
|
|
84
|
-
*
|
|
85
|
-
*
|
|
87
|
+
* Accepts an order, optional in/out toggle and returns
|
|
88
|
+
* a react-spring style object from useSpring that fades an item
|
|
89
|
+
* in based on it's order
|
|
90
|
+
* @param delayOrder number - Order for delaying items
|
|
91
|
+
* @param reverse boolean - Toggles the direction of the animation
|
|
86
92
|
* @returns Object
|
|
87
93
|
*/
|
|
88
|
-
export var useFadeIn = function (
|
|
89
|
-
|
|
94
|
+
export var useFadeIn = function (delayOrder, reverse) {
|
|
95
|
+
if (reverse === void 0) { reverse = false; }
|
|
96
|
+
var animationConfig = {
|
|
90
97
|
from: { opacity: 0 },
|
|
91
|
-
to: { opacity: 1 }
|
|
92
|
-
|
|
98
|
+
to: { opacity: 1 }
|
|
99
|
+
};
|
|
100
|
+
return useStaggerIn(animationConfig, delayOrder, reverse);
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Accepts an order, optional in/out toggle and returns
|
|
104
|
+
* a react-spring style object from useSpring that fades and moves
|
|
105
|
+
* an item in based on it's order
|
|
106
|
+
* @param delayOrder number - Order for delaying items
|
|
107
|
+
* @param reverse boolean - Toggles the direction of the animation
|
|
108
|
+
* @returns Object
|
|
109
|
+
*/
|
|
110
|
+
export var useFadeAndMoveIn = function (delayOrder, reverse) {
|
|
111
|
+
if (reverse === void 0) { reverse = false; }
|
|
112
|
+
var animationConfig = {
|
|
113
|
+
from: { opacity: 0, y: 10 },
|
|
114
|
+
to: { opacity: 1, y: 0 }
|
|
93
115
|
};
|
|
94
|
-
|
|
95
|
-
incrementAnimationCount();
|
|
96
|
-
return staggerFadeInUpAnimation;
|
|
116
|
+
return useStaggerIn(animationConfig, delayOrder, reverse);
|
|
97
117
|
};
|