@moises.ai/design-system 3.5.3 → 3.5.5
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/dist/{EditIcon-DOFkQeiV.js → EditIcon-Bn6TqXCt.js} +12 -6
- package/dist/icons.js +1 -1
- package/dist/index.js +3431 -3348
- package/package.json +1 -1
- package/src/components/Button/Button.module.css +19 -2
- package/src/components/DataTable/DataTable.jsx +120 -33
- package/src/components/DataTable/DataTable.module.css +14 -32
- package/src/components/DataTable/DataTable.stories.jsx +13 -7
- package/src/components/DropdownMenu/DropdownMenu.stories.jsx +62 -23
- package/src/components/IconButton/IconButton.module.css +47 -8
- package/src/components/MoreButton/MoreButton.jsx +25 -0
- package/src/components/MoreButton/MoreButton.module.css +43 -0
- package/src/components/MoreButton/MoreButton.stories.jsx +30 -0
- package/src/components/ProductsBrandPattern/Patterns/thumb-song-lyrics.jpg +0 -0
- package/src/components/ProductsBrandPattern/Patterns/thumb-song-master.jpg +0 -0
- package/src/components/ProductsBrandPattern/Patterns/thumb-song-stems.jpg +0 -0
- package/src/components/ProductsBrandPattern/Patterns/thumb-song-studio.jpg +0 -0
- package/src/components/ProductsBrandPattern/Patterns/thumb-song-voice.jpg +0 -0
- package/src/components/ProductsBrandPattern/ProductsBrandPattern.jsx +15 -13
- package/src/components/ProductsBrandPattern/ProductsBrandPattern.stories.jsx +61 -15
- package/src/components/ProfileMenu/MenuTrigger.jsx +14 -9
- package/src/components/ProjectsList/ProjectsList.jsx +122 -94
- package/src/components/ProjectsList/ProjectsList.stories.jsx +7 -5
- package/src/components/ProjectsList/utils-stories.js +24 -0
- package/src/components/SetlistList/SetlistList.jsx +13 -43
- package/src/components/SetlistList/SetlistList.module.css +1 -1
- package/src/components/Sidebar/Sidebar.jsx +6 -3
- package/src/components/Sidebar/Sidebar.module.css +1 -1
- package/src/components/Sidebar/SidebarSection/SidebarSection.module.css +1 -1
- package/src/components/TextArea/TextArea.jsx +1 -1
- package/src/components/TextArea/TextArea.module.css +16 -0
- package/src/components/TextField/TextField.jsx +16 -4
- package/src/components/TextField/TextField.module.css +45 -1
- package/src/components/TextField/TextField.stories.jsx +32 -0
- package/src/icons/DotsVertical2Icon.jsx +7 -8
- package/src/index.jsx +2 -0
- package/src/lib/menu/Menu.module.css +2 -11
- package/src/components/ProductsBrandPattern/Patterns/aiStudio.png +0 -0
- package/src/components/ProductsBrandPattern/Patterns/mastering.png +0 -0
- package/src/components/ProductsBrandPattern/Patterns/product.png +0 -0
- package/src/components/ProductsBrandPattern/Patterns/stemSeparation.png +0 -0
- package/src/components/ProductsBrandPattern/Patterns/voiceStudio.png +0 -0
package/package.json
CHANGED
|
@@ -2,12 +2,22 @@
|
|
|
2
2
|
box-shadow: none;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
.size1 {
|
|
6
|
+
border-radius: 4px;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
.size2 {
|
|
6
10
|
font-size: 14px;
|
|
11
|
+
border-radius: 6px;
|
|
7
12
|
}
|
|
8
13
|
|
|
9
14
|
.size3 {
|
|
10
15
|
font-size: 16px;
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.size4 {
|
|
20
|
+
border-radius: 12px;
|
|
11
21
|
}
|
|
12
22
|
|
|
13
23
|
.solid.disabled,
|
|
@@ -276,13 +286,20 @@
|
|
|
276
286
|
|
|
277
287
|
.ghost.size1 {
|
|
278
288
|
padding: 4px 8px;
|
|
289
|
+
border-radius: 4px;
|
|
279
290
|
}
|
|
280
291
|
|
|
281
292
|
.ghost.size2 {
|
|
282
|
-
|
|
293
|
+
padding: 6px 12px;
|
|
294
|
+
border-radius: 6px;
|
|
283
295
|
}
|
|
284
296
|
|
|
285
297
|
.ghost.size3 {
|
|
286
|
-
|
|
298
|
+
padding: 10px 16px;
|
|
299
|
+
border-radius: 8px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.ghost.size4 {
|
|
303
|
+
border-radius: 12px;
|
|
287
304
|
}
|
|
288
305
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useCallback, useMemo } from 'react'
|
|
1
|
+
import React, { useState, useCallback, useMemo, useRef } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
Flex,
|
|
4
4
|
Table,
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
ProductsBrandPattern,
|
|
8
8
|
DropdownMenu,
|
|
9
9
|
} from '../../index'
|
|
10
|
-
import { ArrowUpIcon, ArrowDownIcon
|
|
10
|
+
import { ArrowUpIcon, ArrowDownIcon } from '../../icons'
|
|
11
|
+
import { MoreButton } from '../MoreButton/MoreButton'
|
|
11
12
|
import styles from './DataTable.module.css'
|
|
12
13
|
import classNames from 'classnames'
|
|
13
14
|
|
|
@@ -15,19 +16,68 @@ const toUpperCase = (str) => (typeof str === 'string' ? str.toUpperCase() : str)
|
|
|
15
16
|
|
|
16
17
|
const DataRow = React.memo(function DataRow({
|
|
17
18
|
row,
|
|
19
|
+
rowIndex,
|
|
18
20
|
columns,
|
|
19
21
|
isSelected,
|
|
22
|
+
anyRowSelected,
|
|
23
|
+
selectedCount,
|
|
20
24
|
sortedKey,
|
|
21
25
|
hasDropdownOptions,
|
|
22
26
|
onRowClick,
|
|
23
27
|
onSelectRow,
|
|
28
|
+
onShiftClickRow,
|
|
24
29
|
renderProjectCell,
|
|
25
30
|
renderDataCell,
|
|
26
31
|
}) {
|
|
32
|
+
const shiftClickRef = useRef(false)
|
|
33
|
+
|
|
34
|
+
const handleRowClick = (e) => {
|
|
35
|
+
if (e.shiftKey) {
|
|
36
|
+
e.preventDefault()
|
|
37
|
+
onShiftClickRow?.(row, rowIndex)
|
|
38
|
+
} else {
|
|
39
|
+
onRowClick?.(row)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const handleCheckboxClick = (e) => {
|
|
44
|
+
e.stopPropagation()
|
|
45
|
+
if (e.shiftKey) {
|
|
46
|
+
e.preventDefault()
|
|
47
|
+
shiftClickRef.current = true
|
|
48
|
+
onShiftClickRow?.(row, rowIndex)
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
shiftClickRef.current = false
|
|
51
|
+
}, 0)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const handleCheckboxCellClick = (e) => {
|
|
56
|
+
e.stopPropagation()
|
|
57
|
+
if (e.shiftKey) {
|
|
58
|
+
e.preventDefault()
|
|
59
|
+
onShiftClickRow?.(row, rowIndex)
|
|
60
|
+
} else {
|
|
61
|
+
onSelectRow?.(row.id, !isSelected)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const handleCheckedChange = (value) => {
|
|
66
|
+
if (shiftClickRef.current) {
|
|
67
|
+
shiftClickRef.current = false
|
|
68
|
+
return
|
|
69
|
+
}
|
|
70
|
+
onSelectRow?.(row.id, value === true)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const showDropdownAlways = isSelected && selectedCount === 1
|
|
74
|
+
|
|
27
75
|
return (
|
|
28
76
|
<Table.Row
|
|
29
|
-
className={classNames({
|
|
30
|
-
|
|
77
|
+
className={classNames({
|
|
78
|
+
[styles.rowSelected]: isSelected,
|
|
79
|
+
[styles.showDropdownOnSelect]: showDropdownAlways,
|
|
80
|
+
})}
|
|
31
81
|
style={
|
|
32
82
|
isSelected ? { '--row-bg': 'var(--aqua-dark-alpha-2)' } : undefined
|
|
33
83
|
}
|
|
@@ -36,14 +86,15 @@ const DataRow = React.memo(function DataRow({
|
|
|
36
86
|
className={styles.selectColumn}
|
|
37
87
|
data-column-id="select"
|
|
38
88
|
data-sorted="false"
|
|
89
|
+
onClick={handleCheckboxCellClick}
|
|
39
90
|
>
|
|
40
91
|
<Checkbox
|
|
41
92
|
size="1"
|
|
42
93
|
checked={isSelected}
|
|
43
|
-
onClick={
|
|
44
|
-
onCheckedChange={
|
|
94
|
+
onClick={handleCheckboxClick}
|
|
95
|
+
onCheckedChange={handleCheckedChange}
|
|
45
96
|
className={classNames(styles.checkboxCell, {
|
|
46
|
-
[styles.showCheckboxCell]: isSelected,
|
|
97
|
+
[styles.showCheckboxCell]: isSelected || anyRowSelected,
|
|
47
98
|
})}
|
|
48
99
|
/>
|
|
49
100
|
</Table.Cell>
|
|
@@ -58,6 +109,7 @@ const DataRow = React.memo(function DataRow({
|
|
|
58
109
|
)}
|
|
59
110
|
data-column-id={column.id}
|
|
60
111
|
data-sorted={sortedKey === column.id}
|
|
112
|
+
onClick={handleRowClick}
|
|
61
113
|
>
|
|
62
114
|
{index === 0
|
|
63
115
|
? renderProjectCell(row)
|
|
@@ -67,19 +119,17 @@ const DataRow = React.memo(function DataRow({
|
|
|
67
119
|
|
|
68
120
|
{hasDropdownOptions && (
|
|
69
121
|
<Table.Cell
|
|
70
|
-
className={classNames(styles.projectCell, styles.dropdownColumn)}
|
|
122
|
+
className={classNames(styles.projectCell, styles.dropdownColumn, styles.dropdownColumnCell)}
|
|
71
123
|
data-column-id="actions"
|
|
72
124
|
>
|
|
73
125
|
{row.dropdownOptions?.length ? (
|
|
74
126
|
<DropdownMenu
|
|
75
127
|
trigger={
|
|
76
|
-
<Flex
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<DotsVertical2Icon />
|
|
82
|
-
</Flex>
|
|
128
|
+
<Flex className={styles.dropdownTriggerWrapper}>
|
|
129
|
+
<MoreButton
|
|
130
|
+
aria-label={`More options for ${row.title}`}
|
|
131
|
+
className={classNames(styles.dropdownTriggerWrapperIcon, styles.dropdownColumnCell)}
|
|
132
|
+
/>
|
|
83
133
|
</Flex>
|
|
84
134
|
}
|
|
85
135
|
options={row.dropdownOptions}
|
|
@@ -108,6 +158,7 @@ export const DataTable = ({
|
|
|
108
158
|
...props
|
|
109
159
|
}) => {
|
|
110
160
|
const [isHeaderHovering, setIsHeaderHovering] = useState(false)
|
|
161
|
+
const anchorRowIndexRef = useRef(null)
|
|
111
162
|
|
|
112
163
|
const sortedKey = sorting?.field
|
|
113
164
|
|
|
@@ -144,24 +195,45 @@ export const DataTable = ({
|
|
|
144
195
|
[onClick],
|
|
145
196
|
)
|
|
146
197
|
|
|
198
|
+
const handleShiftClickRow = useCallback(
|
|
199
|
+
(clickedRow, clickedIndex) => {
|
|
200
|
+
if (!onSelectRow) return
|
|
201
|
+
|
|
202
|
+
const anchorIndex = anchorRowIndexRef.current
|
|
203
|
+
const start = anchorIndex != null ? Math.min(anchorIndex, clickedIndex) : clickedIndex
|
|
204
|
+
const end = anchorIndex != null ? Math.max(anchorIndex, clickedIndex) : clickedIndex
|
|
205
|
+
|
|
206
|
+
for (let i = start; i <= end; i++) {
|
|
207
|
+
onSelectRow(data[i].id, true)
|
|
208
|
+
}
|
|
209
|
+
if (anchorIndex == null) {
|
|
210
|
+
anchorRowIndexRef.current = clickedIndex
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
[data, onSelectRow],
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
const handleSelectRow = useCallback(
|
|
217
|
+
(rowId, checked) => {
|
|
218
|
+
const index = data?.findIndex((r) => r.id === rowId) ?? -1
|
|
219
|
+
if (index >= 0) {
|
|
220
|
+
anchorRowIndexRef.current = index
|
|
221
|
+
}
|
|
222
|
+
onSelectRow?.(rowId, checked)
|
|
223
|
+
},
|
|
224
|
+
[data, onSelectRow],
|
|
225
|
+
)
|
|
226
|
+
|
|
147
227
|
const renderProjectCell = useCallback((row) => {
|
|
148
228
|
return (
|
|
149
229
|
<Flex align="center" gap="3">
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
/>
|
|
158
|
-
) : (
|
|
159
|
-
<ProductsBrandPattern
|
|
160
|
-
id={row.id}
|
|
161
|
-
size={48}
|
|
162
|
-
className={styles.thumb}
|
|
163
|
-
/>
|
|
164
|
-
)}
|
|
230
|
+
<ProductsBrandPattern
|
|
231
|
+
id={row.id}
|
|
232
|
+
size={48}
|
|
233
|
+
className={styles.thumb}
|
|
234
|
+
type={row.type}
|
|
235
|
+
cover={row.thumb}
|
|
236
|
+
/>
|
|
165
237
|
|
|
166
238
|
<Flex direction="column" style={{ minWidth: 0, flex: 1 }}>
|
|
167
239
|
<Text size="2" className={styles.titleText}>
|
|
@@ -175,6 +247,17 @@ export const DataTable = ({
|
|
|
175
247
|
)
|
|
176
248
|
}, [])
|
|
177
249
|
|
|
250
|
+
const handleSelectAllChange = useCallback(
|
|
251
|
+
(value) => {
|
|
252
|
+
if (anyRowChecked && !allRowsChecked) {
|
|
253
|
+
onSelectAll?.(false)
|
|
254
|
+
} else {
|
|
255
|
+
onSelectAll?.(value === true)
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
[anyRowChecked, allRowsChecked, onSelectAll],
|
|
259
|
+
)
|
|
260
|
+
|
|
178
261
|
const renderDataCell = useCallback((row, column, index) => {
|
|
179
262
|
const baseValue = row?.[column.id] ?? row?.[`${column.id}Formatted`]
|
|
180
263
|
const value =
|
|
@@ -219,7 +302,7 @@ export const DataTable = ({
|
|
|
219
302
|
<Checkbox
|
|
220
303
|
size="1"
|
|
221
304
|
checked={allRowsChecked}
|
|
222
|
-
onCheckedChange={
|
|
305
|
+
onCheckedChange={handleSelectAllChange}
|
|
223
306
|
{...(anyRowChecked && !allRowsChecked
|
|
224
307
|
? { checked: 'indeterminate' }
|
|
225
308
|
: {})}
|
|
@@ -278,16 +361,20 @@ export const DataTable = ({
|
|
|
278
361
|
</Table.Header>
|
|
279
362
|
|
|
280
363
|
<Table.Body>
|
|
281
|
-
{data.map((row) => (
|
|
364
|
+
{data.map((row, index) => (
|
|
282
365
|
<DataRow
|
|
283
366
|
key={row.id}
|
|
284
367
|
row={row}
|
|
368
|
+
rowIndex={index}
|
|
285
369
|
columns={columns}
|
|
286
370
|
isSelected={isRowSelected(row.id)}
|
|
371
|
+
anyRowSelected={anyRowChecked}
|
|
372
|
+
selectedCount={selectedCount}
|
|
287
373
|
sortedKey={sortedKey}
|
|
288
374
|
hasDropdownOptions={hasDropdownOptions}
|
|
289
375
|
onRowClick={handleRowClick}
|
|
290
|
-
onSelectRow={
|
|
376
|
+
onSelectRow={handleSelectRow}
|
|
377
|
+
onShiftClickRow={handleShiftClickRow}
|
|
291
378
|
renderProjectCell={renderProjectCell}
|
|
292
379
|
renderDataCell={renderDataCell}
|
|
293
380
|
/>
|
|
@@ -129,6 +129,10 @@
|
|
|
129
129
|
box-shadow: inset 0 -1px var(--neutral-alpha-4);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
.selectColumn {
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
}
|
|
135
|
+
|
|
132
136
|
.checkboxCell {
|
|
133
137
|
width: 14px;
|
|
134
138
|
min-width: 14px;
|
|
@@ -194,7 +198,8 @@
|
|
|
194
198
|
.DataTable :global(.rt-TableColumnHeaderCell:nth-child(2)),
|
|
195
199
|
.DataTable
|
|
196
200
|
:global(.rt-TableColumnHeaderCell:not(:nth-child(1)):not(:nth-child(2))),
|
|
197
|
-
.DataTable :global(.rt-TableColumnHeaderCell:last-child)
|
|
201
|
+
.DataTable :global(.rt-TableColumnHeaderCell:last-child),
|
|
202
|
+
.DataTable :global(.rt-TableHeader) :global(.rt-TableCell:nth-child(1)) {
|
|
198
203
|
box-shadow: inset 0 -1px var(--neutral-alpha-4) !important;
|
|
199
204
|
}
|
|
200
205
|
|
|
@@ -258,11 +263,15 @@
|
|
|
258
263
|
}
|
|
259
264
|
}
|
|
260
265
|
|
|
261
|
-
.
|
|
266
|
+
.projectCell:not(.dropdownColumn) {
|
|
267
|
+
cursor: pointer;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.DataTable :global(.rt-TableRow:hover) .projectCell:not(.dropdownColumn) :not(.artistText) {
|
|
262
271
|
color: #edeef0;
|
|
263
272
|
}
|
|
264
273
|
|
|
265
|
-
.rowSelected .projectCell :not(.artistText) {
|
|
274
|
+
.rowSelected .projectCell:not(.dropdownColumn) :not(.artistText) {
|
|
266
275
|
color: #edeef0;
|
|
267
276
|
}
|
|
268
277
|
|
|
@@ -274,28 +283,8 @@
|
|
|
274
283
|
justify-content: center;
|
|
275
284
|
}
|
|
276
285
|
|
|
277
|
-
.dropdownMenuTrigger {
|
|
278
|
-
color: var(--neutral-alpha-7) !important;
|
|
279
|
-
transition: color 120ms ease-in-out;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
286
|
.dropdownTriggerWrapperIcon {
|
|
283
|
-
height: fit-content;
|
|
284
|
-
padding: 6px 5px;
|
|
285
|
-
border-radius: 9999px;
|
|
286
287
|
opacity: 0;
|
|
287
|
-
transition: opacity 120ms ease-in-out;
|
|
288
|
-
|
|
289
|
-
&:hover {
|
|
290
|
-
cursor: pointer;
|
|
291
|
-
color: var(--neutral-alpha-11);
|
|
292
|
-
background-color: rgba(255, 255, 255, 0.07);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.dropdownTriggerWrapperIcon:hover .dropdownMenuTrigger,
|
|
297
|
-
.dropdownMenuTrigger:hover {
|
|
298
|
-
color: var(--neutral-alpha-10);
|
|
299
288
|
}
|
|
300
289
|
|
|
301
290
|
.dropdownTriggerWrapper[data-state='open'] .dropdownTriggerWrapperIcon {
|
|
@@ -303,18 +292,11 @@
|
|
|
303
292
|
}
|
|
304
293
|
|
|
305
294
|
.DataTable :global(.rt-TableRow:hover) .dropdownTriggerWrapperIcon,
|
|
306
|
-
.
|
|
307
|
-
.
|
|
295
|
+
.dropdownColumn:focus-within .dropdownTriggerWrapperIcon,
|
|
296
|
+
.showDropdownOnSelect .dropdownTriggerWrapperIcon {
|
|
308
297
|
opacity: 1;
|
|
309
298
|
}
|
|
310
299
|
|
|
311
|
-
.dropdownTriggerWrapper[data-state='open'] .dropdownMenuTrigger {
|
|
312
|
-
color: var(--neutral-alpha-10);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.dropdownTriggerWrapperMobile {
|
|
316
|
-
padding: 8px;
|
|
317
|
-
}
|
|
318
300
|
|
|
319
301
|
.headerActions {
|
|
320
302
|
width: max-content;
|
|
@@ -32,6 +32,7 @@ const baseRows = [
|
|
|
32
32
|
{
|
|
33
33
|
id: '2',
|
|
34
34
|
title: 'Let It Be',
|
|
35
|
+
type: 'studio',
|
|
35
36
|
artist: 'The Beatles',
|
|
36
37
|
RECENT: 'Nov 11, 2025',
|
|
37
38
|
BPM: 110,
|
|
@@ -56,6 +57,7 @@ const baseRows = [
|
|
|
56
57
|
id: '3',
|
|
57
58
|
title: 'Here Comes The Sun',
|
|
58
59
|
artist: 'The Beatles',
|
|
60
|
+
type: 'stems',
|
|
59
61
|
RECENT: 'Dec 02, 2025',
|
|
60
62
|
BPM: 129,
|
|
61
63
|
KEY: 'C#',
|
|
@@ -78,6 +80,7 @@ const baseRows = [
|
|
|
78
80
|
{
|
|
79
81
|
id: '4',
|
|
80
82
|
title: 'Yesterday',
|
|
83
|
+
type: 'voice',
|
|
81
84
|
artist: 'The Beatles',
|
|
82
85
|
RECENT: 'Jan 15, 2025',
|
|
83
86
|
BPM: 95,
|
|
@@ -101,6 +104,7 @@ const baseRows = [
|
|
|
101
104
|
{
|
|
102
105
|
id: '5',
|
|
103
106
|
title: 'Help!',
|
|
107
|
+
type: 'master',
|
|
104
108
|
artist: 'The Beatles',
|
|
105
109
|
RECENT: 'Oct 30, 2025',
|
|
106
110
|
BPM: 184,
|
|
@@ -124,6 +128,7 @@ const baseRows = [
|
|
|
124
128
|
{
|
|
125
129
|
id: '6',
|
|
126
130
|
title: 'Something',
|
|
131
|
+
type: 'lyrics',
|
|
127
132
|
artist: 'The Beatles',
|
|
128
133
|
RECENT: 'Sep 20, 2025',
|
|
129
134
|
BPM: 66,
|
|
@@ -148,6 +153,7 @@ const baseRows = [
|
|
|
148
153
|
id: '7',
|
|
149
154
|
title: 'While My Guitar Gently Weeps',
|
|
150
155
|
artist: 'The Beatles',
|
|
156
|
+
type: 'stems',
|
|
151
157
|
RECENT: 'Aug 10, 2025',
|
|
152
158
|
BPM: 88,
|
|
153
159
|
KEY: 'Am',
|
|
@@ -192,11 +198,11 @@ const auxHeaderTable = [
|
|
|
192
198
|
id: 'RECENT',
|
|
193
199
|
label: 'Created',
|
|
194
200
|
sortable: true,
|
|
195
|
-
onClick: () => {},
|
|
201
|
+
onClick: () => { },
|
|
196
202
|
},
|
|
197
|
-
{ id: 'BPM', label: 'BPM', onClick: () => {} },
|
|
198
|
-
{ id: 'KEY', label: 'Key', onClick: () => {} },
|
|
199
|
-
{ id: 'DURATION', label: 'Duration', onClick: () => {} },
|
|
203
|
+
{ id: 'BPM', label: 'BPM', onClick: () => { } },
|
|
204
|
+
{ id: 'KEY', label: 'Key', onClick: () => { } },
|
|
205
|
+
{ id: 'DURATION', label: 'Duration', onClick: () => { } },
|
|
200
206
|
]
|
|
201
207
|
|
|
202
208
|
export default {
|
|
@@ -267,7 +273,7 @@ const SelectableTemplate = (args) => {
|
|
|
267
273
|
|
|
268
274
|
const sortRows = (items, { field, sort } = {}) => {
|
|
269
275
|
if (!field) return items
|
|
270
|
-
|
|
276
|
+
|
|
271
277
|
const sorted = [...items].sort((a, b) => {
|
|
272
278
|
const av = a[field]
|
|
273
279
|
const bv = b[field]
|
|
@@ -345,8 +351,8 @@ export const Default = {
|
|
|
345
351
|
),
|
|
346
352
|
args: {
|
|
347
353
|
children: 'DataTable Component',
|
|
348
|
-
onSort: () => {},
|
|
349
|
-
onClick: () => {},
|
|
354
|
+
onSort: () => { },
|
|
355
|
+
onClick: () => { },
|
|
350
356
|
renderHeaderActions: ({ selectedCount, total }) => (
|
|
351
357
|
<>
|
|
352
358
|
<Button size="1" variant="soft" color="gray" disabled={!selectedCount}>
|
|
@@ -187,7 +187,7 @@ The \`options\` prop accepts an array of objects with the following types:
|
|
|
187
187
|
showActiveTrigger: {
|
|
188
188
|
control: { type: 'boolean' },
|
|
189
189
|
description:
|
|
190
|
-
'When true, applies a
|
|
190
|
+
'When true, applies a subtle background highlight to the trigger when the menu is open or on hover',
|
|
191
191
|
table: {
|
|
192
192
|
type: { summary: 'boolean' },
|
|
193
193
|
defaultValue: { summary: 'false' },
|
|
@@ -261,6 +261,45 @@ export const Default = {
|
|
|
261
261
|
),
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
export const ShowActiveTrigger = {
|
|
265
|
+
args: {
|
|
266
|
+
showActiveTrigger: true,
|
|
267
|
+
side: 'bottom',
|
|
268
|
+
align: 'end',
|
|
269
|
+
trigger: (
|
|
270
|
+
<IconButton variant="soft">
|
|
271
|
+
<DotsVerticalIcon style={{ color: 'var(--neutral-alpha-8)' }} />
|
|
272
|
+
</IconButton>
|
|
273
|
+
),
|
|
274
|
+
options: [
|
|
275
|
+
{
|
|
276
|
+
type: 'item',
|
|
277
|
+
key: 'item1',
|
|
278
|
+
label: 'Edit',
|
|
279
|
+
onClick: () => console.log('Edit clicked'),
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
type: 'item',
|
|
283
|
+
key: 'item2',
|
|
284
|
+
label: 'Duplicate',
|
|
285
|
+
onClick: () => console.log('Duplicate clicked'),
|
|
286
|
+
},
|
|
287
|
+
{ type: 'separator', key: 'sep1' },
|
|
288
|
+
{
|
|
289
|
+
type: 'item',
|
|
290
|
+
key: 'item3',
|
|
291
|
+
label: 'Delete',
|
|
292
|
+
onClick: () => console.log('Delete clicked'),
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
},
|
|
296
|
+
render: (args) => (
|
|
297
|
+
<Flex justify="center" align="start" height="300px">
|
|
298
|
+
<DropdownMenu {...args} />
|
|
299
|
+
</Flex>
|
|
300
|
+
),
|
|
301
|
+
}
|
|
302
|
+
|
|
264
303
|
export const StayOpenAfterSelect = {
|
|
265
304
|
args: {
|
|
266
305
|
closeOnSelect: false,
|
|
@@ -353,12 +392,12 @@ const ItemPlaygroundComponent = ({
|
|
|
353
392
|
color: item1Color === 'default' ? undefined : item1Color,
|
|
354
393
|
...(item1Type === 'checkbox'
|
|
355
394
|
? {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
395
|
+
checked: item1IsChecked,
|
|
396
|
+
onChange: (checked) => setItem1IsChecked(checked),
|
|
397
|
+
}
|
|
359
398
|
: {
|
|
360
|
-
|
|
361
|
-
|
|
399
|
+
onClick: () => console.log('Item 1 clicked'),
|
|
400
|
+
}),
|
|
362
401
|
}
|
|
363
402
|
|
|
364
403
|
const item2Config = {
|
|
@@ -374,12 +413,12 @@ const ItemPlaygroundComponent = ({
|
|
|
374
413
|
color: item2Color === 'default' ? undefined : item2Color,
|
|
375
414
|
...(item2Type === 'checkbox'
|
|
376
415
|
? {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
416
|
+
checked: item2IsChecked,
|
|
417
|
+
onChange: (checked) => setItem2IsChecked(checked),
|
|
418
|
+
}
|
|
380
419
|
: {
|
|
381
|
-
|
|
382
|
-
|
|
420
|
+
onClick: () => console.log('Item 2 clicked'),
|
|
421
|
+
}),
|
|
383
422
|
}
|
|
384
423
|
|
|
385
424
|
const subItemConfig = {
|
|
@@ -393,12 +432,12 @@ const ItemPlaygroundComponent = ({
|
|
|
393
432
|
disabled: subItemDisabled,
|
|
394
433
|
...(subItemType === 'checkbox'
|
|
395
434
|
? {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
435
|
+
checked: subItemIsChecked,
|
|
436
|
+
onChange: (checked) => setSubItemIsChecked(checked),
|
|
437
|
+
}
|
|
399
438
|
: {
|
|
400
|
-
|
|
401
|
-
|
|
439
|
+
onClick: () => console.log('Sub item clicked'),
|
|
440
|
+
}),
|
|
402
441
|
}
|
|
403
442
|
|
|
404
443
|
const options = [
|
|
@@ -412,13 +451,13 @@ const ItemPlaygroundComponent = ({
|
|
|
412
451
|
{ type: 'separator', key: 'sep1' },
|
|
413
452
|
...(showSubmenu
|
|
414
453
|
? [
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
454
|
+
{
|
|
455
|
+
type: 'sub',
|
|
456
|
+
key: 'submenu',
|
|
457
|
+
label: submenuLabel,
|
|
458
|
+
children: [subItemConfig],
|
|
459
|
+
},
|
|
460
|
+
]
|
|
422
461
|
: []),
|
|
423
462
|
]
|
|
424
463
|
|