@moises.ai/design-system 3.11.0 → 3.11.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
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
width: 20px;
|
|
13
13
|
height: 20px;
|
|
14
14
|
|
|
15
|
-
&:focus-visible:not(.disabled){
|
|
15
|
+
&:focus-visible:not(.disabled) {
|
|
16
16
|
outline: 2px solid var(--neutral-alpha-8);
|
|
17
17
|
outline-offset: 2px;
|
|
18
18
|
}
|
|
@@ -29,21 +29,16 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.selected.mute {
|
|
32
|
-
background: #
|
|
32
|
+
background: #ffc53d;
|
|
33
33
|
color: var(--neutral-1);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.selected.autoMute {
|
|
37
37
|
background: var(--neutral-alpha-2);
|
|
38
|
-
color: #
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.selected.autoMute:hover {
|
|
42
|
-
background: var(--neutral-alpha-3);
|
|
43
|
-
cursor: pointer;
|
|
38
|
+
color: #ffc53d;
|
|
44
39
|
}
|
|
45
40
|
|
|
46
41
|
.selected.solo {
|
|
47
42
|
background: var(--aqua-10);
|
|
48
43
|
color: var(--neutral-1);
|
|
49
|
-
}
|
|
44
|
+
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
More2Icon,
|
|
7
7
|
} from '../../icons'
|
|
8
8
|
import {
|
|
9
|
+
Box,
|
|
9
10
|
DropdownMenu,
|
|
10
11
|
Flex,
|
|
11
12
|
HorizontalVolume,
|
|
@@ -158,7 +159,7 @@ export const TrackHeader = memo(
|
|
|
158
159
|
type={
|
|
159
160
|
isMuted ? 'mute' : isAutoMuted ? 'autoMute' : 'mute'
|
|
160
161
|
}
|
|
161
|
-
selected={isMuted}
|
|
162
|
+
selected={isMuted || (!isSolo && isAutoMuted)}
|
|
162
163
|
onClick={onMutedChange}
|
|
163
164
|
/>
|
|
164
165
|
<TrackControlsToggle
|
|
@@ -170,23 +171,29 @@ export const TrackHeader = memo(
|
|
|
170
171
|
</Flex>
|
|
171
172
|
|
|
172
173
|
{menuOptions && (
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
174
|
+
<Box
|
|
175
|
+
onPointerDown={(e) => e.stopPropagation()}
|
|
176
|
+
onMouseDown={(e) => e.stopPropagation()}
|
|
177
|
+
onTouchStart={(e) => e.stopPropagation()}>
|
|
178
|
+
<DropdownMenu
|
|
179
|
+
trigger={
|
|
180
|
+
<IconButton
|
|
181
|
+
variant="ghost"
|
|
182
|
+
size="1"
|
|
183
|
+
className={styles.menuOptionsTrigger}
|
|
184
|
+
>
|
|
185
|
+
<More2Icon
|
|
186
|
+
width={16}
|
|
187
|
+
height={16}
|
|
188
|
+
className={styles.menuOptionsIcon}
|
|
189
|
+
/>
|
|
190
|
+
</IconButton>
|
|
191
|
+
}
|
|
192
|
+
options={menuOptions}
|
|
193
|
+
/>
|
|
194
|
+
</Box>
|
|
189
195
|
)}
|
|
196
|
+
|
|
190
197
|
</Flex>
|
|
191
198
|
</div>
|
|
192
199
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TrackHeader } from './TrackHeader'
|
|
2
1
|
import { useState } from 'react'
|
|
3
|
-
import { BassIcon, ElectricGuitarIcon, KeysIcon
|
|
2
|
+
import { BassIcon, DrumsIcon, ElectricGuitarIcon, KeysIcon } from '../../icons'
|
|
3
|
+
import { TrackHeader } from './TrackHeader'
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Components/TrackHeader',
|
|
6
6
|
component: TrackHeader,
|
|
@@ -89,15 +89,24 @@ import { TrackHeader } from '@moises.ai/design-system'
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
const menuOptions = [
|
|
92
|
-
{
|
|
92
|
+
{
|
|
93
|
+
type: 'item',
|
|
94
|
+
key: 'delete',
|
|
95
|
+
label: 'Delete',
|
|
96
|
+
onClick: () => console.log('Delete clicked'),
|
|
97
|
+
},
|
|
93
98
|
]
|
|
94
99
|
|
|
95
100
|
const instrumentOptions = [
|
|
96
101
|
{ type: 'item', key: 'bass', label: 'Bass', icon: <BassIcon /> },
|
|
97
|
-
{
|
|
102
|
+
{
|
|
103
|
+
type: 'item',
|
|
104
|
+
key: 'guitar',
|
|
105
|
+
label: 'Guitar',
|
|
106
|
+
icon: <ElectricGuitarIcon />,
|
|
107
|
+
},
|
|
98
108
|
{ type: 'item', key: 'piano', label: 'Piano', icon: <KeysIcon /> },
|
|
99
109
|
{ type: 'item', key: 'drums', label: 'Drums', icon: <DrumsIcon /> },
|
|
100
|
-
|
|
101
110
|
]
|
|
102
111
|
export const Default = {
|
|
103
112
|
args: {
|
|
@@ -110,13 +119,14 @@ export const Default = {
|
|
|
110
119
|
pan: 0,
|
|
111
120
|
isMuted: false,
|
|
112
121
|
isSolo: false,
|
|
122
|
+
isAutoMuted: false,
|
|
113
123
|
compact: false,
|
|
114
124
|
menuOptions,
|
|
115
|
-
onVolumeChange: () => {
|
|
116
|
-
onPanChange: () => {
|
|
117
|
-
onMutedChange: () => {
|
|
118
|
-
onSoloChange: () => {
|
|
119
|
-
onInstrumentChange: () => {
|
|
125
|
+
onVolumeChange: () => {},
|
|
126
|
+
onPanChange: () => {},
|
|
127
|
+
onMutedChange: () => {},
|
|
128
|
+
onSoloChange: () => {},
|
|
129
|
+
onInstrumentChange: () => {},
|
|
120
130
|
instrumentOptions,
|
|
121
131
|
instrumentSelected: instrumentOptions[0],
|
|
122
132
|
},
|
|
@@ -133,12 +143,13 @@ export const Group = {
|
|
|
133
143
|
pan: 0,
|
|
134
144
|
isMuted: false,
|
|
135
145
|
isSolo: false,
|
|
146
|
+
isAutoMuted: false,
|
|
136
147
|
compact: false,
|
|
137
148
|
menuOptions,
|
|
138
|
-
onVolumeChange: () => {
|
|
139
|
-
onPanChange: () => {
|
|
140
|
-
onMutedChange: () => {
|
|
141
|
-
onSoloChange: () => {
|
|
149
|
+
onVolumeChange: () => {},
|
|
150
|
+
onPanChange: () => {},
|
|
151
|
+
onMutedChange: () => {},
|
|
152
|
+
onSoloChange: () => {},
|
|
142
153
|
},
|
|
143
154
|
render: (args) => {
|
|
144
155
|
const [isOpen, setIsOpen] = useState(true)
|
|
@@ -155,10 +166,10 @@ export const Group = {
|
|
|
155
166
|
pan={pan}
|
|
156
167
|
isMuted={false}
|
|
157
168
|
isSolo={false}
|
|
158
|
-
onVolumeChange={() => {
|
|
169
|
+
onVolumeChange={() => {}}
|
|
159
170
|
onPanChange={setPan}
|
|
160
|
-
onMutedChange={() => {
|
|
161
|
-
onSoloChange={() => {
|
|
171
|
+
onMutedChange={() => {}}
|
|
172
|
+
onSoloChange={() => {}}
|
|
162
173
|
menuOptions={menuOptions}
|
|
163
174
|
/>
|
|
164
175
|
<TrackHeader
|
|
@@ -170,10 +181,10 @@ export const Group = {
|
|
|
170
181
|
pan={pan2}
|
|
171
182
|
isMuted={false}
|
|
172
183
|
isSolo={false}
|
|
173
|
-
onVolumeChange={() => {
|
|
184
|
+
onVolumeChange={() => {}}
|
|
174
185
|
onPanChange={setPan2}
|
|
175
|
-
onMutedChange={() => {
|
|
176
|
-
onSoloChange={() => {
|
|
186
|
+
onMutedChange={() => {}}
|
|
187
|
+
onSoloChange={() => {}}
|
|
177
188
|
menuOptions={menuOptions}
|
|
178
189
|
/>
|
|
179
190
|
</TrackHeader>
|
|
@@ -194,11 +205,11 @@ export const Takelanes = {
|
|
|
194
205
|
isSolo: false,
|
|
195
206
|
compact: false,
|
|
196
207
|
menuOptions,
|
|
197
|
-
onVolumeChange: () => {
|
|
198
|
-
onPanChange: () => {
|
|
199
|
-
onMutedChange: () => {
|
|
200
|
-
onSoloChange: () => {
|
|
201
|
-
onOpenChange: () => {
|
|
208
|
+
onVolumeChange: () => {},
|
|
209
|
+
onPanChange: () => {},
|
|
210
|
+
onMutedChange: () => {},
|
|
211
|
+
onSoloChange: () => {},
|
|
212
|
+
onOpenChange: () => {},
|
|
202
213
|
},
|
|
203
214
|
render: (args) => (
|
|
204
215
|
<TrackHeader {...args}>
|