@moises.ai/design-system 4.14.8 → 4.15.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moises.ai/design-system",
3
- "version": "4.14.8",
3
+ "version": "4.15.0",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -9,6 +9,7 @@ import {
9
9
  } from '@radix-ui/themes'
10
10
  import classNames from 'classnames'
11
11
  import React from 'react'
12
+ import { SparklesIcon } from '../../icons/SparklesIcon'
12
13
  import { ThumbnailPicker } from '../ThumbnailPicker/ThumbnailPicker'
13
14
  import styles from './ListCards.module.css'
14
15
 
@@ -157,18 +158,20 @@ const CardDetails = ({
157
158
  : itemAvatar
158
159
 
159
160
  return (
160
- <div className={classNames(
161
- styles.cardWrapper,
162
- loading && styles.cardWrapperLoading,
163
- disabled && styles.cardWrapperDisabled,
164
- )}>
161
+ <div
162
+ className={classNames(
163
+ styles.cardWrapper,
164
+ loading && styles.cardWrapperLoading,
165
+ (disabled || loading) && styles.cardWrapperDisabled,
166
+ )}
167
+ >
165
168
  <RadioCards.Item
166
169
  value={itemId}
167
170
  className={classNames(
168
171
  className,
169
172
  styles.listCardsItem,
170
173
  loading && styles.listCardsItemLoading,
171
- disabled && styles.listCardsItemDisabled,
174
+ (disabled || loading) && styles.listCardsItemDisabled,
172
175
  )}
173
176
  style={{
174
177
  '--color-surface': 'transparent',
@@ -188,15 +191,16 @@ const CardDetails = ({
188
191
  overflow: 'hidden',
189
192
  }}
190
193
  >
191
- {!onAvatarClick && (
192
- avatarContent ? (
194
+ {!onAvatarClick &&
195
+ (loading ? (
193
196
  <div className={styles.listCardsAvatarIcon}>
194
- {avatarContent}
197
+ <SparklesIcon className={styles.loadingIcon} />
195
198
  </div>
199
+ ) : avatarContent ? (
200
+ <div className={styles.listCardsAvatarIcon}>{avatarContent}</div>
196
201
  ) : (
197
202
  <Avatar src={avatarUrl} className={styles.listCardsAvatar} />
198
- )
199
- )}
203
+ ))}
200
204
  <Flex direction="column" justify="center">
201
205
  <Text as="div" size="2" className={styles.listCardsItemText}>
202
206
  {itemName}
@@ -61,6 +61,7 @@
61
61
  .listCardsAvatarIcon {
62
62
  width: 60px;
63
63
  height: 60px;
64
+ min-width: 60px;
64
65
  border-radius: 6px;
65
66
 
66
67
  background: var(--neutral-alpha-2);
@@ -247,26 +248,57 @@
247
248
  }
248
249
 
249
250
  .listCardsItemLoading {
250
- outline: none !important;
251
+ outline: 1px solid var(--neutral-alpha-4) !important;
252
+ outline-offset: -1px;
253
+ pointer-events: none;
254
+ }
255
+
256
+ .listCardsItemLoading:hover {
257
+ background-color: transparent !important;
258
+ outline: 1px solid var(--neutral-alpha-4) !important;
259
+ outline-offset: -1px;
260
+ }
261
+
262
+ .loadingIcon {
263
+ width: 21px;
264
+ height: 21px;
265
+ color: var(--neutral-alpha-6);
266
+ transform: scale(0.619);
267
+ will-change: transform, color;
268
+ animation: loadingIconPulse 5s ease-in-out infinite;
269
+ }
270
+
271
+ @keyframes loadingIconPulse {
272
+ 0%, 100% {
273
+ transform: scale(0.619);
274
+ color: var(--neutral-alpha-6);
275
+ }
276
+ 50% {
277
+ transform: scale(1);
278
+ color: var(--accent-10);
279
+ }
251
280
  }
252
281
 
253
282
  .cardWrapperLoading {
254
283
  position: relative;
284
+ cursor: default;
285
+ pointer-events: none;
286
+ }
287
+
288
+ .cardWrapperLoading .customActions {
289
+ pointer-events: auto;
255
290
  }
256
291
 
257
292
  .cardWrapperLoading::before {
258
293
  content: '';
259
294
  position: absolute;
260
- inset: -1px;
261
- border-radius: 9px;
295
+ inset: 0;
296
+ border-radius: 8px;
262
297
  padding: 1px;
263
- background: conic-gradient(
264
- from var(--loading-angle, 0deg),
265
- transparent 0%,
266
- transparent 60%,
267
- rgba(25, 228, 241, 0.6) 80%,
268
- rgba(25, 228, 241, 1) 90%,
269
- transparent 100%
298
+ background: radial-gradient(
299
+ circle 200px at var(--loading-x, -50%) 50%,
300
+ rgba(25, 228, 241, 1) 0%,
301
+ rgba(25, 228, 241, 0) 100%
270
302
  );
271
303
  -webkit-mask:
272
304
  linear-gradient(#fff 0 0) content-box,
@@ -276,23 +308,38 @@
276
308
  linear-gradient(#fff 0 0) content-box,
277
309
  linear-gradient(#fff 0 0);
278
310
  mask-composite: exclude;
279
- animation: listCardsLoadingSweep 2s linear infinite;
311
+ animation: listCardsShimmer 5s linear infinite;
280
312
  pointer-events: none;
281
313
  z-index: 1;
282
314
  }
283
315
 
284
- @property --loading-angle {
285
- syntax: "<angle>";
286
- initial-value: 0deg;
316
+ .cardWrapperLoading::after {
317
+ content: '';
318
+ position: absolute;
319
+ inset: 0;
320
+ border-radius: 8px;
321
+ background: radial-gradient(
322
+ circle 200px at var(--loading-x, -50%) 50%,
323
+ rgba(25, 228, 241, 0.15) 0%,
324
+ rgba(25, 228, 241, 0) 100%
325
+ );
326
+ animation: listCardsShimmer 5s linear infinite;
327
+ pointer-events: none;
328
+ z-index: 0;
329
+ }
330
+
331
+ @property --loading-x {
332
+ syntax: "<percentage>";
333
+ initial-value: -50%;
287
334
  inherits: false;
288
335
  }
289
336
 
290
- @keyframes listCardsLoadingSweep {
337
+ @keyframes listCardsShimmer {
291
338
  0% {
292
- --loading-angle: 0deg;
339
+ --loading-x: -80%;
293
340
  }
294
341
  100% {
295
- --loading-angle: 360deg;
342
+ --loading-x: 180%;
296
343
  }
297
344
  }
298
345