@blerp/design 1.2.74 → 1.2.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/cjs/Blerp/BlerpImageRow.js +167 -0
  2. package/dist/cjs/Blerp/BlerpSavePopup.js +157 -0
  3. package/dist/cjs/Blerp/BlerpTitleRow.js +116 -0
  4. package/dist/cjs/Blerp/BlerpTopRow.js +246 -0
  5. package/dist/cjs/Blerp.js +239 -0
  6. package/dist/cjs/BlerpAudioContextProvider.js +141 -0
  7. package/dist/cjs/BlerpListView.js +357 -0
  8. package/dist/cjs/BlerpListViewPremium.js +404 -0
  9. package/dist/cjs/BlerpListViewSkeleton.js +27 -0
  10. package/dist/cjs/BlerpSkeleton.js +23 -0
  11. package/dist/cjs/CollectionCard.js +402 -0
  12. package/dist/cjs/CollectionListViewPremium.js +368 -0
  13. package/dist/cjs/CollectionSkeleton.js +28 -0
  14. package/dist/cjs/Dropdown.js +283 -0
  15. package/dist/cjs/EllipsisLoader.js +51 -0
  16. package/dist/cjs/GroupCard.js +172 -0
  17. package/dist/cjs/Icons/Icons.js +606 -0
  18. package/dist/cjs/ImageUploadModal.js +278 -0
  19. package/dist/cjs/Lotties/JiggleLock.json.js +2762 -0
  20. package/dist/cjs/Lotties/LottieAnimation.js +32 -0
  21. package/dist/cjs/NewBlerp.js +740 -0
  22. package/dist/cjs/NewBlerpTest.js +808 -0
  23. package/dist/cjs/NewCollectionModal.js +403 -0
  24. package/dist/cjs/PremiumCollectionCard.js +511 -0
  25. package/dist/cjs/PurchaseModals/CheckoutModal.js +39 -0
  26. package/dist/cjs/PurchaseModals/PremiumBlerpCheckoutModal.js +39 -0
  27. package/dist/cjs/PurchaseModals/PremiumCollectionCheckoutModal.js +39 -0
  28. package/dist/cjs/PurchaseModals/PremiumSubscriptionCheckoutModal.js +39 -0
  29. package/dist/cjs/ReactionButtons.js +65 -0
  30. package/dist/cjs/ScreenSizeHook.js +34 -0
  31. package/dist/cjs/SnackbarContextProvider.js +166 -0
  32. package/dist/cjs/Theme.js +255 -0
  33. package/dist/cjs/Toggle.js +59 -0
  34. package/dist/cjs/UserCard.js +141 -0
  35. package/dist/cjs/UserPage/LibraryControls.js +315 -0
  36. package/dist/cjs/UserPage/UserLibraryHeader.js +93 -0
  37. package/dist/cjs/UserPage/UserProfileHeader.js +283 -0
  38. package/dist/cjs/UsernameWithPopout.js +93 -0
  39. package/dist/cjs/colors.js +368 -0
  40. package/dist/cjs/icons.js +161 -0
  41. package/dist/cjs/index.js +449 -0
  42. package/dist/esm/Blerp/BlerpImageRow.js +157 -0
  43. package/dist/esm/Blerp/BlerpSavePopup.js +147 -0
  44. package/dist/esm/Blerp/BlerpTitleRow.js +108 -0
  45. package/dist/esm/Blerp/BlerpTopRow.js +236 -0
  46. package/dist/esm/Blerp.js +230 -0
  47. package/dist/esm/BlerpAudioContextProvider.js +132 -0
  48. package/dist/esm/BlerpListView.js +344 -0
  49. package/dist/esm/BlerpListViewPremium.js +391 -0
  50. package/dist/esm/BlerpListViewSkeleton.js +17 -0
  51. package/dist/esm/BlerpSkeleton.js +13 -0
  52. package/dist/esm/CollectionCard.js +392 -0
  53. package/dist/esm/CollectionListViewPremium.js +354 -0
  54. package/dist/esm/CollectionSkeleton.js +18 -0
  55. package/dist/esm/Dropdown.js +273 -0
  56. package/dist/esm/EllipsisLoader.js +41 -0
  57. package/dist/esm/GroupCard.js +162 -0
  58. package/dist/esm/Icons/Icons.js +571 -0
  59. package/dist/esm/ImageUploadModal.js +265 -0
  60. package/dist/esm/Lotties/JiggleLock.json.js +2747 -0
  61. package/dist/esm/Lotties/LottieAnimation.js +25 -0
  62. package/dist/esm/NewBlerp.js +719 -0
  63. package/dist/esm/NewBlerpTest.js +787 -0
  64. package/dist/esm/NewCollectionModal.js +391 -0
  65. package/dist/esm/PremiumCollectionCard.js +498 -0
  66. package/dist/esm/PurchaseModals/CheckoutModal.js +33 -0
  67. package/dist/esm/PurchaseModals/PremiumBlerpCheckoutModal.js +33 -0
  68. package/dist/esm/PurchaseModals/PremiumCollectionCheckoutModal.js +33 -0
  69. package/dist/esm/PurchaseModals/PremiumSubscriptionCheckoutModal.js +33 -0
  70. package/dist/esm/ReactionButtons.js +57 -0
  71. package/dist/esm/ScreenSizeHook.js +30 -0
  72. package/dist/esm/SnackbarContextProvider.js +154 -0
  73. package/dist/esm/Theme.js +246 -0
  74. package/dist/esm/Toggle.js +49 -0
  75. package/dist/esm/UserCard.js +133 -0
  76. package/dist/esm/UserPage/LibraryControls.js +301 -0
  77. package/dist/esm/UserPage/UserLibraryHeader.js +87 -0
  78. package/dist/esm/UserPage/UserProfileHeader.js +268 -0
  79. package/dist/esm/UsernameWithPopout.js +85 -0
  80. package/dist/esm/colors.js +360 -0
  81. package/dist/esm/icons.js +159 -0
  82. package/dist/esm/index.js +336 -0
  83. package/package.json +2 -1
