@cuemath/leap 3.3.24 → 3.3.25-af-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/dist/assets/lottie/lottie.js +2 -2
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +6 -6
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/pill-button/pill-button.js +19 -19
- package/dist/features/auth/comps/pill-button/pill-button.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +4 -5
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/pla-signup/signup-header/signup-header.js +1 -1
- package/dist/features/auth/pla-signup/signup-header/signup-header.js.map +1 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js +24 -24
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/constants.js +5 -7
- package/dist/features/circle-games/hooks/use-circle-sounds/constants.js.map +1 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js +73 -72
- package/dist/features/circle-games/hooks/use-circle-sounds/use-circle-sounds.js.map +1 -1
- package/dist/features/circle-games/sign-up/comp/circular-steps/circular-steps.js +12 -12
- package/dist/features/circle-games/sign-up/comp/circular-steps/circular-steps.js.map +1 -1
- package/dist/features/circle-games/sign-up/sign-up-types.js.map +1 -1
- package/dist/features/circle-games/sign-up/sign-up.js +128 -156
- package/dist/features/circle-games/sign-up/sign-up.js.map +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +29 -23
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js +1 -1
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js +40 -42
- package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +64 -70
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js +29 -54
- package/dist/features/milestone/create/comps/add-custom-chapter/hooks/use-catalog-helpers.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js +28 -48
- package/dist/features/milestone/create/comps/chapters-selection-step/chapter-selection-step-v2/chapter-category/chapter-category-container.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js +76 -79
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js +94 -97
- package/dist/features/milestone/create/comps/chapters-selection-step/utils.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js +143 -160
- package/dist/features/milestone/create/comps/class-details-step/class-details-step.js.map +1 -1
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js +12 -22
- package/dist/features/milestone/create/comps/class-details-step/class-details-utils.js.map +1 -1
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js +59 -64
- package/dist/features/milestone/create/comps/test-type-step/test-type-step.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-container.js +15 -17
- package/dist/features/milestone/create/milestone-create-container.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-helpers.js +153 -170
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js.map +1 -1
- package/dist/features/milestone/create/milestone-create.js +17 -19
- package/dist/features/milestone/create/milestone-create.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +42 -45
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-types.js +2 -3
- package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +127 -139
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
- package/dist/features/sentry/constants/ignored.js +6 -10
- package/dist/features/sentry/constants/ignored.js.map +1 -1
- package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js +7 -8
- package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +1 -1
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +26 -27
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +1 -1
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +16 -16
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals.js +24 -25
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/report-information/report-information-styled.js +13 -15
- package/dist/features/trial-session/comps/session-report/report-information/report-information-styled.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/report-information/report-information.js +1 -1
- package/dist/features/trial-session/comps/session-report/report-information/report-information.js.map +1 -1
- package/dist/features/trial-session/comps/worksheet/worksheet.js +23 -23
- package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/ui/dot-lottie-animations/dot-lottie-animation.js +75 -88
- package/dist/features/ui/dot-lottie-animations/dot-lottie-animation.js.map +1 -1
- package/dist/features/ui/lottie-animation/lottie-animation.js +46 -55
- package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +15 -48
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +38 -46
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/{stickers/sticker-selector/comps/sticker/sticker-styled.js → ui/sticker-grid/sticker-grid-styles.js} +45 -15
- package/dist/features/ui/sticker-grid/sticker-grid-styles.js.map +1 -0
- package/dist/features/ui/sticker-grid/sticker-grid.js +24 -0
- package/dist/features/ui/sticker-grid/sticker-grid.js.map +1 -0
- package/dist/features/ui/sticker-grid/sticker.js +57 -0
- package/dist/features/ui/sticker-grid/sticker.js.map +1 -0
- package/dist/features/ui/stickers/constants.js +6 -0
- package/dist/features/ui/stickers/constants.js.map +1 -0
- package/dist/features/ui/stickers/stickers-effects.js +64 -0
- package/dist/features/ui/stickers/stickers-effects.js.map +1 -0
- package/dist/features/ui/stickers/stickers-styled.js +29 -0
- package/dist/features/ui/stickers/stickers-styled.js.map +1 -0
- package/dist/features/ui/stickers/stickers-utils.js +91 -0
- package/dist/features/ui/stickers/stickers-utils.js.map +1 -0
- package/dist/features/ui/stickers/stickers.js +40 -0
- package/dist/features/ui/stickers/stickers.js.map +1 -0
- package/dist/index.d.ts +59 -138
- package/dist/index.js +467 -485
- package/dist/index.js.map +1 -1
- package/dist/static/error.cbe1ddde.json +1 -0
- package/dist/static/username.9e034d51.json +1 -0
- package/package.json +1 -1
- package/dist/features/auth/signup-unavailable/signup-unavailable-styled.js +0 -16
- package/dist/features/auth/signup-unavailable/signup-unavailable-styled.js.map +0 -1
- package/dist/features/auth/signup-unavailable/signup-unavailable-view.js +0 -62
- package/dist/features/auth/signup-unavailable/signup-unavailable-view.js.map +0 -1
- package/dist/features/auth/signup-unavailable/signup-unavailable.js +0 -17
- package/dist/features/auth/signup-unavailable/signup-unavailable.js.map +0 -1
- package/dist/features/circle-games/hooks/use-circle-sounds/helper.js +0 -19
- package/dist/features/circle-games/hooks/use-circle-sounds/helper.js.map +0 -1
- package/dist/features/circle-games/sign-up/api/use-update-username-api/use-update-username-api.js +0 -9
- package/dist/features/circle-games/sign-up/api/use-update-username-api/use-update-username-api.js.map +0 -1
- package/dist/features/circle-games/sign-up/dal/update-username-dal/update-username-dal.js +0 -38
- package/dist/features/circle-games/sign-up/dal/update-username-dal/update-username-dal.js.map +0 -1
- package/dist/features/parent-dashboard/api/get-student-profile-summary.js +0 -9
- package/dist/features/parent-dashboard/api/get-student-profile-summary.js.map +0 -1
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction-styled.js +0 -10
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +0 -42
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +0 -1
- package/dist/features/parent-dashboard/hooks/use-student-profile-summary-data.js +0 -24
- package/dist/features/parent-dashboard/hooks/use-student-profile-summary-data.js.map +0 -1
- package/dist/features/parent-dashboard/hooks/use-switch-user-journey.js +0 -71
- package/dist/features/parent-dashboard/hooks/use-switch-user-journey.js.map +0 -1
- package/dist/features/parent-dashboard/modals/help-and-support/help-and-support.js +0 -40
- package/dist/features/parent-dashboard/modals/help-and-support/help-and-support.js.map +0 -1
- package/dist/features/parent-dashboard/modals/student-login-info/student-login-info.js +0 -44
- package/dist/features/parent-dashboard/modals/student-login-info/student-login-info.js.map +0 -1
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-helpers.js +0 -32
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-helpers.js.map +0 -1
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js +0 -12
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js.map +0 -1
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js +0 -44
- package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js.map +0 -1
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js +0 -13
- package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js.map +0 -1
- package/dist/features/parent-dashboard/modals/trial-report/trial-report.js +0 -28
- package/dist/features/parent-dashboard/modals/trial-report/trial-report.js.map +0 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-constants.js +0 -43
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-constants.js.map +0 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +0 -59
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +0 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change.js +0 -86
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change.js.map +0 -1
- package/dist/features/stickers/constants.js +0 -235
- package/dist/features/stickers/constants.js.map +0 -1
- package/dist/features/stickers/sticker-selector/comps/sticker/sticker-styled.js.map +0 -1
- package/dist/features/stickers/sticker-selector/comps/sticker/sticker.js +0 -49
- package/dist/features/stickers/sticker-selector/comps/sticker/sticker.js.map +0 -1
- package/dist/features/stickers/sticker-selector/comps/stiker-selector-grid/sticker-selector-grid-styled.js +0 -28
- package/dist/features/stickers/sticker-selector/comps/stiker-selector-grid/sticker-selector-grid-styled.js.map +0 -1
- package/dist/features/stickers/sticker-selector/comps/stiker-selector-grid/sticker-selector-grid.js +0 -26
- package/dist/features/stickers/sticker-selector/comps/stiker-selector-grid/sticker-selector-grid.js.map +0 -1
- package/dist/features/stickers/sticker-selector/sticker-selector-styled.js +0 -13
- package/dist/features/stickers/sticker-selector/sticker-selector-styled.js.map +0 -1
- package/dist/features/stickers/sticker-selector/sticker-selector.js +0 -86
- package/dist/features/stickers/sticker-selector/sticker-selector.js.map +0 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-animations.js +0 -82
- package/dist/features/stickers/stickers-effects/stickers-effects-animations.js.map +0 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-cache.js +0 -19
- package/dist/features/stickers/stickers-effects/stickers-effects-cache.js.map +0 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-helper.js +0 -105
- package/dist/features/stickers/stickers-effects/stickers-effects-helper.js.map +0 -1
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js +0 -37
- package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +0 -1
- package/dist/features/stickers/stickers-effects/stickers-effects.js +0 -67
- package/dist/features/stickers/stickers-effects/stickers-effects.js.map +0 -1
- package/dist/static/error.dd744fa5.json +0 -1
- package/dist/static/username.2c755605.json +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import a from "styled-components";
|
|
2
|
-
const
|
|
3
|
-
({ theme: { colors: t, zIndex: o }, $isClosing: e
|
|
2
|
+
const p = a.div(
|
|
3
|
+
({ theme: { colors: t, zIndex: o }, $isClosing: e }) => `
|
|
4
4
|
position: fixed;
|
|
5
5
|
top: 0;
|
|
6
6
|
left: 0;
|
|
@@ -10,7 +10,6 @@ const l = a.div(
|
|
|
10
10
|
backdrop-filter: blur(40px);
|
|
11
11
|
display: flex;
|
|
12
12
|
animation: ${e ? "backdropFadeOut" : "backdropFadeIn"} 0.2s ease-out forwards;
|
|
13
|
-
pointer-events: ${i ? "auto" : "none"};
|
|
14
13
|
z-index: ${o.MODAL};
|
|
15
14
|
|
|
16
15
|
@keyframes backdropFadeIn {
|
|
@@ -31,7 +30,7 @@ const l = a.div(
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
`
|
|
34
|
-
),
|
|
33
|
+
), l = a.div(
|
|
35
34
|
({ theme: { colors: t }, $isClosing: o, $width: e }) => `
|
|
36
35
|
position: relative;
|
|
37
36
|
align-self: center;
|
|
@@ -101,19 +100,19 @@ const l = a.div(
|
|
|
101
100
|
color: ${t.BLACK_1};
|
|
102
101
|
}
|
|
103
102
|
`
|
|
104
|
-
),
|
|
103
|
+
), d = a.div`
|
|
105
104
|
display: flex;
|
|
106
105
|
align-items: center;
|
|
107
106
|
justify-content: center;
|
|
108
107
|
height: 100vh;
|
|
109
108
|
width: 100%;
|
|
110
|
-
`,
|
|
109
|
+
`, i = 720, r = 800, n = 500, f = a.div(
|
|
111
110
|
({ $isClosing: t }) => `
|
|
112
111
|
position: absolute;
|
|
113
|
-
width: ${
|
|
112
|
+
width: ${i}px;
|
|
114
113
|
height: 100%;
|
|
115
114
|
left: 50%;
|
|
116
|
-
margin-left: ${-(
|
|
115
|
+
margin-left: ${-(i / 2)}px;
|
|
117
116
|
clip-path: polygon(calc(50% - 100px) 0, calc(50% + 100px) 0, 100% 100%, 0 100%);
|
|
118
117
|
background: linear-gradient(
|
|
119
118
|
180deg,
|
|
@@ -121,13 +120,13 @@ const l = a.div(
|
|
|
121
120
|
rgba(0, 0, 0, 0) 100%
|
|
122
121
|
);
|
|
123
122
|
animation: openSpotlight;
|
|
124
|
-
animation-duration: ${
|
|
123
|
+
animation-duration: ${r}ms;
|
|
125
124
|
animation-timing-function: linear;
|
|
126
125
|
animation-fill-mode: forwards;
|
|
127
126
|
opacity: 0;
|
|
128
127
|
${t ? `
|
|
129
128
|
animation: closeSpotlight;
|
|
130
|
-
animation-duration: ${
|
|
129
|
+
animation-duration: ${n}ms;
|
|
131
130
|
animation-timing-function: linear;
|
|
132
131
|
animation-fill-mode: forwards;
|
|
133
132
|
opacity: 1;
|
|
@@ -151,38 +150,7 @@ const l = a.div(
|
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
152
|
`
|
|
154
|
-
),
|
|
155
|
-
({ theme: { colors: t, zIndex: o }, $isClosing: e, $blocking: i }) => `
|
|
156
|
-
position: fixed;
|
|
157
|
-
top: 0;
|
|
158
|
-
left: 0;
|
|
159
|
-
right: 0;
|
|
160
|
-
bottom: 0;
|
|
161
|
-
background-color: ${t.TRANSPARENT};
|
|
162
|
-
display: flex;
|
|
163
|
-
pointer-events: ${i ? "auto" : "none"};
|
|
164
|
-
animation: ${e ? "backdropFadeOut" : "backdropFadeIn"} 0.2s ease-out forwards;
|
|
165
|
-
z-index: ${o.MODAL};
|
|
166
|
-
|
|
167
|
-
@keyframes backdropFadeIn {
|
|
168
|
-
from {
|
|
169
|
-
opacity: 0;
|
|
170
|
-
}
|
|
171
|
-
to {
|
|
172
|
-
opacity: 1;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
@keyframes backdropFadeOut {
|
|
177
|
-
from {
|
|
178
|
-
opacity: 1;
|
|
179
|
-
}
|
|
180
|
-
to {
|
|
181
|
-
opacity: 0;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
`
|
|
185
|
-
), g = a.div(
|
|
153
|
+
), h = a.div(
|
|
186
154
|
({ $isClosing: t }) => `
|
|
187
155
|
width: 100%;
|
|
188
156
|
height: max-content;
|
|
@@ -217,13 +185,12 @@ const l = a.div(
|
|
|
217
185
|
`
|
|
218
186
|
);
|
|
219
187
|
export {
|
|
220
|
-
|
|
188
|
+
l as BaseModal,
|
|
221
189
|
c as BaseModalContent,
|
|
222
|
-
|
|
190
|
+
h as BottomSheetModal,
|
|
223
191
|
m as CloseButtonContainer,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
x as TransparentModalContainer
|
|
192
|
+
p as ModalContainer,
|
|
193
|
+
d as ModalLoaderWrapper,
|
|
194
|
+
f as SpotlightModal
|
|
228
195
|
};
|
|
229
196
|
//# sourceMappingURL=modal-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-styled.js","sources":["../../../../src/features/ui/modals/modal-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nconst ModalContainer = styled.div<{ $isClosing?: boolean
|
|
1
|
+
{"version":3,"file":"modal-styled.js","sources":["../../../../src/features/ui/modals/modal-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nconst ModalContainer = styled.div<{ $isClosing?: boolean }>(\n ({ theme: { colors, zIndex }, $isClosing }) => `\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ${colors.BLACK_T_60};\n backdrop-filter: blur(40px);\n display: flex;\n animation: ${$isClosing ? 'backdropFadeOut' : 'backdropFadeIn'} 0.2s ease-out forwards;\n z-index: ${zIndex.MODAL};\n\n @keyframes backdropFadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n \n @keyframes backdropFadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n`,\n);\n\n/**\n * Base modal container with customizable width and animation state\n */\nconst BaseModal = styled.div<{\n $isClosing?: boolean;\n $width: string;\n}>(\n ({ theme: { colors }, $isClosing, $width }) => `\n position: relative;\n align-self: center;\n margin: 0 auto;\n width: ${$width};\n background-color: ${colors.WHITE_1};\n border: 1px solid ${colors.BLACK_1};\n transform-origin: center center;\n animation: ${\n $isClosing ? 'modalDisappear' : 'modalAppear'\n } 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.20);\n \n /* Responsive behavior for smaller screens */\n @media (max-width: calc(${$width} + 80px)) {\n width: 100%;\n max-width: 100%;\n height: 100%;\n max-height: 100%;\n border: none;\n }\n \n @keyframes modalAppear {\n 0% {\n opacity: 0;\n transform: perspective(1200px) translateZ(-50px) translateY(10px) scale(0.98);\n }\n 100% {\n opacity: 1;\n transform: perspective(1200px) translateZ(0) translateY(0) scale(1);\n }\n }\n \n @keyframes modalDisappear {\n 0% {\n opacity: 1;\n transform: perspective(1200px) translateZ(0) translateY(0) scale(1);\n }\n 100% {\n opacity: 0;\n transform: perspective(1200px) translateZ(-50px) translateY(10px) scale(0.98);\n }\n }\n`,\n);\n\n/**\n * Scrollable content container inside the modal\n */\nconst BaseModalContent = styled.div<{ $modalWidth: string }>(\n ({ $modalWidth }) => `\n max-height: calc(100vh - 142px);\n overflow-y: auto;\n\n @media (max-width: calc(${$modalWidth} + 80px)) {\n max-height: 100vh;\n }\n}`,\n);\n\n/**\n * Container for the close button with responsive positioning\n */\nconst CloseButtonContainer = styled.div<{ $modalWidth: string }>(\n ({ theme: { colors }, $modalWidth }) => `\n position: absolute;\n top: -56px;\n right: -40px;\n color: ${colors.WHITE_1};\n transition: all 0.2s ease;\n \n &:hover {\n transform: scale(1.05);\n }\n\n @media (max-width: calc(${$modalWidth} + 80px)) {\n top: 16px;\n right: 16px;\n color: ${colors.BLACK_1};\n }\n`,\n);\n\nconst ModalLoaderWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n width: 100%;\n`;\n\nconst spotlightWidth = 720;\nconst spotlightAnimationStartDuration = 800;\nconst spotlightAnimationEndDuration = 500;\n\nconst SpotlightModal = styled.div<{\n $isClosing?: boolean;\n}>(\n ({ $isClosing }) => `\n position: absolute;\n width: ${spotlightWidth}px;\n height: 100%;\n left: 50%;\n margin-left: ${-(spotlightWidth / 2)}px;\n clip-path: polygon(calc(50% - 100px) 0, calc(50% + 100px) 0, 100% 100%, 0 100%);\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 1) 0%,\n rgba(0, 0, 0, 0) 100%\n );\n animation: openSpotlight;\n animation-duration: ${spotlightAnimationStartDuration}ms;\n animation-timing-function: linear;\n animation-fill-mode: forwards;\n opacity: 0;\n ${\n $isClosing\n ? `\n animation: closeSpotlight;\n animation-duration: ${spotlightAnimationEndDuration}ms;\n animation-timing-function: linear;\n animation-fill-mode: forwards;\n opacity: 1;\n `\n : ''\n }\n\n @keyframes openSpotlight {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n @keyframes closeSpotlight {\n from {\n transform: rotateY(0);\n }\n to {\n transform: rotateY(90deg);\n }\n }\n`,\n);\n\nconst BottomSheetModal = styled.div<{ $isClosing?: boolean }>(\n ({ $isClosing }) => `\n width: 100%;\n height: max-content;\n overflow: auto;\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n animation: ${$isClosing ? 'slideOut' : 'slideIn'} 0.3s forwards;\n\n @keyframes slideIn {\n from {\n transform: translateY(100%);\n opacity: 0;\n }\n to {\n transform: translateY(0%);\n opacity: 1;\n }\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0%);\n opacity: 1;\n }\n to {\n transform: translateY(100%);\n opacity: 0;\n }\n }\n `,\n);\n\nexport {\n ModalContainer,\n BaseModal,\n BaseModalContent,\n CloseButtonContainer,\n SpotlightModal,\n ModalLoaderWrapper,\n BottomSheetModal,\n};\n"],"names":["ModalContainer","styled","colors","zIndex","$isClosing","BaseModal","$width","BaseModalContent","$modalWidth","CloseButtonContainer","ModalLoaderWrapper","spotlightWidth","spotlightAnimationStartDuration","spotlightAnimationEndDuration","SpotlightModal","BottomSheetModal"],"mappings":";AAEA,MAAMA,IAAiBC,EAAO;AAAA,EAC5B,CAAC,EAAE,OAAO,EAAE,QAAAC,GAAQ,QAAAC,EAAO,GAAG,YAAAC,QAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAM3BF,EAAO,UAAU;AAAA;AAAA;AAAA,eAGxBE,IAAa,oBAAoB,gBAAgB;AAAA,aACnDD,EAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBzB,GAKME,IAAYJ,EAAO;AAAA,EAIvB,CAAC,EAAE,OAAO,EAAE,QAAAC,EAAU,GAAA,YAAAE,GAAY,QAAAE,QAAa;AAAA;AAAA;AAAA;AAAA,WAItCA,CAAM;AAAA,sBACKJ,EAAO,OAAO;AAAA,sBACdA,EAAO,OAAO;AAAA;AAAA,eAGhCE,IAAa,mBAAmB,aAClC;AAAA;AAAA;AAAA;AAAA,4BAI0BE,CAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BlC,GAKMC,IAAmBN,EAAO;AAAA,EAC9B,CAAC,EAAE,aAAAO,EAAA,MAAkB;AAAA;AAAA;AAAA;AAAA,4BAIKA,CAAW;AAAA;AAAA;AAAA;AAIvC,GAKMC,IAAuBR,EAAO;AAAA,EAClC,CAAC,EAAE,OAAO,EAAE,QAAAC,EAAO,GAAG,aAAAM,EAAkB,MAAA;AAAA;AAAA;AAAA;AAAA,WAI/BN,EAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAOGM,CAAW;AAAA;AAAA;AAAA,aAG1BN,EAAO,OAAO;AAAA;AAAA;AAG3B,GAEMQ,IAAqBT,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ5BU,IAAiB,KACjBC,IAAkC,KAClCC,IAAgC,KAEhCC,IAAiBb,EAAO;AAAA,EAG5B,CAAC,EAAE,YAAAG,EAAA,MAAiB;AAAA;AAAA,WAEXO,CAAc;AAAA;AAAA;AAAA,iBAGR,EAAEA,IAAiB,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAQdC,CAA+B;AAAA;AAAA;AAAA;AAAA,IAKnDR,IACI;AAAA;AAAA,4BAEoBS,CAA6B;AAAA;AAAA;AAAA;AAAA,QAKjD,EACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBF,GAEME,IAAmBd,EAAO;AAAA,EAC9B,CAAC,EAAE,YAAAG,EAAA,MAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAQLA,IAAa,aAAa,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBpD;"}
|
|
@@ -1,65 +1,57 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { captureException as
|
|
3
|
-
import { memo as
|
|
4
|
-
import { ErrorBoundary as
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { EDeviceType as
|
|
12
|
-
import { ModalContainer as
|
|
13
|
-
const
|
|
14
|
-
const { device:
|
|
15
|
-
|
|
16
|
-
}, []),
|
|
17
|
-
|
|
1
|
+
import { jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { captureException as E } from "@sentry/browser";
|
|
3
|
+
import { memo as v, useCallback as b, Suspense as n } from "react";
|
|
4
|
+
import { ErrorBoundary as a } from "react-error-boundary";
|
|
5
|
+
import { useTheme as x } from "styled-components";
|
|
6
|
+
import B from "../../../assets/line-icons/icons/cross.js";
|
|
7
|
+
import h from "../error/error.js";
|
|
8
|
+
import S from "../buttons/clickable/clickable.js";
|
|
9
|
+
import W from "../layout/flex-view.js";
|
|
10
|
+
import c from "../loader/app-loader/app-loader.js";
|
|
11
|
+
import { EDeviceType as w } from "../theme/constants.js";
|
|
12
|
+
import { ModalContainer as d, BottomSheetModal as y, ModalLoaderWrapper as g, SpotlightModal as A, BaseModal as L, CloseButtonContainer as j, BaseModalContent as D } from "./modal-styled.js";
|
|
13
|
+
const N = v(({ modal: u, isClosing: r = !1, onClose: m }) => {
|
|
14
|
+
const { device: C } = x(), k = C <= w.MOBILE, { renderAs: s, element: e, modalWidth: i, isDismissable: p, renderOnMobileAs: M } = u, t = b((l) => {
|
|
15
|
+
E(l);
|
|
16
|
+
}, []), $ = b((l) => {
|
|
17
|
+
l.stopPropagation();
|
|
18
18
|
}, []);
|
|
19
|
-
return
|
|
20
|
-
|
|
19
|
+
return s === "bottom-sheet" || k && M === "bottom-sheet" ? /* @__PURE__ */ o(d, { $isClosing: r, onClick: p ? m : () => null, children: /* @__PURE__ */ o(y, { $isClosing: r, onClick: $, children: /* @__PURE__ */ o(
|
|
20
|
+
a,
|
|
21
21
|
{
|
|
22
|
-
$
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
children: /* @__PURE__ */ r(A, { $isClosing: o, onClick: E, children: /* @__PURE__ */ r(
|
|
26
|
-
h,
|
|
27
|
-
{
|
|
28
|
-
fallback: /* @__PURE__ */ r(w, { $gap: 24, children: /* @__PURE__ */ r(d, { height: "100%" }) }),
|
|
29
|
-
onError: n,
|
|
30
|
-
children: /* @__PURE__ */ r(c, { fallback: /* @__PURE__ */ r(s, { height: "50vh" }), children: e })
|
|
31
|
-
}
|
|
32
|
-
) })
|
|
22
|
+
fallback: /* @__PURE__ */ o(W, { $gap: 24, children: /* @__PURE__ */ o(h, { height: "100%" }) }),
|
|
23
|
+
onError: t,
|
|
24
|
+
children: /* @__PURE__ */ o(n, { fallback: /* @__PURE__ */ o(c, { height: "50vh" }), children: e })
|
|
33
25
|
}
|
|
34
|
-
) :
|
|
35
|
-
|
|
26
|
+
) }) }) : s === "spotlight" ? /* @__PURE__ */ o(d, { $isClosing: r, children: /* @__PURE__ */ o(
|
|
27
|
+
a,
|
|
36
28
|
{
|
|
37
|
-
fallback: /* @__PURE__ */
|
|
38
|
-
onError:
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
|
|
29
|
+
fallback: /* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(h, { height: "100vh" }) }),
|
|
30
|
+
onError: t,
|
|
31
|
+
children: /* @__PURE__ */ f(
|
|
32
|
+
n,
|
|
41
33
|
{
|
|
42
|
-
fallback: /* @__PURE__ */
|
|
34
|
+
fallback: /* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(c, { height: "100vh" }) }),
|
|
43
35
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ o(A, { $isClosing: r }),
|
|
45
37
|
e
|
|
46
38
|
]
|
|
47
39
|
}
|
|
48
40
|
)
|
|
49
41
|
}
|
|
50
|
-
) }) :
|
|
51
|
-
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
42
|
+
) }) : /* @__PURE__ */ o(d, { $isClosing: r, children: /* @__PURE__ */ f(L, { $isClosing: r, $width: i, children: [
|
|
43
|
+
p !== !1 && /* @__PURE__ */ o(j, { $modalWidth: i, children: /* @__PURE__ */ o(S, { label: "Close", onClick: m, children: /* @__PURE__ */ o(B, { width: 40, height: 40 }) }) }),
|
|
44
|
+
/* @__PURE__ */ o(D, { $modalWidth: i, children: /* @__PURE__ */ o(
|
|
45
|
+
a,
|
|
54
46
|
{
|
|
55
|
-
fallback: /* @__PURE__ */
|
|
56
|
-
onError:
|
|
57
|
-
children: /* @__PURE__ */
|
|
47
|
+
fallback: /* @__PURE__ */ o(h, { height: "50vh", size: "compact" }),
|
|
48
|
+
onError: t,
|
|
49
|
+
children: /* @__PURE__ */ o(n, { fallback: /* @__PURE__ */ o(c, { height: "50vh" }), children: e })
|
|
58
50
|
}
|
|
59
51
|
) })
|
|
60
52
|
] }) });
|
|
61
53
|
});
|
|
62
54
|
export {
|
|
63
|
-
|
|
55
|
+
N as default
|
|
64
56
|
};
|
|
65
57
|
//# sourceMappingURL=modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sources":["../../../../src/features/ui/modals/modal.tsx"],"sourcesContent":["import type { IModalProps } from './modal-types';\nimport type { FC } from 'react';\n\nimport { captureException } from '@sentry/browser';\nimport { memo, Suspense, useCallback } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { useTheme } from 'styled-components';\n\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport Error from '../../ui/error/error';\nimport Clickable from '../buttons/clickable/clickable';\nimport FlexView from '../layout/flex-view';\nimport AppLoader from '../loader/app-loader/app-loader';\nimport { EDeviceType } from '../theme/constants';\nimport * as Styled from './modal-styled';\n\n/**\n * Modal component that renders modal content with close button\n * Handles animation state for entry and exit transitions\n */\nconst Modal: FC<IModalProps> = memo(({ modal, isClosing = false, onClose }) => {\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n const { renderAs, element, modalWidth, isDismissable, renderOnMobileAs
|
|
1
|
+
{"version":3,"file":"modal.js","sources":["../../../../src/features/ui/modals/modal.tsx"],"sourcesContent":["import type { IModalProps } from './modal-types';\nimport type { FC } from 'react';\n\nimport { captureException } from '@sentry/browser';\nimport { memo, Suspense, useCallback } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { useTheme } from 'styled-components';\n\nimport CrossIcon from '../../../assets/line-icons/icons/cross';\nimport Error from '../../ui/error/error';\nimport Clickable from '../buttons/clickable/clickable';\nimport FlexView from '../layout/flex-view';\nimport AppLoader from '../loader/app-loader/app-loader';\nimport { EDeviceType } from '../theme/constants';\nimport * as Styled from './modal-styled';\n\n/**\n * Modal component that renders modal content with close button\n * Handles animation state for entry and exit transitions\n */\nconst Modal: FC<IModalProps> = memo(({ modal, isClosing = false, onClose }) => {\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n const { renderAs, element, modalWidth, isDismissable, renderOnMobileAs } = modal;\n\n const sentryCaptureException = useCallback((error: Error) => {\n captureException(error);\n }, []);\n\n const handleStopPropagation = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n }, []);\n\n if (renderAs === 'bottom-sheet' || (isMobile && renderOnMobileAs === 'bottom-sheet')) {\n return (\n <Styled.ModalContainer $isClosing={isClosing} onClick={isDismissable ? onClose : () => null}>\n <Styled.BottomSheetModal $isClosing={isClosing} onClick={handleStopPropagation}>\n <ErrorBoundary\n fallback={\n <FlexView $gap={24}>\n <Error height=\"100%\" />\n </FlexView>\n }\n onError={sentryCaptureException}\n >\n <Suspense fallback={<AppLoader height=\"50vh\" />}>{element}</Suspense>\n </ErrorBoundary>\n </Styled.BottomSheetModal>\n </Styled.ModalContainer>\n );\n }\n\n if (renderAs === 'spotlight') {\n return (\n <Styled.ModalContainer $isClosing={isClosing}>\n <ErrorBoundary\n fallback={\n <Styled.ModalLoaderWrapper>\n <Error height=\"100vh\" />\n </Styled.ModalLoaderWrapper>\n }\n onError={sentryCaptureException}\n >\n <Suspense\n fallback={\n <Styled.ModalLoaderWrapper>\n <AppLoader height=\"100vh\" />\n </Styled.ModalLoaderWrapper>\n }\n >\n <Styled.SpotlightModal $isClosing={isClosing} />\n {element}\n </Suspense>\n </ErrorBoundary>\n </Styled.ModalContainer>\n );\n }\n\n return (\n <Styled.ModalContainer $isClosing={isClosing}>\n <Styled.BaseModal $isClosing={isClosing} $width={modalWidth}>\n {isDismissable !== false && (\n <Styled.CloseButtonContainer $modalWidth={modalWidth}>\n <Clickable label=\"Close\" onClick={onClose}>\n <CrossIcon width={40} height={40} />\n </Clickable>\n </Styled.CloseButtonContainer>\n )}\n <Styled.BaseModalContent $modalWidth={modalWidth}>\n <ErrorBoundary\n fallback={<Error height=\"50vh\" size=\"compact\" />}\n onError={sentryCaptureException}\n >\n <Suspense fallback={<AppLoader height=\"50vh\" />}>{element}</Suspense>\n </ErrorBoundary>\n </Styled.BaseModalContent>\n </Styled.BaseModal>\n </Styled.ModalContainer>\n );\n});\n\nexport default Modal;\n"],"names":["Modal","memo","modal","isClosing","onClose","device","useTheme","isMobile","EDeviceType","renderAs","element","modalWidth","isDismissable","renderOnMobileAs","sentryCaptureException","useCallback","error","captureException","handleStopPropagation","e","Styled.ModalContainer","Styled.BottomSheetModal","jsx","ErrorBoundary","FlexView","Error","Suspense","AppLoader","Styled.ModalLoaderWrapper","jsxs","Styled.SpotlightModal","Styled.BaseModal","Styled.CloseButtonContainer","Clickable","CrossIcon","Styled.BaseModalContent"],"mappings":";;;;;;;;;;;;AAoBM,MAAAA,IAAyBC,EAAK,CAAC,EAAE,OAAAC,GAAO,WAAAC,IAAY,IAAO,SAAAC,QAAc;AACvE,QAAA,EAAE,QAAAC,MAAWC,KACbC,IAAWF,KAAUG,EAAY,QACjC,EAAE,UAAAC,GAAU,SAAAC,GAAS,YAAAC,GAAY,eAAAC,GAAe,kBAAAC,EAAqB,IAAAX,GAErEY,IAAyBC,EAAY,CAACC,MAAiB;AAC3D,IAAAC,EAAiBD,CAAK;AAAA,EACxB,GAAG,CAAE,CAAA,GAECE,IAAwBH,EAAY,CAACI,MAAwB;AACjE,IAAAA,EAAE,gBAAgB;AAAA,EACpB,GAAG,CAAE,CAAA;AAEL,SAAIV,MAAa,kBAAmBF,KAAYM,MAAqB,mCAEhEO,GAAA,EAAsB,YAAYjB,GAAW,SAASS,IAAgBR,IAAU,MAAM,MACrF,4BAACiB,GAAA,EAAwB,YAAYlB,GAAW,SAASe,GACvD,UAAA,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,4BACGC,GAAS,EAAA,MAAM,IACd,UAAC,gBAAAF,EAAAG,GAAA,EAAM,QAAO,OAAA,CAAO,EACvB,CAAA;AAAA,MAEF,SAASX;AAAA,MAET,UAAA,gBAAAQ,EAACI,KAAS,UAAU,gBAAAJ,EAACK,KAAU,QAAO,OAAO,CAAA,GAAK,UAAQjB,EAAA,CAAA;AAAA,IAAA;AAAA,EAAA,EAE9D,CAAA,EACF,CAAA,IAIAD,MAAa,cAEZ,gBAAAa,EAAAF,GAAA,EAAsB,YAAYjB,GACjC,UAAA,gBAAAmB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,4BACGK,GAAA,EACC,UAAC,gBAAAN,EAAAG,GAAA,EAAM,QAAO,QAAQ,CAAA,GACxB;AAAA,MAEF,SAASX;AAAA,MAET,UAAA,gBAAAe;AAAA,QAACH;AAAA,QAAA;AAAA,UACC,4BACGE,GAAA,EACC,UAAC,gBAAAN,EAAAK,GAAA,EAAU,QAAO,QAAQ,CAAA,GAC5B;AAAA,UAGF,UAAA;AAAA,YAAA,gBAAAL,EAACQ,GAAA,EAAsB,YAAY3B,EAAW,CAAA;AAAA,YAC7CO;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAEJ,EAAA,CAAA,IAKD,gBAAAY,EAAAF,GAAA,EAAsB,YAAYjB,GACjC,UAAC,gBAAA0B,EAAAE,GAAA,EAAiB,YAAY5B,GAAW,QAAQQ,GAC9C,UAAA;AAAA,IAAkBC,MAAA,wBAChBoB,GAAA,EAA4B,aAAarB,GACxC,4BAACsB,GAAU,EAAA,OAAM,SAAQ,SAAS7B,GAChC,4BAAC8B,GAAU,EAAA,OAAO,IAAI,QAAQ,IAAI,GACpC,EACF,CAAA;AAAA,IAED,gBAAAZ,EAAAa,GAAA,EAAwB,aAAaxB,GACpC,UAAA,gBAAAW;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,UAAW,gBAAAD,EAAAG,GAAA,EAAM,QAAO,QAAO,MAAK,WAAU;AAAA,QAC9C,SAASX;AAAA,QAET,UAAA,gBAAAQ,EAACI,KAAS,UAAU,gBAAAJ,EAACK,KAAU,QAAO,OAAO,CAAA,GAAK,UAAQjB,EAAA,CAAA;AAAA,MAAA;AAAA,IAAA,GAE9D;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import r from "styled-components";
|
|
2
|
+
const e = r.div`
|
|
3
3
|
position: relative;
|
|
4
4
|
width: ${({ $size: t }) => typeof t == "number" ? `${t}px` : t};
|
|
5
5
|
height: ${({ $size: t }) => typeof t == "number" ? `${t}px` : t};
|
|
@@ -12,8 +12,6 @@ const n = e.div`
|
|
|
12
12
|
transition: all 0.2s ease;
|
|
13
13
|
background-color: transparent;
|
|
14
14
|
opacity: ${({ $disabled: t }) => t ? 0.5 : 1};
|
|
15
|
-
pointer-events: ${({ $disabled: t }) => t ? "none" : "auto"};
|
|
16
|
-
user-select: none;
|
|
17
15
|
|
|
18
16
|
&:hover {
|
|
19
17
|
transform: ${({ $disabled: t }) => t ? "none" : "scale(1.1)"};
|
|
@@ -23,34 +21,66 @@ const n = e.div`
|
|
|
23
21
|
&:active {
|
|
24
22
|
transform: ${({ $disabled: t }) => t ? "none" : "scale(0.95)"};
|
|
25
23
|
}
|
|
26
|
-
`,
|
|
24
|
+
`, n = r.div`
|
|
27
25
|
font-size: ${({ $size: t }) => typeof t == "number" ? `${t * 0.7}px` : "70%"};
|
|
28
26
|
line-height: 1;
|
|
29
|
-
display:
|
|
27
|
+
display: flex;
|
|
30
28
|
align-items: center;
|
|
31
29
|
justify-content: center;
|
|
32
30
|
width: 100%;
|
|
33
31
|
height: 100%;
|
|
34
32
|
transition: opacity 0.2s ease;
|
|
35
|
-
`,
|
|
33
|
+
`, a = r.div`
|
|
36
34
|
position: absolute;
|
|
37
35
|
top: 50%;
|
|
38
36
|
left: 50%;
|
|
39
37
|
width: ${({ $size: t }) => typeof t == "number" ? `${t * 0.7}px` : t};
|
|
40
38
|
height: ${({ $size: t }) => typeof t == "number" ? `${t * 0.7}px` : t};
|
|
39
|
+
opacity: 0;
|
|
40
|
+
transition: opacity 0.2s ease;
|
|
41
41
|
transform: translate(-50%, -50%);
|
|
42
42
|
pointer-events: none;
|
|
43
|
-
display: 'flex';
|
|
44
|
-
opacity: ${({ $visible: t }) => t ? 1 : 0};
|
|
45
|
-
transition: opacity 0.2s ease;
|
|
46
43
|
|
|
47
|
-
${
|
|
44
|
+
${e}:hover & {
|
|
48
45
|
opacity: 1;
|
|
49
46
|
}
|
|
47
|
+
`, i = r.div`
|
|
48
|
+
display: grid;
|
|
49
|
+
grid-template-columns: repeat(${({ $columns: t }) => t}, 1fr);
|
|
50
|
+
gap: ${({ $gap: t }) => t}px;
|
|
51
|
+
padding: 16px;
|
|
52
|
+
background-color: #2a2a2a;
|
|
53
|
+
border-radius: 12px;
|
|
54
|
+
max-height: 400px;
|
|
55
|
+
overflow-y: auto;
|
|
56
|
+
|
|
57
|
+
&::-webkit-scrollbar {
|
|
58
|
+
width: 8px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&::-webkit-scrollbar-track {
|
|
62
|
+
background: rgba(255, 255, 255, 0.1);
|
|
63
|
+
border-radius: 4px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&::-webkit-scrollbar-thumb {
|
|
67
|
+
background: rgba(255, 255, 255, 0.3);
|
|
68
|
+
border-radius: 4px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
72
|
+
background: rgba(255, 255, 255, 0.5);
|
|
73
|
+
}
|
|
74
|
+
`, c = r.div`
|
|
75
|
+
width: 100%;
|
|
76
|
+
max-width: ${({ $width: t }) => t};
|
|
77
|
+
max-height: ${({ $height: t }) => t};
|
|
50
78
|
`;
|
|
51
79
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
80
|
+
a as LottieContainer,
|
|
81
|
+
n as StaticEmoji,
|
|
82
|
+
e as StickerContainer,
|
|
83
|
+
i as StickerGrid,
|
|
84
|
+
c as StickerGridContainer
|
|
55
85
|
};
|
|
56
|
-
//# sourceMappingURL=sticker-
|
|
86
|
+
//# sourceMappingURL=sticker-grid-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticker-grid-styles.js","sources":["../../../../src/features/ui/sticker-grid/sticker-grid-styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StickerContainer = styled.div<{\n $size: number | string;\n $disabled?: boolean;\n}>`\n position: relative;\n width: ${({ $size }) => (typeof $size === 'number' ? `${$size}px` : $size)};\n height: ${({ $size }) => (typeof $size === 'number' ? `${$size}px` : $size)};\n cursor: ${({ $disabled }) => ($disabled ? 'none' : 'pointer')};\n border-radius: 8px;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n background-color: transparent;\n opacity: ${({ $disabled }) => ($disabled ? 0.5 : 1)};\n\n &:hover {\n transform: ${({ $disabled }) => ($disabled ? 'none' : 'scale(1.1)')};\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n &:active {\n transform: ${({ $disabled }) => ($disabled ? 'none' : 'scale(0.95)')};\n }\n`;\n\nexport const StaticEmoji = styled.div<{ $size: number | string }>`\n font-size: ${({ $size }) => {\n if (typeof $size === 'number') {\n return `${$size * 0.7}px`;\n }\n\n return '70%';\n }};\n line-height: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n transition: opacity 0.2s ease;\n`;\n\nexport const LottieContainer = styled.div<{ $size: number | string }>`\n position: absolute;\n top: 50%;\n left: 50%;\n width: ${({ $size }) => (typeof $size === 'number' ? `${$size * 0.7}px` : $size)};\n height: ${({ $size }) => (typeof $size === 'number' ? `${$size * 0.7}px` : $size)};\n opacity: 0;\n transition: opacity 0.2s ease;\n transform: translate(-50%, -50%);\n pointer-events: none;\n\n ${StickerContainer}:hover & {\n opacity: 1;\n }\n`;\n\nexport const StickerGrid = styled.div<{\n $columns: number;\n $gap: number;\n}>`\n display: grid;\n grid-template-columns: repeat(${({ $columns }) => $columns}, 1fr);\n gap: ${({ $gap }) => $gap}px;\n padding: 16px;\n background-color: #2a2a2a;\n border-radius: 12px;\n max-height: 400px;\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n width: 8px;\n }\n\n &::-webkit-scrollbar-track {\n background: rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.3);\n border-radius: 4px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: rgba(255, 255, 255, 0.5);\n }\n`;\n\nexport const StickerGridContainer = styled.div<{\n $width: string;\n $height: string;\n}>`\n width: 100%;\n max-width: ${({ $width }) => $width};\n max-height: ${({ $height }) => $height};\n`;\n"],"names":["StickerContainer","styled","$size","$disabled","StaticEmoji","LottieContainer","StickerGrid","$columns","$gap","StickerGridContainer","$width","$height"],"mappings":";AAEO,MAAMA,IAAmBC,EAAO;AAAA;AAAA,WAK5B,CAAC,EAAE,OAAAC,EAAa,MAAA,OAAOA,KAAU,WAAW,GAAGA,CAAK,OAAOA,CAAM;AAAA,YAChE,CAAC,EAAE,OAAAA,EAAa,MAAA,OAAOA,KAAU,WAAW,GAAGA,CAAK,OAAOA,CAAM;AAAA,YACjE,CAAC,EAAE,WAAAC,EAAA,MAAiBA,IAAY,SAAS,SAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAQlD,CAAC,EAAE,WAAAA,EAAA,MAAiBA,IAAY,MAAM,CAAE;AAAA;AAAA;AAAA,iBAGpC,CAAC,EAAE,WAAAA,EAAA,MAAiBA,IAAY,SAAS,YAAa;AAAA;AAAA;AAAA;AAAA;AAAA,iBAKtD,CAAC,EAAE,WAAAA,EAAA,MAAiBA,IAAY,SAAS,aAAc;AAAA;AAAA,GAI3DC,IAAcH,EAAO;AAAA,eACnB,CAAC,EAAE,OAAAC,QACV,OAAOA,KAAU,WACZ,GAAGA,IAAQ,GAAG,OAGhB,KACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAUUG,IAAkBJ,EAAO;AAAA;AAAA;AAAA;AAAA,WAI3B,CAAC,EAAE,OAAAC,QAAa,OAAOA,KAAU,WAAW,GAAGA,IAAQ,GAAG,OAAOA,CAAM;AAAA,YACtE,CAAC,EAAE,OAAAA,QAAa,OAAOA,KAAU,WAAW,GAAGA,IAAQ,GAAG,OAAOA,CAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM/EF,CAAgB;AAAA;AAAA;AAAA,GAKPM,IAAcL,EAAO;AAAA;AAAA,kCAKA,CAAC,EAAE,UAAAM,EAAS,MAAMA,CAAQ;AAAA,SACnD,CAAC,EAAE,MAAAC,EAAK,MAAMA,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GA0BdC,IAAuBR,EAAO;AAAA;AAAA,eAK5B,CAAC,EAAE,QAAAS,EAAO,MAAMA,CAAM;AAAA,gBACrB,CAAC,EAAE,SAAAC,EAAQ,MAAMA,CAAO;AAAA;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { memo as d } from "react";
|
|
3
|
+
import n from "./sticker.js";
|
|
4
|
+
import { StickerGridContainer as a, StickerGrid as f } from "./sticker-grid-styles.js";
|
|
5
|
+
const h = ({
|
|
6
|
+
stickers: t,
|
|
7
|
+
columns: i = 4,
|
|
8
|
+
gap: e = 8,
|
|
9
|
+
stickerSize: p = 48,
|
|
10
|
+
onStickerClick: o
|
|
11
|
+
}) => /* @__PURE__ */ m(a, { $width: "350px", $height: "400px", children: /* @__PURE__ */ m(f, { $columns: i, $gap: e, children: t.map((r) => /* @__PURE__ */ m(
|
|
12
|
+
n,
|
|
13
|
+
{
|
|
14
|
+
emoji: r.emoji,
|
|
15
|
+
lottieUrl: r.lottieUrl,
|
|
16
|
+
size: p,
|
|
17
|
+
onClick: () => o == null ? void 0 : o(r)
|
|
18
|
+
},
|
|
19
|
+
r.id
|
|
20
|
+
)) }) }), $ = d(h);
|
|
21
|
+
export {
|
|
22
|
+
$ as default
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=sticker-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticker-grid.js","sources":["../../../../src/features/ui/sticker-grid/sticker-grid.tsx"],"sourcesContent":["import type { IStickerGridProps } from './sticker-grid-types';\n\nimport React, { memo } from 'react';\n\nimport Sticker from './sticker';\nimport { StickerGrid, StickerGridContainer } from './sticker-grid-styles';\n\nconst StickerGridComponent: React.FC<IStickerGridProps> = ({\n stickers,\n columns = 4,\n gap = 8,\n stickerSize = 48,\n onStickerClick,\n}) => {\n return (\n <StickerGridContainer $width=\"350px\" $height=\"400px\">\n <StickerGrid $columns={columns} $gap={gap}>\n {stickers.map(sticker => (\n <Sticker\n key={sticker.id}\n emoji={sticker.emoji}\n lottieUrl={sticker.lottieUrl}\n size={stickerSize}\n onClick={() => onStickerClick?.(sticker)}\n />\n ))}\n </StickerGrid>\n </StickerGridContainer>\n );\n};\n\nexport default memo(StickerGridComponent);\n"],"names":["StickerGridComponent","stickers","columns","gap","stickerSize","onStickerClick","jsx","StickerGridContainer","StickerGrid","sticker","Sticker","stickerGrid","memo"],"mappings":";;;;AAOA,MAAMA,IAAoD,CAAC;AAAA,EACzD,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,KAAAC,IAAM;AAAA,EACN,aAAAC,IAAc;AAAA,EACd,gBAAAC;AACF,MAEK,gBAAAC,EAAAC,GAAA,EAAqB,QAAO,SAAQ,SAAQ,SAC3C,UAAA,gBAAAD,EAACE,GAAY,EAAA,UAAUN,GAAS,MAAMC,GACnC,UAAAF,EAAS,IAAI,CACZQ,MAAA,gBAAAH;AAAA,EAACI;AAAA,EAAA;AAAA,IAEC,OAAOD,EAAQ;AAAA,IACf,WAAWA,EAAQ;AAAA,IACnB,MAAML;AAAA,IACN,SAAS,MAAMC,KAAA,gBAAAA,EAAiBI;AAAA,EAAO;AAAA,EAJlCA,EAAQ;AAAA,CAMhB,GACH,EACF,CAAA,GAIWE,IAAAC,EAAKZ,CAAoB;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs as p, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { memo as S, useState as v, useRef as L, useLayoutEffect as M, useCallback as i, useMemo as $ } from "react";
|
|
3
|
+
import g from "../lottie-animation/lottie-animation.js";
|
|
4
|
+
import { StickerContainer as k, StaticEmoji as E, LottieContainer as j } from "./sticker-grid-styles.js";
|
|
5
|
+
const x = ({
|
|
6
|
+
emoji: a,
|
|
7
|
+
lottieUrl: c,
|
|
8
|
+
size: t = 48,
|
|
9
|
+
onClick: o,
|
|
10
|
+
disabled: e = !1
|
|
11
|
+
}) => {
|
|
12
|
+
const [r, u] = v(!1), n = L(null);
|
|
13
|
+
M(() => {
|
|
14
|
+
n.current && n.current.playSegments([0, 1], !0);
|
|
15
|
+
}, []);
|
|
16
|
+
const f = i(() => {
|
|
17
|
+
e || u(!0);
|
|
18
|
+
}, [e]), m = i(() => {
|
|
19
|
+
e || u(!1);
|
|
20
|
+
}, [e]), l = i(() => {
|
|
21
|
+
!e && o && o();
|
|
22
|
+
}, [e, o]), h = $(
|
|
23
|
+
() => ({
|
|
24
|
+
loop: !0,
|
|
25
|
+
renderer: "canvas",
|
|
26
|
+
autoplay: r
|
|
27
|
+
}),
|
|
28
|
+
[r]
|
|
29
|
+
);
|
|
30
|
+
return /* @__PURE__ */ p(
|
|
31
|
+
k,
|
|
32
|
+
{
|
|
33
|
+
$size: t,
|
|
34
|
+
$disabled: e,
|
|
35
|
+
onMouseEnter: f,
|
|
36
|
+
onMouseLeave: m,
|
|
37
|
+
onClick: l,
|
|
38
|
+
children: [
|
|
39
|
+
!r && /* @__PURE__ */ s(E, { $size: t, children: a }),
|
|
40
|
+
c && /* @__PURE__ */ s(j, { $size: t, children: /* @__PURE__ */ s(
|
|
41
|
+
g,
|
|
42
|
+
{
|
|
43
|
+
ref: n,
|
|
44
|
+
src: c,
|
|
45
|
+
width: "100%",
|
|
46
|
+
height: "100%",
|
|
47
|
+
settings: h
|
|
48
|
+
}
|
|
49
|
+
) })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}, d = S(x);
|
|
54
|
+
export {
|
|
55
|
+
d as default
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=sticker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticker.js","sources":["../../../../src/features/ui/sticker-grid/sticker.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../lottie-animation/types';\nimport type { IStickerProps } from './sticker-grid-types';\n\nimport React, { useCallback, useMemo, useRef, useState, memo, useLayoutEffect } from 'react';\n\nimport LottieAnimation from '../lottie-animation/lottie-animation';\nimport { StickerContainer, StaticEmoji, LottieContainer } from './sticker-grid-styles';\n\nconst Sticker: React.FC<IStickerProps> = ({\n emoji,\n lottieUrl,\n size = 48,\n onClick,\n disabled = false,\n}) => {\n const [isHovered, setIsHovered] = useState(false);\n const lottieRef = useRef<ILottieAnimationRef>(null);\n\n useLayoutEffect(() => {\n if (lottieRef.current) {\n lottieRef.current.playSegments([0, 1], true);\n }\n }, []);\n\n const handleMouseEnter = useCallback(() => {\n if (!disabled) setIsHovered(true);\n }, [disabled]);\n\n const handleMouseLeave = useCallback(() => {\n if (!disabled) setIsHovered(false);\n }, [disabled]);\n\n const handleClick = useCallback(() => {\n if (!disabled && onClick) onClick();\n }, [disabled, onClick]);\n\n const lottieSettings = useMemo(\n () => ({\n loop: true,\n renderer: 'canvas',\n autoplay: isHovered,\n }),\n [isHovered],\n );\n\n return (\n <StickerContainer\n $size={size}\n $disabled={disabled}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onClick={handleClick}\n >\n {!isHovered && <StaticEmoji $size={size}>{emoji}</StaticEmoji>}\n\n {lottieUrl && (\n <LottieContainer $size={size}>\n <LottieAnimation\n ref={lottieRef}\n src={lottieUrl}\n width=\"100%\"\n height=\"100%\"\n settings={lottieSettings}\n />\n </LottieContainer>\n )}\n </StickerContainer>\n );\n};\n\nexport default memo(Sticker);\n"],"names":["Sticker","emoji","lottieUrl","size","onClick","disabled","isHovered","setIsHovered","useState","lottieRef","useRef","useLayoutEffect","handleMouseEnter","useCallback","handleMouseLeave","handleClick","lottieSettings","useMemo","jsxs","StickerContainer","jsx","StaticEmoji","LottieContainer","LottieAnimation","Sticker$1","memo"],"mappings":";;;;AAQA,MAAMA,IAAmC,CAAC;AAAA,EACxC,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAAC;AAAA,EACA,UAAAC,IAAW;AACb,MAAM;AACJ,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1CC,IAAYC,EAA4B,IAAI;AAElD,EAAAC,EAAgB,MAAM;AACpB,IAAIF,EAAU,WACZA,EAAU,QAAQ,aAAa,CAAC,GAAG,CAAC,GAAG,EAAI;AAAA,EAE/C,GAAG,CAAE,CAAA;AAEC,QAAAG,IAAmBC,EAAY,MAAM;AACrC,IAACR,KAAUE,EAAa,EAAI;AAAA,EAAA,GAC/B,CAACF,CAAQ,CAAC,GAEPS,IAAmBD,EAAY,MAAM;AACrC,IAACR,KAAUE,EAAa,EAAK;AAAA,EAAA,GAChC,CAACF,CAAQ,CAAC,GAEPU,IAAcF,EAAY,MAAM;AAChC,IAAA,CAACR,KAAYD,KAAiBA;EAAA,GACjC,CAACC,GAAUD,CAAO,CAAC,GAEhBY,IAAiBC;AAAA,IACrB,OAAO;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,MACV,UAAUX;AAAA,IAAA;AAAA,IAEZ,CAACA,CAAS;AAAA,EAAA;AAIV,SAAA,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAOhB;AAAA,MACP,WAAWE;AAAA,MACX,cAAcO;AAAA,MACd,cAAcE;AAAA,MACd,SAASC;AAAA,MAER,UAAA;AAAA,QAAA,CAACT,KAAa,gBAAAc,EAACC,GAAY,EAAA,OAAOlB,GAAO,UAAMF,GAAA;AAAA,QAE/CC,KACC,gBAAAkB,EAACE,GAAgB,EAAA,OAAOnB,GACtB,UAAA,gBAAAiB;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,KAAKd;AAAA,YACL,KAAKP;AAAA,YACL,OAAM;AAAA,YACN,QAAO;AAAA,YACP,UAAUc;AAAA,UAAA;AAAA,QAAA,GAEd;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,GAEeQ,IAAAC,EAAKzB,CAAO;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/features/ui/stickers/constants.ts"],"sourcesContent":["export const STICKER_MIN_SIZE = 32;\nexport const STICKER_MAX_SIZE = 48;\n"],"names":["STICKER_MIN_SIZE","STICKER_MAX_SIZE"],"mappings":"AAAO,MAAMA,IAAmB,IACnBC,IAAmB;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { keyframes as r, css as t } from "styled-components";
|
|
2
|
+
import { randomizeDuration as o } from "./stickers-utils.js";
|
|
3
|
+
const s = r`
|
|
4
|
+
0% {
|
|
5
|
+
transform: translateY(0vh);
|
|
6
|
+
opacity: 1;
|
|
7
|
+
}
|
|
8
|
+
100% {
|
|
9
|
+
transform: translateY(-100vh);
|
|
10
|
+
opacity: 0;
|
|
11
|
+
}
|
|
12
|
+
`, n = r`
|
|
13
|
+
0% {
|
|
14
|
+
transform: translateY(0vh);
|
|
15
|
+
opacity: 1;
|
|
16
|
+
}
|
|
17
|
+
100% {
|
|
18
|
+
transform: translateY(100vh);
|
|
19
|
+
opacity: 0;
|
|
20
|
+
}
|
|
21
|
+
`, e = r`
|
|
22
|
+
0% {
|
|
23
|
+
transform: translateX(var(--from-x)) translateY(var(--from-y)) scale(1);
|
|
24
|
+
opacity: 1;
|
|
25
|
+
}
|
|
26
|
+
100% {
|
|
27
|
+
transform: translateX(0vw) translateY(0vh) scale(1.25);
|
|
28
|
+
opacity: 0;
|
|
29
|
+
}
|
|
30
|
+
`, m = r`
|
|
31
|
+
0% {
|
|
32
|
+
transform: translateX(0) translateY(0vh);
|
|
33
|
+
opacity: 1;
|
|
34
|
+
}
|
|
35
|
+
35% {
|
|
36
|
+
transform: translateX(0) translateY(-50vh) scale(1.25);
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
60% {
|
|
40
|
+
transform: translateX(var(--from-x)) translateY(var(--from-y)) scale(1.25);
|
|
41
|
+
opacity: 0.75;
|
|
42
|
+
}
|
|
43
|
+
100% {
|
|
44
|
+
transform: translateX(var(--from-x)) translateY(-110vh) scale(1.25);
|
|
45
|
+
opacity: 0;
|
|
46
|
+
}
|
|
47
|
+
`, i = {
|
|
48
|
+
float_up: (a) => t`
|
|
49
|
+
animation: ${s} ${o(a)}ms ease-out forwards;
|
|
50
|
+
`,
|
|
51
|
+
fall_down: (a) => t`
|
|
52
|
+
animation: ${n} ${o(a)}ms ease-out forwards;
|
|
53
|
+
`,
|
|
54
|
+
burst_from_edges: (a) => t`
|
|
55
|
+
animation: ${e} ${o(a)}ms linear forwards;
|
|
56
|
+
`,
|
|
57
|
+
pop_expand: (a) => t`
|
|
58
|
+
animation: ${m} ${a}ms cubic-bezier(0.5, 0.1, 0.7, 1) forwards;
|
|
59
|
+
`
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
i as effectAnimations
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=stickers-effects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stickers-effects.js","sources":["../../../../src/features/ui/stickers/stickers-effects.ts"],"sourcesContent":["import type { StickersProps } from './stickers-types';\n\nimport { keyframes, css } from 'styled-components';\n\nimport { randomizeDuration } from './stickers-utils';\n\nconst floatUp = keyframes`\n 0% {\n transform: translateY(0vh);\n opacity: 1;\n }\n 100% {\n transform: translateY(-100vh);\n opacity: 0;\n }\n`;\n\nconst fallDown = keyframes`\n 0% {\n transform: translateY(0vh);\n opacity: 1;\n }\n 100% {\n transform: translateY(100vh);\n opacity: 0;\n }\n`;\n\nconst burstFromEdges = keyframes`\n 0% {\n transform: translateX(var(--from-x)) translateY(var(--from-y)) scale(1);\n opacity: 1;\n }\n 100% {\n transform: translateX(0vw) translateY(0vh) scale(1.25);\n opacity: 0;\n }\n`;\n\nconst popExpand = keyframes`\n 0% {\n transform: translateX(0) translateY(0vh);\n opacity: 1;\n }\n 35% {\n transform: translateX(0) translateY(-50vh) scale(1.25);\n opacity: 1;\n }\n 60% {\n transform: translateX(var(--from-x)) translateY(var(--from-y)) scale(1.25);\n opacity: 0.75;\n }\n 100% {\n transform: translateX(var(--from-x)) translateY(-110vh) scale(1.25);\n opacity: 0;\n }\n`;\n\nexport const effectAnimations: Record<\n StickersProps['effect'],\n (duration: number) => ReturnType<typeof css>\n> = {\n float_up: (duration: number) => css`\n animation: ${floatUp} ${randomizeDuration(duration)}ms ease-out forwards;\n `,\n fall_down: (duration: number) => css`\n animation: ${fallDown} ${randomizeDuration(duration)}ms ease-out forwards;\n `,\n burst_from_edges: (duration: number) => css`\n animation: ${burstFromEdges} ${randomizeDuration(duration)}ms linear forwards;\n `,\n pop_expand: (duration: number) => css`\n animation: ${popExpand} ${duration}ms cubic-bezier(0.5, 0.1, 0.7, 1) forwards;\n `,\n};\n"],"names":["floatUp","keyframes","fallDown","burstFromEdges","popExpand","effectAnimations","duration","css","randomizeDuration"],"mappings":";;AAMA,MAAMA,IAAUC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWVC,IAAWD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWXE,IAAiBF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWjBG,IAAYH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAmBLI,IAGT;AAAA,EACF,UAAU,CAACC,MAAqBC;AAAA,iBACjBP,CAAO,IAAIQ,EAAkBF,CAAQ,CAAC;AAAA;AAAA,EAErD,WAAW,CAACA,MAAqBC;AAAA,iBAClBL,CAAQ,IAAIM,EAAkBF,CAAQ,CAAC;AAAA;AAAA,EAEtD,kBAAkB,CAACA,MAAqBC;AAAA,iBACzBJ,CAAc,IAAIK,EAAkBF,CAAQ,CAAC;AAAA;AAAA,EAE5D,YAAY,CAACA,MAAqBC;AAAA,iBACnBH,CAAS,IAAIE,CAAQ;AAAA;AAEtC;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import $, { css as s } from "styled-components";
|
|
2
|
+
import { effectAnimations as n } from "./stickers-effects.js";
|
|
3
|
+
const h = $.div`
|
|
4
|
+
position: relative;
|
|
5
|
+
width: 100vw;
|
|
6
|
+
height: 100vh;
|
|
7
|
+
background: transparent;
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
`, a = $.div`
|
|
10
|
+
position: absolute;
|
|
11
|
+
z-index: 10;
|
|
12
|
+
|
|
13
|
+
left: ${({ x: t }) => `${t}%`};
|
|
14
|
+
top: ${({ y: t }) => `${t}%`};
|
|
15
|
+
width: ${({ size: t }) => `${t}px`};
|
|
16
|
+
height: ${({ size: t }) => `${t}px`};
|
|
17
|
+
font-size: ${({ size: t }) => `${t}px`};
|
|
18
|
+
|
|
19
|
+
${({ effect: t, duration: i, fromX: o, fromY: e }) => o && e ? s`
|
|
20
|
+
${n[t](i)}
|
|
21
|
+
--from-x: ${o};
|
|
22
|
+
--from-y: ${e};
|
|
23
|
+
` : n[t](i)}
|
|
24
|
+
`;
|
|
25
|
+
export {
|
|
26
|
+
h as Container,
|
|
27
|
+
a as Sticker
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=stickers-styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stickers-styled.js","sources":["../../../../src/features/ui/stickers/stickers-styled.ts"],"sourcesContent":["import type { StickersProps } from './stickers-types';\n\nimport styled, { css } from 'styled-components';\n\nimport { effectAnimations } from './stickers-effects';\n\nexport const Container = styled.div`\n position: relative;\n width: 100vw;\n height: 100vh;\n background: transparent;\n pointer-events: none;\n`;\n\nexport const Sticker = styled.div<{\n effect: StickersProps['effect'];\n duration: number;\n fromX?: string;\n fromY?: string;\n x: number;\n y: number;\n size: number;\n}>`\n position: absolute;\n z-index: 10;\n\n left: ${({ x }) => `${x}%`};\n top: ${({ y }) => `${y}%`};\n width: ${({ size }) => `${size}px`};\n height: ${({ size }) => `${size}px`};\n font-size: ${({ size }) => `${size}px`};\n\n ${({ effect, duration, fromX, fromY }) =>\n fromX && fromY\n ? css`\n ${effectAnimations[effect](duration)}\n --from-x: ${fromX};\n --from-y: ${fromY};\n `\n : effectAnimations[effect](duration)}\n`;\n"],"names":["Container","styled","Sticker","x","y","size","effect","duration","fromX","fromY","css","effectAnimations"],"mappings":";;AAMO,MAAMA,IAAYC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQnBC,IAAUD,EAAO;AAAA;AAAA;AAAA;AAAA,UAYpB,CAAC,EAAE,GAAAE,EAAQ,MAAA,GAAGA,CAAC,GAAG;AAAA,SACnB,CAAC,EAAE,GAAAC,EAAQ,MAAA,GAAGA,CAAC,GAAG;AAAA,WAChB,CAAC,EAAE,MAAAC,EAAW,MAAA,GAAGA,CAAI,IAAI;AAAA,YACxB,CAAC,EAAE,MAAAA,EAAW,MAAA,GAAGA,CAAI,IAAI;AAAA,eACtB,CAAC,EAAE,MAAAA,EAAW,MAAA,GAAGA,CAAI,IAAI;AAAA;AAAA,IAEpC,CAAC,EAAE,QAAAC,GAAQ,UAAAC,GAAU,OAAAC,GAAO,OAAAC,QAC5BD,KAASC,IACLC;AAAA,YACIC,EAAiBL,CAAM,EAAEC,CAAQ,CAAC;AAAA,sBACxBC,CAAK;AAAA,sBACLC,CAAK;AAAA,YAEnBE,EAAiBL,CAAM,EAAEC,CAAQ,CAAC;AAAA;"}
|