@moises.ai/design-system 3.9.16 → 3.9.17
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/index.js +3648 -3627
- package/package.json +1 -1
- package/src/components/AdditionalItems/AdditionalItems.jsx +9 -1
- package/src/components/ProductsList/ProductsList.jsx +9 -1
- package/src/components/ProfileMenu/ProfileMenu.jsx +14 -2
- package/src/components/SetlistList/SetlistList.jsx +12 -3
- package/src/components/Shell/Shell.jsx +12 -1
- package/src/components/Sidebar/Sidebar.jsx +109 -96
- package/src/components/Sidebar/Sidebar.module.css +5 -0
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Flex, Text } from '@radix-ui/themes'
|
|
2
2
|
import styles from './AdditionalItems.module.css'
|
|
3
|
+
import { Tooltip } from '../Tooltip/Tooltip'
|
|
3
4
|
import classNames from 'classnames'
|
|
4
5
|
import { useMobileDrawerContext } from '../../contexts/MobileDrawerContext'
|
|
5
6
|
|
|
@@ -22,7 +23,7 @@ export const AdditionalItems = ({
|
|
|
22
23
|
item.onClick?.()
|
|
23
24
|
if (isMobile) close()
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
const navItem = (
|
|
26
27
|
<Flex
|
|
27
28
|
key={item.id || index}
|
|
28
29
|
align="center"
|
|
@@ -52,6 +53,13 @@ export const AdditionalItems = ({
|
|
|
52
53
|
</div>
|
|
53
54
|
</Flex>
|
|
54
55
|
)
|
|
56
|
+
return collapsed ? (
|
|
57
|
+
<Tooltip key={item.id || index} content={item.label} side="right">
|
|
58
|
+
{navItem}
|
|
59
|
+
</Tooltip>
|
|
60
|
+
) : (
|
|
61
|
+
navItem
|
|
62
|
+
)
|
|
55
63
|
})}
|
|
56
64
|
</Flex>
|
|
57
65
|
)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Flex, Text, Badge } from '@radix-ui/themes'
|
|
2
|
+
import { Tooltip } from '../Tooltip/Tooltip'
|
|
2
3
|
import styles from './ProductsList.module.css'
|
|
3
4
|
import classNames from 'classnames'
|
|
4
5
|
import { useMobileDrawerContext } from '../../contexts/MobileDrawerContext'
|
|
@@ -20,7 +21,7 @@ export const ProductsList = ({
|
|
|
20
21
|
<Flex direction="column">
|
|
21
22
|
{products.map((product) => {
|
|
22
23
|
const isSelected = selectedProductId === product.id
|
|
23
|
-
|
|
24
|
+
const navItem = (
|
|
24
25
|
<Flex
|
|
25
26
|
key={product.id}
|
|
26
27
|
align="center"
|
|
@@ -64,6 +65,13 @@ export const ProductsList = ({
|
|
|
64
65
|
</div>
|
|
65
66
|
</Flex>
|
|
66
67
|
)
|
|
68
|
+
return collapsed ? (
|
|
69
|
+
<Tooltip key={product.id} content={product.label} side="right">
|
|
70
|
+
{navItem}
|
|
71
|
+
</Tooltip>
|
|
72
|
+
) : (
|
|
73
|
+
navItem
|
|
74
|
+
)
|
|
67
75
|
})}
|
|
68
76
|
</Flex>
|
|
69
77
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import {
|
|
3
|
+
import { Tooltip } from '../Tooltip/Tooltip'
|
|
4
4
|
import { useIsMobileViewport } from '../../utils/useIsMobileViewport'
|
|
5
5
|
import { DropdownMenu } from '../DropdownMenu/DropdownMenu'
|
|
6
6
|
import { MenuTrigger } from './MenuTrigger'
|
|
@@ -12,6 +12,7 @@ export const ProfileMenu = ({
|
|
|
12
12
|
user,
|
|
13
13
|
menuOptions = [],
|
|
14
14
|
collapsed,
|
|
15
|
+
tooltip = 'Profile',
|
|
15
16
|
onSelectionChange,
|
|
16
17
|
...props
|
|
17
18
|
}) => {
|
|
@@ -23,10 +24,21 @@ export const ProfileMenu = ({
|
|
|
23
24
|
if (isMobile) close()
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
const trigger = <MenuTrigger user={user} collapsed={collapsed} />
|
|
26
28
|
return (
|
|
27
29
|
<DropdownMenu
|
|
28
30
|
className={classNames(styles.profileMenu, className)}
|
|
29
|
-
trigger={
|
|
31
|
+
trigger={
|
|
32
|
+
collapsed && tooltip ? (
|
|
33
|
+
<div>
|
|
34
|
+
<Tooltip content={tooltip} side="right">
|
|
35
|
+
{trigger}
|
|
36
|
+
</Tooltip>
|
|
37
|
+
</div>
|
|
38
|
+
) : (
|
|
39
|
+
trigger
|
|
40
|
+
)
|
|
41
|
+
}
|
|
30
42
|
options={menuOptions}
|
|
31
43
|
side={isMobileViewport ? 'top' : 'right'}
|
|
32
44
|
{...props}
|
|
@@ -13,8 +13,8 @@ import { useMobileDrawerContext } from '../../contexts/MobileDrawerContext'
|
|
|
13
13
|
|
|
14
14
|
const SetlistIconFallback = () => <SetlistIcon width={16} height={16} />
|
|
15
15
|
|
|
16
|
-
function SetlistExpandButton({ onExpand, className, style, collapsed = false }) {
|
|
17
|
-
|
|
16
|
+
function SetlistExpandButton({ onExpand, className, style, collapsed = false, tooltip }) {
|
|
17
|
+
const button = (
|
|
18
18
|
<button
|
|
19
19
|
type="button"
|
|
20
20
|
className={classNames(
|
|
@@ -39,9 +39,16 @@ function SetlistExpandButton({ onExpand, className, style, collapsed = false })
|
|
|
39
39
|
</Flex>
|
|
40
40
|
</button>
|
|
41
41
|
)
|
|
42
|
+
return collapsed && tooltip ? (
|
|
43
|
+
<Tooltip content={tooltip} side="right">
|
|
44
|
+
{button}
|
|
45
|
+
</Tooltip>
|
|
46
|
+
) : (
|
|
47
|
+
button
|
|
48
|
+
)
|
|
42
49
|
}
|
|
43
50
|
|
|
44
|
-
function NewSetlistButton({ onClick, className, collapsed = false, text = 'New Setlist' }) {
|
|
51
|
+
function NewSetlistButton({ onClick, className, collapsed = false, text = 'New Setlist', }) {
|
|
45
52
|
return (
|
|
46
53
|
<SetlistItem
|
|
47
54
|
isSelected={false}
|
|
@@ -239,6 +246,7 @@ export const SetlistList = ({
|
|
|
239
246
|
onSetlistClick,
|
|
240
247
|
onNewSetlistClick,
|
|
241
248
|
newSetlistButtonText = 'New Setlist',
|
|
249
|
+
newSetlistButtonTooltip = 'Expand setlists',
|
|
242
250
|
collapsed = false,
|
|
243
251
|
isMobile = false,
|
|
244
252
|
}) => {
|
|
@@ -394,6 +402,7 @@ export const SetlistList = ({
|
|
|
394
402
|
<SetlistExpandButton
|
|
395
403
|
onExpand={handleSetlistIconClick}
|
|
396
404
|
collapsed={collapsed}
|
|
405
|
+
tooltip={newSetlistButtonTooltip}
|
|
397
406
|
className={styles.collapsedStackItem}
|
|
398
407
|
style={{
|
|
399
408
|
position: 'relative',
|
|
@@ -20,6 +20,10 @@ export const Shell = ({
|
|
|
20
20
|
selectedSetlistId,
|
|
21
21
|
onSetlistClick,
|
|
22
22
|
onNewSetlistClick,
|
|
23
|
+
newSetlistButtonTooltip,
|
|
24
|
+
expandButtonTooltip,
|
|
25
|
+
profileMenuTooltip,
|
|
26
|
+
sidebarTooltip,
|
|
23
27
|
children,
|
|
24
28
|
}) => {
|
|
25
29
|
const [collapsed, setCollapsed] = useState(false)
|
|
@@ -29,7 +33,11 @@ export const Shell = ({
|
|
|
29
33
|
|
|
30
34
|
return (
|
|
31
35
|
<>
|
|
32
|
-
|
|
36
|
+
<Sidebar
|
|
37
|
+
isCollapsed={collapsed}
|
|
38
|
+
onCollapsedChange={setCollapsed}
|
|
39
|
+
tooltip={sidebarTooltip}
|
|
40
|
+
>
|
|
33
41
|
<Flex direction="column">
|
|
34
42
|
<SidebarSection title="PRODUCTS" collapsed={effectiveCollapsed} />
|
|
35
43
|
<ProductsList
|
|
@@ -49,6 +57,8 @@ export const Shell = ({
|
|
|
49
57
|
selectedSetlistId={selectedSetlistId}
|
|
50
58
|
onSetlistClick={onSetlistClick}
|
|
51
59
|
onNewSetlistClick={onNewSetlistClick}
|
|
60
|
+
newSetlistButtonTooltip={newSetlistButtonTooltip}
|
|
61
|
+
expandButtonTooltip={expandButtonTooltip}
|
|
52
62
|
collapsed={effectiveCollapsed}
|
|
53
63
|
isMobile={isMobile}
|
|
54
64
|
/>
|
|
@@ -67,6 +77,7 @@ export const Shell = ({
|
|
|
67
77
|
user={userProfileItems}
|
|
68
78
|
menuOptions={userProfileItems?.menuOptions}
|
|
69
79
|
collapsed={effectiveCollapsed}
|
|
80
|
+
tooltip={profileMenuTooltip}
|
|
70
81
|
/>
|
|
71
82
|
</Flex>
|
|
72
83
|
</Sidebar>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Flex } from '@radix-ui/themes'
|
|
2
2
|
import { IconButton } from '../IconButton/IconButton'
|
|
3
|
+
import { Tooltip } from '../Tooltip/Tooltip'
|
|
3
4
|
import styles from './Sidebar.module.css'
|
|
4
5
|
import { useState } from 'react'
|
|
5
6
|
import classNames from 'classnames'
|
|
@@ -19,6 +20,7 @@ export const Sidebar = ({
|
|
|
19
20
|
isCollapsed,
|
|
20
21
|
onCollapsedChange,
|
|
21
22
|
onLogoClick,
|
|
23
|
+
tooltip = 'Expand menu',
|
|
22
24
|
...props
|
|
23
25
|
}) => {
|
|
24
26
|
const { isMobile, isOpen: mobileOpen, open, close } = useMobileDrawer()
|
|
@@ -50,6 +52,38 @@ export const Sidebar = ({
|
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
const logoContent = (
|
|
56
|
+
<>
|
|
57
|
+
<div
|
|
58
|
+
className={classNames(styles.logoToggleContainer, {
|
|
59
|
+
[styles.logoToggleContainerCollapsed]: effectiveCollapsed,
|
|
60
|
+
})}
|
|
61
|
+
>
|
|
62
|
+
<MoisesLogoIcon
|
|
63
|
+
width={32}
|
|
64
|
+
height={17}
|
|
65
|
+
className={classNames(styles.logoInContainer, {
|
|
66
|
+
[styles.logoInContainerHidden]: effectiveCollapsed && isHovered,
|
|
67
|
+
})}
|
|
68
|
+
/>
|
|
69
|
+
<SidebarLeftIcon
|
|
70
|
+
width={16}
|
|
71
|
+
height={16}
|
|
72
|
+
className={classNames(styles.toggleInContainer, {
|
|
73
|
+
[styles.toggleInContainerVisible]:
|
|
74
|
+
effectiveCollapsed && isHovered,
|
|
75
|
+
})}
|
|
76
|
+
/>
|
|
77
|
+
</div>
|
|
78
|
+
<MoisesIcon
|
|
79
|
+
height={12.269}
|
|
80
|
+
className={classNames(styles.moisesIcon, {
|
|
81
|
+
[styles.moisesIconHidden]: effectiveCollapsed,
|
|
82
|
+
})}
|
|
83
|
+
/>
|
|
84
|
+
</>
|
|
85
|
+
)
|
|
86
|
+
|
|
53
87
|
return (
|
|
54
88
|
<MobileDrawerProvider value={{ close, isMobile }}>
|
|
55
89
|
<div
|
|
@@ -58,120 +92,99 @@ export const Sidebar = ({
|
|
|
58
92
|
})}
|
|
59
93
|
{...props}
|
|
60
94
|
>
|
|
61
|
-
|
|
62
|
-
<Flex
|
|
63
|
-
align="center"
|
|
64
|
-
justify="between"
|
|
65
|
-
className={classNames(styles.mobileTopBar, {
|
|
66
|
-
[styles.mobileTopBarOpen]: isMobile && mobileOpen,
|
|
67
|
-
})}
|
|
68
|
-
>
|
|
95
|
+
<div className={styles.mobileTopBarWrapper}>
|
|
69
96
|
<Flex
|
|
70
97
|
align="center"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
98
|
+
justify="between"
|
|
99
|
+
className={classNames(styles.mobileTopBar, {
|
|
100
|
+
[styles.mobileTopBarOpen]: isMobile && mobileOpen,
|
|
101
|
+
})}
|
|
75
102
|
>
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
103
|
+
<Flex
|
|
104
|
+
align="center"
|
|
105
|
+
gap="2"
|
|
106
|
+
height="38px"
|
|
107
|
+
onClick={onLogoClick}
|
|
108
|
+
style={{ cursor: onLogoClick ? 'pointer' : 'default' }}
|
|
109
|
+
>
|
|
110
|
+
<MoisesLogoIcon width={32} height={17} />
|
|
111
|
+
<MoisesIcon height={12.269} />
|
|
112
|
+
</Flex>
|
|
79
113
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
114
|
+
<IconButton
|
|
115
|
+
variant="ghost"
|
|
116
|
+
size="2"
|
|
117
|
+
onClick={mobileOpen ? close : open}
|
|
118
|
+
className={styles.mobileTopBarAction}
|
|
119
|
+
aria-label={mobileOpen ? 'Close menu' : 'Open menu'}
|
|
120
|
+
>
|
|
121
|
+
{mobileOpen ? (
|
|
122
|
+
<CloseIcon width={20} height={20} />
|
|
123
|
+
) : (
|
|
124
|
+
<HamburgerMenu3Icon width={20} height={20} />
|
|
125
|
+
)}
|
|
126
|
+
</IconButton>
|
|
127
|
+
</Flex>
|
|
128
|
+
</div>
|
|
95
129
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
})}
|
|
100
|
-
>
|
|
101
|
-
<Flex
|
|
102
|
-
direction="column"
|
|
103
|
-
className={classNames(styles.mobileDrawerContent, {
|
|
104
|
-
[styles.mobileDrawerContentOpen]: isMobile && mobileOpen,
|
|
130
|
+
<div
|
|
131
|
+
className={classNames(styles.mobileDrawer, {
|
|
132
|
+
[styles.mobileDrawerOpen]: isMobile && mobileOpen,
|
|
105
133
|
})}
|
|
106
134
|
>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
135
|
+
<Flex
|
|
136
|
+
direction="column"
|
|
137
|
+
className={classNames(styles.mobileDrawerContent, {
|
|
138
|
+
[styles.mobileDrawerContentOpen]: isMobile && mobileOpen,
|
|
139
|
+
})}
|
|
140
|
+
>
|
|
141
|
+
{children}
|
|
142
|
+
</Flex>
|
|
143
|
+
</div>
|
|
110
144
|
|
|
111
|
-
<Flex
|
|
112
|
-
direction="column"
|
|
113
|
-
className={styles.desktopSidebar}
|
|
114
|
-
onMouseEnter={handleMouseEnter}
|
|
115
|
-
onMouseLeave={handleMouseLeave}
|
|
116
|
-
>
|
|
117
145
|
<Flex
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
})}
|
|
146
|
+
direction="column"
|
|
147
|
+
className={styles.desktopSidebar}
|
|
148
|
+
onMouseEnter={handleMouseEnter}
|
|
149
|
+
onMouseLeave={handleMouseLeave}
|
|
123
150
|
>
|
|
124
151
|
<Flex
|
|
125
152
|
align="center"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
153
|
+
justify="between"
|
|
154
|
+
className={classNames(styles.header, {
|
|
155
|
+
[styles.headerCollapsed]: effectiveCollapsed,
|
|
156
|
+
})}
|
|
129
157
|
>
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
158
|
+
<Flex
|
|
159
|
+
align="center"
|
|
160
|
+
gap="2"
|
|
161
|
+
onClick={handleLogoClick}
|
|
162
|
+
style={{ cursor: 'pointer' }}
|
|
134
163
|
>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
})}
|
|
150
|
-
/>
|
|
151
|
-
</div>
|
|
152
|
-
<MoisesIcon
|
|
153
|
-
height={12.269}
|
|
154
|
-
className={classNames(styles.moisesIcon, {
|
|
155
|
-
[styles.moisesIconHidden]: effectiveCollapsed,
|
|
164
|
+
{effectiveCollapsed ? (
|
|
165
|
+
<Tooltip content={tooltip} side="right">
|
|
166
|
+
<div className={styles.tooltipTriggerWrapper}>{logoContent}</div>
|
|
167
|
+
</Tooltip>
|
|
168
|
+
) : (
|
|
169
|
+
logoContent
|
|
170
|
+
)}
|
|
171
|
+
</Flex>
|
|
172
|
+
<Flex
|
|
173
|
+
align="center"
|
|
174
|
+
justify="center"
|
|
175
|
+
onClick={handleToggleCollapse}
|
|
176
|
+
className={classNames(styles.toggleButton, {
|
|
177
|
+
[styles.toggleButtonHidden]: effectiveCollapsed,
|
|
156
178
|
})}
|
|
157
|
-
|
|
179
|
+
>
|
|
180
|
+
<SidebarLeftIcon width={16} height={16} />
|
|
181
|
+
</Flex>
|
|
158
182
|
</Flex>
|
|
159
|
-
<Flex
|
|
160
|
-
|
|
161
|
-
justify="center"
|
|
162
|
-
onClick={handleToggleCollapse}
|
|
163
|
-
className={classNames(styles.toggleButton, {
|
|
164
|
-
[styles.toggleButtonHidden]: effectiveCollapsed,
|
|
165
|
-
})}
|
|
166
|
-
>
|
|
167
|
-
<SidebarLeftIcon width={16} height={16} />
|
|
183
|
+
<Flex direction="column" className={styles.content}>
|
|
184
|
+
{children}
|
|
168
185
|
</Flex>
|
|
169
186
|
</Flex>
|
|
170
|
-
|
|
171
|
-
{children}
|
|
172
|
-
</Flex>
|
|
173
|
-
</Flex>
|
|
174
|
-
</div>
|
|
187
|
+
</div>
|
|
175
188
|
</MobileDrawerProvider>
|
|
176
189
|
)
|
|
177
190
|
}
|