odaptos_design_system 1.4.269 → 1.4.270
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/Interviews/Scenario.d.ts +3 -2
- package/dist/Interviews/Task.d.ts +1 -1
- package/dist/odaptos_design_system.cjs.development.js +57 -82
- package/dist/odaptos_design_system.cjs.development.js.map +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js.map +1 -1
- package/dist/odaptos_design_system.esm.js +57 -82
- package/dist/odaptos_design_system.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Interviews/Chat.tsx +5 -3
- package/src/Interviews/Scenario.modules.scss +9 -5
- package/src/Interviews/Scenario.tsx +10 -3
- package/src/Interviews/Task.modules.scss +34 -1
- package/src/Interviews/Task.tsx +64 -107
package/package.json
CHANGED
package/src/Interviews/Chat.tsx
CHANGED
|
@@ -185,9 +185,10 @@ export const Chat = ({
|
|
|
185
185
|
url={realTask.url}
|
|
186
186
|
notes={realTask.notes}
|
|
187
187
|
state={
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
idsTasksAlreadySent.includes(realTask._id) &&
|
|
189
|
+
realCurrentTask._id !== realTask._id
|
|
190
|
+
? 'done'
|
|
191
|
+
: disabledTask
|
|
191
192
|
? 'disabled'
|
|
192
193
|
: realCurrentTask &&
|
|
193
194
|
realCurrentTask._id === realTask._id
|
|
@@ -218,6 +219,7 @@ export const Chat = ({
|
|
|
218
219
|
return (
|
|
219
220
|
<Scenario
|
|
220
221
|
title={`Scenario #${scenario.index}`}
|
|
222
|
+
scenarioName={scenario.name}
|
|
221
223
|
description={scenario.description}
|
|
222
224
|
buttonText={
|
|
223
225
|
scenario.url ? startInterviewBtnTitle : undefined
|
|
@@ -7,11 +7,15 @@
|
|
|
7
7
|
border-radius: 0.5rem;
|
|
8
8
|
border: 1px solid #66adff;
|
|
9
9
|
background: #e5f1ff;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
.name {
|
|
11
|
+
margin-top: 0.37rem;
|
|
12
|
+
}
|
|
13
|
+
.description {
|
|
14
|
+
margin-top: 0.37rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
button {
|
|
12
18
|
width: 100%;
|
|
13
|
-
|
|
14
|
-
width: 100%;
|
|
15
|
-
}
|
|
19
|
+
margin-top: 0.5rem;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
@@ -4,7 +4,8 @@ import { Button, Text, SendIcon } from '..';
|
|
|
4
4
|
|
|
5
5
|
export interface ScenarioProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
title: string;
|
|
7
|
-
|
|
7
|
+
scenarioName?: string;
|
|
8
|
+
description?: string;
|
|
8
9
|
buttonText?: string;
|
|
9
10
|
buttonIcon?: JSX.Element;
|
|
10
11
|
url: string;
|
|
@@ -14,6 +15,7 @@ export interface ScenarioProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
14
15
|
|
|
15
16
|
export const Scenario = ({
|
|
16
17
|
title,
|
|
18
|
+
scenarioName,
|
|
17
19
|
description,
|
|
18
20
|
buttonText,
|
|
19
21
|
buttonIcon,
|
|
@@ -24,8 +26,13 @@ export const Scenario = ({
|
|
|
24
26
|
}: ScenarioProps) => {
|
|
25
27
|
return (
|
|
26
28
|
<div className={styles.start_interview_container} {...props}>
|
|
27
|
-
<Text text={title}
|
|
28
|
-
|
|
29
|
+
<Text text={title} size="xs" />
|
|
30
|
+
{scenarioName && (
|
|
31
|
+
<Text text={scenarioName} weight="bold" className={styles.name} />
|
|
32
|
+
)}
|
|
33
|
+
{description && (
|
|
34
|
+
<Text text={description} size="sm" className={styles.description} />
|
|
35
|
+
)}
|
|
29
36
|
{buttonIcon && buttonText && (
|
|
30
37
|
<Button
|
|
31
38
|
text={buttonText}
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
.header_right {
|
|
75
75
|
display: flex;
|
|
76
|
-
padding: 1.
|
|
76
|
+
padding: 1.1rem 0.75rem;
|
|
77
77
|
justify-content: center;
|
|
78
78
|
align-items: center;
|
|
79
79
|
gap: 0.5rem;
|
|
@@ -122,6 +122,38 @@
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
+
.done_task {
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
padding: 0px;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
align-items: flex-start;
|
|
131
|
+
gap: 0.5rem;
|
|
132
|
+
border-radius: 0.5rem;
|
|
133
|
+
border: 1px solid var(--Color-Neutral-Dark-Shades-950, #26292e);
|
|
134
|
+
background: var(--Color-Extended-Green-100, #e8f5ea);
|
|
135
|
+
cursor: not-allowed;
|
|
136
|
+
max-width: 100%;
|
|
137
|
+
.header {
|
|
138
|
+
width: 100%;
|
|
139
|
+
max-width: 100%;
|
|
140
|
+
.header_left {
|
|
141
|
+
border: 1px solid var(--Color-Neutral-Dark-Shades-950, #26292e);
|
|
142
|
+
cursor: not-allowed;
|
|
143
|
+
width: 100%;
|
|
144
|
+
}
|
|
145
|
+
.header_right {
|
|
146
|
+
border-color: #26292e;
|
|
147
|
+
background: var(--Color-Extended-Green-200, #d5edd8);
|
|
148
|
+
cursor: not-allowed;
|
|
149
|
+
svg {
|
|
150
|
+
height: 1rem;
|
|
151
|
+
width: 1rem;
|
|
152
|
+
fill: black;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
125
157
|
.active_task {
|
|
126
158
|
display: flex;
|
|
127
159
|
flex-direction: column;
|
|
@@ -164,6 +196,7 @@
|
|
|
164
196
|
overflow: hidden;
|
|
165
197
|
border: 1px solid var(--color-neutral-dark-shades-950, #26292e);
|
|
166
198
|
background: var(--color-neutral-basics-white, #fff);
|
|
199
|
+
margin-top: 1rem;
|
|
167
200
|
}
|
|
168
201
|
.notesContainer {
|
|
169
202
|
display: flex;
|
package/src/Interviews/Task.tsx
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import React, { HTMLAttributes, useState
|
|
1
|
+
import React, { HTMLAttributes, useState } from 'react';
|
|
2
2
|
import styles from './Task.modules.scss';
|
|
3
3
|
import { Button, CheckedIcon, IconButton, Text, SendIcon, colors } from '../';
|
|
4
|
-
import { Tooltip as MTooltip } from '@mui/material';
|
|
5
|
-
import { styled } from '@mui/material/styles';
|
|
6
|
-
|
|
7
|
-
const StyledTooltip = styled(MTooltip)({
|
|
8
|
-
'& .MuiPopover-root': {
|
|
9
|
-
borderRadius: '0.5rem',
|
|
10
|
-
background: 'transparent',
|
|
11
|
-
},
|
|
12
|
-
'& .MuiPopover-paper': {
|
|
13
|
-
borderRadius: '0.5rem',
|
|
14
|
-
background: 'transparent',
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
|
|
18
4
|
interface TaskItem {
|
|
19
5
|
_id: string;
|
|
20
6
|
description: string;
|
|
@@ -35,7 +21,7 @@ export interface TaskProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
35
21
|
taskTitleTooltip: string;
|
|
36
22
|
url?: string;
|
|
37
23
|
notes?: string;
|
|
38
|
-
state: 'idle' | 'active' | 'disabled';
|
|
24
|
+
state: 'idle' | 'active' | 'disabled' | 'done';
|
|
39
25
|
isDone: boolean;
|
|
40
26
|
task: TaskItem;
|
|
41
27
|
sendTask: (task: TaskItem) => void;
|
|
@@ -72,19 +58,19 @@ export const Task = ({
|
|
|
72
58
|
isInterviewer,
|
|
73
59
|
...props
|
|
74
60
|
}: TaskProps) => {
|
|
75
|
-
const [
|
|
76
|
-
const taskRef = useRef<any>(null);
|
|
61
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
77
62
|
const handleClose = () => {
|
|
78
|
-
|
|
63
|
+
setIsHovered(false);
|
|
79
64
|
};
|
|
80
65
|
|
|
81
66
|
const handleOpen = () => {
|
|
82
|
-
|
|
67
|
+
setIsHovered(true);
|
|
83
68
|
};
|
|
84
69
|
|
|
85
70
|
const getContainerStyle = () => {
|
|
86
71
|
if (state === 'active') return styles.active_task;
|
|
87
72
|
else if (state === 'disabled') return styles.disabled_task;
|
|
73
|
+
else if (state === 'done') return styles.done_task;
|
|
88
74
|
else return styles.task_container;
|
|
89
75
|
};
|
|
90
76
|
|
|
@@ -168,102 +154,73 @@ export const Task = ({
|
|
|
168
154
|
else
|
|
169
155
|
return (
|
|
170
156
|
<>
|
|
171
|
-
<
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
157
|
+
<div
|
|
158
|
+
className={`${getContainerStyle()} ${className ?? ''}`}
|
|
159
|
+
{...props}
|
|
160
|
+
onMouseEnter={handleOpen}
|
|
161
|
+
onMouseLeave={handleClose}
|
|
162
|
+
>
|
|
163
|
+
<div className={styles.header}>
|
|
178
164
|
<div
|
|
179
|
-
className={
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
maxWidth: taskRef.current
|
|
185
|
-
? taskRef.current.getBoundingClientRect().width
|
|
186
|
-
: 'unset',
|
|
187
|
-
}}
|
|
165
|
+
className={
|
|
166
|
+
isInterviewer
|
|
167
|
+
? styles.header_left_interviewer
|
|
168
|
+
: styles.header_left_interviewee
|
|
169
|
+
}
|
|
188
170
|
>
|
|
189
|
-
<Text text={
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
color={colors.blue_500}
|
|
198
|
-
style={{ cursor: 'pointer !important' }}
|
|
199
|
-
onClick={() =>
|
|
200
|
-
window.open(
|
|
201
|
-
url.includes('https://') ? url : `https://${url}`,
|
|
202
|
-
'_blank'
|
|
203
|
-
)
|
|
204
|
-
}
|
|
205
|
-
/>
|
|
206
|
-
</div>
|
|
207
|
-
)}
|
|
208
|
-
{notes && isInterviewer && (
|
|
209
|
-
<div className={styles.notesContainer}>
|
|
210
|
-
<Text text="Notes" size="xs" italic />
|
|
211
|
-
<Text text={notes} size="sm" />
|
|
212
|
-
</div>
|
|
213
|
-
)}
|
|
171
|
+
<Text text={taskNumber} color={'#64666A'} size="xs" />
|
|
172
|
+
|
|
173
|
+
<Text
|
|
174
|
+
text={taskTitle}
|
|
175
|
+
size="sm"
|
|
176
|
+
weight="bold"
|
|
177
|
+
className={styles.title}
|
|
178
|
+
/>
|
|
214
179
|
</div>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
}}
|
|
228
|
-
>
|
|
229
|
-
<div
|
|
230
|
-
className={`${getContainerStyle()} ${className ?? ''}`}
|
|
231
|
-
ref={taskRef}
|
|
232
|
-
{...props}
|
|
233
|
-
>
|
|
234
|
-
<div className={styles.header}>
|
|
235
|
-
<div
|
|
236
|
-
className={
|
|
237
|
-
isInterviewer
|
|
238
|
-
? styles.header_left_interviewer
|
|
239
|
-
: styles.header_left_interviewee
|
|
240
|
-
}
|
|
180
|
+
{isInterviewer && (
|
|
181
|
+
<button
|
|
182
|
+
className={`${styles.header_right} ${
|
|
183
|
+
state === 'idle' && styles.clickable
|
|
184
|
+
}`}
|
|
185
|
+
onClick={() => {
|
|
186
|
+
if (state === 'idle') sendTask(task);
|
|
187
|
+
}}
|
|
188
|
+
disabled={state === 'disabled' || state === 'done'}
|
|
241
189
|
>
|
|
242
|
-
<
|
|
243
|
-
|
|
190
|
+
{isDone ? <CheckedIcon /> : <SendIcon />}
|
|
191
|
+
</button>
|
|
192
|
+
)}
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
{isHovered && (
|
|
196
|
+
<div className={styles.taskPopover}>
|
|
197
|
+
<Text text={taskTitleTooltip} size="sm" weight="bold" />
|
|
198
|
+
{url && (
|
|
199
|
+
<div className={styles.notesContainer}>
|
|
200
|
+
<Text text="URL" size="xs" italic />
|
|
244
201
|
<Text
|
|
245
|
-
text={
|
|
202
|
+
text={url}
|
|
203
|
+
textDecoration="underline"
|
|
246
204
|
size="sm"
|
|
247
|
-
|
|
248
|
-
|
|
205
|
+
color={colors.blue_500}
|
|
206
|
+
style={{ cursor: 'pointer !important' }}
|
|
207
|
+
onClick={() =>
|
|
208
|
+
window.open(
|
|
209
|
+
url.includes('https://') ? url : `https://${url}`,
|
|
210
|
+
'_blank'
|
|
211
|
+
)
|
|
212
|
+
}
|
|
249
213
|
/>
|
|
250
214
|
</div>
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}}
|
|
259
|
-
disabled={state === 'disabled'}
|
|
260
|
-
>
|
|
261
|
-
{isDone ? <CheckedIcon /> : <SendIcon />}
|
|
262
|
-
</button>
|
|
263
|
-
)}
|
|
264
|
-
</div>
|
|
215
|
+
)}
|
|
216
|
+
{notes && isInterviewer && (
|
|
217
|
+
<div className={styles.notesContainer}>
|
|
218
|
+
<Text text="Notes" size="xs" italic />
|
|
219
|
+
<Text text={notes} size="sm" />
|
|
220
|
+
</div>
|
|
221
|
+
)}
|
|
265
222
|
</div>
|
|
266
|
-
|
|
223
|
+
)}
|
|
267
224
|
</>
|
|
268
225
|
);
|
|
269
226
|
};
|