@@ -0,0 +1,392 @@
1
+ import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
2
+ import { BookmarkRounded, BookmarkAddOutlined, AccountCircleRounded, LockRounded, VisibilityOffRounded } from '@mui/icons-material';
3
+ import React, { useState } from 'react';
4
+ import { usePalette } from 'react-palette';
5
+ import { Box, Stack, IconButton, Tooltip, Text } from './index.js';
6
+ import { PremiumCollectionCard } from './PremiumCollectionCard.js';
7
+ import styled from 'styled-components';
8
+ import { TwitchBitIcon } from './Icons/Icons.js';
9
+
10
+ var _templateObject;
11
+ const LineClamp = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin: 5px 0;\n max-width: 92%;\n"]))); //on background click
12
+ //primary and secondary action buttons
13
+
14
+ const CollectionCard = _ref => {
15
+ var _collection$image, _collection$image$ori, _collection$image2, _collection$image2$or, _collection$image3, _collection$image3$or;
16
+
17
+ let {
18
+ collection,
19
+ variantSize,
20
+ handleClickBackground,
21
+ handleClickSave,
22
+ handleClickDrag,
23
+ handleClickView,
24
+ handleClickUnlock,
25
+ handleClickPrimaryAction,
26
+ handleClickSecondaryAction,
27
+ primaryActionButton,
28
+ secondaryActionButton,
29
+ fluid,
30
+ fontSize,
31
+ isLink,
32
+ isPremium,
33
+ isLocked,
34
+ isOwner,
35
+ overrideViewText,
36
+ hideUnlockPlatformText,
37
+ hidePremiumLockIcon,
38
+ unlockPlatformText,
39
+ hideCollectionBackground,
40
+ bottomLeftIcon,
41
+ handleClickBottomLeftIcon,
42
+ premiumDiamondPill
43
+ } = _ref;
44
+ const [cardColors, setCardColors] = useState(null);
45
+ const {
46
+ data,
47
+ loading,
48
+ error
49
+ } = usePalette((collection === null || collection === void 0 ? void 0 : collection.visibility) !== "PRIVATE" || isOwner ? collection === null || collection === void 0 ? void 0 : (_collection$image = collection.image) === null || _collection$image === void 0 ? void 0 : (_collection$image$ori = _collection$image.original) === null || _collection$image$ori === void 0 ? void 0 : _collection$image$ori.url : "black");
50
+
51
+ const renderProfileImage = () => {
52
+ var _collection$ownerObje, _collection$ownerObje2, _collection$ownerObje3, _collection$ownerObje4, _collection$ownerObje5, _collection$ownerObje6;
53
+
54
+ return /*#__PURE__*/React.createElement(Stack, {
55
+ sx: {
56
+ zIndex: "3",
57
+ justifyContent: "center",
58
+ alignItems: "center",
59
+ position: "absolute",
60
+ width: "20px",
61
+ height: "20px",
62
+ borderRadius: "50%",
63
+ top: "5px",
64
+ right: "5px",
65
+ padding: "2px",
66
+ transition: "all .1s ease-in-out"
67
+ }
68
+ }, /*#__PURE__*/React.createElement(IconButton, {
69
+ sx: {
70
+ backgroundColor: "notBlack.override",
71
+ width: "20px",
72
+ height: "20px",
73
+ ":hover": {
74
+ backgroundColor: "ibisRed.main"
75
+ }
76
+ },
77
+ onClick: e => {
78
+ e.stopPropagation();
79
+ handleClickSecondaryAction();
80
+ }
81
+ }, collection !== null && collection !== void 0 && (_collection$ownerObje = collection.ownerObject) !== null && _collection$ownerObje !== void 0 && (_collection$ownerObje2 = _collection$ownerObje.profileImage) !== null && _collection$ownerObje2 !== void 0 && (_collection$ownerObje3 = _collection$ownerObje2.original) !== null && _collection$ownerObje3 !== void 0 && _collection$ownerObje3.url ? /*#__PURE__*/React.createElement("img", {
82
+ alt: "profile",
83
+ src: collection === null || collection === void 0 ? void 0 : (_collection$ownerObje4 = collection.ownerObject) === null || _collection$ownerObje4 === void 0 ? void 0 : (_collection$ownerObje5 = _collection$ownerObje4.profileImage) === null || _collection$ownerObje5 === void 0 ? void 0 : (_collection$ownerObje6 = _collection$ownerObje5.original) === null || _collection$ownerObje6 === void 0 ? void 0 : _collection$ownerObje6.url,
84
+ style: {
85
+ width: "18px",
86
+ height: "18px",
87
+ objectFit: "cover",
88
+ borderRadius: "50%",
89
+ pointerEvents: "none"
90
+ }
91
+ }) : /*#__PURE__*/React.createElement(AccountCircleRounded, {
92
+ sx: {
93
+ fontSize: "16px",
94
+ color: "white.override"
95
+ }
96
+ })));
97
+ };
98
+
99
+ const renderPrimaryActionButton = () => {
100
+ return primaryActionButton ? primaryActionButton : /*#__PURE__*/React.createElement(IconButton, {
101
+ sx: {
102
+ width: "16px",
103
+ height: "16px",
104
+ margin: "0",
105
+ ":hover": {
106
+ backgroundColor: "grey3.override"
107
+ }
108
+ }
109
+ }, collection !== null && collection !== void 0 && collection.saved ? /*#__PURE__*/React.createElement(BookmarkRounded, {
110
+ onClick: e => {
111
+ e.stopPropagation();
112
+ handleClickSave(false);
113
+ },
114
+ sx: {
115
+ fontSize: "16px",
116
+ color: "white.override"
117
+ }
118
+ }) : /*#__PURE__*/React.createElement(BookmarkAddOutlined, {
119
+ onClick: e => {
120
+ e.stopPropagation();
121
+ handleClickSave(true);
122
+ },
123
+ sx: {
124
+ fontSize: "16px",
125
+ color: "white.override"
126
+ }
127
+ }));
128
+ };
129
+
130
+ const smallSize = {
131
+ size: "small",
132
+ width: "70px",
133
+ height: "70px"
134
+ };
135
+ const largeSize = {
136
+ size: "large",
137
+ width: "200px",
138
+ height: "200px"
139
+ };
140
+ let sizeParams = largeSize;
141
+
142
+ if (variantSize === "small") {
143
+ sizeParams = smallSize;
144
+ }
145
+
146
+ if (isPremium) {
147
+ return /*#__PURE__*/React.createElement(PremiumCollectionCard, {
148
+ collection: collection,
149
+ variantSize: variantSize,
150
+ handleClickBackground: handleClickBackground,
151
+ handleClickView: handleClickView,
152
+ handleClickUnlock: handleClickUnlock,
153
+ handleClickSave: handleClickSave,
154
+ handleClickDrag: handleClickDrag,
155
+ handleClickPrimaryAction: handleClickPrimaryAction,
156
+ handleClickSecondaryAction: handleClickSecondaryAction,
157
+ primaryActionButton: primaryActionButton,
158
+ secondaryActionButton: secondaryActionButton,
159
+ fluid: fluid,
160
+ fontSize: fontSize,
161
+ isLink: isLink,
162
+ isPremium: isPremium,
163
+ isLocked: isLocked,
164
+ overrideViewText: overrideViewText,
165
+ hideUnlockPlatformText: hideUnlockPlatformText,
166
+ hidePremiumLockIcon: hidePremiumLockIcon,
167
+ unlockPlatformText: unlockPlatformText,
168
+ hideCollectionBackground: hideCollectionBackground,
169
+ bottomLeftIcon: bottomLeftIcon,
170
+ handleClickBottomLeftIcon: handleClickBottomLeftIcon,
171
+ premiumDiamondPill: premiumDiamondPill
172
+ });
173
+ }
174
+
175
+ return /*#__PURE__*/React.createElement(Box, {
176
+ sx: {
177
+ display: "flex",
178
+ alignItems: "center",
179
+ width: fluid ? "80%" : sizeParams.width,
180
+ height: fluid ? "80%" : sizeParams.height // ":hover #collection-background-1": {
181
+ // transform: "rotate(7deg)",
182
+ // height: "91%",
183
+ // right: "-11px",
184
+ // top: "12px",
185
+ // },
186
+ // ":hover #collection-background-2": {
187
+ // transform: "rotate(14deg)",
188
+ // height: "84%",
189
+ // right: "-20px",
190
+ // top: "24px",
191
+ // },
192
+
193
+ }
194
+ }, /*#__PURE__*/React.createElement(Box, {
195
+ onClick: () => {
196
+ handleClickBackground();
197
+ },
198
+ sx: {
199
+ borderRadius: "8px",
200
+ position: "relative",
201
+ width: fluid ? "90%" : sizeParams.width,
202
+ height: fluid ? "90%" : sizeParams.height,
203
+ cursor: "pointer",
204
+ ":hover #collection-background-1": {
205
+ transform: "rotate(7deg)",
206
+ height: "91%",
207
+ right: "-11px",
208
+ top: "12px"
209
+ },
210
+ ":hover #collection-background-2": {
211
+ transform: "rotate(14deg)",
212
+ height: "84%",
213
+ right: "-20px",
214
+ top: "24px"
215
+ }
216
+ }
217
+ }, variantSize !== "small" ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
218
+ sx: {
219
+ backgroundColor: "white.override",
220
+ borderRadius: "8px",
221
+ width: "100%",
222
+ height: "100%",
223
+ position: "absolute",
224
+ top: "0",
225
+ zIndex: "3"
226
+ }
227
+ }), /*#__PURE__*/React.createElement(Box, {
228
+ id: "collection-background-1",
229
+ sx: {
230
+ backgroundImage: "linear-gradient(".concat(data.muted || "#444444", ", #444444)"),
231
+ borderRadius: "8px",
232
+ width: "50%",
233
+ height: "94%",
234
+ position: "absolute",
235
+ transform: "rotate(5deg) scale(1)",
236
+ right: "-8px",
237
+ top: "8px",
238
+ zIndex: "2",
239
+ transition: "0.2s ease-out"
240
+ }
241
+ }), /*#__PURE__*/React.createElement(Box, {
242
+ id: "collection-background-2",
243
+ sx: {
244
+ backgroundImage: "linear-gradient(".concat(data.darkMuted || "#252525", ", #252525)"),
245
+ borderRadius: "8px",
246
+ width: "50%",
247
+ height: "89%",
248
+ position: "absolute",
249
+ transform: "rotate(10deg) scale(1)",
250
+ right: "-16px",
251
+ top: "16px",
252
+ zIndex: "1",
253
+ transition: "0.2s ease-out"
254
+ }
255
+ }), (collection === null || collection === void 0 ? void 0 : collection.visibility) === "PRIVATE" && !isOwner ? /*#__PURE__*/React.createElement(Box, {
256
+ sx: {
257
+ backgroundColor: "grey3.main",
258
+ backgroundSize: "cover",
259
+ backgroundPosition: "center",
260
+ backgroundRepeat: "no-repeat",
261
+ width: "100%",
262
+ height: "100%",
263
+ borderRadius: "8px",
264
+ display: "flex",
265
+ flexDirection: "column",
266
+ justifyContent: "space-between",
267
+ alignItems: "center",
268
+ position: "absolute",
269
+ zIndex: "3"
270
+ }
271
+ }, /*#__PURE__*/React.createElement("div", {
272
+ style: {
273
+ height: "20%"
274
+ }
275
+ }), /*#__PURE__*/React.createElement(Stack, {
276
+ direction: "row",
277
+ sx: {
278
+ position: "absolute",
279
+ top: "5px",
280
+ left: "5px",
281
+ backgroundColor: "notBlack.override",
282
+ opacity: "0.7",
283
+ borderRadius: "20px",
284
+ padding: "3px 6px",
285
+ boxSizing: "border-box",
286
+ alignItems: "center"
287
+ }
288
+ }, renderPrimaryActionButton()), renderProfileImage(), /*#__PURE__*/React.createElement(Tooltip, {
289
+ title: "This collection has been removed or hidden"
290
+ }, /*#__PURE__*/React.createElement(LockRounded, {
291
+ sx: {
292
+ color: "white.override",
293
+ fontSize: "35px"
294
+ }
295
+ })), /*#__PURE__*/React.createElement(LineClamp, null, /*#__PURE__*/React.createElement(Text, {
296
+ fontSize: fontSize ? fontSize : "22px",
297
+ color: "white.override",
298
+ textAlign: "center"
299
+ }, collection === null || collection === void 0 ? void 0 : collection.title))) : /*#__PURE__*/React.createElement(Box, {
300
+ sx: {
301
+ backgroundImage: "linear-gradient(".concat(data.muted || "#000000", "7a, #0000007a), url(").concat(collection === null || collection === void 0 ? void 0 : (_collection$image2 = collection.image) === null || _collection$image2 === void 0 ? void 0 : (_collection$image2$or = _collection$image2.original) === null || _collection$image2$or === void 0 ? void 0 : _collection$image2$or.url, ")"),
302
+ backgroundSize: "cover",
303
+ backgroundPosition: "center",
304
+ backgroundRepeat: "no-repeat",
305
+ width: "100%",
306
+ height: "100%",
307
+ borderRadius: "8px",
308
+ display: "flex",
309
+ justifyContent: "center",
310
+ alignItems: "center",
311
+ position: "absolute",
312
+ zIndex: "3"
313
+ }
314
+ }, /*#__PURE__*/React.createElement(Stack, {
315
+ direction: "row",
316
+ sx: {
317
+ position: "absolute",
318
+ top: "5px",
319
+ left: "5px",
320
+ backgroundColor: "notBlack.override",
321
+ opacity: "0.7",
322
+ borderRadius: "20px",
323
+ padding: "3px 6px",
324
+ boxSizing: "border-box",
325
+ alignItems: "center"
326
+ }
327
+ }, (collection === null || collection === void 0 ? void 0 : collection.edgeType) !== "NewTwitchGroupEdge" && renderPrimaryActionButton(), (collection === null || collection === void 0 ? void 0 : collection.edgeType) === "NewTwitchGroupEdge" && /*#__PURE__*/React.createElement(Tooltip, {
328
+ title: "Featured on Twitch Bits"
329
+ }, /*#__PURE__*/React.createElement(Stack, {
330
+ sx: {
331
+ alignItems: "center"
332
+ }
333
+ }, /*#__PURE__*/React.createElement(TwitchBitIcon, {
334
+ sx: {
335
+ color: "white.override",
336
+ zIndex: "1",
337
+ fontSize: "18px"
338
+ }
339
+ }))), (collection === null || collection === void 0 ? void 0 : collection.visibility) === "PRIVATE" && isOwner && /*#__PURE__*/React.createElement(Tooltip, {
340
+ title: "Private"
341
+ }, /*#__PURE__*/React.createElement(LockRounded, {
342
+ sx: {
343
+ marginLeft: "4px",
344
+ fontSize: "16px",
345
+ color: "white.override"
346
+ }
347
+ })), (collection === null || collection === void 0 ? void 0 : collection.visibility) === "UNLISTED" && /*#__PURE__*/React.createElement(Tooltip, {
348
+ title: "Unlisted"
349
+ }, /*#__PURE__*/React.createElement(VisibilityOffRounded, {
350
+ sx: {
351
+ marginLeft: "4px",
352
+ fontSize: "16px",
353
+ color: "white.override"
354
+ }
355
+ }))), secondaryActionButton ? secondaryActionButton : renderProfileImage(), /*#__PURE__*/React.createElement(LineClamp, null, isLink ? /*#__PURE__*/React.createElement("a", {
356
+ href: "/sound-collection/".concat(collection._id),
357
+ style: {
358
+ color: "white",
359
+ textDecoration: "none"
360
+ }
361
+ }, /*#__PURE__*/React.createElement(Text, {
362
+ fontSize: fontSize ? fontSize : "22px",
363
+ color: "white.override",
364
+ textAlign: "center",
365
+ sx: {
366
+ ":hover": {
367
+ textDecoration: "underline"
368
+ }
369
+ }
370
+ }, collection === null || collection === void 0 ? void 0 : collection.title)) : /*#__PURE__*/React.createElement(Text, {
371
+ fontSize: fontSize ? fontSize : "22px",
372
+ color: "white.override",
373
+ textAlign: "center"
374
+ }, collection === null || collection === void 0 ? void 0 : collection.title)))) : /*#__PURE__*/React.createElement(Box, {
375
+ sx: {
376
+ backgroundImage: "linear-gradient(".concat(cardColors ? cardColors[0] : "#000000", "7a, #0000004a), url(").concat(collection === null || collection === void 0 ? void 0 : (_collection$image3 = collection.image) === null || _collection$image3 === void 0 ? void 0 : (_collection$image3$or = _collection$image3.original) === null || _collection$image3$or === void 0 ? void 0 : _collection$image3$or.url, ")"),
377
+ backgroundSize: "cover",
378
+ backgroundPosition: "center",
379
+ backgroundRepeat: "no-repeat",
380
+ width: "100%",
381
+ height: "100%",
382
+ borderRadius: "8px",
383
+ display: "flex",
384
+ justifyContent: "center",
385
+ alignItems: "center",
386
+ position: "relative"
387
+ }
388
+ })));
389
+ };
390
+
391
+ export default CollectionCard;
392
+ export { CollectionCard };