@moises.ai/design-system 3.5.5 → 3.5.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moises.ai/design-system",
3
- "version": "3.5.5",
3
+ "version": "3.5.7",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -19,11 +19,19 @@ export const AdditionalItems = ({
19
19
  <Flex
20
20
  key={item.id || index}
21
21
  align="center"
22
+ role="button"
23
+ tabIndex={0}
22
24
  className={classNames(styles.upgradeItem, {
23
25
  [styles.upgradeItemCollapsed]: collapsed,
24
26
  [styles.upgradeItemSelected]: isSelected,
25
27
  })}
26
28
  onClick={item.onClick}
29
+ onKeyDown={(e) => {
30
+ if ((e.key === 'Enter' || e.key === ' ') && item.onClick) {
31
+ e.preventDefault()
32
+ item.onClick()
33
+ }
34
+ }}
27
35
  >
28
36
  {item.icon && <div className={styles.upgradeIcon}>{item.icon}</div>}
29
37
  <div
@@ -14,6 +14,11 @@
14
14
  transition-delay: 100ms;
15
15
  }
16
16
 
17
+ .upgradeItem:focus-visible {
18
+ outline: 2px solid var(--neutral-alpha-8);
19
+ outline-offset: -3px;
20
+ }
21
+
17
22
  .upgradeItem:hover {
18
23
  background-color: var(--neutral-alpha-2);
19
24
  }
@@ -95,6 +95,70 @@
95
95
  justify-content: center;
96
96
  align-items: center;
97
97
  gap: 8px;
98
+
99
+ animation-duration: 400ms;
100
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
101
+ will-change: transform, opacity;
102
+ }
103
+
104
+ .content[data-side='top'] {
105
+ animation-name: slideDownAndFade;
106
+ }
107
+
108
+ .content[data-side='right'] {
109
+ animation-name: slideLeftAndFade;
110
+ }
111
+
112
+ .content[data-side='bottom'] {
113
+ animation-name: slideUpAndFade;
114
+ }
115
+
116
+ .content[data-side='left'] {
117
+ animation-name: slideRightAndFade;
118
+ }
119
+
120
+ @keyframes slideUpAndFade {
121
+ from {
122
+ opacity: 0;
123
+ transform: translateY(2px);
124
+ }
125
+ to {
126
+ opacity: 1;
127
+ transform: translateY(0);
128
+ }
129
+ }
130
+
131
+ @keyframes slideRightAndFade {
132
+ from {
133
+ opacity: 0;
134
+ transform: translateX(-2px);
135
+ }
136
+ to {
137
+ opacity: 1;
138
+ transform: translateX(0);
139
+ }
140
+ }
141
+
142
+ @keyframes slideDownAndFade {
143
+ from {
144
+ opacity: 0;
145
+ transform: translateY(-2px);
146
+ }
147
+ to {
148
+ opacity: 1;
149
+ transform: translateY(0);
150
+ }
151
+ }
152
+
153
+ @keyframes slideLeftAndFade {
154
+ from {
155
+ opacity: 0;
156
+ transform: translateX(2px);
157
+ }
158
+ to {
159
+ opacity: 1;
160
+ transform: translateX(0);
161
+ }
98
162
  }
99
163
 
100
164
  .chevron {
@@ -290,6 +290,7 @@ export const ShowActiveTrigger = {
290
290
  key: 'item3',
291
291
  label: 'Delete',
292
292
  onClick: () => console.log('Delete clicked'),
293
+ color: 'red',
293
294
  },
294
295
  ],
295
296
  },
@@ -37,7 +37,7 @@
37
37
  }
38
38
 
39
39
  .icon {
40
- width: 4px;
41
- height: 14px;
40
+ width: 3px;
41
+ height: 11px;
42
42
  flex-shrink: 0;
43
43
  }
