@moises.ai/design-system 4.16.11 → 4.17.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/package.json
CHANGED
|
@@ -9,6 +9,9 @@ export const Tooltip = ({
|
|
|
9
9
|
content,
|
|
10
10
|
shortcut,
|
|
11
11
|
color = 'gray',
|
|
12
|
+
variant = 'default',
|
|
13
|
+
title,
|
|
14
|
+
headerActions,
|
|
12
15
|
delayDuration = 200,
|
|
13
16
|
skipDelayDuration,
|
|
14
17
|
disableHoverableContent,
|
|
@@ -22,6 +25,8 @@ export const Tooltip = ({
|
|
|
22
25
|
...restContentProps
|
|
23
26
|
} = props
|
|
24
27
|
|
|
28
|
+
const isDiagram = variant === 'diagram'
|
|
29
|
+
|
|
25
30
|
const providerProps = {
|
|
26
31
|
delayDuration,
|
|
27
32
|
skipDelayDuration,
|
|
@@ -45,19 +50,40 @@ export const Tooltip = ({
|
|
|
45
50
|
<TooltipPrimitive.Content
|
|
46
51
|
className={classNames(
|
|
47
52
|
styles.TooltipContent,
|
|
48
|
-
styles[`TooltipContent--${color}`]
|
|
53
|
+
!isDiagram && styles[`TooltipContent--${color}`],
|
|
54
|
+
isDiagram && styles.TooltipDiagram
|
|
49
55
|
)}
|
|
50
56
|
sideOffset={5}
|
|
51
57
|
{...restContentProps}
|
|
52
58
|
>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
{isDiagram ? (
|
|
60
|
+
<>
|
|
61
|
+
<div className={styles.TooltipDiagramHeader}>
|
|
62
|
+
{title && (
|
|
63
|
+
<Text size='2' className={styles.TooltipDiagramTitle}>
|
|
64
|
+
{title}
|
|
65
|
+
</Text>
|
|
66
|
+
)}
|
|
67
|
+
{headerActions && (
|
|
68
|
+
<div className={styles.TooltipDiagramActions}>
|
|
69
|
+
{headerActions}
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
</div>
|
|
73
|
+
<div className={styles.TooltipDiagramBody}>{content}</div>
|
|
74
|
+
</>
|
|
75
|
+
) : (
|
|
76
|
+
<>
|
|
77
|
+
<Text size='1' className={styles.TooltipText}>{content}</Text>
|
|
78
|
+
{shortcut && (
|
|
79
|
+
<Text size='0' className={classNames(
|
|
80
|
+
styles.TooltipShortcut,
|
|
81
|
+
styles[`TooltipShortcut--${color}`]
|
|
82
|
+
)}>
|
|
83
|
+
{shortcut}
|
|
84
|
+
</Text>
|
|
85
|
+
)}
|
|
86
|
+
</>
|
|
61
87
|
)}
|
|
62
88
|
<TooltipPrimitive.Arrow className={styles.TooltipArrow} />
|
|
63
89
|
</TooltipPrimitive.Content>
|
|
@@ -85,6 +85,54 @@
|
|
|
85
85
|
color: rgba(252, 253, 255, 0.94);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
/* Diagram variant (matches the "tooltip diagram" surface from Figma) */
|
|
89
|
+
.TooltipDiagram {
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
align-items: stretch;
|
|
92
|
+
gap: var(--spacing-1, 4px);
|
|
93
|
+
max-width: none;
|
|
94
|
+
padding: var(--spacing-1, 4px) var(--spacing-2, 8px) var(--spacing-2, 8px);
|
|
95
|
+
border-radius: var(--radius-4, 8px);
|
|
96
|
+
background: var(--panel-solid, #18191b);
|
|
97
|
+
color: var(--neutral-alpha-12, rgba(252, 253, 255, 0.94));
|
|
98
|
+
box-shadow:
|
|
99
|
+
0 12px 32px -16px rgba(0, 0, 0, 0.3),
|
|
100
|
+
0 12px 60px 0 rgba(0, 0, 0, 0.15);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.TooltipDiagram .TooltipArrow {
|
|
104
|
+
fill: var(--panel-solid, #18191b);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.TooltipDiagramHeader {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: space-between;
|
|
111
|
+
gap: var(--spacing-2, 8px);
|
|
112
|
+
width: 100%;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.TooltipDiagramTitle {
|
|
116
|
+
color: var(--neutral-alpha-9, rgba(223, 235, 253, 0.43));
|
|
117
|
+
font-weight: 400;
|
|
118
|
+
font-size: 14px;
|
|
119
|
+
line-height: 20px;
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.TooltipDiagramActions {
|
|
124
|
+
display: inline-flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.TooltipDiagramBody {
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
align-items: center;
|
|
132
|
+
gap: var(--spacing-1, 4px);
|
|
133
|
+
width: 100%;
|
|
134
|
+
}
|
|
135
|
+
|
|
88
136
|
.TooltipText {
|
|
89
137
|
white-space: normal;
|
|
90
138
|
overflow-wrap: anywhere;
|
|
@@ -13,6 +13,10 @@ export default {
|
|
|
13
13
|
control: 'select',
|
|
14
14
|
options: ['white', 'gray'],
|
|
15
15
|
},
|
|
16
|
+
variant: {
|
|
17
|
+
control: 'select',
|
|
18
|
+
options: ['default', 'diagram'],
|
|
19
|
+
},
|
|
16
20
|
},
|
|
17
21
|
}
|
|
18
22
|
|
|
@@ -58,4 +62,42 @@ export const WithShortcutWhite = {
|
|
|
58
62
|
color: 'white',
|
|
59
63
|
children: <Button>Hover me</Button>,
|
|
60
64
|
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const Diagram = {
|
|
68
|
+
args: {
|
|
69
|
+
variant: 'diagram',
|
|
70
|
+
title: 'Diagram',
|
|
71
|
+
side: 'top',
|
|
72
|
+
open: true,
|
|
73
|
+
headerActions: (
|
|
74
|
+
<button
|
|
75
|
+
type="button"
|
|
76
|
+
aria-label="More"
|
|
77
|
+
style={{
|
|
78
|
+
width: 12,
|
|
79
|
+
height: 24,
|
|
80
|
+
padding: 0,
|
|
81
|
+
border: 'none',
|
|
82
|
+
background: 'transparent',
|
|
83
|
+
color: 'rgba(223, 235, 253, 0.43)',
|
|
84
|
+
cursor: 'pointer',
|
|
85
|
+
lineHeight: 0,
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
⋮
|
|
89
|
+
</button>
|
|
90
|
+
),
|
|
91
|
+
content: (
|
|
92
|
+
<div
|
|
93
|
+
style={{
|
|
94
|
+
width: 100,
|
|
95
|
+
height: 155,
|
|
96
|
+
borderRadius: 8,
|
|
97
|
+
background: '#edeef0',
|
|
98
|
+
}}
|
|
99
|
+
/>
|
|
100
|
+
),
|
|
101
|
+
children: <Button>Hover me</Button>,
|
|
102
|
+
},
|
|
61
103
|
}
|
|
@@ -80,9 +80,7 @@ export const createRenderItem = (MenuPrimitives) => {
|
|
|
80
80
|
</div>
|
|
81
81
|
</MenuPrimitives.SubTrigger>
|
|
82
82
|
|
|
83
|
-
<MenuPrimitives.SubContent
|
|
84
|
-
className={classNames(styles.menuSubContent, opt.subContentClassName)}
|
|
85
|
-
>
|
|
83
|
+
<MenuPrimitives.SubContent className={styles.menuSubContent}>
|
|
86
84
|
{opt?.children?.map((child) =>
|
|
87
85
|
renderItem(
|
|
88
86
|
child,
|