@moises.ai/design-system 3.10.18 → 3.11.0

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.
@@ -3,13 +3,9 @@
3
3
  display: flex;
4
4
  justify-content: space-between;
5
5
  box-sizing: border-box;
6
- box-shadow: 0 1px 0 0 var(--neutral-alpha-3);
6
+ box-shadow: 0 1px 0 0 var(--neutral-3);
7
+
7
8
 
8
- &:hover {
9
- .leftIcon {
10
- color: var(--neutral-12);
11
- }
12
- }
13
9
  }
14
10
 
15
11
  .name {
@@ -17,7 +13,7 @@
17
13
  min-width: 0;
18
14
  white-space: nowrap;
19
15
  overflow: hidden;
20
- background: linear-gradient(90deg, #fff 81%, #1d1d1d 100%);
16
+ background: linear-gradient(90deg, #fff 95%, #1d1d1d 100%);
21
17
  background-clip: text;
22
18
  -webkit-background-clip: text;
23
19
  -webkit-text-fill-color: transparent;
@@ -31,16 +27,49 @@
31
27
  min-width: 0;
32
28
  }
33
29
 
34
- .left {
30
+ /* .left {
35
31
  flex: 1;
36
32
  display: flex;
37
33
  align-items: center;
38
34
  min-width: 0;
35
+ } */
36
+
37
+ .instrumentIconButton {
38
+ margin-right: 4px !important;
39
+ border-radius: 4px;
39
40
  }
40
41
 
41
- .leftIcon {
42
- width: 24px;
43
- color: var(--neutral-8);
42
+ .headerActions {
43
+ min-width: 0;
44
+ width: 100%;
45
+ }
46
+
47
+ .trackContent{
48
+ /* background-color: ; */
49
+ flex: 1;
50
+ min-width: 0;
51
+ /* border: 1px solid var(--neutral-3); */
52
+ background-color: rgba(17, 17, 19);
53
+
54
+ &:hover {
55
+ .menuOptionsTrigger svg {
56
+ opacity: 1;
57
+ color: var(--neutral-11);
58
+ }
59
+
60
+ .instrumentIcon {
61
+ opacity: 1;
62
+ color: var(--neutral-alpha-11);
63
+ }
64
+ }
65
+ }
66
+
67
+ .trackContent.isActive {
68
+ background-color: var(--neutral-2);
69
+ }
70
+
71
+ .instrumentIcon {
72
+ color: var(--neutral-alpha-8);
44
73
  }
45
74
 
46
75
  .right {
@@ -82,26 +111,33 @@
82
111
  justify-content: center;
83
112
  }
84
113
 
85
- .menuOptionsTrigger:hover {
86
- color: var(--accent-a12) !important;
87
- background-color: transparent !important;
114
+
115
+
116
+ .menuOptionsTrigger {
117
+
118
+ svg {
119
+ opacity: 0.5;
120
+ }
121
+
122
+ &:hover {
123
+ svg {
124
+ opacity: 1;
125
+ }
126
+ }
127
+
128
+ &[data-state='open'],
129
+ &[data-highlighted] {
130
+ svg {
131
+ opacity: 1;
132
+ color: var(--neutral-11);
133
+ }
134
+ }
88
135
  }
89
136
 
90
- .menuOptionsTrigger[data-state=open] {
137
+ /* .menuOptionsTrigger[data-state=open] {
91
138
  color: var(--accent-a10) !important;
92
- }
139
+ } */
93
140
 
94
- .trackContent {
95
- flex: 1;
96
- min-width: 0;
97
- display: flex;
98
- padding-left: var(--space-1);
99
- padding-right: var(--space-3);
100
- padding-top: var(--space-3);
101
- padding-bottom: var(--space-3);
102
- flex-direction: column;
103
- justify-content: space-between;
104
- }
105
141
 
106
142
  /* Open */
107
143
 
@@ -118,26 +154,27 @@
118
154
  /* Not parent track (either grouped or not) */
119
155
 
120
156
  .track:not(.isParentTrack) {
121
- .leftIcon {
157
+ .toggleOpenButton {
122
158
  visibility: hidden;
123
159
  pointer-events: none;
124
160
  }
125
161
  }
126
162
 
127
163
  /* Child track */
128
-
164
+ .group {
165
+ background-color: rgba(17, 17, 19);
166
+ }
129
167
  .group > * {
130
168
  .track {
131
169
  margin-left: 28px;
132
170
  background-color: var(--neutral-alpha-2);
133
- border-left-style: solid;
134
- border-left-color: var(--neutral-alpha-3);
135
- border-left-width: 1px;
171
+ border-radius: none;
172
+ box-shadow: 0 1px 0 0 var(--neutral-alpha-4);
136
173
 
137
174
  .trackContent {
138
175
  padding-left: 0;
139
-
140
- .leftIcon {
176
+ background-color: var(--neutral-alpha-2);
177
+ .toggleOpenButton {
141
178
  display: none;
142
179
  }
143
180
 
@@ -145,7 +182,7 @@
145
182
  padding-left: var(--space-4);
146
183
  background: linear-gradient(
147
184
  90deg,
148
- var(--neutral-alpha-11) 81%,
185
+ var(--neutral-alpha-11) 95%,
149
186
  #1d1d1d 100%
150
187
  );
151
188
  background-clip: text;
@@ -161,7 +198,6 @@
161
198
  &:first-child .track {
162
199
  border-top-style: solid;
163
200
  border-top-color: var(--neutral-alpha-3);
164
- border-top-left-radius: 4px;
165
201
  border-top-width: 1px;
166
202
  }
167
203
 
@@ -192,3 +228,14 @@
192
228
  }
193
229
  }
194
230
  }
231
+
232
+
233
+ .toggleOpenButton {
234
+ background: transparent;
235
+ width: 20px;
236
+ height: 20px;
237
+ opacity: 0.5;
238
+ &:hover {
239
+ opacity: 1;
240
+ }
241
+ }
@@ -1,6 +1,6 @@
1
1
  import { TrackHeader } from './TrackHeader'
2
2
  import { useState } from 'react'
3
-
3
+ import { BassIcon, ElectricGuitarIcon, KeysIcon, DrumsIcon } from '../../icons'
4
4
  export default {
5
5
  title: 'Components/TrackHeader',
6
6
  component: TrackHeader,
@@ -92,6 +92,13 @@ const menuOptions = [
92
92
  { type: 'item', key: 'delete', label: 'Delete', onClick: () => console.log('Delete clicked') },
93
93
  ]
94
94
 
95
+ const instrumentOptions = [
96
+ { type: 'item', key: 'bass', label: 'Bass', icon: <BassIcon /> },
97
+ { type: 'item', key: 'guitar', label: 'Guitar', icon: <ElectricGuitarIcon /> },
98
+ { type: 'item', key: 'piano', label: 'Piano', icon: <KeysIcon /> },
99
+ { type: 'item', key: 'drums', label: 'Drums', icon: <DrumsIcon /> },
100
+
101
+ ]
95
102
  export const Default = {
96
103
  args: {
97
104
  title: 'Common Track',
@@ -109,13 +116,15 @@ export const Default = {
109
116
  onPanChange: () => { },
110
117
  onMutedChange: () => { },
111
118
  onSoloChange: () => { },
119
+ onInstrumentChange: () => { },
120
+ instrumentOptions,
121
+ instrumentSelected: instrumentOptions[0],
112
122
  },
113
123
  render: (args) => <TrackHeader {...args} />,
114
124
  }
115
125
 
116
126
  export const Group = {
117
127
  args: {
118
- isOpen: true,
119
128
  title: 'Group Track',
120
129
  showPan: false,
121
130
  showVolumeControls: true,
@@ -130,13 +139,13 @@ export const Group = {
130
139
  onPanChange: () => { },
131
140
  onMutedChange: () => { },
132
141
  onSoloChange: () => { },
133
- onOpenChange: () => { },
134
142
  },
135
143
  render: (args) => {
144
+ const [isOpen, setIsOpen] = useState(true)
136
145
  const [pan, setPan] = useState(-0.3)
137
146
  const [pan2, setPan2] = useState(-0.3)
138
147
  return (
139
- <TrackHeader {...args}>
148
+ <TrackHeader {...args} isOpen={isOpen} onOpenChange={setIsOpen}>
140
149
  <TrackHeader
141
150
  title="Grouped Track"
142
151
  isGrouped
@@ -0,0 +1,17 @@
1
+ export const ChevronDownFilledIcon = ({ width = 9, height = 5, className, ...props }) => (
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width={width}
5
+ height={height}
6
+ viewBox="0 0 9 5"
7
+ fill="none"
8
+ className={className}
9
+ {...props}
10
+ >
11
+ <path
12
+ d="M3.58684 4.29289L0.147499 0.853553C-0.167484 0.538571 0.0555997 0 0.501052 0L8.08684 0C8.53229 0 8.75537 0.53857 8.44039 0.853553L5.00105 4.29289C4.61053 4.68342 3.97736 4.68342 3.58684 4.29289Z"
13
+ fill="currentColor" />
14
+ </svg>
15
+ )
16
+
17
+ ChevronDownFilledIcon.displayName = 'ChevronDownFilledIcon'
@@ -0,0 +1,17 @@
1
+ export const ChevronRightFilledIcon = ({ width = 5, height = 9, className, ...props }) => (
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width={width}
5
+ height={height}
6
+ viewBox="0 0 5 9"
7
+ fill="none"
8
+ className={className}
9
+ {...props}
10
+ >
11
+ <path
12
+ d="M4.29289 5.001L0.853553 8.44034C0.538571 8.75532 -3.3293e-08 8.53224 -5.27643e-08 8.08679L-3.8435e-07 0.501002C-4.03821e-07 0.0555496 0.53857 -0.167534 0.853552 0.147449L4.29289 3.58679C4.68342 3.97731 4.68342 4.61048 4.29289 5.001Z"
13
+ fill="currentColor" />
14
+ </svg>
15
+ )
16
+
17
+ ChevronRightFilledIcon.displayName = 'ChevronRightFilledIcon'
package/src/icons.jsx CHANGED
@@ -347,3 +347,5 @@ export { EmailIcon } from './icons/EmailIcon'
347
347
  export { EyeIcon } from './icons/EyeIcon'
348
348
  export { EyeOffIcon } from './icons/EyeOffIcon'
349
349
  export { Play1Icon } from './icons/Play1Icon'
350
+ export { ChevronRightFilledIcon } from './icons/ChevronRightFilledIcon'
351
+ export { ChevronDownFilledIcon } from './icons/ChevronDownFilledIcon'
package/src/index.jsx CHANGED
@@ -142,4 +142,5 @@ export { useForm } from './components/useForm/useForm'
142
142
  export { VoiceConversionForm } from './components/VoiceConversionForm/VoiceConversionForm'
143
143
  export { Waveform } from './components/VoiceConversionForm/Waveform/Waveform'
144
144
 
145
- export { EmptyState } from './components/EmptyState/EmptyState'
145
+ export { EmptyState } from './components/EmptyState/EmptyState'
146
+ export { TrackControlsToggle } from './components/TrackControlsToggle/TrackControlsToggle'
@@ -286,6 +286,11 @@
286
286
  background-color: transparent;
287
287
  }
288
288
 
289
+ .menuTrigger[data-state='open'].showActiveTrigger,
290
+ .menuTrigger[data-highlighted].showActiveTrigger {
291
+ background-color: var(--neutral-alpha-3);
292
+ }
293
+
289
294
  .menuSubTrigger[data-highlighted],
290
295
  .menuItem[data-highlighted],
291
296
  .menuSubTrigger[data-state='open'] {