@moises.ai/design-system 3.11.18 → 3.11.19
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/colors/custom-styles.css +28 -8
- package/dist/index.js +2214 -2202
- package/package.json +1 -1
- package/src/colors/custom-styles.css +28 -8
- package/src/components/InputLevelMeter/InputLevelMeter.module.css +1 -1
- package/src/components/TrackControlButton/TrackControlButton.jsx +53 -13
- package/src/components/TrackControlButton/TrackControlButton.module.css +80 -30
- package/src/components/TrackControlButton/TrackControlButton.stories.jsx +25 -6
- package/src/components/TrackControlsToggle/TrackControlsToggle.jsx +24 -52
- package/src/components/TrackControlsToggle/TrackControlsToggle.module.css +0 -44
package/package.json
CHANGED
|
@@ -85,7 +85,26 @@
|
|
|
85
85
|
|
|
86
86
|
/* Neutral */
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
/* Figma paths: colors/neutral/…, colors/semantic/…, colors/accent/… (AI Studio file) */
|
|
89
|
+
--colors-neutral-neutral-1: #111113;
|
|
90
|
+
--colors-neutral-neutral-alpha-2: rgba(216, 244, 246, 0.04);
|
|
91
|
+
--colors-neutral-neutral-alpha-3: rgba(221, 234, 248, 0.08);
|
|
92
|
+
--colors-neutral-neutral-alpha-4: rgba(211, 237, 248, 0.11);
|
|
93
|
+
--colors-neutral-neutral-alpha-5: rgba(217, 237, 254, 0.15);
|
|
94
|
+
--colors-neutral-neutral-alpha-10: rgba(229, 237, 253, 0.48);
|
|
95
|
+
--colors-semantic-warning-alpha-9: #ffc53d;
|
|
96
|
+
--colors-accent-accent-10: #19e4f1;
|
|
97
|
+
--colors-red-alpha-10: rgba(255, 100, 101, 0.92);
|
|
98
|
+
|
|
99
|
+
/* Figma Dev Mode (PascalCase) — mesmo valor que colors/neutral/neutral-alpha/… */
|
|
100
|
+
--Colors-Neutral-Neutral-Alpha-2: var(--colors-neutral-neutral-alpha-2);
|
|
101
|
+
--Colors-Neutral-Neutral-Alpha-3: var(--colors-neutral-neutral-alpha-3);
|
|
102
|
+
--Colors-Neutral-Neutral-Alpha-4: var(--colors-neutral-neutral-alpha-4);
|
|
103
|
+
--Colors-Neutral-Neutral-Alpha-5: var(--colors-neutral-neutral-alpha-5);
|
|
104
|
+
--Colors-Neutral-Neutral-Alpha-10: var(--colors-neutral-neutral-alpha-10);
|
|
105
|
+
--Colors-Neutral-Neutral-1: var(--colors-neutral-neutral-1);
|
|
106
|
+
|
|
107
|
+
--neutral-1: var(--colors-neutral-neutral-1);
|
|
89
108
|
--neutral-2: rgba(24, 25, 27, 1);
|
|
90
109
|
--neutral-3: rgba(33, 34, 37, 1);
|
|
91
110
|
--neutral-4: rgba(39, 42, 45, 1);
|
|
@@ -99,15 +118,15 @@
|
|
|
99
118
|
--neutral-12: rgba(237, 238, 240, 1);
|
|
100
119
|
|
|
101
120
|
--neutral-alpha-1: rgba(0, 0, 0, 0);
|
|
102
|
-
--neutral-alpha-2:
|
|
103
|
-
--neutral-alpha-3:
|
|
104
|
-
--neutral-alpha-4:
|
|
105
|
-
--neutral-alpha-5:
|
|
121
|
+
--neutral-alpha-2: var(--colors-neutral-neutral-alpha-2);
|
|
122
|
+
--neutral-alpha-3: var(--colors-neutral-neutral-alpha-3);
|
|
123
|
+
--neutral-alpha-4: var(--colors-neutral-neutral-alpha-4);
|
|
124
|
+
--neutral-alpha-5: var(--colors-neutral-neutral-alpha-5);
|
|
106
125
|
--neutral-alpha-6: rgba(214, 235, 253, 0.19);
|
|
107
126
|
--neutral-alpha-7: rgba(217, 237, 255, 0.25);
|
|
108
127
|
--neutral-alpha-8: rgba(217, 237, 255, 0.36);
|
|
109
128
|
--neutral-alpha-9: rgba(223, 235, 253, 0.43);
|
|
110
|
-
--neutral-alpha-10:
|
|
129
|
+
--neutral-alpha-10: var(--colors-neutral-neutral-alpha-10);
|
|
111
130
|
--neutral-alpha-11: rgba(241, 247, 254, 0.71);
|
|
112
131
|
--neutral-alpha-12: rgba(252, 253, 255, 0.94);
|
|
113
132
|
|
|
@@ -118,6 +137,7 @@
|
|
|
118
137
|
/* Red */
|
|
119
138
|
--red-alpha-2: rgba(242, 47, 62, 0.07);
|
|
120
139
|
--red-alpha-3: rgba(255, 23, 63, 0.18);
|
|
140
|
+
--red-alpha-10: var(--colors-red-alpha-10);
|
|
121
141
|
|
|
122
142
|
/* Success */
|
|
123
143
|
--success-alpha-2: rgba(41, 249, 157, 0.04);
|
|
@@ -128,6 +148,7 @@
|
|
|
128
148
|
|
|
129
149
|
/* Warning */
|
|
130
150
|
--warning-alpha-2: rgba(253, 155, 0, 0.05);
|
|
151
|
+
--warning-alpha-9: var(--colors-semantic-warning-alpha-9);
|
|
131
152
|
--warning-alpha-12: #FFE7B3;
|
|
132
153
|
|
|
133
154
|
/* Error */
|
|
@@ -140,7 +161,6 @@
|
|
|
140
161
|
--info-alpha-3: rgba(0, 249, 121, 0.11);
|
|
141
162
|
--info-alpha-12: rgba(166, 255, 206, 1);
|
|
142
163
|
|
|
143
|
-
|
|
144
164
|
.radix-themes {
|
|
145
165
|
--cursor-button: pointer;
|
|
146
166
|
--cursor-checkbox: pointer;
|
|
@@ -221,7 +241,7 @@
|
|
|
221
241
|
--cyan-7: var(--aqua-7);
|
|
222
242
|
--cyan-8: var(--aqua-8);
|
|
223
243
|
--cyan-9: var(--aqua-9);
|
|
224
|
-
--cyan-10: var(--
|
|
244
|
+
--cyan-10: var(--colors-accent-accent-10);
|
|
225
245
|
--cyan-11: var(--aqua-11);
|
|
226
246
|
--cyan-12: var(--aqua-12);
|
|
227
247
|
--cyan-a1: var(--aqua-alpha-1);
|
|
@@ -1,27 +1,67 @@
|
|
|
1
1
|
import classNames from 'classnames'
|
|
2
2
|
import { memo } from 'react'
|
|
3
|
-
import {
|
|
3
|
+
import { Tooltip } from '../Tooltip/Tooltip'
|
|
4
4
|
import styles from './TrackControlButton.module.css'
|
|
5
5
|
|
|
6
|
+
const LABELS = {
|
|
7
|
+
record: 'R',
|
|
8
|
+
mute: 'M',
|
|
9
|
+
autoMute: 'M',
|
|
10
|
+
solo: 'S',
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
export const TrackControlButton = memo(
|
|
7
|
-
({
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
({
|
|
15
|
+
variant = 'mute',
|
|
16
|
+
isActive,
|
|
17
|
+
selected,
|
|
18
|
+
className,
|
|
19
|
+
onChange,
|
|
20
|
+
onClick,
|
|
21
|
+
disabled,
|
|
22
|
+
tooltipContent,
|
|
23
|
+
...props
|
|
24
|
+
}) => {
|
|
25
|
+
const pressed = isActive ?? selected ?? false
|
|
26
|
+
const label = LABELS[variant] ?? LABELS.mute
|
|
27
|
+
|
|
28
|
+
const handleClick = (event) => {
|
|
29
|
+
onClick?.(event)
|
|
30
|
+
onChange?.(!pressed)
|
|
31
|
+
}
|
|
10
32
|
|
|
11
|
-
|
|
12
|
-
<
|
|
33
|
+
const button = (
|
|
34
|
+
<button
|
|
35
|
+
type="button"
|
|
36
|
+
disabled={disabled}
|
|
13
37
|
className={classNames(styles.button, className, {
|
|
14
|
-
[styles.
|
|
15
|
-
[styles.
|
|
16
|
-
[styles.
|
|
38
|
+
[styles.active]: pressed,
|
|
39
|
+
[styles.record]: variant === 'record',
|
|
40
|
+
[styles.mute]: variant === 'mute',
|
|
41
|
+
[styles.autoMute]: variant === 'autoMute',
|
|
42
|
+
[styles.solo]: variant === 'solo',
|
|
17
43
|
})}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
44
|
+
aria-pressed={pressed}
|
|
45
|
+
onClick={handleClick}
|
|
46
|
+
{...props}
|
|
21
47
|
>
|
|
22
48
|
{label}
|
|
23
|
-
</
|
|
49
|
+
</button>
|
|
24
50
|
)
|
|
51
|
+
|
|
52
|
+
if (tooltipContent) {
|
|
53
|
+
return (
|
|
54
|
+
<Tooltip
|
|
55
|
+
content={tooltipContent?.text}
|
|
56
|
+
color="gray"
|
|
57
|
+
shortcut={tooltipContent?.shortcut}
|
|
58
|
+
>
|
|
59
|
+
{button}
|
|
60
|
+
</Tooltip>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return button
|
|
25
65
|
},
|
|
26
66
|
)
|
|
27
67
|
|
|
@@ -1,32 +1,82 @@
|
|
|
1
1
|
.button {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
width: 20px;
|
|
4
|
+
min-width: 20px;
|
|
5
|
+
min-height: 20px;
|
|
6
|
+
height: 100%;
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 2px;
|
|
9
|
+
border: none;
|
|
10
|
+
border-radius: var(--radius-2, 4px);
|
|
11
|
+
font-family: var(--default-font-family, inherit);
|
|
12
|
+
font-size: 12px;
|
|
13
|
+
line-height: 16px;
|
|
14
|
+
letter-spacing: 0.04px;
|
|
15
|
+
font-weight: 400;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
-webkit-tap-highlight-color: transparent;
|
|
21
|
+
|
|
22
|
+
background: var(--Colors-Neutral-Neutral-Alpha-4, rgba(211, 237, 248, 0.11));
|
|
23
|
+
color: var(--Colors-Neutral-Neutral-Alpha-10, rgba(229, 237, 253, 0.48));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.button:hover:not(:disabled) {
|
|
27
|
+
background: var(--Colors-Neutral-Neutral-Alpha-5, rgba(217, 237, 254, 0.15));
|
|
28
|
+
color: var(--Colors-Neutral-Neutral-Alpha-10, rgba(229, 237, 253, 0.48));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.button:focus-visible {
|
|
32
|
+
outline: 2px solid var(--neutral-alpha-8);
|
|
33
|
+
outline-offset: 2px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.button:disabled {
|
|
37
|
+
cursor: default;
|
|
38
|
+
opacity: 0.5;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Auto Mute inativo — Figma */
|
|
42
|
+
.button.autoMute:not(.active) {
|
|
43
|
+
background: var(--Colors-Neutral-Neutral-Alpha-2, rgba(216, 244, 246, 0.04));
|
|
44
|
+
color: var(--colors-semantic-warning-alpha-9);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.button.autoMute:not(.active):hover:not(:disabled) {
|
|
48
|
+
background: var(--Colors-Neutral-Neutral-Alpha-3, rgba(221, 234, 248, 0.08));
|
|
49
|
+
color: var(--colors-semantic-warning-alpha-9);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.button.active.record {
|
|
53
|
+
background-color: var(--colors-red-alpha-10);
|
|
54
|
+
color: var(--colors-neutral-neutral-1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.button.active.record:hover:not(:disabled) {
|
|
58
|
+
background-color: var(--colors-red-alpha-10);
|
|
59
|
+
color: var(--colors-neutral-neutral-1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.button.active.mute,
|
|
63
|
+
.button.active.autoMute {
|
|
64
|
+
background-color: var(--colors-semantic-warning-alpha-9);
|
|
65
|
+
color: var(--colors-neutral-neutral-1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.button.active.mute:hover:not(:disabled),
|
|
69
|
+
.button.active.autoMute:hover:not(:disabled) {
|
|
70
|
+
background-color: var(--colors-semantic-warning-alpha-9);
|
|
71
|
+
color: var(--colors-neutral-neutral-1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.button.active.solo {
|
|
75
|
+
background-color: var(--colors-accent-accent-10);
|
|
76
|
+
color: var(--colors-neutral-neutral-1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.button.active.solo:hover:not(:disabled) {
|
|
80
|
+
background-color: var(--colors-accent-accent-10);
|
|
81
|
+
color: var(--colors-neutral-neutral-1);
|
|
32
82
|
}
|
|
@@ -8,18 +8,28 @@ export default {
|
|
|
8
8
|
argTypes: {
|
|
9
9
|
variant: {
|
|
10
10
|
control: 'select',
|
|
11
|
-
options: ['mute', 'solo'],
|
|
12
|
-
description: '
|
|
13
|
-
defaultValue: 'mute',
|
|
11
|
+
options: ['mute', 'solo', 'record', 'autoMute'],
|
|
12
|
+
description: 'Tipo de controle (R, M ou S)',
|
|
14
13
|
},
|
|
15
14
|
isActive: {
|
|
16
15
|
control: 'boolean',
|
|
17
|
-
description: '
|
|
18
|
-
|
|
16
|
+
description: 'Estado ativo (pressionado)',
|
|
17
|
+
},
|
|
18
|
+
selected: {
|
|
19
|
+
control: 'boolean',
|
|
20
|
+
description: 'Alias de `isActive` (compatível com TrackControlsToggle)',
|
|
19
21
|
},
|
|
20
22
|
onChange: {
|
|
21
23
|
action: 'changed',
|
|
22
|
-
description: '
|
|
24
|
+
description: 'Recebe o próximo boolean ao clicar',
|
|
25
|
+
},
|
|
26
|
+
onClick: {
|
|
27
|
+
action: 'clicked',
|
|
28
|
+
description: 'Handler nativo do clique (disparado junto com onChange quando ambos existem)',
|
|
29
|
+
},
|
|
30
|
+
tooltipContent: {
|
|
31
|
+
control: 'object',
|
|
32
|
+
description: 'Opcional: `{ text, shortcut }`',
|
|
23
33
|
},
|
|
24
34
|
},
|
|
25
35
|
}
|
|
@@ -45,3 +55,12 @@ export const Interactive = {
|
|
|
45
55
|
)
|
|
46
56
|
},
|
|
47
57
|
}
|
|
58
|
+
|
|
59
|
+
export const WithTooltip = {
|
|
60
|
+
args: {
|
|
61
|
+
variant: 'solo',
|
|
62
|
+
isActive: false,
|
|
63
|
+
tooltipContent: { text: 'Solo', shortcut: 'S' },
|
|
64
|
+
onClick: () => {},
|
|
65
|
+
},
|
|
66
|
+
}
|
|
@@ -1,55 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import classNames from 'classnames'
|
|
3
|
-
import { Text, Tooltip, Flex } from '../../index'
|
|
1
|
+
import { TrackControlButton } from '../TrackControlButton/TrackControlButton'
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
}
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `TrackControlButton` with `variant={type}` and `isActive={selected}`.
|
|
5
|
+
* Maintained for backward compatibility.
|
|
6
|
+
*/
|
|
7
|
+
export const TrackControlsToggle = ({
|
|
8
|
+
type,
|
|
9
|
+
selected,
|
|
10
|
+
className,
|
|
11
|
+
onClick,
|
|
12
|
+
tooltipContent,
|
|
13
|
+
disabled,
|
|
14
|
+
...props
|
|
15
|
+
}) => (
|
|
16
|
+
<TrackControlButton
|
|
17
|
+
variant={type}
|
|
18
|
+
isActive={selected}
|
|
19
|
+
className={className}
|
|
20
|
+
onClick={onClick}
|
|
21
|
+
tooltipContent={tooltipContent}
|
|
22
|
+
disabled={disabled}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
54
26
|
|
|
55
27
|
TrackControlsToggle.displayName = 'TrackControlsToggle'
|
|
@@ -1,44 +0,0 @@
|
|
|
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.solo {
|
|
42
|
-
background: var(--aqua-10);
|
|
43
|
-
color: var(--neutral-1);
|
|
44
|
-
}
|