@moises.ai/design-system 4.15.3 → 4.15.5
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/index.js +1028 -1068
- package/package.json +1 -1
- package/src/components/PreviewCard/PreviewCard.jsx +14 -34
- package/src/components/PreviewCard/PreviewCard.module.css +4 -120
package/package.json
CHANGED
|
@@ -184,6 +184,10 @@ export const PreviewCard = forwardRef(function PreviewCard(
|
|
|
184
184
|
|
|
185
185
|
const handleInteraction = useCallback(
|
|
186
186
|
(ws, newTime) => {
|
|
187
|
+
if (!showSkeleton) {
|
|
188
|
+
onSelect?.()
|
|
189
|
+
}
|
|
190
|
+
|
|
187
191
|
if (!wavegroup) return
|
|
188
192
|
|
|
189
193
|
const previousActive = wavegroup.state.active
|
|
@@ -228,7 +232,7 @@ export const PreviewCard = forwardRef(function PreviewCard(
|
|
|
228
232
|
isPlaying: wasPlaying,
|
|
229
233
|
}))
|
|
230
234
|
},
|
|
231
|
-
[wavegroup, isSafari, progressColor],
|
|
235
|
+
[wavegroup, isSafari, progressColor, showSkeleton, onSelect],
|
|
232
236
|
)
|
|
233
237
|
|
|
234
238
|
const onFinish = useCallback(() => {
|
|
@@ -288,38 +292,18 @@ export const PreviewCard = forwardRef(function PreviewCard(
|
|
|
288
292
|
<button
|
|
289
293
|
type="button"
|
|
290
294
|
className={classNames(styles.leftButton, isPlaying && styles.isPlaying)}
|
|
291
|
-
onClick={
|
|
292
|
-
e.stopPropagation()
|
|
293
|
-
handleTogglePlay()
|
|
294
|
-
}}
|
|
295
|
+
onClick={handleTogglePlay}
|
|
295
296
|
disabled={showSkeleton}
|
|
296
297
|
aria-label={isPlaying ? 'Pause' : 'Play'}
|
|
297
298
|
>
|
|
298
|
-
|
|
299
|
-
<
|
|
300
|
-
|
|
301
|
-
<
|
|
302
|
-
|
|
303
|
-
<span className={styles.equalizerBar} />
|
|
304
|
-
</span>
|
|
305
|
-
<PauseIcon
|
|
306
|
-
width={18}
|
|
307
|
-
height={18}
|
|
308
|
-
className={styles.pauseOnHover}
|
|
309
|
-
aria-hidden="true"
|
|
310
|
-
/>
|
|
311
|
-
<PlayIcon
|
|
312
|
-
width={18}
|
|
313
|
-
height={18}
|
|
314
|
-
className={styles.playIcon}
|
|
315
|
-
aria-hidden="true"
|
|
316
|
-
/>
|
|
299
|
+
{isPlaying ? (
|
|
300
|
+
<PauseIcon width={18} height={18} aria-hidden="true" />
|
|
301
|
+
) : (
|
|
302
|
+
<PlayIcon width={18} height={18} aria-hidden="true" />
|
|
303
|
+
)}
|
|
317
304
|
</button>
|
|
318
305
|
|
|
319
|
-
<div
|
|
320
|
-
className={styles.waveformContainer}
|
|
321
|
-
onClick={(e) => e.stopPropagation()}
|
|
322
|
-
>
|
|
306
|
+
<div className={styles.waveformContainer}>
|
|
323
307
|
{audio && (
|
|
324
308
|
<WavesurferPlayer
|
|
325
309
|
url={audio}
|
|
@@ -327,7 +311,7 @@ export const PreviewCard = forwardRef(function PreviewCard(
|
|
|
327
311
|
progressColor={progressColor}
|
|
328
312
|
normalize
|
|
329
313
|
barWidth={2}
|
|
330
|
-
barHeight={
|
|
314
|
+
barHeight={1}
|
|
331
315
|
cursorWidth={0}
|
|
332
316
|
height={40}
|
|
333
317
|
onReady={onReady}
|
|
@@ -341,11 +325,7 @@ export const PreviewCard = forwardRef(function PreviewCard(
|
|
|
341
325
|
)}
|
|
342
326
|
</div>
|
|
343
327
|
|
|
344
|
-
{actions &&
|
|
345
|
-
<div className={styles.actions} onClick={(e) => e.stopPropagation()}>
|
|
346
|
-
{actions}
|
|
347
|
-
</div>
|
|
348
|
-
)}
|
|
328
|
+
{actions && <div className={styles.actions}>{actions}</div>}
|
|
349
329
|
</div>
|
|
350
330
|
)
|
|
351
331
|
})
|
|
@@ -10,62 +10,11 @@
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
@keyframes equalizerBar1 {
|
|
14
|
-
0%,
|
|
15
|
-
100% {
|
|
16
|
-
height: 17px;
|
|
17
|
-
}
|
|
18
|
-
50% {
|
|
19
|
-
height: 7px;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@keyframes equalizerBar2 {
|
|
24
|
-
0%,
|
|
25
|
-
100% {
|
|
26
|
-
height: 5px;
|
|
27
|
-
}
|
|
28
|
-
50% {
|
|
29
|
-
height: 17px;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@keyframes equalizerBar3 {
|
|
34
|
-
0%,
|
|
35
|
-
100% {
|
|
36
|
-
height: 21px;
|
|
37
|
-
}
|
|
38
|
-
50% {
|
|
39
|
-
height: 9px;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@keyframes equalizerBar4 {
|
|
44
|
-
0%,
|
|
45
|
-
100% {
|
|
46
|
-
height: 17px;
|
|
47
|
-
}
|
|
48
|
-
50% {
|
|
49
|
-
height: 5px;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@keyframes equalizerBar5 {
|
|
54
|
-
0%,
|
|
55
|
-
100% {
|
|
56
|
-
height: 7px;
|
|
57
|
-
}
|
|
58
|
-
50% {
|
|
59
|
-
height: 17px;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
13
|
.previewCard {
|
|
64
14
|
display: flex;
|
|
65
15
|
align-items: center;
|
|
66
16
|
gap: 12px;
|
|
67
17
|
width: 100%;
|
|
68
|
-
max-width: 344px;
|
|
69
18
|
padding: 4px;
|
|
70
19
|
border-radius: 8px;
|
|
71
20
|
border: 1px solid var(--neutral-alpha-4);
|
|
@@ -138,72 +87,6 @@
|
|
|
138
87
|
opacity: 0;
|
|
139
88
|
}
|
|
140
89
|
|
|
141
|
-
.equalizer {
|
|
142
|
-
display: none;
|
|
143
|
-
align-items: center;
|
|
144
|
-
justify-content: center;
|
|
145
|
-
gap: 1.8px;
|
|
146
|
-
width: 19px;
|
|
147
|
-
height: 21px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.equalizerBar {
|
|
151
|
-
display: block;
|
|
152
|
-
width: 2px;
|
|
153
|
-
border-radius: 4.8px;
|
|
154
|
-
background: var(--neutral-alpha-11);
|
|
155
|
-
flex-shrink: 0;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.equalizerBar:nth-child(1) {
|
|
159
|
-
height: 17px;
|
|
160
|
-
animation: equalizerBar1 0.8s ease-in-out infinite;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.equalizerBar:nth-child(2) {
|
|
164
|
-
height: 5px;
|
|
165
|
-
animation: equalizerBar2 0.8s ease-in-out infinite;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.equalizerBar:nth-child(3) {
|
|
169
|
-
height: 21px;
|
|
170
|
-
animation: equalizerBar3 0.8s ease-in-out infinite;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.equalizerBar:nth-child(4) {
|
|
174
|
-
height: 17px;
|
|
175
|
-
animation: equalizerBar4 0.8s ease-in-out infinite;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.equalizerBar:nth-child(5) {
|
|
179
|
-
height: 7px;
|
|
180
|
-
animation: equalizerBar5 0.8s ease-in-out infinite;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.pauseOnHover {
|
|
184
|
-
display: none;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.playIcon {
|
|
188
|
-
display: flex;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.leftButton.isPlaying .equalizer {
|
|
192
|
-
display: flex;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.leftButton.isPlaying .playIcon {
|
|
196
|
-
display: none !important;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.previewCard.playing:has(.leftButton:hover) .equalizer {
|
|
200
|
-
display: none;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.previewCard.playing:has(.leftButton:hover) .pauseOnHover {
|
|
204
|
-
display: flex;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
90
|
.waveformContainer {
|
|
208
91
|
position: relative;
|
|
209
92
|
flex: 1 1 0;
|
|
@@ -213,11 +96,12 @@
|
|
|
213
96
|
cursor: pointer;
|
|
214
97
|
}
|
|
215
98
|
|
|
216
|
-
.waveformContainer
|
|
217
|
-
|
|
99
|
+
.waveformContainer > div {
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 40px;
|
|
218
102
|
}
|
|
219
103
|
|
|
220
|
-
.skeleton .waveformContainer
|
|
104
|
+
.skeleton .waveformContainer > div {
|
|
221
105
|
visibility: hidden;
|
|
222
106
|
}
|
|
223
107
|
|