@moises.ai/design-system 3.10.17 → 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.
- package/dist/{Play1Icon-DsUtkWM6.js → ChevronDownFilledIcon-C2hb_0Wr.js} +1824 -1799
- package/dist/icons.js +537 -535
- package/dist/index.js +4047 -3898
- package/package.json +1 -1
- package/src/components/SetlistList/SetlistList.jsx +70 -19
- package/src/components/SetlistList/SetlistList.module.css +53 -6
- package/src/components/TrackControlsToggle/TrackControlsToggle.jsx +55 -0
- package/src/components/TrackControlsToggle/TrackControlsToggle.module.css +49 -0
- package/src/components/TrackControlsToggle/TrackControlsToggle.stories.jsx +156 -0
- package/src/components/TrackHeader/TrackHeader.jsx +145 -60
- package/src/components/TrackHeader/TrackHeader.module.css +83 -36
- package/src/components/TrackHeader/TrackHeader.stories.jsx +13 -4
- package/src/icons/ChevronDownFilledIcon.jsx +17 -0
- package/src/icons/ChevronRightFilledIcon.jsx +17 -0
- package/src/icons.jsx +2 -0
- package/src/index.jsx +2 -1
- package/src/lib/menu/Menu.module.css +5 -0
package/package.json
CHANGED
|
@@ -77,10 +77,7 @@ function NewSetlistButton({
|
|
|
77
77
|
</div>
|
|
78
78
|
}
|
|
79
79
|
text={text}
|
|
80
|
-
className={classNames(
|
|
81
|
-
styles.newSetlistItemButton,
|
|
82
|
-
className,
|
|
83
|
-
)}
|
|
80
|
+
className={classNames(styles.newSetlistItemButton, className)}
|
|
84
81
|
collapsed={collapsed}
|
|
85
82
|
style={style}
|
|
86
83
|
/>
|
|
@@ -323,11 +320,15 @@ export const SetlistList = ({
|
|
|
323
320
|
const collapsedVisibleOffset = 4
|
|
324
321
|
const maxCollapsedItems = 4
|
|
325
322
|
const collapsedNewItemOffset = collapsed && onNewSetlistClick ? 1 : 0
|
|
326
|
-
const showCollapsedStack =
|
|
323
|
+
const showCollapsedStack =
|
|
324
|
+
collapsed && !isHoveredWhenCollapsed && !isCollapseTransitioning
|
|
327
325
|
const visibleSetlists = setlists
|
|
328
326
|
|
|
329
327
|
const totalAnimatedItems = setlists.length + (onNewSetlistClick ? 1 : 0)
|
|
330
|
-
const
|
|
328
|
+
const slideItemCount = Math.min(4, totalAnimatedItems)
|
|
329
|
+
const slideTotalDuration =
|
|
330
|
+
staggerItemDuration + Math.max(0, slideItemCount - 1) * staggerBaseDelay
|
|
331
|
+
const staggerTotalDuration = slideTotalDuration
|
|
331
332
|
|
|
332
333
|
const expandItems = () => {
|
|
333
334
|
if (shrinkTimeoutRef.current) {
|
|
@@ -460,6 +461,13 @@ export const SetlistList = ({
|
|
|
460
461
|
'0 3.401px 13.603px -6.801px var(--Overlays-Black-Alpha-2, rgba(0, 0, 0, 0.10)), 0 2.551px 10.202px -3.401px var(--Overlays-Black-Alpha-2, rgba(0, 0, 0, 0.10)), 0 1.701px 2.551px -1.701px var(--Overlays-Black-Alpha-3, rgba(0, 0, 0, 0.15))',
|
|
461
462
|
]
|
|
462
463
|
|
|
464
|
+
const narrowingPerLevel = 1
|
|
465
|
+
const scale =
|
|
466
|
+
stackPosition === 0
|
|
467
|
+
? 1
|
|
468
|
+
: (collapsedItemHeight - stackPosition * narrowingPerLevel * 2) /
|
|
469
|
+
collapsedItemHeight
|
|
470
|
+
|
|
463
471
|
return {
|
|
464
472
|
position: 'relative',
|
|
465
473
|
marginTop:
|
|
@@ -468,27 +476,59 @@ export const SetlistList = ({
|
|
|
468
476
|
: -(collapsedItemHeight - collapsedVisibleOffset),
|
|
469
477
|
zIndex,
|
|
470
478
|
boxShadow: boxShadows[index],
|
|
479
|
+
transform: scale < 1 ? `scaleX(${scale})` : undefined,
|
|
471
480
|
}
|
|
472
481
|
}
|
|
473
482
|
|
|
474
|
-
const isStaggerActive =
|
|
483
|
+
const isStaggerActive =
|
|
484
|
+
(collapsed && !showCollapsedStack) || isCollapseTransitioning
|
|
475
485
|
const itemCollapsed = collapsed || isCollapseTransitioning
|
|
476
486
|
|
|
477
487
|
const getStaggerStyle = (itemIndex) => {
|
|
478
488
|
if (!isStaggerActive) return undefined
|
|
489
|
+
const isSlideItem = itemIndex < slideItemCount
|
|
490
|
+
|
|
479
491
|
if (isShrinking) {
|
|
480
|
-
|
|
492
|
+
if (isSlideItem) {
|
|
493
|
+
const outY = -(
|
|
494
|
+
itemIndex *
|
|
495
|
+
(collapsedItemHeight - collapsedVisibleOffset)
|
|
496
|
+
)
|
|
497
|
+
const outScale =
|
|
498
|
+
itemIndex === 0
|
|
499
|
+
? 1
|
|
500
|
+
: (collapsedItemHeight - itemIndex * 2) / collapsedItemHeight
|
|
501
|
+
return {
|
|
502
|
+
animationDelay: `${itemIndex * staggerBaseDelay}ms`,
|
|
503
|
+
'--stagger-out-y': `${outY}px`,
|
|
504
|
+
'--stagger-out-scale': outScale,
|
|
505
|
+
zIndex: totalAnimatedItems - itemIndex,
|
|
506
|
+
}
|
|
507
|
+
}
|
|
481
508
|
return {
|
|
482
|
-
|
|
483
|
-
'--stagger-out-y': `${outY}px`,
|
|
509
|
+
'--fade-duration': `${slideTotalDuration}ms`,
|
|
484
510
|
zIndex: totalAnimatedItems - itemIndex,
|
|
485
511
|
}
|
|
486
512
|
}
|
|
487
513
|
if (isExpanding) {
|
|
488
|
-
|
|
514
|
+
if (isSlideItem) {
|
|
515
|
+
const inY = -(
|
|
516
|
+
itemIndex *
|
|
517
|
+
(collapsedItemHeight - collapsedVisibleOffset)
|
|
518
|
+
)
|
|
519
|
+
const inScale =
|
|
520
|
+
itemIndex === 0
|
|
521
|
+
? 1
|
|
522
|
+
: (collapsedItemHeight - itemIndex * 2) / collapsedItemHeight
|
|
523
|
+
return {
|
|
524
|
+
animationDelay: `${(slideItemCount - 1 - itemIndex) * staggerBaseDelay}ms`,
|
|
525
|
+
'--stagger-in-y': `${inY}px`,
|
|
526
|
+
'--stagger-in-scale': inScale,
|
|
527
|
+
zIndex: totalAnimatedItems - itemIndex,
|
|
528
|
+
}
|
|
529
|
+
}
|
|
489
530
|
return {
|
|
490
|
-
|
|
491
|
-
'--stagger-in-y': `${inY}px`,
|
|
531
|
+
'--fade-duration': `${slideTotalDuration}ms`,
|
|
492
532
|
zIndex: totalAnimatedItems - itemIndex,
|
|
493
533
|
}
|
|
494
534
|
}
|
|
@@ -547,6 +587,8 @@ export const SetlistList = ({
|
|
|
547
587
|
))}
|
|
548
588
|
{visibleSetlists.map((setlist, index) => {
|
|
549
589
|
const isSelected = selectedSetlistId === setlist.id
|
|
590
|
+
const itemStaggerIndex = index + collapsedNewItemOffset
|
|
591
|
+
const isSlideItem = itemStaggerIndex < slideItemCount
|
|
550
592
|
const setlistItem = (
|
|
551
593
|
<SetlistItem
|
|
552
594
|
isSelected={isSelected}
|
|
@@ -555,9 +597,7 @@ export const SetlistList = ({
|
|
|
555
597
|
droppable={droppable}
|
|
556
598
|
isDropTarget={activeDropSetlistId === setlist.id}
|
|
557
599
|
dndDroppableId={
|
|
558
|
-
enableDndDropTargets
|
|
559
|
-
? `setlist:${setlist.id}`
|
|
560
|
-
: undefined
|
|
600
|
+
enableDndDropTargets ? `setlist:${setlist.id}` : undefined
|
|
561
601
|
}
|
|
562
602
|
onDragOver={(event) => {
|
|
563
603
|
onSetlistDragOver?.(setlist.id, event)
|
|
@@ -587,12 +627,23 @@ export const SetlistList = ({
|
|
|
587
627
|
[styles.collapsedStackItem]: showCollapsedStack,
|
|
588
628
|
[styles.collapsedTransition]: collapsed && showCollapsedStack,
|
|
589
629
|
[styles.staggerItem]: isStaggerActive,
|
|
590
|
-
[styles.staggerAnimateIn]:
|
|
591
|
-
|
|
630
|
+
[styles.staggerAnimateIn]:
|
|
631
|
+
isStaggerActive && isExpanding && isSlideItem,
|
|
632
|
+
[styles.staggerAnimateOut]:
|
|
633
|
+
isStaggerActive && isShrinking && isSlideItem,
|
|
634
|
+
[styles.fadeAnimateIn]:
|
|
635
|
+
isStaggerActive && isExpanding && !isSlideItem,
|
|
636
|
+
[styles.fadeAnimateOut]:
|
|
637
|
+
isStaggerActive && isShrinking && !isSlideItem,
|
|
638
|
+
[styles.fadeHidden]:
|
|
639
|
+
!isSlideItem &&
|
|
640
|
+
collapsed &&
|
|
641
|
+
!isHoveredWhenCollapsed &&
|
|
642
|
+
!isCollapseTransitioning,
|
|
592
643
|
})}
|
|
593
644
|
style={{
|
|
594
645
|
...getCollapsedStackStyle(index),
|
|
595
|
-
...getStaggerStyle(
|
|
646
|
+
...getStaggerStyle(itemStaggerIndex),
|
|
596
647
|
}}
|
|
597
648
|
/>
|
|
598
649
|
)
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
background: var(--neutral-alpha-3);
|
|
158
158
|
|
|
159
159
|
&.collapsed {
|
|
160
|
-
|
|
160
|
+
background: transparent;
|
|
161
161
|
|
|
162
162
|
.avatarSetlist {
|
|
163
163
|
background: var(--neutral-2);
|
|
@@ -165,8 +165,6 @@
|
|
|
165
165
|
|
|
166
166
|
&:hover,
|
|
167
167
|
&.menuOpen {
|
|
168
|
-
background: transparent !important;
|
|
169
|
-
|
|
170
168
|
.avatarSetlist {
|
|
171
169
|
background: var(--neutral-2) !important;
|
|
172
170
|
}
|
|
@@ -265,6 +263,21 @@ sectionTitle {
|
|
|
265
263
|
position: relative;
|
|
266
264
|
}
|
|
267
265
|
|
|
266
|
+
.collapsedStack .collapsedStackItem:not(:first-child) {
|
|
267
|
+
background: transparent !important;
|
|
268
|
+
pointer-events: none;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.collapsedStack .collapsedStackItem:not(:first-child) .avatarSetlist::after {
|
|
272
|
+
content: '';
|
|
273
|
+
position: absolute;
|
|
274
|
+
inset: 0;
|
|
275
|
+
background: #11111399;
|
|
276
|
+
border-radius: inherit;
|
|
277
|
+
pointer-events: none;
|
|
278
|
+
z-index: 2;
|
|
279
|
+
}
|
|
280
|
+
|
|
268
281
|
.setlistExpandButton {
|
|
269
282
|
display: flex;
|
|
270
283
|
align-items: center;
|
|
@@ -313,16 +326,19 @@ sectionTitle {
|
|
|
313
326
|
|
|
314
327
|
@keyframes staggerIn {
|
|
315
328
|
from {
|
|
316
|
-
transform: translateY(var(--stagger-in-y, 0));
|
|
329
|
+
transform: translateY(var(--stagger-in-y, 0)) scaleX(var(--stagger-in-scale, 1));
|
|
317
330
|
}
|
|
318
331
|
to {
|
|
319
|
-
transform: translateY(0);
|
|
332
|
+
transform: translateY(0) scaleX(1);
|
|
320
333
|
}
|
|
321
334
|
}
|
|
322
335
|
|
|
323
336
|
@keyframes staggerOut {
|
|
337
|
+
from {
|
|
338
|
+
transform: translateY(0) scaleX(1);
|
|
339
|
+
}
|
|
324
340
|
to {
|
|
325
|
-
transform: translateY(var(--stagger-out-y, 0));
|
|
341
|
+
transform: translateY(var(--stagger-out-y, 0)) scaleX(var(--stagger-out-scale, 1));
|
|
326
342
|
}
|
|
327
343
|
}
|
|
328
344
|
|
|
@@ -340,6 +356,37 @@ sectionTitle {
|
|
|
340
356
|
animation: staggerOut 200ms ease-out both;
|
|
341
357
|
}
|
|
342
358
|
|
|
359
|
+
@keyframes fadeIn {
|
|
360
|
+
from {
|
|
361
|
+
opacity: 0;
|
|
362
|
+
}
|
|
363
|
+
to {
|
|
364
|
+
opacity: 1;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
@keyframes fadeOut {
|
|
369
|
+
from {
|
|
370
|
+
opacity: 1;
|
|
371
|
+
}
|
|
372
|
+
to {
|
|
373
|
+
opacity: 0;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.fadeAnimateIn {
|
|
378
|
+
animation: fadeIn var(--fade-duration, 300ms) ease-out both;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.fadeAnimateOut {
|
|
382
|
+
animation: fadeOut var(--fade-duration, 300ms) ease-out both;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.fadeHidden {
|
|
386
|
+
opacity: 0;
|
|
387
|
+
pointer-events: none;
|
|
388
|
+
}
|
|
389
|
+
|
|
343
390
|
.contentInner {
|
|
344
391
|
gap: 12px;
|
|
345
392
|
flex: 1;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import styles from './TrackControlsToggle.module.css'
|
|
2
|
+
import classNames from 'classnames'
|
|
3
|
+
import { Text, Tooltip, Flex } from '../../index'
|
|
4
|
+
|
|
5
|
+
export const TrackControlsToggle = ({ children, className, type, selected, onClick, tooltipContent, ...props }) => {
|
|
6
|
+
const toggleType = {
|
|
7
|
+
record: 'R',
|
|
8
|
+
mute: 'M',
|
|
9
|
+
autoMute: 'M',
|
|
10
|
+
solo: 'S',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const content = () => {
|
|
14
|
+
return (
|
|
15
|
+
<Flex className={classNames(styles.TrackControlsToggle, className, {
|
|
16
|
+
[styles.selected]: selected,
|
|
17
|
+
[styles.record]: type === 'record',
|
|
18
|
+
[styles.mute]: type === 'mute',
|
|
19
|
+
[styles.autoMute]: type === 'autoMute',
|
|
20
|
+
[styles.solo]: type === 'solo',
|
|
21
|
+
})}
|
|
22
|
+
onClick={onClick}
|
|
23
|
+
role="button"
|
|
24
|
+
tabIndex={0}
|
|
25
|
+
aria-pressed={selected}
|
|
26
|
+
onKeyDown={(e) => {
|
|
27
|
+
if (e.key === 'Enter') {
|
|
28
|
+
e.preventDefault()
|
|
29
|
+
onClick?.()
|
|
30
|
+
}
|
|
31
|
+
}}
|
|
32
|
+
{...props}>
|
|
33
|
+
<Text size="1" weight="regular">{toggleType[type]}</Text>
|
|
34
|
+
</Flex>
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
{tooltipContent && (
|
|
42
|
+
<Tooltip content={tooltipContent?.text} color='gray' shortcut={tooltipContent?.shortcut}>
|
|
43
|
+
{content()}
|
|
44
|
+
</Tooltip>
|
|
45
|
+
)}
|
|
46
|
+
{!tooltipContent && (
|
|
47
|
+
<>
|
|
48
|
+
{content()}
|
|
49
|
+
</>
|
|
50
|
+
)}
|
|
51
|
+
</>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
TrackControlsToggle.displayName = 'TrackControlsToggle'
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.TrackControlsToggle {
|
|
2
|
+
border-radius: 4px;
|
|
3
|
+
background: var(--neutral-alpha-2);
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
padding: 2px;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 4px;
|
|
9
|
+
|
|
10
|
+
color: var(--neutral-alpha-10);
|
|
11
|
+
|
|
12
|
+
width: 20px;
|
|
13
|
+
height: 20px;
|
|
14
|
+
|
|
15
|
+
&:focus-visible:not(.disabled){
|
|
16
|
+
outline: 2px solid var(--neutral-alpha-8);
|
|
17
|
+
outline-offset: 2px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.TrackControlsToggle:hover {
|
|
22
|
+
background: var(--neutral-alpha-3);
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.selected.record {
|
|
27
|
+
background: rgba(255, 100, 101, 0.92);
|
|
28
|
+
color: var(--neutral-1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.selected.mute {
|
|
32
|
+
background: #FFC53D;
|
|
33
|
+
color: var(--neutral-1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.selected.autoMute {
|
|
37
|
+
background: var(--neutral-alpha-2);
|
|
38
|
+
color: #FFC53D;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.selected.autoMute:hover {
|
|
42
|
+
background: var(--neutral-alpha-3);
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.selected.solo {
|
|
47
|
+
background: var(--aqua-10);
|
|
48
|
+
color: var(--neutral-1);
|
|
49
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import { TrackControlsToggle } from './TrackControlsToggle'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/TrackControlsToggle',
|
|
6
|
+
component: TrackControlsToggle,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: 'Toggle button for track controls (Record, Mute, Auto Mute, and Solo). Use `selected` to represent active state and `tooltipContent` to show context and keyboard shortcut.',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
argTypes: {
|
|
17
|
+
type: {
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: ['record', 'mute', 'autoMute', 'solo'],
|
|
20
|
+
description: 'Defines the control type and the displayed label (R, M, or S).',
|
|
21
|
+
table: {
|
|
22
|
+
type: { summary: "'record' | 'mute' | 'autoMute' | 'solo'" },
|
|
23
|
+
defaultValue: { summary: "'solo'" },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
selected: {
|
|
27
|
+
control: 'boolean',
|
|
28
|
+
description: 'Controls the visual active/inactive state of the toggle.',
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: 'boolean' },
|
|
31
|
+
defaultValue: { summary: 'false' },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
onClick: {
|
|
35
|
+
action: 'clicked',
|
|
36
|
+
description: 'Triggered when clicking (or pressing Enter/Space) on the toggle.',
|
|
37
|
+
table: {
|
|
38
|
+
type: { summary: '() => void' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
tooltipContent: {
|
|
42
|
+
control: 'object',
|
|
43
|
+
description: 'Tooltip data in the `{ text, shortcut }` format.',
|
|
44
|
+
table: {
|
|
45
|
+
type: { summary: '{ text?: string; shortcut?: string }' },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
children: {
|
|
49
|
+
control: false,
|
|
50
|
+
table: {
|
|
51
|
+
disable: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const Default = {
|
|
58
|
+
args: {
|
|
59
|
+
type: 'solo',
|
|
60
|
+
selected: true,
|
|
61
|
+
tooltipContent: {
|
|
62
|
+
text: 'Tooltip Content',
|
|
63
|
+
shortcut: '⌘ C',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const Inactive = {
|
|
69
|
+
args: {
|
|
70
|
+
type: 'solo',
|
|
71
|
+
selected: false,
|
|
72
|
+
tooltipContent: {
|
|
73
|
+
text: 'Solo',
|
|
74
|
+
shortcut: 'S',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const RecordSelected = {
|
|
80
|
+
args: {
|
|
81
|
+
type: 'record',
|
|
82
|
+
selected: true,
|
|
83
|
+
tooltipContent: {
|
|
84
|
+
text: 'Record',
|
|
85
|
+
shortcut: 'R',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const MuteSelected = {
|
|
91
|
+
args: {
|
|
92
|
+
type: 'mute',
|
|
93
|
+
selected: true,
|
|
94
|
+
tooltipContent: {
|
|
95
|
+
text: 'Mute',
|
|
96
|
+
shortcut: 'M',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const AllStates = {
|
|
102
|
+
parameters: {
|
|
103
|
+
docs: {
|
|
104
|
+
description: {
|
|
105
|
+
story: 'Shows all states with and without tooltip. Click any toggle to switch between inactive and active.',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
render: (args) => {
|
|
110
|
+
const InteractiveGroup = ({ withTooltip }) => {
|
|
111
|
+
const [states, setStates] = useState({
|
|
112
|
+
record: false,
|
|
113
|
+
mute: false,
|
|
114
|
+
autoMute: false,
|
|
115
|
+
solo: false,
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
const types = ['record', 'mute', 'autoMute', 'solo']
|
|
119
|
+
|
|
120
|
+
const toggleState = (type) => {
|
|
121
|
+
setStates((prev) => ({ ...prev, [type]: !prev[type] }))
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<div style={{ display: 'flex', gap: 8 }}>
|
|
126
|
+
{types.map((type) => (
|
|
127
|
+
<TrackControlsToggle
|
|
128
|
+
key={`${withTooltip ? 'with' : 'without'}-${type}`}
|
|
129
|
+
{...args}
|
|
130
|
+
type={type}
|
|
131
|
+
selected={states[type]}
|
|
132
|
+
tooltipContent={withTooltip ? { text: `${type}`, shortcut: type.slice(0, 1).toUpperCase() } : undefined}
|
|
133
|
+
onClick={() => {
|
|
134
|
+
args.onClick?.()
|
|
135
|
+
toggleState(type)
|
|
136
|
+
}}
|
|
137
|
+
/>
|
|
138
|
+
))}
|
|
139
|
+
</div>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<div style={{ display: 'grid', gap: 14 }}>
|
|
145
|
+
<div style={{ display: 'grid', gap: 8 }}>
|
|
146
|
+
<span style={{ color: '#9da3b4', fontSize: 12 }}>With tooltip</span>
|
|
147
|
+
<InteractiveGroup withTooltip />
|
|
148
|
+
</div>
|
|
149
|
+
<div style={{ display: 'grid', gap: 8 }}>
|
|
150
|
+
<span style={{ color: '#9da3b4', fontSize: 12 }}>Without tooltip</span>
|
|
151
|
+
<InteractiveGroup withTooltip={false} />
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
)
|
|
155
|
+
},
|
|
156
|
+
}
|