@moises.ai/design-system 3.9.29 → 3.10.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": "3.9.29",
3
+ "version": "3.10.0",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -183,7 +183,7 @@ const DataRow = React.memo(function DataRow({
183
183
  trigger={
184
184
  <Flex className={styles.dropdownTriggerWrapper}>
185
185
  <MoreButton
186
- aria-label={`More options for ${row.title}`}
186
+ aria-label={`More options for ${row.title ?? ''}`}
187
187
  className={classNames(styles.dropdownTriggerWrapperIcon, styles.dropdownColumnCell)}
188
188
  />
189
189
  </Flex>
@@ -204,6 +204,7 @@ export const DataTable = ({
204
204
  columns,
205
205
  data,
206
206
  selectedRowIds = [],
207
+ selectedFilesLabel,
207
208
  onClick,
208
209
  renderHeaderActions,
209
210
  sorting,
@@ -439,24 +440,30 @@ export const DataTable = ({
439
440
  })}
440
441
  >
441
442
  <Flex align="center" gap="3" height="24px">
442
- {index === 0 ? (
443
- <Text size="2" className={styles.headerTextFirst}>
444
- {column.label}
443
+ {index === 0 && anyRowChecked ? (
444
+ <Text size="2" weight="regular" className={styles.headerTextFirst}>
445
+ {selectedFilesLabel}
445
446
  </Text>
446
- ) : (
447
+ ) : column.sortable ? (
447
448
  <button
448
449
  type="button"
449
- className={styles.sortButton}
450
+ className={classNames(styles.sortButton, {
451
+ [styles.sortButtonFirst]: index === 0,
452
+ })}
450
453
  onClick={() => handleSortClick(column.id)}
451
454
  >
452
455
  <Text size="2">{column.label}</Text>
453
- {sortedKey === column.id &&
456
+ {toUpperCase(sortedKey) === toUpperCase(column.id) &&
454
457
  (sorting?.sort === 'DESC' ? (
455
458
  <ArrowUpIcon width={16} height={16} />
456
459
  ) : (
457
460
  <ArrowDownIcon width={16} height={16} />
458
461
  ))}
459
462
  </button>
463
+ ) : (
464
+ <Text size="2" className={styles.headerText}>
465
+ {column.label}
466
+ </Text>
460
467
  )}
461
468
 
462
469
  {index === 0 && renderHeaderActions && (
@@ -93,6 +93,7 @@
93
93
 
94
94
  .headerTextFirst {
95
95
  padding: 0;
96
+ color: var(--neutral-alpha-10);
96
97
  }
97
98
 
98
99
  .headerTextFirst {
@@ -125,6 +126,10 @@
125
126
  }
126
127
  }
127
128
 
129
+ .sortButtonFirst {
130
+ padding: 0 12px 0 0;
131
+ }
132
+
128
133
  .headerRow {
129
134
  background: rgba(255, 255, 255, 0);
130
135
  box-shadow: inset 0 -1px var(--neutral-alpha-4);
@@ -375,7 +380,7 @@
375
380
  }
376
381
  }
377
382
 
378
- @media (max-width: 1023px) {
383
+ @media (max-width: 1124px) {
379
384
  .selectColumn {
380
385
  display: none !important;
381
386
  }
@@ -190,19 +190,22 @@ const auxBodyTable = [
190
190
  })),
191
191
  ]
192
192
 
193
- const projectsCount = auxBodyTable.length
194
-
195
193
  const auxHeaderTable = [
196
- { id: 'project', label: `${projectsCount} Projects` },
194
+ {
195
+ id: 'title',
196
+ label: 'Title',
197
+ sortable: true,
198
+ onClick: () => { },
199
+ },
197
200
  {
198
201
  id: 'RECENT',
199
202
  label: 'Created',
200
203
  sortable: true,
201
204
  onClick: () => { },
202
205
  },
203
- { id: 'BPM', label: 'BPM', onClick: () => { } },
204
- { id: 'KEY', label: 'Key', onClick: () => { } },
205
- { id: 'DURATION', label: 'Duration', onClick: () => { } },
206
+ { id: 'BPM', label: 'BPM', onClick: () => { }, sortable: true },
207
+ { id: 'KEY', label: 'Key', onClick: () => { }, sortable: true },
208
+ { id: 'DURATION', label: 'Duration', onClick: () => { }, sortable: true },
206
209
  ]
207
210
 
208
211
  export default {
@@ -325,6 +328,11 @@ const SelectableTemplate = (args) => {
325
328
  console.log('Row clicked:', row)
326
329
  }
327
330
 
331
+ const selectedFilesLabel =
332
+ selectedRowIds.length === 1
333
+ ? '1 file selected'
334
+ : `${selectedRowIds.length} files selected`
335
+
328
336
  return (
329
337
  <DataTable
330
338
  {...args}
@@ -332,6 +340,7 @@ const SelectableTemplate = (args) => {
332
340
  data={sortedRows}
333
341
  sorting={sorting}
334
342
  selectedRowIds={selectedRowIds}
343
+ selectedFilesLabel={selectedFilesLabel}
335
344
  onSelectRow={handleSelectRow}
336
345
  onSelectAll={handleSelectAll}
337
346
  onSort={handleSort}
@@ -375,6 +384,11 @@ const ReorderableTemplate = (args) => {
375
384
  // Reorderable: mostra na ordem atual (sem reaplicar sort) para a reordenação refletir na tela
376
385
  const displayRows = rows
377
386
 
387
+ const selectedFilesLabel =
388
+ selectedRowIds.length === 1
389
+ ? '1 file selected'
390
+ : `${selectedRowIds.length} files selected`
391
+
378
392
  return (
379
393
  <DataTable
380
394
  {...args}
@@ -382,6 +396,7 @@ const ReorderableTemplate = (args) => {
382
396
  data={displayRows}
383
397
  sorting={sorting}
384
398
  selectedRowIds={selectedRowIds}
399
+ selectedFilesLabel={selectedFilesLabel}
385
400
  onSelectRow={(id, checked) =>
386
401
  setSelectedRowIds((prev) =>
387
402
  checked ? [...prev, id] : prev.filter((x) => x !== id),
@@ -1,9 +1,9 @@
1
1
  import classNames from 'classnames'
2
- import lyrics from './Patterns/thumb-song-lyrics.jpg'
3
- import mastering from './Patterns/thumb-song-master.jpg'
4
- import stems from './Patterns/thumb-song-stems.jpg'
5
- import studio from './Patterns/thumb-song-studio.jpg'
6
- import voice from './Patterns/thumb-song-voice.jpg'
2
+ import lyrics from './Patterns/lyrics.png'
3
+ import mastering from './Patterns/master.png'
4
+ import stems from './Patterns/stems.png'
5
+ import studio from './Patterns/studio.png'
6
+ import voice from './Patterns/voice.png'
7
7
 
8
8
  export const ProductsBrandPattern = ({
9
9
  className,