@moises.ai/design-system 3.5.4 → 3.5.6
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 +4658 -4630
- 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 +63 -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/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 +3 -8
- package/src/components/ProjectsList/utils.jsx +0 -26
- package/src/components/SetlistList/SetlistList.jsx +15 -48
- package/src/components/SetlistList/SetlistList.module.css +7 -5
- 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 +6 -15
- 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/src/components/{ProjectsList/assets/images → ProductsBrandPattern/Patterns}/thumb-song-lyrics.jpg +0 -0
- /package/src/components/{ProjectsList/assets/images → ProductsBrandPattern/Patterns}/thumb-song-master.jpg +0 -0
- /package/src/components/{ProjectsList/assets/images → ProductsBrandPattern/Patterns}/thumb-song-stems.jpg +0 -0
- /package/src/components/{ProjectsList/assets/images → ProductsBrandPattern/Patterns}/thumb-song-studio.jpg +0 -0
- /package/src/components/{ProjectsList/assets/images → ProductsBrandPattern/Patterns}/thumb-song-voice.jpg +0 -0
|
@@ -109,7 +109,8 @@
|
|
|
109
109
|
|
|
110
110
|
.ghost.cyan.highContrast:active:not(.disabled),
|
|
111
111
|
.ghost.cyan.highContrast[class*="_dropdownMenuTrigger"][data-state='open']:not(.disabled),
|
|
112
|
-
.ghost.cyan.highContrast[class*="_popoverTrigger"][data-state='open']:not(.disabled)
|
|
112
|
+
.ghost.cyan.highContrast[class*="_popoverTrigger"][data-state='open']:not(.disabled),
|
|
113
|
+
.ghost.cyan.highContrast[class*="_menuTrigger"][data-state='open']:not(.disabled) {
|
|
113
114
|
background-color: transparent;
|
|
114
115
|
color: var(--aqua-dark-alpha-10) !important;
|
|
115
116
|
}
|
|
@@ -146,6 +147,7 @@
|
|
|
146
147
|
width: 24px;
|
|
147
148
|
height: 24px;
|
|
148
149
|
padding: 0 !important;
|
|
150
|
+
border-radius: 4px;
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
/* size 2 → 32×32px */
|
|
@@ -154,6 +156,7 @@
|
|
|
154
156
|
width: 32px ;
|
|
155
157
|
height: 32px ;
|
|
156
158
|
padding: 0 !important;
|
|
159
|
+
border-radius: 6px;
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
/* size 3 → 40×40px */
|
|
@@ -162,6 +165,7 @@
|
|
|
162
165
|
width: 40px ;
|
|
163
166
|
height: 40px ;
|
|
164
167
|
padding: 0 !important;
|
|
168
|
+
border-radius: 8px;
|
|
165
169
|
}
|
|
166
170
|
|
|
167
171
|
/* size 4 → 48×48px */
|
|
@@ -170,6 +174,23 @@
|
|
|
170
174
|
width: 48px;
|
|
171
175
|
height: 48px;
|
|
172
176
|
padding: 0 !important;
|
|
177
|
+
border-radius: 12px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.size1 {
|
|
181
|
+
border-radius: 4px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.size2 {
|
|
185
|
+
border-radius: 6px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.size3 {
|
|
189
|
+
border-radius: 8px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.size4 {
|
|
193
|
+
border-radius: 12px;
|
|
173
194
|
}
|
|
174
195
|
|
|
175
196
|
.solid.cyan {
|
|
@@ -192,7 +213,8 @@
|
|
|
192
213
|
|
|
193
214
|
.solid.cyan.highContrast:active:not(.disabled):not(.loading),
|
|
194
215
|
.solid.cyan.highContrast[class*="_dropdownMenuTrigger"][data-state='open']:not(.disabled),
|
|
195
|
-
.solid.cyan.highContrast[class*="_popoverTrigger"][data-state='open']:not(.disabled)
|
|
216
|
+
.solid.cyan.highContrast[class*="_popoverTrigger"][data-state='open']:not(.disabled),
|
|
217
|
+
.solid.cyan.highContrast[class*="_menuTrigger"][data-state='open']:not(.disabled) {
|
|
196
218
|
opacity: 0.82;
|
|
197
219
|
}
|
|
198
220
|
|
|
@@ -228,7 +250,8 @@
|
|
|
228
250
|
|
|
229
251
|
.solid.red.highContrast:active:not(.disabled):not(.loading),
|
|
230
252
|
.solid.red.highContrast[class*="_dropdownMenuTrigger"][data-state='open']:not(.disabled),
|
|
231
|
-
.solid.red.highContrast[class*="_popoverTrigger"][data-state='open']:not(.disabled)
|
|
253
|
+
.solid.red.highContrast[class*="_popoverTrigger"][data-state='open']:not(.disabled),
|
|
254
|
+
.solid.red.highContrast[class*="_menuTrigger"][data-state='open']:not(.disabled) {
|
|
232
255
|
background-color: var(--red-12);
|
|
233
256
|
opacity: 0.82;
|
|
234
257
|
}
|
|
@@ -242,10 +265,23 @@
|
|
|
242
265
|
background-color: var(--neutral-alpha-4);
|
|
243
266
|
}
|
|
244
267
|
|
|
268
|
+
|
|
269
|
+
/*
|
|
270
|
+
quando é um trigger é assim que o botao ta ficando
|
|
271
|
+
<button data-accent-color="gray" type="button" id="radix-«r0»"
|
|
272
|
+
aria-haspopup="menu" aria-expanded="true" data-state="open"
|
|
273
|
+
class="rt-reset rt-BaseButton rt-r-size-1 rt-variant-soft
|
|
274
|
+
rt-IconButton _iconButton_1c4cc_1 _gray_1c4cc_61 _size1_1c4cc_144 _soft_1c4cc_256
|
|
275
|
+
_menuTrigger_17nux_207 _showActiveTrigger_17nux_207" aria-controls="radix-«r1»">conteudo do botao</button>
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
*/
|
|
245
279
|
.soft.gray:active:not(.disabled):not(.loading),
|
|
246
280
|
.soft.gray[class*="_dropdownMenuTrigger"][data-state='open']:not(.disabled),
|
|
247
|
-
.soft.gray[class*="_popoverTrigger"][data-state='open']:not(.disabled)
|
|
248
|
-
|
|
281
|
+
.soft.gray[class*="_popoverTrigger"][data-state='open']:not(.disabled),
|
|
282
|
+
.soft.gray[class*="_menuTrigger"][data-state='open']:not(.disabled)[class*="_showActiveTrigger"]
|
|
283
|
+
{
|
|
284
|
+
background-color: var(--neutral-alpha-5) !important;
|
|
249
285
|
opacity: 0.92;
|
|
250
286
|
}
|
|
251
287
|
|
|
@@ -261,7 +297,8 @@
|
|
|
261
297
|
|
|
262
298
|
.soft.gray.highContrast:active:not(.disabled):not(.loading),
|
|
263
299
|
.soft.gray.highContrast[class*="_dropdownMenuTrigger"][data-state='open']:not(.disabled),
|
|
264
|
-
.soft.gray.highContrast[class*="_popoverTrigger"][data-state='open']:not(.disabled)
|
|
300
|
+
.soft.gray.highContrast[class*="_popoverTrigger"][data-state='open']:not(.disabled),
|
|
301
|
+
.soft.gray.highContrast[class*="_menuTrigger"][data-state='open']:not(.disabled)[class*="_showActiveTrigger"] {
|
|
265
302
|
background-color: var(--neutral-alpha-5);
|
|
266
303
|
opacity: 0.82;
|
|
267
304
|
}
|
|
@@ -277,7 +314,8 @@
|
|
|
277
314
|
|
|
278
315
|
.surface.gray:active:not(.disabled):not(.loading),
|
|
279
316
|
.surface.gray[class*="_dropdownMenuTrigger"][data-state='open']:not(.disabled),
|
|
280
|
-
.surface.gray[class*="_popoverTrigger"][data-state='open']:not(.disabled)
|
|
317
|
+
.surface.gray[class*="_popoverTrigger"][data-state='open']:not(.disabled),
|
|
318
|
+
.surface.gray[class*="_menuTrigger"][data-state='open']:not(.disabled)[class*="_showActiveTrigger"] {
|
|
281
319
|
background-color: var(--neutral-alpha-3);
|
|
282
320
|
border: 1px solid var(--neutral-alpha-8);
|
|
283
321
|
opacity: 0.92;
|
|
@@ -295,7 +333,8 @@
|
|
|
295
333
|
|
|
296
334
|
.surface.gray.highContrast:active:not(.disabled):not(.loading),
|
|
297
335
|
.surface.gray.highContrast[class*="_dropdownMenuTrigger"][data-state='open']:not(.disabled),
|
|
298
|
-
.surface.gray.highContrast[class*="_popoverTrigger"][data-state='open']:not(.disabled)
|
|
336
|
+
.surface.gray.highContrast[class*="_popoverTrigger"][data-state='open']:not(.disabled),
|
|
337
|
+
.surface.gray.highContrast[class*="_menuTrigger"][data-state='open']:not(.disabled)[class*="_showActiveTrigger"] {
|
|
299
338
|
background-color: var(--neutral-alpha-3);
|
|
300
339
|
border: 1px solid var(--neutral-alpha-8);
|
|
301
340
|
opacity: 0.82;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import styles from './MoreButton.module.css'
|
|
2
|
+
import classNames from 'classnames'
|
|
3
|
+
import { DotsVertical2Icon } from '../../icons'
|
|
4
|
+
|
|
5
|
+
export const MoreButton = ({
|
|
6
|
+
className,
|
|
7
|
+
'aria-label': ariaLabel = 'More options',
|
|
8
|
+
hovered = false,
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
return (
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
className={classNames(styles.MoreButton, className, {
|
|
15
|
+
[styles.hovered]: hovered,
|
|
16
|
+
})}
|
|
17
|
+
aria-label={ariaLabel}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<DotsVertical2Icon className={styles.icon} />
|
|
21
|
+
</button >
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
MoreButton.displayName = 'MoreButton'
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.MoreButton {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
width: 12px;
|
|
6
|
+
height: 24px;
|
|
7
|
+
padding: 0;
|
|
8
|
+
border: none;
|
|
9
|
+
background: transparent;
|
|
10
|
+
border-radius: 9999px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
color: var(--neutral-alpha-7);
|
|
13
|
+
transition:
|
|
14
|
+
background-color 0.15s ease,
|
|
15
|
+
color 0.15s ease;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@media (pointer: coarse) {
|
|
19
|
+
.MoreButton {
|
|
20
|
+
width: auto;
|
|
21
|
+
height: auto;
|
|
22
|
+
min-width: 32px;
|
|
23
|
+
min-height: 32px;
|
|
24
|
+
padding: 4px 10px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.MoreButton:hover,
|
|
29
|
+
.MoreButton.hovered {
|
|
30
|
+
background-color: var(--neutral-alpha-3);
|
|
31
|
+
color: var(--neutral-alpha-11);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.MoreButton:focus-visible {
|
|
35
|
+
outline: 2px solid var(--neutral-alpha-8);
|
|
36
|
+
outline-offset: 2px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.icon {
|
|
40
|
+
width: 3px;
|
|
41
|
+
height: 11px;
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Box } from '@radix-ui/themes'
|
|
2
|
+
import { MoreButton } from './MoreButton'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/MoreButton',
|
|
6
|
+
component: MoreButton,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
decorators: [
|
|
12
|
+
(Story) => (
|
|
13
|
+
<Box
|
|
14
|
+
style={{
|
|
15
|
+
padding: 24,
|
|
16
|
+
background: 'var(--neutral-2)',
|
|
17
|
+
borderRadius: 8,
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<Story />
|
|
21
|
+
</Box>
|
|
22
|
+
),
|
|
23
|
+
],
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const Default = {
|
|
27
|
+
args: {
|
|
28
|
+
'aria-label': 'More options',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { Flex } from '@radix-ui/themes'
|
|
2
1
|
import classNames from 'classnames'
|
|
3
|
-
import
|
|
4
|
-
import mastering from './Patterns/
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
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'
|
|
8
7
|
|
|
9
8
|
export const ProductsBrandPattern = ({
|
|
10
9
|
className,
|
|
11
|
-
type = 'stem-separation',
|
|
12
10
|
size = '40px',
|
|
11
|
+
type = 'lyrics',
|
|
12
|
+
cover,
|
|
13
13
|
...props
|
|
14
14
|
}) => {
|
|
15
15
|
const patterns = {
|
|
16
|
-
'
|
|
17
|
-
'voice
|
|
18
|
-
'
|
|
19
|
-
mastering,
|
|
20
|
-
|
|
16
|
+
'stems': stems,
|
|
17
|
+
'voice': voice,
|
|
18
|
+
'studio': studio,
|
|
19
|
+
'master': mastering,
|
|
20
|
+
'lyrics': lyrics,
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
const pattern = cover || patterns[type]
|
|
24
25
|
return (
|
|
25
26
|
<img
|
|
26
27
|
src={pattern}
|
|
27
28
|
alt={`${type} pattern`}
|
|
28
29
|
width={size}
|
|
29
30
|
height={size}
|
|
31
|
+
draggable={false}
|
|
30
32
|
className={classNames(className)}
|
|
31
33
|
{...props}
|
|
32
34
|
/>
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { ProductsBrandPattern } from './ProductsBrandPattern'
|
|
2
|
+
import { projects } from '../ProjectsList/utils-stories'
|
|
2
3
|
|
|
3
|
-
const patternTypes = [
|
|
4
|
-
'stem-separation',
|
|
5
|
-
'voice-studio',
|
|
6
|
-
'ai-studio',
|
|
7
|
-
'mastering',
|
|
8
|
-
'product',
|
|
9
|
-
]
|
|
4
|
+
const patternTypes = ['stems', 'voice', 'studio', 'master', 'lyrics']
|
|
10
5
|
|
|
11
6
|
export default {
|
|
12
7
|
title: 'Components/ProductsBrandPattern',
|
|
@@ -25,23 +20,74 @@ export default {
|
|
|
25
20
|
type: {
|
|
26
21
|
control: 'select',
|
|
27
22
|
options: patternTypes,
|
|
28
|
-
description: '
|
|
23
|
+
description: 'Product type for the pattern image.',
|
|
29
24
|
},
|
|
30
25
|
size: {
|
|
31
26
|
control: 'text',
|
|
32
|
-
description:
|
|
33
|
-
'Width/height of the pattern image. Accepts px, rem, or number.',
|
|
34
|
-
},
|
|
35
|
-
className: {
|
|
36
|
-
control: false,
|
|
37
|
-
description: 'Custom class applied to the wrapper Flex.',
|
|
27
|
+
description: 'Width/height of the pattern image. Accepts px, rem, or number.',
|
|
38
28
|
},
|
|
39
29
|
},
|
|
30
|
+
args: {
|
|
31
|
+
type: 'lyrics',
|
|
32
|
+
},
|
|
40
33
|
}
|
|
41
34
|
|
|
42
35
|
export const Default = {
|
|
43
36
|
args: {
|
|
44
|
-
type: '
|
|
37
|
+
type: 'lyrics',
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const Stems = {
|
|
42
|
+
args: {
|
|
43
|
+
type: 'stems',
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Voice = {
|
|
48
|
+
args: {
|
|
49
|
+
type: 'voice',
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const Studio = {
|
|
54
|
+
args: {
|
|
55
|
+
type: 'studio',
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const Master = {
|
|
60
|
+
args: {
|
|
61
|
+
type: 'master',
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const Lyrics = {
|
|
66
|
+
args: {
|
|
67
|
+
type: 'lyrics',
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const WithCustomCover = {
|
|
72
|
+
args: {
|
|
73
|
+
type: 'lyrics',
|
|
74
|
+
cover: projects.find((p) => p.cover)?.cover,
|
|
45
75
|
size: '40px',
|
|
46
76
|
},
|
|
47
77
|
}
|
|
78
|
+
|
|
79
|
+
export const AllPatterns = {
|
|
80
|
+
render: ({ type: _type, ...args }) => (
|
|
81
|
+
<div style={{ display: 'flex', gap: 16, alignItems: 'center', flexWrap: 'wrap' }}>
|
|
82
|
+
{patternTypes.map((type) => (
|
|
83
|
+
<div key={type} style={{ textAlign: 'center' }}>
|
|
84
|
+
<ProductsBrandPattern type={type} {...args} />
|
|
85
|
+
<div style={{ fontSize: 12, marginTop: 4, textTransform: 'capitalize' }}>{type}</div>
|
|
86
|
+
</div>
|
|
87
|
+
))}
|
|
88
|
+
</div>
|
|
89
|
+
),
|
|
90
|
+
args: {
|
|
91
|
+
size: '48px',
|
|
92
|
+
},
|
|
93
|
+
}
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import classNames from 'classnames'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { DotsVerticalIcon } from '../../icons'
|
|
2
|
+
import React, { useState } from 'react'
|
|
4
3
|
import { Avatar, Flex, Text } from '../../index'
|
|
5
4
|
import styles from './ProfileMenu.module.css'
|
|
5
|
+
import { MoreButton } from '../MoreButton/MoreButton'
|
|
6
6
|
|
|
7
7
|
export function MenuTrigger({ className, user, collapsed, ...props }) {
|
|
8
|
+
const [hover, setHover] = useState(false)
|
|
9
|
+
|
|
10
|
+
const handleMouseEnter = () => {
|
|
11
|
+
setHover(true)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const handleMouseLeave = () => {
|
|
15
|
+
setHover(false)
|
|
16
|
+
}
|
|
8
17
|
return (
|
|
9
18
|
<Flex
|
|
19
|
+
onMouseEnter={handleMouseEnter}
|
|
20
|
+
onMouseLeave={handleMouseLeave}
|
|
10
21
|
className={classNames(styles.userProfile, { [styles.collapsed]: collapsed }, className)}
|
|
11
22
|
align="center"
|
|
12
23
|
justify="between"
|
|
@@ -32,13 +43,7 @@ export function MenuTrigger({ className, user, collapsed, ...props }) {
|
|
|
32
43
|
</div>
|
|
33
44
|
|
|
34
45
|
<div className={styles.userMenuWrapper}>
|
|
35
|
-
<
|
|
36
|
-
<DotsVerticalIcon
|
|
37
|
-
className={styles.dropdownMenuTrigger}
|
|
38
|
-
width={16}
|
|
39
|
-
height={16}
|
|
40
|
-
/>
|
|
41
|
-
</Flex>
|
|
46
|
+
<MoreButton hovered={hover} />
|
|
42
47
|
</div>
|
|
43
48
|
</Flex>
|
|
44
49
|
)
|
|
@@ -2,8 +2,9 @@ import { Flex, Text, Separator } from '@radix-ui/themes'
|
|
|
2
2
|
import styles from './ProjectsList.module.css'
|
|
3
3
|
import { useState, createContext, useContext } from 'react'
|
|
4
4
|
import { ArrowLeftIcon, NoMusicIcon, ChevronDownIcon, ChevronUpIcon } from '../../icons'
|
|
5
|
-
import { getIconFromTrackId
|
|
5
|
+
import { getIconFromTrackId } from './utils'
|
|
6
6
|
import { Button } from '../Button/Button'
|
|
7
|
+
import { ProductsBrandPattern } from '../ProductsBrandPattern/ProductsBrandPattern'
|
|
7
8
|
|
|
8
9
|
const ProjectsListContext = createContext({
|
|
9
10
|
onClickTrack: null,
|
|
@@ -63,7 +64,6 @@ const ProjectsListItem = ({
|
|
|
63
64
|
setShowAllTracks(!showAllTracks)
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
const project = { id, title, artist, cover, type, tracks }
|
|
67
67
|
|
|
68
68
|
return (
|
|
69
69
|
<Flex
|
|
@@ -76,12 +76,7 @@ const ProjectsListItem = ({
|
|
|
76
76
|
>
|
|
77
77
|
<Flex direction="row" gap="3">
|
|
78
78
|
<Flex className={styles.projectCover}>
|
|
79
|
-
<
|
|
80
|
-
src={getProjectCover(project)}
|
|
81
|
-
alt={title}
|
|
82
|
-
draggable={false}
|
|
83
|
-
className={styles.projectCoverImage}
|
|
84
|
-
/>
|
|
79
|
+
<ProductsBrandPattern type={type} cover={cover} size="48px" />
|
|
85
80
|
</Flex>
|
|
86
81
|
|
|
87
82
|
<Flex direction="column" gap="1" align="start" justify="center">
|
|
@@ -19,11 +19,6 @@ import {
|
|
|
19
19
|
MusicIcon,
|
|
20
20
|
SparkBarsIcon,
|
|
21
21
|
} from '../../icons'
|
|
22
|
-
import thumbCoverLyrics from './assets/images/thumb-song-lyrics.jpg'
|
|
23
|
-
import thumbCoverMaster from './assets/images/thumb-song-master.jpg'
|
|
24
|
-
import thumbCoverStems from './assets/images/thumb-song-stems.jpg'
|
|
25
|
-
import thumbCoverStudio from './assets/images/thumb-song-studio.jpg'
|
|
26
|
-
import thumbCoverVoice from './assets/images/thumb-song-voice.jpg'
|
|
27
22
|
|
|
28
23
|
export const getIconFromTrackId = (trackId) => {
|
|
29
24
|
switch (trackId) {
|
|
@@ -73,24 +68,3 @@ export const getIconFromTrackId = (trackId) => {
|
|
|
73
68
|
return <SparkBarsIcon width={16} height={16} />
|
|
74
69
|
}
|
|
75
70
|
}
|
|
76
|
-
|
|
77
|
-
export const getProjectCover = (project) => {
|
|
78
|
-
if (project?.cover) {
|
|
79
|
-
return project.cover
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
switch (project?.type) {
|
|
83
|
-
case 'studio':
|
|
84
|
-
return thumbCoverStudio
|
|
85
|
-
case 'stems':
|
|
86
|
-
return thumbCoverStems
|
|
87
|
-
case 'voice':
|
|
88
|
-
return thumbCoverVoice
|
|
89
|
-
case 'master':
|
|
90
|
-
return thumbCoverMaster
|
|
91
|
-
case 'lyrics':
|
|
92
|
-
return thumbCoverLyrics
|
|
93
|
-
default:
|
|
94
|
-
return thumbCoverLyrics
|
|
95
|
-
}
|
|
96
|
-
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from '../../icons'
|
|
11
11
|
import { DropdownMenu } from '../DropdownMenu/DropdownMenu'
|
|
12
12
|
import { useState, useEffect, useRef, useMemo } from 'react'
|
|
13
|
+
import { MoreButton } from '../MoreButton/MoreButton'
|
|
13
14
|
|
|
14
15
|
export const SetlistItem = ({
|
|
15
16
|
isSelected,
|
|
@@ -45,47 +46,6 @@ export const SetlistItem = ({
|
|
|
45
46
|
e.stopPropagation()
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
const constructIconToRender = useMemo(() => {
|
|
49
|
-
if (moises) {
|
|
50
|
-
return (
|
|
51
|
-
<Flex gap="1" align="center">
|
|
52
|
-
<GlobeIcon
|
|
53
|
-
width={12}
|
|
54
|
-
height={12}
|
|
55
|
-
className={styles.textSubtitleIcon}
|
|
56
|
-
/>
|
|
57
|
-
<Text
|
|
58
|
-
size="1"
|
|
59
|
-
weight="regular"
|
|
60
|
-
className={styles.textSubtitle}
|
|
61
|
-
truncate
|
|
62
|
-
>
|
|
63
|
-
{subtitle}
|
|
64
|
-
</Text>
|
|
65
|
-
</Flex>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
if (group) {
|
|
69
|
-
return (
|
|
70
|
-
<Flex gap="1" align="center">
|
|
71
|
-
<UserGroupIcon
|
|
72
|
-
width={12}
|
|
73
|
-
height={12}
|
|
74
|
-
className={styles.textSubtitleIcon}
|
|
75
|
-
/>
|
|
76
|
-
<Text
|
|
77
|
-
size="1"
|
|
78
|
-
weight="regular"
|
|
79
|
-
className={styles.textSubtitle}
|
|
80
|
-
truncate
|
|
81
|
-
>
|
|
82
|
-
{subtitle}
|
|
83
|
-
</Text>
|
|
84
|
-
</Flex>
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
})
|
|
88
|
-
|
|
89
49
|
return (
|
|
90
50
|
<Flex
|
|
91
51
|
gap="3"
|
|
@@ -137,7 +97,14 @@ export const SetlistItem = ({
|
|
|
137
97
|
{text}
|
|
138
98
|
</Text>
|
|
139
99
|
)}
|
|
140
|
-
|
|
100
|
+
<Text
|
|
101
|
+
size="1"
|
|
102
|
+
weight="regular"
|
|
103
|
+
className={styles.textSubtitle}
|
|
104
|
+
truncate
|
|
105
|
+
>
|
|
106
|
+
{subtitle}
|
|
107
|
+
</Text>
|
|
141
108
|
</Flex>
|
|
142
109
|
</Flex>
|
|
143
110
|
{dropdownMenuOptions &&
|
|
@@ -154,11 +121,7 @@ export const SetlistItem = ({
|
|
|
154
121
|
onPointerDown={handleDropdownTriggerPointerDown}
|
|
155
122
|
onClick={handleDropdownTriggerClick}
|
|
156
123
|
>
|
|
157
|
-
<
|
|
158
|
-
className={styles.dropdownMenuTrigger}
|
|
159
|
-
width={16}
|
|
160
|
-
height={16}
|
|
161
|
-
/>
|
|
124
|
+
<MoreButton hovered={dropdownMenuOpen} />
|
|
162
125
|
</Flex>
|
|
163
126
|
}
|
|
164
127
|
options={dropdownMenuOptions}
|
|
@@ -181,8 +144,12 @@ export const SetlistList = ({
|
|
|
181
144
|
const hoverTimeoutRef = useRef(null)
|
|
182
145
|
const collapsedItemHeight = 44
|
|
183
146
|
const collapsedVisibleOffset = 4
|
|
147
|
+
const maxCollapsedItems = 4
|
|
184
148
|
const collapsedNewItemOffset = collapsed && onNewSetlistClick ? 1 : 0
|
|
185
149
|
const showCollapsedStack = collapsed && !isHoveredWhenCollapsed
|
|
150
|
+
const visibleSetlists = showCollapsedStack
|
|
151
|
+
? setlists.slice(0, maxCollapsedItems)
|
|
152
|
+
: setlists
|
|
186
153
|
|
|
187
154
|
const handleMouseEnter = () => {
|
|
188
155
|
if (!collapsed) return
|
|
@@ -304,7 +271,7 @@ export const SetlistList = ({
|
|
|
304
271
|
collapsed={collapsed}
|
|
305
272
|
/>
|
|
306
273
|
))}
|
|
307
|
-
{
|
|
274
|
+
{visibleSetlists.map((setlist, index) => {
|
|
308
275
|
const isSelected = selectedSetlistId === setlist.id
|
|
309
276
|
return (
|
|
310
277
|
<SetlistItem
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
.collapsed {
|
|
29
29
|
width: fit-content;
|
|
30
30
|
padding: 2px;
|
|
31
|
+
margin: 0 10px;
|
|
32
|
+
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
.dropdownTriggerWrapper {
|
|
@@ -41,9 +43,9 @@
|
|
|
41
43
|
margin-left: auto;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
.dropdownTriggerWrapperMobile {
|
|
46
|
+
/* .dropdownTriggerWrapperMobile {
|
|
45
47
|
padding: 8px;
|
|
46
|
-
}
|
|
48
|
+
} */
|
|
47
49
|
|
|
48
50
|
.collapsed .dropdownTriggerWrapper {
|
|
49
51
|
opacity: 0;
|
|
@@ -53,7 +55,7 @@
|
|
|
53
55
|
color: var(--neutral-alpha-7);
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
.dropdownTriggerWrapper:hover .dropdownMenuTrigger,
|
|
58
|
+
/* .dropdownTriggerWrapper:hover .dropdownMenuTrigger,
|
|
57
59
|
.menuOpen .dropdownTriggerWrapper .dropdownMenuTrigger {
|
|
58
60
|
color: var(--neutral-alpha-11);
|
|
59
61
|
background-color: rgba(255, 255, 255, 0.07);
|
|
@@ -61,7 +63,7 @@
|
|
|
61
63
|
width: 16px;
|
|
62
64
|
height: 24px;
|
|
63
65
|
}
|
|
64
|
-
|
|
66
|
+
*/
|
|
65
67
|
.avatarSetlist {
|
|
66
68
|
display: flex;
|
|
67
69
|
width: 40px;
|
|
@@ -165,7 +167,7 @@
|
|
|
165
167
|
|
|
166
168
|
|
|
167
169
|
.setlistsContent {
|
|
168
|
-
gap: 4px;
|
|
170
|
+
/* gap: 4px; */
|
|
169
171
|
}
|
|
170
172
|
.collapsedStack {
|
|
171
173
|
gap: 0;
|
|
@@ -106,7 +106,12 @@ export const Sidebar = ({
|
|
|
106
106
|
</Flex>
|
|
107
107
|
</div>
|
|
108
108
|
|
|
109
|
-
<Flex
|
|
109
|
+
<Flex
|
|
110
|
+
direction="column"
|
|
111
|
+
className={styles.desktopSidebar}
|
|
112
|
+
onMouseEnter={handleMouseEnter}
|
|
113
|
+
onMouseLeave={handleMouseLeave}
|
|
114
|
+
>
|
|
110
115
|
<Flex
|
|
111
116
|
align="center"
|
|
112
117
|
justify="between"
|
|
@@ -124,8 +129,6 @@ export const Sidebar = ({
|
|
|
124
129
|
className={classNames(styles.logoToggleContainer, {
|
|
125
130
|
[styles.logoToggleContainerCollapsed]: effectiveCollapsed,
|
|
126
131
|
})}
|
|
127
|
-
onMouseEnter={effectiveCollapsed ? handleMouseEnter : undefined}
|
|
128
|
-
onMouseLeave={effectiveCollapsed ? handleMouseLeave : undefined}
|
|
129
132
|
>
|
|
130
133
|
<MoisesLogoIcon
|
|
131
134
|
width={32}
|