@moises.ai/design-system 3.6.3 → 3.6.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/index.js +3726 -3656
- package/package.json +1 -1
- package/src/components/AdditionalItems/AdditionalItems.jsx +9 -2
- package/src/components/ProductsList/ProductsList.jsx +10 -2
- package/src/components/ProfileMenu/ProfileMenu.jsx +10 -2
- package/src/components/SetlistList/SetlistList.jsx +121 -52
- package/src/components/SetlistList/SetlistList.module.css +43 -7
- package/src/components/SetlistList/SetlistList.stories.jsx +164 -60
- package/src/components/Sidebar/Sidebar.jsx +9 -6
- package/src/contexts/MobileDrawerContext.jsx +10 -0
|
@@ -1,6 +1,164 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
import { SetlistList } from './SetlistList'
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
const defaultSetlists = [
|
|
5
|
+
{
|
|
6
|
+
id: 'b55ae387-6f5e-44e9-af9f-c05e0438db69',
|
|
7
|
+
label: 'Jam Sessions with Charlie Puth',
|
|
8
|
+
description:
|
|
9
|
+
'Submit your cover or remix of "Beat Yourself Up" for a chance to win your share of $100,000* in prizes, including cash, music gear, and an all-expenses-paid NYC trip to meet Charlie backstage at Madison Square Garden.',
|
|
10
|
+
subtitle: 'By Moises',
|
|
11
|
+
moises: true,
|
|
12
|
+
icon: 'https://storage.googleapis.com/moises-stage-api-assets/setlists/jam-sessions-charlie-puth-setlist-title/logo-1770055262172-charlie-puth-cover-132x132-3x-png',
|
|
13
|
+
group: false,
|
|
14
|
+
dropdownMenuOptions: [
|
|
15
|
+
{
|
|
16
|
+
type: 'item',
|
|
17
|
+
key: 'leave-setlist',
|
|
18
|
+
label: 'Leave setlist',
|
|
19
|
+
color: 'red',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: '00fc53a1-da6f-4b9c-afc0-64e40892d32a',
|
|
25
|
+
label: 'track, master and voice',
|
|
26
|
+
description: '',
|
|
27
|
+
subtitle: 'By testeqajp265',
|
|
28
|
+
moises: false,
|
|
29
|
+
icon: [
|
|
30
|
+
'https://d2-stage.moises.ai/v3/download/moises-stage--tasks/operations/FILEMETADATA_A/bf262dfd-8fe5-4e2a-8baa-ca8971690f62/cover.jpeg',
|
|
31
|
+
'https://d2-stage.moises.ai/v3/download/moises-stage--tasks/operations/FILEMETADATA_A/62b4b14d-b81f-4ef4-b681-bf6c863f9db8/cover.jpeg',
|
|
32
|
+
'https://d2-stage.moises.ai/v3/download/moises-stage--tasks/operations/FILEMETADATA_A/5db13e39-a0ac-4251-a4b5-4edb35f6b4a2/cover.jpeg',
|
|
33
|
+
'https://d3-stage.moises.ai/v3/download/moises-stage--tasks/operations/FILEMETADATA_A/9315c6df-aa12-4265-bb6d-594f638d8a63/cover.jpeg',
|
|
34
|
+
],
|
|
35
|
+
group: true,
|
|
36
|
+
dropdownMenuOptions: [
|
|
37
|
+
{
|
|
38
|
+
type: 'item',
|
|
39
|
+
key: 'leave-setlist',
|
|
40
|
+
label: 'Leave setlist',
|
|
41
|
+
color: 'red',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: '15c1b18e-a0b8-439a-9480-78660562173b',
|
|
47
|
+
label: 'Minha setlist #532',
|
|
48
|
+
description: '',
|
|
49
|
+
subtitle: 'By Swanny Kathllen',
|
|
50
|
+
moises: false,
|
|
51
|
+
icon: [
|
|
52
|
+
'https://d2-stage.moises.ai/v3/download/moises-stage--tasks-us-east1/operations/FILEMETADATA_A/8e5ec2e6-61f4-4721-9ed0-c31fda5904ab/cover.jpeg',
|
|
53
|
+
'https://d2-stage.moises.ai/v3/download/moises-stage--tasks/operations/FILEMETADATA_A/b4112cfb-3f37-4551-bd42-8ce9fcaec2b0/cover.jpeg',
|
|
54
|
+
'https://d1-stage.moises.ai/v3/download/moises-stage--tasks/operations/FILEMETADATA_A/2e6d2a5f-d9c8-4750-bf9e-12f5d0b43f1d/cover.jpeg',
|
|
55
|
+
],
|
|
56
|
+
group: false,
|
|
57
|
+
dropdownMenuOptions: [
|
|
58
|
+
{ type: 'item', key: 'edit', label: 'Edit' },
|
|
59
|
+
{ type: 'separator', key: 'separator-edit' },
|
|
60
|
+
{ type: 'item', key: 'delete', label: 'Delete', color: 'red' },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: '85aabd11-4bfe-4f5e-814a-c450fa3695fd',
|
|
65
|
+
label: 'My Setlist #4',
|
|
66
|
+
description: '',
|
|
67
|
+
subtitle: 'By Swanny Kathllen',
|
|
68
|
+
moises: false,
|
|
69
|
+
icon: [],
|
|
70
|
+
group: true,
|
|
71
|
+
dropdownMenuOptions: [
|
|
72
|
+
{
|
|
73
|
+
type: 'item',
|
|
74
|
+
key: 'leave-setlist',
|
|
75
|
+
label: 'Leave setlist',
|
|
76
|
+
color: 'red',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'd234cc21-b271-4f11-af53-73fdc685e83b',
|
|
82
|
+
label: 'My Setlist #3',
|
|
83
|
+
description: '',
|
|
84
|
+
subtitle: 'By Swanny Kathllen',
|
|
85
|
+
moises: false,
|
|
86
|
+
group: false,
|
|
87
|
+
dropdownMenuOptions: [
|
|
88
|
+
{ type: 'item', key: 'edit', label: 'Edit' },
|
|
89
|
+
{ type: 'separator', key: 'separator-edit' },
|
|
90
|
+
{ type: 'item', key: 'delete', label: 'Delete', color: 'red' },
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: 'd7fe60bb-261e-4f55-89c3-80cffcb018d1',
|
|
95
|
+
label: 'playlist de outro user [não editável]',
|
|
96
|
+
description: '',
|
|
97
|
+
subtitle: 'By Swanny Kathllen',
|
|
98
|
+
moises: false,
|
|
99
|
+
group: true,
|
|
100
|
+
dropdownMenuOptions: [
|
|
101
|
+
{
|
|
102
|
+
type: 'item',
|
|
103
|
+
key: 'leave-setlist',
|
|
104
|
+
label: 'Leave setlist',
|
|
105
|
+
color: 'red',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: '0a3668ac-24f0-4363-a018-5ca9b1d22cfe',
|
|
111
|
+
label: 'Playlist de outro usuário [editável]',
|
|
112
|
+
description: '',
|
|
113
|
+
subtitle: 'By Swanny Kathllen',
|
|
114
|
+
moises: false,
|
|
115
|
+
group: true,
|
|
116
|
+
dropdownMenuOptions: [
|
|
117
|
+
{
|
|
118
|
+
type: 'item',
|
|
119
|
+
key: 'leave-setlist',
|
|
120
|
+
label: 'Leave setlist',
|
|
121
|
+
color: 'red',
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 'df74975a-fbfe-4000-9ce1-d02d998ecd7f',
|
|
127
|
+
label: 'Guitar Exercises',
|
|
128
|
+
description:
|
|
129
|
+
'Improve your chops with these Berklee Online guitar exercises, pulled from actual courses.',
|
|
130
|
+
subtitle: 'By Berklee Online',
|
|
131
|
+
moises: true,
|
|
132
|
+
icon: 'https://storage.googleapis.com/moises-api-assets/setlists/berklee2.png',
|
|
133
|
+
group: false,
|
|
134
|
+
dropdownMenuOptions: [
|
|
135
|
+
{
|
|
136
|
+
type: 'item',
|
|
137
|
+
key: 'leave-setlist',
|
|
138
|
+
label: 'Leave setlist',
|
|
139
|
+
color: 'red',
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: '66d16b7e-2dc0-46e9-8706-56b7d4133104',
|
|
145
|
+
label: 'Moises Collection',
|
|
146
|
+
description:
|
|
147
|
+
'Songs written and recorded by the Moises community. For demo purposes only.',
|
|
148
|
+
subtitle: 'By Moises',
|
|
149
|
+
moises: true,
|
|
150
|
+
icon: 'https://storage.googleapis.com/moises-api-assets/moises-collection-cover.png',
|
|
151
|
+
group: true,
|
|
152
|
+
dropdownMenuOptions: [
|
|
153
|
+
{
|
|
154
|
+
type: 'item',
|
|
155
|
+
key: 'leave-setlist',
|
|
156
|
+
label: 'Leave setlist',
|
|
157
|
+
color: 'red',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
]
|
|
4
162
|
|
|
5
163
|
export default {
|
|
6
164
|
title: 'Components/SetlistList',
|
|
@@ -14,12 +172,14 @@ export default {
|
|
|
14
172
|
|
|
15
173
|
export const Default = {
|
|
16
174
|
render: (args) => {
|
|
17
|
-
const [selectedSetlistId, setSelectedSetlistId] =
|
|
18
|
-
|
|
175
|
+
const [selectedSetlistId, setSelectedSetlistId] = useState(
|
|
176
|
+
defaultSetlists[0].id
|
|
177
|
+
)
|
|
19
178
|
|
|
20
179
|
return (
|
|
21
180
|
<SetlistList
|
|
22
181
|
{...args}
|
|
182
|
+
setlists={defaultSetlists}
|
|
23
183
|
selectedSetlistId={selectedSetlistId}
|
|
24
184
|
onSetlistClick={(id) => {
|
|
25
185
|
setSelectedSetlistId(id)
|
|
@@ -32,63 +192,7 @@ export const Default = {
|
|
|
32
192
|
)
|
|
33
193
|
},
|
|
34
194
|
args: {
|
|
35
|
-
setlists:
|
|
36
|
-
{
|
|
37
|
-
id: 'piano-exercises',
|
|
38
|
-
label: 'Piano Exercises',
|
|
39
|
-
subtitle: 'By Berklee',
|
|
40
|
-
moises: true,
|
|
41
|
-
icon: 'https://storage.googleapis.com/moises-api-assets/setlists/jamsession_cory/cover.png',
|
|
42
|
-
dropdownMenuOptions: [
|
|
43
|
-
{
|
|
44
|
-
type: 'item',
|
|
45
|
-
key: 'edit',
|
|
46
|
-
label: 'Edit',
|
|
47
|
-
onClick: () => console.log('Edit clicked'),
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: 'bossa-nova',
|
|
53
|
-
label: 'Bossa Nova Essentials',
|
|
54
|
-
dropdownMenuOptions: [
|
|
55
|
-
{
|
|
56
|
-
type: 'item',
|
|
57
|
-
key: 'edit',
|
|
58
|
-
label: 'Edit',
|
|
59
|
-
onClick: () => console.log('Edit clicked'),
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: 'band-rehearsal',
|
|
65
|
-
label: 'Band Rehearsal',
|
|
66
|
-
subtitle: 'By Nickyz dsdasdas',
|
|
67
|
-
moises: true,
|
|
68
|
-
group: true,
|
|
69
|
-
dropdownMenuOptions: [
|
|
70
|
-
{
|
|
71
|
-
type: 'item',
|
|
72
|
-
key: 'edit',
|
|
73
|
-
label: 'Edit',
|
|
74
|
-
onClick: () => console.log('Edit clicked'),
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 'gig-dec-21',
|
|
80
|
-
label: 'Gig Dec 21th',
|
|
81
|
-
icon: <MusicNoteIcon width={16} height={16} />,
|
|
82
|
-
dropdownMenuOptions: [
|
|
83
|
-
{
|
|
84
|
-
type: 'item',
|
|
85
|
-
key: 'edit',
|
|
86
|
-
label: 'Edit',
|
|
87
|
-
onClick: () => console.log('Edit clicked'),
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
],
|
|
195
|
+
setlists: defaultSetlists,
|
|
92
196
|
collapsed: false,
|
|
93
197
|
isMobile: false,
|
|
94
198
|
},
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
CloseIcon,
|
|
12
12
|
} from '../../icons'
|
|
13
13
|
import { useMobileDrawer } from '../../utils/useMobileDrawer'
|
|
14
|
+
import { MobileDrawerProvider } from '../../contexts/MobileDrawerContext'
|
|
14
15
|
|
|
15
16
|
export const Sidebar = ({
|
|
16
17
|
className,
|
|
@@ -50,12 +51,13 @@ export const Sidebar = ({
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
return (
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
<MobileDrawerProvider value={{ close, isMobile }}>
|
|
55
|
+
<div
|
|
56
|
+
className={classNames(styles.root, {
|
|
57
|
+
[styles.rootCollapsed]: effectiveCollapsed,
|
|
58
|
+
})}
|
|
59
|
+
{...props}
|
|
60
|
+
>
|
|
59
61
|
<div className={styles.mobileTopBarWrapper}>
|
|
60
62
|
<Flex
|
|
61
63
|
align="center"
|
|
@@ -170,6 +172,7 @@ export const Sidebar = ({
|
|
|
170
172
|
</Flex>
|
|
171
173
|
</Flex>
|
|
172
174
|
</div>
|
|
175
|
+
</MobileDrawerProvider>
|
|
173
176
|
)
|
|
174
177
|
}
|
|
175
178
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react'
|
|
2
|
+
|
|
3
|
+
const MobileDrawerContext = createContext({
|
|
4
|
+
close: () => {},
|
|
5
|
+
isMobile: false,
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
export const useMobileDrawerContext = () => useContext(MobileDrawerContext)
|
|
9
|
+
|
|
10
|
+
export const MobileDrawerProvider = MobileDrawerContext.Provider
|