@moises.ai/design-system 3.9.30 → 3.10.1

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.30",
3
+ "version": "3.10.1",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -160,7 +160,8 @@ const DataRow = React.memo(function DataRow({
160
160
  key={column.id}
161
161
  className={classNames(
162
162
  styles.projectCell,
163
- index === 0 ? styles.columnProject : styles.dataColumn,
163
+ index === 0 ? styles.columnProject : styles.dataColumn,
164
+ index === 1 ? styles.firstDataColumn : null,
164
165
  { [styles.sortedColumn]: sortedKey === column.id },
165
166
  )}
166
167
  data-column-id={column.id}
@@ -183,7 +184,7 @@ const DataRow = React.memo(function DataRow({
183
184
  trigger={
184
185
  <Flex className={styles.dropdownTriggerWrapper}>
185
186
  <MoreButton
186
- aria-label={`More options for ${row.title}`}
187
+ aria-label={`More options for ${row.title ?? ''}`}
187
188
  className={classNames(styles.dropdownTriggerWrapperIcon, styles.dropdownColumnCell)}
188
189
  />
189
190
  </Flex>
@@ -204,6 +205,7 @@ export const DataTable = ({
204
205
  columns,
205
206
  data,
206
207
  selectedRowIds = [],
208
+ selectedFilesLabel,
207
209
  onClick,
208
210
  renderHeaderActions,
209
211
  sorting,
@@ -434,29 +436,36 @@ export const DataTable = ({
434
436
  key={column.id}
435
437
  className={classNames(styles.columnHeaderCell, {
436
438
  [styles.columnProject]: index === 0,
437
- [styles.dataColumn]: index !== 0,
439
+ [styles.dataColumn]: index !== 0,
440
+ [styles.firstDataColumn]: index === 1,
438
441
  [styles.sortedColumn]: toUpperCase(sortedKey) === toUpperCase(column.id),
439
442
  })}
440
443
  >
441
444
  <Flex align="center" gap="3" height="24px">
442
- {index === 0 ? (
443
- <Text size="2" className={styles.headerTextFirst}>
444
- {column.label}
445
+ {index === 0 && anyRowChecked ? (
446
+ <Text size="2" weight="regular" className={styles.headerTextFirst}>
447
+ {selectedFilesLabel}
445
448
  </Text>
446
- ) : (
449
+ ) : column.sortable ? (
447
450
  <button
448
451
  type="button"
449
- className={styles.sortButton}
452
+ className={classNames(styles.sortButton, {
453
+ [styles.sortButtonFirst]: index === 0,
454
+ })}
450
455
  onClick={() => handleSortClick(column.id)}
451
456
  >
452
457
  <Text size="2">{column.label}</Text>
453
- {sortedKey === column.id &&
458
+ {toUpperCase(sortedKey) === toUpperCase(column.id) &&
454
459
  (sorting?.sort === 'DESC' ? (
455
460
  <ArrowUpIcon width={16} height={16} />
456
461
  ) : (
457
462
  <ArrowDownIcon width={16} height={16} />
458
463
  ))}
459
464
  </button>
465
+ ) : (
466
+ <Text size="2" className={styles.headerText}>
467
+ {column.label}
468
+ </Text>
460
469
  )}
461
470
 
462
471
  {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);
@@ -173,7 +178,7 @@
173
178
 
174
179
  .DataTable :global(.rt-TableColumnHeaderCell:nth-child(2)),
175
180
  .DataTable :global(.rt-TableCell:nth-child(2)) {
176
- max-width: 565px;
181
+ max-width: 480px;
177
182
  min-width: 260px;
178
183
  box-shadow: none;
179
184
  width: 100%;
@@ -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
  }
@@ -396,7 +401,7 @@
396
401
  display: table-cell !important;
397
402
  }
398
403
 
399
- .sortedColumn {
404
+ .dataColumn.sortedColumn {
400
405
  display: table-cell !important;
401
406
  }
402
407
 
@@ -408,4 +413,10 @@
408
413
  .dropdownTriggerWrapperIcon {
409
414
  opacity: 1;
410
415
  }
416
+ }
417
+
418
+ @media (max-width: 1124px) {
419
+ .firstDataColumn {
420
+ display: table-cell !important;
421
+ }
411
422
  }
@@ -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),