@@ -18,11 +18,19 @@ export const ProductsList = ({
18
18
  align="center"
19
19
  px="3"
20
20
  py="2"
21
+ role="button"
22
+ tabIndex={0}
21
23
  className={classNames(styles.navItem, {
22
24
  [styles.navItemSelected]: isSelected,
23
25
  [styles.collapsed]: collapsed,
24
26
  })}
25
27
  onClick={() => onProductClick?.(product.id, product)}
28
+ onKeyDown={(e) => {
29
+ if (e.key === 'Enter' || e.key === ' ') {
30
+ e.preventDefault()
31
+ onProductClick?.(product.id, product)
32
+ }
33
+ }}
26
34
  >
27
35
  {product.icon && (
28
36
  <div className={styles.navItemIcon}>{product.icon}</div>
@@ -63,6 +63,11 @@
63
63
  color: var(--neutral-alpha-12);
64
64
  }
65
65
 
66
+ .navItem:focus-visible {
67
+ outline: 2px solid var(--neutral-alpha-8);
68
+ outline-offset: -3px;
69
+ }
70
+
66
71
  .navItemSelected {
67
72
  background-color: var(--neutral-alpha-3);
68
73
  }
@@ -16,6 +16,8 @@ export function MenuTrigger({ className, user, collapsed, ...props }) {
16
16
  }
17
17
  return (
18
18
  <Flex
19
+ role="button"
20
+ tabIndex={0}
19
21
  onMouseEnter={handleMouseEnter}
20
22
  onMouseLeave={handleMouseLeave}
21
23
  className={classNames(styles.userProfile, { [styles.collapsed]: collapsed }, className)}
@@ -3,6 +3,11 @@
3
3
  width: 100%;
4
4
  }
5
5
 
6
+ .userProfile:focus-visible {
7
+ outline: 2px solid var(--neutral-alpha-8);
8
+ outline-offset: -3px;
9
+ }
10
+
6
11
  .userProfileInner {
7
12
  display: flex;
8
13
  align-items: center;
@@ -69,7 +69,11 @@ export const Select = ({
69
69
  </Text>
70
70
  ) : undefined}
71
71
  </SelectRadix.Trigger>
72
- <SelectRadix.Content position="popper" style={{ height: maxHeight }}>
72
+ <SelectRadix.Content
73
+ position="popper"
74
+ className={styles.selectContent}
75
+ style={{ height: maxHeight }}
76
+ >
73
77
  <SelectRadix.Group>
74
78
  {items.map((item) =>
75
79
  item.type === 'separator' ? (
@@ -1,3 +1,70 @@
1
+ /* Select content popover animation */
2
+ .selectContent {
3
+ animation-duration: 400ms;
4
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
5
+ will-change: transform, opacity;
6
+ }
7
+
8
+ .selectContent[data-side='top'] {
9
+ animation-name: slideDownAndFade;
10
+ }
11
+
12
+ .selectContent[data-side='right'] {
13
+ animation-name: slideLeftAndFade;
14
+ }
15
+
16
+ .selectContent[data-side='bottom'] {
17
+ animation-name: slideUpAndFade;
18
+ }
19
+
20
+ .selectContent[data-side='left'] {
21
+ animation-name: slideRightAndFade;
22
+ }
23
+
24
+ @keyframes slideUpAndFade {
25
+ from {
26
+ opacity: 0;
27
+ transform: translateY(2px);
28
+ }
29
+ to {
30
+ opacity: 1;
31
+ transform: translateY(0);
32
+ }
33
+ }
34
+
35
+ @keyframes slideRightAndFade {
36
+ from {
37
+ opacity: 0;
38
+ transform: translateX(-2px);
39
+ }
40
+ to {
41
+ opacity: 1;
42
+ transform: translateX(0);
43
+ }
44
+ }
45
+
46
+ @keyframes slideDownAndFade {
47
+ from {
48
+ opacity: 0;
49
+ transform: translateY(-2px);
50
+ }
51
+ to {
52
+ opacity: 1;
53
+ transform: translateY(0);
54
+ }
55
+ }
56
+
57
+ @keyframes slideLeftAndFade {
58
+ from {
59
+ opacity: 0;
60
+ transform: translateX(2px);
61
+ }
62
+ to {
63
+ opacity: 1;
64
+ transform: translateX(0);
65
+ }
66
+ }
67
+
1
68
  .selectTrigger.soft:focus-visible,
2
69
  .selectTrigger.ghost:focus-visible {
3
70
  outline: none;
@@ -10,12 +10,14 @@ import {
10
10
  } from '../../icons'
11
11
  import { DropdownMenu } from '../DropdownMenu/DropdownMenu'
12
12
  import { useState, useEffect, useRef, useMemo } from 'react'
13
+ import { MoreButton } from '../MoreButton/MoreButton'
13
14
 
14
15
  export const SetlistItem = ({
15
16
  isSelected,
16
17
  onClick,
17
18
  className,
18
19
  style,
20
+ avatarStyle,
19
21
  avatar,
20
22
  text,
21
23
  subtitle,
@@ -49,6 +51,8 @@ export const SetlistItem = ({
49
51
  <Flex
50
52
  gap="3"
51
53
  align="center"
54
+ role="button"
55
+ tabIndex={0}
52
56
  onClick={onClick}
53
57
  className={classNames(styles.newSetlistItem, className, {
54
58
  [styles.navItemSelected]: isSelected,
@@ -57,6 +61,12 @@ export const SetlistItem = ({
57
61
  })}
58
62
  onMouseEnter={handleMouseEnter}
59
63
  onMouseLeave={handleMouseLeave}
64
+ onKeyDown={(e) => {
65
+ if (e.key === 'Enter' || e.key === ' ') {
66
+ e.preventDefault()
67
+ onClick?.()
68
+ }
69
+ }}
60
70
  style={style}
61
71
  >
62
72
  <Flex
@@ -67,13 +77,14 @@ export const SetlistItem = ({
67
77
  })}
68
78
  >
69
79
  {avatar && (
70
- <div className={styles.avatarSetlist}>
80
+ <div className={styles.avatarSetlist} style={avatarStyle}>
71
81
  {typeof avatar === 'string' ? (
72
82
  <Avatar
73
83
  src={avatar}
74
84
  fallback={<SetlistIcon width={16} height={16} />}
75
- size="3"
85
+ // size="3"
76
86
  radius="small"
87
+ style={avatarStyle}
77
88
  />
78
89
  ) : (
79
90
  avatar
@@ -120,11 +131,7 @@ export const SetlistItem = ({
120
131
  onPointerDown={handleDropdownTriggerPointerDown}
121
132
  onClick={handleDropdownTriggerClick}
122
133
  >
123
- <DotsVerticalIcon
124
- className={styles.dropdownMenuTrigger}
125
- width={16}
126
- height={16}
127
- />
134
+ <MoreButton hovered={dropdownMenuOpen} />
128
135
  </Flex>
129
136
  }
130
137
  options={dropdownMenuOptions}
@@ -146,7 +153,7 @@ export const SetlistList = ({
146
153
  const [isHoveredWhenCollapsed, setIsHoveredWhenCollapsed] = useState(false)
147
154
  const hoverTimeoutRef = useRef(null)
148
155
  const collapsedItemHeight = 44
149
- const collapsedVisibleOffset = 4
156
+ const collapsedVisibleOffset = 8
150
157
  const maxCollapsedItems = 4
151
158
  const collapsedNewItemOffset = collapsed && onNewSetlistClick ? 1 : 0
152
159
  const showCollapsedStack = collapsed && !isHoveredWhenCollapsed
@@ -203,7 +210,9 @@ export const SetlistList = ({
203
210
  </div>
204
211
  )
205
212
 
206
- const getCollapsedStackStyle = (index) => {
213
+ const collapsedStackAvatarSizes = ['38px', '37px', '36px', '35px']
214
+
215
+ const getCollapsedStackStyle = (index, setlist) => {
207
216
  if (!collapsed) return undefined
208
217
  if (!showCollapsedStack) {
209
218
  return {
@@ -214,6 +223,14 @@ export const SetlistList = ({
214
223
  }
215
224
  const stackPosition = index + collapsedNewItemOffset
216
225
  const zIndex = setlists.length + collapsedNewItemOffset - stackPosition
226
+
227
+ const boxShadows = [
228
+ '0 3.84px 15.36px -7.68px var(--Overlays-Black-Alpha-2, rgba(0, 0, 0, 0.10)), 0 2.88px 11.52px -3.84px var(--Overlays-Black-Alpha-2, rgba(0, 0, 0, 0.10)), 0 1.92px 2.88px -1.92px var(--Overlays-Black-Alpha-3, rgba(0, 0, 0, 0.15))',
229
+ '0 3.686px 14.746px -7.373px var(--Overlays-Black-Alpha-2, rgba(0, 0, 0, 0.10)), 0 2.765px 11.059px -3.686px var(--Overlays-Black-Alpha-2, rgba(0, 0, 0, 0.10)), 0 1.843px 2.765px -1.843px var(--Overlays-Black-Alpha-3, rgba(0, 0, 0, 0.15))',
230
+ '0 3.539px 14.156px -7.078px var(--Overlays-Black-Alpha-2, rgba(0, 0, 0, 0.10)), 0 2.654px 10.617px -3.539px var(--Overlays-Black-Alpha-2, rgba(0, 0, 0, 0.10)), 0 1.769px 2.654px -1.769px var(--Overlays-Black-Alpha-3, rgba(0, 0, 0, 0.15))',
231
+ '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))',
232
+ ]
233
+
217
234
  return {
218
235
  position: 'relative',
219
236
  marginTop:
@@ -221,6 +238,7 @@ export const SetlistList = ({
221
238
  ? 0
222
239
  : -(collapsedItemHeight - collapsedVisibleOffset),
223
240
  zIndex,
241
+ boxShadow: boxShadows[index],
224
242
  }
225
243
  }
226
244
 
@@ -286,6 +304,14 @@ export const SetlistList = ({
286
304
  setOpenSetlistMenuId(nextOpen ? setlist.id : null)
287
305
  }}
288
306
  avatar={setlist.icon || <SetlistIcon width={16} height={16} />}
307
+ avatarStyle={
308
+ showCollapsedStack
309
+ ? {
310
+ width: collapsedStackAvatarSizes[index],
311
+ height: collapsedStackAvatarSizes[index],
312
+ }
313
+ : undefined
314
+ }
289
315
  group={setlist.group}
290
316
  moises={setlist.moises}
291
317
  text={setlist.label}
@@ -297,7 +323,7 @@ export const SetlistList = ({
297
323
  [styles.collapsedStackItem]: showCollapsedStack,
298
324
  [styles.collapsedTransition]: collapsed,
299
325
  })}
300
- style={getCollapsedStackStyle(index)}
326
+ style={getCollapsedStackStyle(index, setlist)}
301
327
  />
302
328
  )
303
329
  })}
@@ -9,6 +9,11 @@
9
9
  align-items: center;
10
10
  width: calc(100% - 24px);
11
11
 
12
+ &:focus-visible {
13
+ outline: 2px solid var(--neutral-alpha-8);
14
+ outline-offset: -1px;
15
+ }
16
+
12
17
  &:hover,
13
18
  &.menuOpen {
14
19
  background: var(--neutral-alpha-2);
@@ -28,6 +33,8 @@
28
33
  .collapsed {
29
34
  width: fit-content;
30
35
  padding: 2px;
36
+ margin: 0 10px;
37
+
31
38
  }
32
39
 
33
40
  .dropdownTriggerWrapper {
@@ -41,9 +48,9 @@
41
48
  margin-left: auto;
42
49
  }
43
50
 
44
- .dropdownTriggerWrapperMobile {
51
+ /* .dropdownTriggerWrapperMobile {
45
52
  padding: 8px;
46
- }
53
+ } */
47
54
 
48
55
  .collapsed .dropdownTriggerWrapper {
49
56
  opacity: 0;
@@ -53,7 +60,7 @@
53
60
  color: var(--neutral-alpha-7);
54
61
  }
55
62
 
56
- .dropdownTriggerWrapper:hover .dropdownMenuTrigger,
63
+ /* .dropdownTriggerWrapper:hover .dropdownMenuTrigger,
57
64
  .menuOpen .dropdownTriggerWrapper .dropdownMenuTrigger {
58
65
  color: var(--neutral-alpha-11);
59
66
  background-color: rgba(255, 255, 255, 0.07);
@@ -61,7 +68,7 @@
61
68
  width: 16px;
62
69
  height: 24px;
63
70
  }
64
-
71
+ */
65
72
  .avatarSetlist {
66
73
  display: flex;
67
74
  width: 40px;
@@ -115,6 +122,23 @@
115
122
  border-radius: var(--Radius-3-max, 6px);
116
123
  background: var(--neutral-alpha-3);
117
124
 
125
+ &.collapsed {
126
+ background: transparent;
127
+
128
+ .avatarSetlist {
129
+ background: var(--neutral-2);
130
+ }
131
+
132
+ &:hover,
133
+ &.menuOpen {
134
+ background: transparent !important;
135
+
136
+ .avatarSetlist {
137
+ background: var(--neutral-2) !important;
138
+ }
139
+ }
140
+ }
141
+
118
142
  &:hover,
119
143
  &.menuOpen {
120
144
  border-radius: var(--Radius-3-max, 6px);
@@ -166,12 +190,15 @@
166
190
 
167
191
  .setlistsContent {
168
192
  /* gap: 4px; */
193
+ margin: 1px 0;
169
194
  }
170
195
  .collapsedStack {
171
196
  gap: 0;
197
+ align-items: center;
172
198
  }
173
199
  .collapsedStackItem {
174
200
  position: relative;
201
+ justify-content: flex-start;
175
202
  }
176
203
 
177
204
  .collapsedMask {
@@ -180,6 +207,10 @@
180
207
  padding-top: 2px;
181
208
  }
182
209
 
210
+ .collapsedStack.collapsedMask {
211
+ padding-top: 12px;
212
+ }
213
+
183
214
  .collapsedTransition {
184
215
  transition: margin-top 360ms ease-in-out;
185
216
  }
@@ -246,7 +246,7 @@
246
246
  }
247
247
 
248
248
  .headerCollapsed {
249
- padding-left: 17px;
249
+ padding-left: 16px;
250
250
  }
251
251
 
252
252
  .separator {
@@ -16,5 +16,5 @@
16
16
 
17
17
  .separator {
18
18
  background: var(--neutral-alpha-4) !important;
19
- margin: 0 4px 23px 4px;
19
+ margin: 0 3px 23px 3px;
20
20
  }
@@ -1,4 +1,5 @@
1
- .menuContent, .menuSubContent {
1
+ .menuContent,
2
+ .menuSubContent {
2
3
  border-radius: 8px;
3
4
  width: fit-content;
4
5
  min-width: 151px;
@@ -7,6 +8,73 @@
7
8
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.30), 0 12px 60px 0 rgba(0, 0, 0, 0.15);
8
9
  z-index: 9999;
9
10
  border: 1px solid var(--neutral-alpha-3);
11
+ animation-duration: 400ms;
12
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
13
+ will-change: transform, opacity;
14
+ }
15
+
16
+ .menuContent[data-side='top'],
17
+ .menuSubContent[data-side='top'] {
18
+ animation-name: slideDownAndFade;
19
+ }
20
+
21
+ .menuContent[data-side='right'],
22
+ .menuSubContent[data-side='right'] {
23
+ animation-name: slideLeftAndFade;
24
+ }
25
+
26
+ .menuContent[data-side='bottom'],
27
+ .menuSubContent[data-side='bottom'] {
28
+ animation-name: slideUpAndFade;
29
+ }
30
+
31
+ .menuContent[data-side='left'],
32
+ .menuSubContent[data-side='left'] {
33
+ animation-name: slideRightAndFade;
34
+ }
35
+
36
+ @keyframes slideUpAndFade {
37
+ from {
38
+ opacity: 0;
39
+ transform: translateY(2px);
40
+ }
41
+ to {
42
+ opacity: 1;
43
+ transform: translateY(0);
44
+ }
45
+ }
46
+
47
+ @keyframes slideRightAndFade {
48
+ from {
49
+ opacity: 0;
50
+ transform: translateX(-2px);
51
+ }
52
+ to {
53
+ opacity: 1;
54
+ transform: translateX(0);
55
+ }
56
+ }
57
+
58
+ @keyframes slideDownAndFade {
59
+ from {
60
+ opacity: 0;
61
+ transform: translateY(-2px);
62
+ }
63
+ to {
64
+ opacity: 1;
65
+ transform: translateY(0);
66
+ }
67
+ }
68
+
69
+ @keyframes slideLeftAndFade {
70
+ from {
71
+ opacity: 0;
72
+ transform: translateX(2px);
73
+ }
74
+ to {
75
+ opacity: 1;
76
+ transform: translateX(0);
77
+ }
10
78
  }
11
79
 
12
80
  [data-radix-popper-content-wrapper] {
@@ -218,9 +286,6 @@
218
286
 
219
287
  .menuSubContent {
220
288
  min-width: 242px;
221
- animation-duration: 400ms;
222
- animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
223
- will-change: transform, opacity;
224
289
  }
225
290
 
226
291
  .menuLabel {
@@ -249,7 +314,7 @@
249
314
  .menuItemSelected {
250
315
  background-color: var(--neutral-alpha-3);
251
316
  border-radius: 6px;
252
- cursor: default;
317
+ cursor: pointer;
253
318
  font-weight: 400;
254
319
 
255
320
  &[data-disabled] {
@@ -312,19 +377,19 @@
312
377
  }
313
378
 
314
379
  .red {
315
- color: color(display-p3 1 .57 .55);
380
+ color: rgba(255, 149, 146, 1);
316
381
 
317
382
  & .label,
318
383
  & .leftIcon,
319
384
  & .rightIcon,
320
385
  & .checkboxIndicatorSlot {
321
- color: color(display-p3 1 .57 .55);
386
+ color: rgba(255, 149, 146, 1);
322
387
  }
323
388
 
324
389
  & .leftIcon > svg,
325
390
  & .rightIcon > svg,
326
391
  & .menuCheckboxIndicator > svg {
327
- color: color(display-p3 1 .57 .55);
392
+ color: rgba(255, 149, 146, 1);
328
393
  }
329
394
  }
330
395