@moises.ai/design-system 4.17.2 → 4.17.4

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.17.2",
3
+ "version": "4.17.4",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -1,4 +1,4 @@
1
- import { Flex, Text, Avatar, ScrollArea } from '@radix-ui/themes'
1
+ import { Flex, Text, Avatar, ScrollArea, Skeleton } from '@radix-ui/themes'
2
2
  import { useDroppable } from '@dnd-kit/core'
3
3
  import styles from './SetlistList.module.css'
4
4
  import classNames from 'classnames'
@@ -145,6 +145,7 @@ export const SetlistItem = ({
145
145
  onDragLeave,
146
146
  onDragOver,
147
147
  onDrop,
148
+ isLoading = false,
148
149
  }) => {
149
150
  const [isHovering, setIsHovering] = useState(false)
150
151
 
@@ -210,9 +211,11 @@ export const SetlistItem = ({
210
211
  [styles.collapsedInner]: collapsed,
211
212
  })}
212
213
  >
213
- {avatar && (
214
+ {(avatar || isLoading) && (
214
215
  <div className={styles.avatarSetlist}>
215
- {typeof avatar === 'string' ? (
216
+ {isLoading ? (
217
+ <Skeleton className={styles.avatarSetlistSkeleton} />
218
+ ) : typeof avatar === 'string' ? (
216
219
  <Avatar
217
220
  src={avatar}
218
221
  fallback={<SetlistIcon width={16} height={16} />}
@@ -226,28 +229,37 @@ export const SetlistItem = ({
226
229
  )}
227
230
  <Flex
228
231
  direction="column"
232
+ gap={isLoading ? '1' : '0'}
229
233
  className={classNames(styles.textWrapper, {
230
234
  [styles.textWrapperHidden]: collapsed,
231
235
  })}
232
236
  >
233
- {text && (
234
- <Text
235
- size="2"
236
- weight="regular"
237
- className={styles.textNewSetlist}
238
- truncate
239
- >
240
- {text}
241
- </Text>
242
- )}
243
- <Text
244
- size="1"
245
- weight="regular"
246
- className={styles.textSubtitle}
247
- truncate
248
- >
249
- {subtitle}
250
- </Text>
237
+ {(text || isLoading) &&
238
+ (isLoading ? (
239
+ <Skeleton className={styles.textNewSetlistSkeleton} />
240
+ ) : (
241
+ <Text
242
+ size="2"
243
+ weight="regular"
244
+ className={styles.textNewSetlist}
245
+ truncate
246
+ >
247
+ {text}
248
+ </Text>
249
+ ))}
250
+ {(subtitle || isLoading) &&
251
+ (isLoading ? (
252
+ <Skeleton className={styles.textSubtitleSkeleton} />
253
+ ) : (
254
+ <Text
255
+ size="1"
256
+ weight="regular"
257
+ className={styles.textSubtitle}
258
+ truncate
259
+ >
260
+ {subtitle}
261
+ </Text>
262
+ ))}
251
263
  </Flex>
252
264
  </Flex>
253
265
  {dropdownMenuOptions &&
@@ -292,6 +304,7 @@ export const SetlistList = ({
292
304
  droppable = false,
293
305
  activeDropSetlistId = null,
294
306
  enableDndDropTargets = false,
307
+ className,
295
308
  }) => {
296
309
  const { close, isMobile: isMobileDrawer } = useMobileDrawerContext()
297
310
  const [openSetlistMenuId, setOpenSetlistMenuId] = useState(null)
@@ -575,7 +588,7 @@ export const SetlistList = ({
575
588
  ) : (
576
589
  <NewSetlistButton
577
590
  onClick={handleNewSetlistClick}
578
- className={classNames({
591
+ className={classNames(className, {
579
592
  [styles.staggerItem]: isStaggerActive,
580
593
  [styles.staggerAnimateIn]: isStaggerActive && isExpanding,
581
594
  [styles.staggerAnimateOut]: isStaggerActive && isShrinking,
@@ -620,10 +633,11 @@ export const SetlistList = ({
620
633
  moises={setlist.moises}
621
634
  text={setlist.label}
622
635
  subtitle={setlist.subtitle}
636
+ isLoading={setlist.isLoading}
623
637
  dropdownMenuOptions={setlist.dropdownMenuOptions}
624
638
  collapsed={itemCollapsed}
625
639
  isMobile={isMobile}
626
- className={classNames({
640
+ className={classNames(className, {
627
641
  [styles.collapsedStackItem]: showCollapsedStack,
628
642
  [styles.collapsedTransition]: collapsed && showCollapsedStack,
629
643
  [styles.staggerItem]: isStaggerActive,
@@ -92,6 +92,12 @@
92
92
  z-index: 1;
93
93
  }
94
94
 
95
+ .avatarSetlistSkeleton {
96
+ width: 100%;
97
+ height: 100%;
98
+ border-radius: 4px;
99
+ }
100
+
95
101
  .avatarClickable {
96
102
  cursor: pointer;
97
103
  }
@@ -128,6 +134,12 @@
128
134
  color: var(--neutral-alpha-11);
129
135
  }
130
136
 
137
+ .textNewSetlistSkeleton {
138
+ height: 14px;
139
+ width: 126px;
140
+ border-radius: 4px;
141
+ }
142
+
131
143
  .collapsed .textNewSetlist {
132
144
  opacity: 0;
133
145
  }
@@ -140,6 +152,12 @@
140
152
  white-space: nowrap;
141
153
  }
142
154
 
155
+ .textSubtitleSkeleton {
156
+ height: 12px;
157
+ width: 95px;
158
+ border-radius: 4px;
159
+ }
160
+
143
161
  .collapsed .textSubtitle {
144
162
  opacity: 0;
145
163
  }
@@ -236,6 +236,28 @@ export const Empty = {
236
236
  },
237
237
  }
238
238
 
239
+ const loadingSetlists = [
240
+ { id: 'loading-1', isLoading: true },
241
+ { id: 'loading-2', isLoading: true },
242
+ { id: 'loading-3', isLoading: true },
243
+ ]
244
+
245
+ export const Loading = {
246
+ render: (args) => (
247
+ <SetlistList
248
+ {...args}
249
+ setlists={loadingSetlists}
250
+ onNewSetlistClick={() => {
251
+ args.onNewSetlistClick?.()
252
+ }}
253
+ />
254
+ ),
255
+ args: {
256
+ collapsed: false,
257
+ isMobile: false,
258
+ },
259
+ }
260
+
239
261
  const trackRows = [
240
262
  {
241
263
  id: 'track-1',