@moises.ai/design-system 4.14.8 → 4.14.9

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.14.9",
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,7 +248,34 @@
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
+ }
254
+
255
+ .cardWrapperLoading:hover .listCardsItem {
256
+ background-color: transparent !important;
257
+ outline: 1px solid var(--neutral-alpha-4) !important;
258
+ outline-offset: -1px;
259
+ }
260
+
261
+ .loadingIcon {
262
+ width: 21px;
263
+ height: 21px;
264
+ color: var(--neutral-alpha-6);
265
+ transform: scale(0.619);
266
+ will-change: transform, color;
267
+ animation: loadingIconPulse 5s ease-in-out infinite;
268
+ }
269
+
270
+ @keyframes loadingIconPulse {
271
+ 0%, 100% {
272
+ transform: scale(0.619);
273
+ color: var(--neutral-alpha-6);
274
+ }
275
+ 50% {
276
+ transform: scale(1);
277
+ color: var(--accent-10);
278
+ }
251
279
  }
252
280
 
253
281
  .cardWrapperLoading {
@@ -257,16 +285,13 @@
257
285
  .cardWrapperLoading::before {
258
286
  content: '';
259
287
  position: absolute;
260
- inset: -1px;
261
- border-radius: 9px;
288
+ inset: 0;
289
+ border-radius: 8px;
262
290
  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%
291
+ background: radial-gradient(
292
+ circle 200px at var(--loading-x, -50%) 50%,
293
+ rgba(25, 228, 241, 1) 0%,
294
+ rgba(25, 228, 241, 0) 100%
270
295
  );
271
296
  -webkit-mask:
272
297
  linear-gradient(#fff 0 0) content-box,
@@ -276,23 +301,38 @@
276
301
  linear-gradient(#fff 0 0) content-box,
277
302
  linear-gradient(#fff 0 0);
278
303
  mask-composite: exclude;
279
- animation: listCardsLoadingSweep 2s linear infinite;
304
+ animation: listCardsShimmer 5s linear infinite;
280
305
  pointer-events: none;
281
306
  z-index: 1;
282
307
  }
283
308
 
284
- @property --loading-angle {
285
- syntax: "<angle>";
286
- initial-value: 0deg;
309
+ .cardWrapperLoading::after {
310
+ content: '';
311
+ position: absolute;
312
+ inset: 0;
313
+ border-radius: 8px;
314
+ background: radial-gradient(
315
+ circle 200px at var(--loading-x, -50%) 50%,
316
+ rgba(25, 228, 241, 0.15) 0%,
317
+ rgba(25, 228, 241, 0) 100%
318
+ );
319
+ animation: listCardsShimmer 5s linear infinite;
320
+ pointer-events: none;
321
+ z-index: 0;
322
+ }
323
+
324
+ @property --loading-x {
325
+ syntax: "<percentage>";
326
+ initial-value: -50%;
287
327
  inherits: false;
288
328
  }
289
329
 
290
- @keyframes listCardsLoadingSweep {
330
+ @keyframes listCardsShimmer {
291
331
  0% {
292
- --loading-angle: 0deg;
332
+ --loading-x: -80%;
293
333
  }
294
334
  100% {
295
- --loading-angle: 360deg;
335
+ --loading-x: 180%;
296
336
  }
297
337
  }
298
338