@learningpool/ui 1.15.5 → 1.16.1
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,77 +1,273 @@
|
|
|
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 Drawer from '@mui/material/Drawer';
|
|
6
2
|
import { Box, IconButton, BottomNavigation, BottomNavigationAction, Paper, Avatar } from '../../../index';
|
|
7
3
|
import { getNavigationBackground, getNavigationContrastText, getOffsetNavigationBackground, getOffsetNavigationContrastText } from '../helpers';
|
|
8
4
|
import { styled } from '@mui/material/styles';
|
|
9
5
|
import { motion } from '../../../utils/theme';
|
|
10
|
-
export
|
|
6
|
+
export const DRAWER_WIDTH = {
|
|
11
7
|
Collapsed: 60,
|
|
12
8
|
Expanded: 300
|
|
13
9
|
};
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
10
|
+
export const StyledPaper = styled(Paper) `
|
|
11
|
+
background-image: none;
|
|
12
|
+
border-radius: 0;
|
|
13
|
+
bottom: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
position: fixed;
|
|
16
|
+
right: 0;
|
|
17
|
+
z-index: ${props => props.theme.zIndex.appBar};
|
|
18
|
+
`;
|
|
19
|
+
export const StyledNotchSVG = styled('svg', {
|
|
20
|
+
shouldForwardProp: (prop) => prop !== 'mobileNotchPosition'
|
|
21
|
+
}) `
|
|
22
|
+
display: block;
|
|
23
|
+
fill: ${props => getNavigationBackground(props.theme)};
|
|
24
|
+
height: 50px;
|
|
25
|
+
left: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
position: absolute;
|
|
28
|
+
stroke: transparent;
|
|
29
|
+
top: -29px;
|
|
30
|
+
transform: rotate(270deg);
|
|
31
|
+
width: 50px;
|
|
32
|
+
z-index: -1;
|
|
33
|
+
`;
|
|
34
|
+
export const StyledBottomNavigation = styled(BottomNavigation) `
|
|
35
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
36
|
+
position: relative;
|
|
37
|
+
`;
|
|
38
|
+
export const StyledBottomNavigationAction = styled(BottomNavigationAction) `
|
|
39
|
+
color: ${props => getNavigationContrastText(props.theme)};
|
|
40
|
+
flex: none;
|
|
41
|
+
height: 56px;
|
|
42
|
+
max-width: 168px;
|
|
43
|
+
min-width: 80px;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
padding: 0;
|
|
46
|
+
stroke: ${props => getNavigationContrastText(props.theme)};
|
|
47
|
+
|
|
48
|
+
.MuiBottomNavigationAction-label {
|
|
49
|
+
color: inherit;
|
|
50
|
+
font-size: 0.65rem;
|
|
51
|
+
|
|
52
|
+
// Handle long text string overflow
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
width: 100%;
|
|
57
|
+
|
|
58
|
+
&.Mui-selected {
|
|
59
|
+
color: ${props => props.theme.palette.mode === 'dark'
|
|
60
|
+
? props.theme.palette.primary.contrastText
|
|
61
|
+
: props.theme.palette.getContrastText(props.theme.palette.background.paper)};
|
|
62
|
+
font-size: 0.75rem;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.MuiSvgIcon-root {
|
|
67
|
+
fill: ${props => getNavigationBackground(props.theme)};
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
export const DrawerHeader = styled('div', {
|
|
71
|
+
shouldForwardProp: (prop) => prop !== 'isDrawerOpen'
|
|
72
|
+
}) `
|
|
73
|
+
`;
|
|
74
|
+
export const DrawerToggle = styled(IconButton) `
|
|
75
|
+
background: transparent;
|
|
76
|
+
height: 44px;
|
|
77
|
+
padding: 0 ${props => props.theme.spacing(2)} !important;
|
|
78
|
+
position: absolute;
|
|
79
|
+
transform: translate(22px, calc(50% - 5.5px));
|
|
80
|
+
transition: all 225ms ${motion.easeInOut} 0ms !important;
|
|
81
|
+
width: 44px;
|
|
82
|
+
z-index: 10;
|
|
83
|
+
|
|
84
|
+
@media (min-width: ${props => props.theme.breakpoints.values.sm}) {
|
|
85
|
+
padding: 0 ${props => props.theme.spacing(2.5)} !important;
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
export const DrawerToggleHitboxContent = styled('span') `
|
|
89
|
+
background-color: ${props => props.theme.palette.mode === 'dark'
|
|
29
90
|
? props.theme.palette.primary.main
|
|
30
|
-
: props.theme.palette.background.paper
|
|
31
|
-
|
|
32
|
-
|
|
91
|
+
: props.theme.palette.background.paper};
|
|
92
|
+
border-radius: 50%;
|
|
93
|
+
box-shadow: 5px 0 15px 0 rgb(0 0 0 / 10%);
|
|
94
|
+
box-sizing: content-box;
|
|
95
|
+
height: 1.75rem;
|
|
96
|
+
padding: ${props => props.theme.spacing(0.5)};
|
|
97
|
+
width: 1.75rem;
|
|
98
|
+
`;
|
|
99
|
+
export const StyledAside = styled('aside') ``;
|
|
100
|
+
export const StyledNav = styled('nav') `
|
|
101
|
+
background-color: ${props => props.theme.palette.mode === 'dark'
|
|
33
102
|
? props.theme.palette.primary.main
|
|
34
|
-
: props.theme.palette.background.paper;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
103
|
+
: props.theme.palette.background.paper};
|
|
104
|
+
display: flex;
|
|
105
|
+
flex: 1 auto;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
justify-content: flex-start;
|
|
108
|
+
margin-top: -1px;
|
|
109
|
+
overflow-x: hidden;
|
|
110
|
+
overflow-y: auto;
|
|
111
|
+
|
|
112
|
+
// Firefox and future scrollbars
|
|
113
|
+
* & {
|
|
114
|
+
scrollbar-width: thin;
|
|
115
|
+
scrollbar-color: ${props => props.theme.palette.mode === 'dark'
|
|
116
|
+
? 'rgba(255, 255, 255, 0.12) transparent'
|
|
117
|
+
: 'rgba(0, 0, 0, 0.12) transparent'};
|
|
118
|
+
transition: backgroundColor 225ms ${motion.easeIn};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
* &:hover {
|
|
122
|
+
scrollbar-color: ${props => props.theme.palette.mode === 'dark'
|
|
123
|
+
? 'rgba(255, 255, 255, 0.24) transparent'
|
|
124
|
+
: 'rgba(0, 0, 0, 0.24) transparent'};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Webkit and fall back scrollbars
|
|
128
|
+
::-webkit-scrollbar {
|
|
129
|
+
width: 8px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
::-webkit-scrollbar-track {
|
|
133
|
+
background-color: transparent;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
::-webkit-scrollbar-thumb {
|
|
137
|
+
background-color: ${props => props.theme.palette.mode === 'dark'
|
|
138
|
+
? 'rgba(255, 255, 255, 0.12)'
|
|
139
|
+
: 'rgba(0, 0, 0, 0.12)'};
|
|
140
|
+
border-radius: 55px;
|
|
141
|
+
transition: background-color 225ms ${motion.easeIn};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
::-webkit-scrollbar-thumb:hover {
|
|
145
|
+
background-color: ${props => props.theme.palette.mode === 'dark'
|
|
146
|
+
? 'rgba(255, 255, 255, 0.24)'
|
|
147
|
+
: 'rgba(0, 0, 0, 0.24)'};
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
export const StyledNavSecondary = styled('nav') `
|
|
151
|
+
background-color: ${props => props.theme.palette.mode === 'dark'
|
|
52
152
|
? props.theme.palette.primary.main
|
|
53
|
-
: props.theme.palette.background.paper
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
153
|
+
: props.theme.palette.background.paper};
|
|
154
|
+
display: flex;
|
|
155
|
+
flex: 1 auto;
|
|
156
|
+
flex-direction: column;
|
|
157
|
+
justify-content: flex-end;
|
|
158
|
+
margin-top: auto;
|
|
159
|
+
overflow: hidden;
|
|
160
|
+
`;
|
|
161
|
+
export const DrawerShadow = styled(Box, {
|
|
162
|
+
shouldForwardProp: (prop) => prop !== 'isDrawerOpen'
|
|
163
|
+
}) `
|
|
164
|
+
background: rgba(0,0,0,0.125);
|
|
165
|
+
content: '';
|
|
166
|
+
display: block;
|
|
167
|
+
filter: blur(13px);
|
|
168
|
+
height: 100%;
|
|
169
|
+
left: ${props => props.isDrawerOpen
|
|
170
|
+
? `${DRAWER_WIDTH.Expanded - 38}px`
|
|
171
|
+
: `${DRAWER_WIDTH.Collapsed - 41}px`};
|
|
172
|
+
position: fixed;
|
|
173
|
+
top: 0;
|
|
174
|
+
transition: left 225ms ${motion.easeInOut} 0ms;
|
|
175
|
+
visibility: visible;
|
|
176
|
+
width: 40px;
|
|
177
|
+
|
|
178
|
+
@media (min-width: ${props => props.theme.breakpoints.values.sm}) {
|
|
179
|
+
left: ${props => props.isDrawerOpen
|
|
180
|
+
? `${DRAWER_WIDTH.Expanded - 38}px`
|
|
181
|
+
: `${DRAWER_WIDTH.Collapsed - 33}px`};
|
|
182
|
+
}
|
|
183
|
+
`;
|
|
184
|
+
export const NotchContainer = styled(Box) `
|
|
185
|
+
display: flex;
|
|
186
|
+
justify-content: flex-end;
|
|
187
|
+
height: auto;
|
|
188
|
+
margin-top: -${props => props.theme.spacing(0.5)};
|
|
189
|
+
position: relative;
|
|
190
|
+
transition: width 225ms ${motion.easeInOut} 0ms !important;
|
|
191
|
+
width: 100%;
|
|
192
|
+
z-index: 9;
|
|
193
|
+
`;
|
|
194
|
+
export const NotchBackground = styled(Box) `
|
|
195
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
196
|
+
flex: 1;
|
|
197
|
+
height: auto;
|
|
198
|
+
width: auto;
|
|
199
|
+
`;
|
|
200
|
+
export const NotchBackgroundClip = styled(Box) `
|
|
201
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
202
|
+
clip-path: url("#notch");
|
|
203
|
+
display: flex;
|
|
204
|
+
height: 85px;
|
|
205
|
+
width: 45px;
|
|
206
|
+
`;
|
|
207
|
+
export const NotchSeemMask = styled(Box) `
|
|
208
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
209
|
+
height: 90px;
|
|
210
|
+
position: absolute;
|
|
211
|
+
right: 25px;
|
|
212
|
+
top: -2px;
|
|
213
|
+
width: calc(100% - 25px);
|
|
214
|
+
`;
|
|
215
|
+
export const StyledDrawer = styled(Drawer, {
|
|
216
|
+
shouldForwardProp: (prop) => prop !== 'open'
|
|
217
|
+
}) `
|
|
218
|
+
box-shadow: none;
|
|
219
|
+
box-sizing: border-box;
|
|
220
|
+
flexshrink: 0;
|
|
221
|
+
overflow-x: visible;
|
|
222
|
+
transition: width 225ms ${motion.easeInOut} 0ms !important;
|
|
223
|
+
white-space: nowrap;
|
|
224
|
+
width: ${props => !props.open ? `calc(${props.theme.spacing(7)} + 1px)` : `${DRAWER_WIDTH.Expanded}px`};
|
|
225
|
+
|
|
226
|
+
@media (min-width: ${props => props.theme.breakpoints.values.sm}) {
|
|
227
|
+
width: ${props => !props.open ? `calc(${props.theme.spacing(8)} + 1px)` : `${DRAWER_WIDTH.Expanded}px`};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.MuiDrawer-paper {
|
|
231
|
+
background: transparent none;
|
|
232
|
+
border: 0;
|
|
233
|
+
box-shadow: none;
|
|
234
|
+
color: ${props => props.theme.palette.mode === 'dark'
|
|
235
|
+
? props.theme.palette.primary.contrastText
|
|
236
|
+
: props.theme.palette.getContrastText(props.theme.palette.background.paper)};
|
|
237
|
+
overflow: visible !important;
|
|
238
|
+
overflow-x: visible;
|
|
239
|
+
transform: translateX(0) !important;
|
|
240
|
+
transition: width 225ms ${motion.easeInOut} 0ms !important;
|
|
241
|
+
visibility: visible;
|
|
242
|
+
width: ${props => !props.open ? `calc(${props.theme.spacing(7)} + 1px)` : `${DRAWER_WIDTH.Expanded}px`};
|
|
243
|
+
|
|
244
|
+
[theme.breakpoints.up('sm')] {
|
|
245
|
+
width: ${props => !props.open ? `calc(${props.theme.spacing(8)} + 1px)` : `${DRAWER_WIDTH.Expanded}px`};
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
`;
|
|
249
|
+
export const StyledNotchShadow = styled(Box) `
|
|
250
|
+
border-radius: 50%;
|
|
251
|
+
box-shadow: 0px -7px 10px -5px rgb(0 0 0 / 20%), 0px 2px 10px 0px rgb(0 0 0 / 14%), 0px 0px 8px 0px rgb(0 0 0 / 12%);
|
|
252
|
+
height: 13px;
|
|
253
|
+
left: 13px;
|
|
254
|
+
position: absolute;
|
|
255
|
+
top: -7px;
|
|
256
|
+
width: 25px;
|
|
257
|
+
z-index: -2;
|
|
258
|
+
`;
|
|
259
|
+
export const StyledNotchShadowMask = styled(Box) `
|
|
260
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
261
|
+
border-radius: 50%;
|
|
262
|
+
height: 13px;
|
|
263
|
+
left: 13px;
|
|
264
|
+
position: absolute;
|
|
265
|
+
top: -1px;
|
|
266
|
+
width: 25px;
|
|
267
|
+
z-index: -1;
|
|
268
|
+
`;
|
|
269
|
+
export const StyledAvatar = styled(Avatar) `
|
|
270
|
+
background-color: ${props => getOffsetNavigationBackground(props.theme)};
|
|
271
|
+
color: ${props => getOffsetNavigationContrastText(props.theme)};
|
|
272
|
+
font-weight: bold;
|
|
273
|
+
`;
|
|
@@ -1,28 +1,29 @@
|
|
|
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 { useSpring, animated, easings } from '@react-spring/web';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
reverse: props
|
|
3
|
+
const Path = (props) => (_jsx(animated.path, { fill: 'transparent', strokeWidth: '3', stroke: 'inherit', strokeLinecap: 'round', ...props }));
|
|
4
|
+
const ToggleSearchX = (props) => {
|
|
5
|
+
const animationDefaults = {
|
|
6
|
+
reverse: props?.isOpen,
|
|
18
7
|
config: {
|
|
19
8
|
duration: 150,
|
|
20
9
|
easing: easings.easeInOutQuad
|
|
21
10
|
}
|
|
22
11
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
const handle = useSpring({
|
|
13
|
+
...animationDefaults,
|
|
14
|
+
from: { d: 'M 15 15 L 35 35' },
|
|
15
|
+
to: { d: 'M 26 26 L 35 35' }
|
|
16
|
+
});
|
|
17
|
+
const closeBar = useSpring({
|
|
18
|
+
...animationDefaults,
|
|
19
|
+
from: { d: 'M 15 35 L 35 15', opacity: 1, scale: 1 },
|
|
20
|
+
to: { d: 'M 26 26 L 35 35', opacity: 0, scale: 0 }
|
|
21
|
+
});
|
|
22
|
+
const circle = useSpring({
|
|
23
|
+
...animationDefaults,
|
|
24
|
+
from: { opacity: 0, scale: 0 },
|
|
25
|
+
to: { opacity: 1, scale: 1 }
|
|
26
|
+
});
|
|
27
|
+
return (_jsxs("svg", { width: '40', height: '40', viewBox: '0 0 50 50', stroke: 'inherit', children: [_jsx(Path, { ...handle }), _jsx(Path, { ...closeBar }), _jsx(animated.circle, { ...circle, cx: '20', cy: '20', r: '8', fill: 'transparent', strokeWidth: '3', stroke: 'inherit' })] }));
|
|
27
28
|
};
|
|
28
29
|
export default ToggleSearchX;
|
|
@@ -1,28 +1,29 @@
|
|
|
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 { useSpring, animated, easings } from '@react-spring/web';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
reverse: props
|
|
3
|
+
const Path = (props) => (_jsx(animated.path, { fill: 'transparent', strokeWidth: '3', stroke: 'inherit', strokeLinecap: 'round', ...props }));
|
|
4
|
+
const ToggleX = (props) => {
|
|
5
|
+
const animationDefaults = {
|
|
6
|
+
reverse: props?.isOpen,
|
|
18
7
|
config: {
|
|
19
8
|
duration: 150,
|
|
20
9
|
easing: easings.easeInOutQuad
|
|
21
10
|
}
|
|
22
11
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
const topBar = useSpring({
|
|
13
|
+
...animationDefaults,
|
|
14
|
+
from: { d: 'M 15 15 L 35 35' },
|
|
15
|
+
to: { d: 'M 10 15 L 40 15' }
|
|
16
|
+
});
|
|
17
|
+
const middleBar = useSpring({
|
|
18
|
+
...animationDefaults,
|
|
19
|
+
from: { opacity: 0, scale: 0 },
|
|
20
|
+
to: { opacity: 1, scale: 1 }
|
|
21
|
+
});
|
|
22
|
+
const bottomBar = useSpring({
|
|
23
|
+
...animationDefaults,
|
|
24
|
+
from: { d: 'M 15 35 L 35 15' },
|
|
25
|
+
to: { d: 'M 10 35 L 40 35' }
|
|
26
|
+
});
|
|
27
|
+
return (_jsxs("svg", { width: "40", height: "40", viewBox: "0 0 50 50", children: [_jsx(Path, { ...topBar }), _jsx(Path, { d: 'M 10 25 L 40 25', ...middleBar }), _jsx(Path, { ...bottomBar })] }));
|
|
27
28
|
};
|
|
28
29
|
export default ToggleX;
|