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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.269",
2
+ "version": "1.4.270",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -185,9 +185,10 @@ export const Chat = ({
185
185
  url={realTask.url}
186
186
  notes={realTask.notes}
187
187
  state={
188
- (idsTasksAlreadySent.includes(realTask._id) &&
189
- realCurrentTask._id !== realTask._id) ||
190
- disabledTask
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
- gap: 0.5rem;
11
- a {
10
+ .name {
11
+ margin-top: 0.37rem;
12
+ }
13
+ .description {
14
+ margin-top: 0.37rem;
15
+ }
16
+
17
+ button {
12
18
  width: 100%;
13
- button {
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
- description: string;
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} weight="bold" />
28
- <Text text={description} size="sm" />
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.4rem 0.75rem;
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;
@@ -1,20 +1,6 @@
1
- import React, { HTMLAttributes, useState, useRef } from 'react';
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 [open, setOpen] = useState(false);
76
- const taskRef = useRef<any>(null);
61
+ const [isHovered, setIsHovered] = useState(false);
77
62
  const handleClose = () => {
78
- setOpen(false);
63
+ setIsHovered(false);
79
64
  };
80
65
 
81
66
  const handleOpen = () => {
82
- setOpen(true);
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
- <StyledTooltip
172
- id="mouse-over-popover"
173
- open={open}
174
- onClose={handleClose}
175
- onOpen={handleOpen}
176
- placement="bottom-start"
177
- title={
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={styles.taskPopover}
180
- style={{
181
- width: taskRef.current
182
- ? taskRef.current.getBoundingClientRect().width
183
- : 'unset',
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={taskTitleTooltip} size="sm" weight="bold" />
190
- {url && (
191
- <div className={styles.notesContainer}>
192
- <Text text="URL" size="xs" italic />
193
- <Text
194
- text={url}
195
- textDecoration="underline"
196
- size="sm"
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
- componentsProps={{
217
- tooltip: {
218
- sx: {
219
- bgcolor: 'transparent',
220
- padding: 0,
221
- borderRadius: '0.5rem',
222
- '& .MuiTooltip-arrow': {
223
- color: 'transparent',
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
- <Text text={taskNumber} color={'#64666A'} size="xs" />
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={taskTitle}
202
+ text={url}
203
+ textDecoration="underline"
246
204
  size="sm"
247
- weight="bold"
248
- className={styles.title}
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
- {isInterviewer && (
252
- <button
253
- className={`${styles.header_right} ${
254
- state === 'idle' && styles.clickable
255
- }`}
256
- onClick={() => {
257
- if (state === 'idle') sendTask(task);
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
- </StyledTooltip>
223
+ )}
267
224
  </>
268
225
  );
269
226
  };