rio-assist-widget 0.1.18 → 0.1.23

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/index.html CHANGED
@@ -28,7 +28,7 @@
28
28
  data-title="Rio Insight"
29
29
  data-button-label="Rio Insight"
30
30
  data-placeholder="Pergunte alguma coisa"
31
- data-suggestions="Veículos com problemas|Valor das peças|Planos de manutenção"
31
+ data-suggestions="Resumo da Frota|Frota Disponível|Chamados Abertos|Parados + Causas|Aguardando Peças|Principais Gargalos|Tempo por Concessionária|Tempo de Ciclo|Preventiva x Corretiva"
32
32
  data-accent-color="#c02267"
33
33
  ></rio-assist-widget>
34
34
 
@@ -36,4 +36,3 @@
36
36
  <script type="module" src="/src/playground.ts"></script>
37
37
  </body>
38
38
  </html>
39
- </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rio-assist-widget",
3
- "version": "0.1.18",
3
+ "version": "0.1.23",
4
4
  "description": "Web Component do painel lateral Rio Insight, pronto para ser embutido em qualquer projeto.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -232,14 +232,46 @@ export const miniPanelStyles = css`
232
232
  text-align: right;
233
233
  }
234
234
 
235
- .typing {
236
- font-style: italic;
237
- opacity: 0.75;
238
- }
239
-
240
- .message--user time {
241
- margin-top: 3px;
242
- }
235
+ .typing {
236
+ font-style: italic;
237
+ opacity: 0.75;
238
+ }
239
+
240
+ .typing__dots {
241
+ display: inline-flex;
242
+ gap: 2px;
243
+ margin-left: 4px;
244
+ }
245
+
246
+ .typing__dots span {
247
+ display: inline-block;
248
+ animation: typing-bounce 1.2s infinite;
249
+ }
250
+
251
+ .typing__dots span:nth-child(2) {
252
+ animation-delay: 0.2s;
253
+ }
254
+
255
+ .typing__dots span:nth-child(3) {
256
+ animation-delay: 0.4s;
257
+ }
258
+
259
+ @keyframes typing-bounce {
260
+ 0%,
261
+ 80%,
262
+ 100% {
263
+ transform: translateY(0);
264
+ opacity: 0.25;
265
+ }
266
+ 40% {
267
+ transform: translateY(-4px);
268
+ opacity: 1;
269
+ }
270
+ }
271
+
272
+ .message--user time {
273
+ margin-top: 3px;
274
+ }
243
275
 
244
276
  .panel-footer {
245
277
  width: 100%;
@@ -251,11 +283,12 @@ export const miniPanelStyles = css`
251
283
  margin-top: auto;
252
284
  }
253
285
 
254
- .suggestions {
255
- display: inline-flex;
256
- gap: 12px;
257
- justify-content: center;
258
- }
286
+ .suggestions {
287
+ display: flex;
288
+ flex-wrap: wrap;
289
+ gap: 12px;
290
+ justify-content: center;
291
+ }
259
292
 
260
293
  .suggestions-wrapper {
261
294
  width: 100%;
@@ -47,7 +47,10 @@ export const renderChatSurface = (component: RioAssistWidget) => {
47
47
  ${component.isLoading
48
48
  ? html`
49
49
  <div class="message message--assistant typing">
50
- <span>Rio Insight está respondendo...</span>
50
+ <span>${component.loadingLabel}</span>
51
+ <span class="typing__dots" aria-hidden="true">
52
+ <span>.</span><span>.</span><span>.</span>
53
+ </span>
51
54
  </div>
52
55
  `
53
56
  : null}
@@ -50,6 +50,21 @@ const baseStyles = css`
50
50
  color: #1f2f36;
51
51
  }
52
52
 
53
+ .dialog__input {
54
+ width: 100%;
55
+ box-sizing: border-box;
56
+ padding: 10px 12px;
57
+ border-radius: 8px;
58
+ border: 1px solid #c7d0d9;
59
+ font: inherit;
60
+ outline: none;
61
+ }
62
+
63
+ .dialog__input:focus {
64
+ border-color: var(--accent-color, #008b9a);
65
+ box-shadow: 0 0 0 2px rgba(0, 139, 154, 0.2);
66
+ }
67
+
53
68
  .dialog__actions {
54
69
  display: flex;
55
70
  justify-content: flex-end;
@@ -73,7 +88,12 @@ const baseStyles = css`
73
88
  }
74
89
 
75
90
  .dialog__button--danger {
76
- background: #008b9a;
91
+ background: #d9534f;
92
+ color: #fff;
93
+ }
94
+
95
+ .dialog__button--primary {
96
+ background: var(--accent-color, #008b9a);
77
97
  color: #fff;
78
98
  }
79
99
  `;
@@ -16,6 +16,35 @@ export const renderRioAssist = (component: RioAssistWidget) => {
16
16
  ${renderFloatingButton(component)}
17
17
  ${renderMiniPanel(component)}
18
18
  ${component.isFullscreen ? renderFullscreen(component) : null}
19
+ ${component.renameConversationTarget
20
+ ? html`
21
+ <div class="dialog-overlay" role="dialog" aria-modal="true">
22
+ <div class="dialog">
23
+ <p class="dialog__message">Digite o novo título para a conversa:</p>
24
+ <input
25
+ class="dialog__input"
26
+ type="text"
27
+ .value=${component.renameConversationTarget.draft}
28
+ @input=${(event: InputEvent) => component.handleRenameDraft(event)}
29
+ aria-label="Novo titulo da conversa"
30
+ />
31
+ <div class="dialog__actions">
32
+ <button type="button" class="dialog__button dialog__button--ghost" @click=${() =>
33
+ component.cancelRenameConversation()}>
34
+ Cancelar
35
+ </button>
36
+ <button
37
+ type="button"
38
+ class="dialog__button dialog__button--primary"
39
+ @click=${() => component.confirmRenameConversation()}
40
+ >
41
+ Renomear
42
+ </button>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ `
47
+ : null}
19
48
  ${component.deleteConversationTarget
20
49
  ? html`
21
50
  <div class="dialog-overlay" role="dialog" aria-modal="true">