@r2digisolutions/components 0.21.22 → 0.21.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.
@@ -12,7 +12,8 @@
12
12
  LoaderCircle,
13
13
  RotateCcw,
14
14
  Copy,
15
- Check
15
+ Check,
16
+ ChevronLeft
16
17
  } from '@lucide/svelte';
17
18
 
18
19
  export interface AssistantMessage {
@@ -52,12 +53,16 @@
52
53
  voiceOffLabel?: string;
53
54
  copyChatLabel?: string;
54
55
  copiedChatLabel?: string;
56
+ /** Optional back control (e.g. return to conversation list). */
57
+ backLabel?: string;
58
+ subtitle?: string;
55
59
  class?: string;
56
60
  result?: Snippet<[AssistantMessage]>;
57
61
  footerExtra?: Snippet;
58
62
  onsend?: () => void;
59
63
  onclose?: () => void;
60
64
  onnewchat?: () => void;
65
+ onback?: () => void;
61
66
  oncopychat?: () => void | Promise<void>;
62
67
  onmicclick?: () => void;
63
68
  onvoiceoutputchange?: (on: boolean) => void;
@@ -92,12 +97,15 @@
92
97
  voiceOffLabel = 'Voz desactivada',
93
98
  copyChatLabel = 'Copiar chat',
94
99
  copiedChatLabel = 'Copiado',
100
+ backLabel = 'Volver',
101
+ subtitle = '',
95
102
  class: className = '',
96
103
  result,
97
104
  footerExtra,
98
105
  onsend,
99
106
  onclose,
100
107
  onnewchat,
108
+ onback,
101
109
  oncopychat,
102
110
  onmicclick,
103
111
  onvoiceoutputchange,
@@ -201,16 +209,24 @@
201
209
  >
202
210
  <!-- Header -->
203
211
  <header class="gap-2 border-border px-3 py-2.5 flex shrink-0 items-center border-b">
204
- <span
205
- class="h-7 w-7 rounded-lg bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400 flex shrink-0 items-center justify-center"
206
- aria-hidden="true"
207
- >
208
- <Sparkles size={15} strokeWidth={2} />
209
- </span>
212
+ {#if onback}
213
+ <IconButton variant="ghost" size="xs" label={backLabel} onclick={() => onback()}>
214
+ <ChevronLeft size={16} strokeWidth={2} />
215
+ </IconButton>
216
+ {:else}
217
+ <span
218
+ class="h-7 w-7 rounded-lg bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400 flex shrink-0 items-center justify-center"
219
+ aria-hidden="true"
220
+ >
221
+ <Sparkles size={15} strokeWidth={2} />
222
+ </span>
223
+ {/if}
210
224
  <div class="min-w-0 flex-1">
211
225
  <p class="text-sm font-semibold text-primary truncate">{title}</p>
212
226
  {#if statusLabel}
213
227
  <p class="text-xs text-muted truncate">{statusLabel}</p>
228
+ {:else if subtitle}
229
+ <p class="text-xs text-muted truncate">{subtitle}</p>
214
230
  {/if}
215
231
  </div>
216
232
  <IconButton
@@ -35,12 +35,16 @@ interface AssistantChatProps {
35
35
  voiceOffLabel?: string;
36
36
  copyChatLabel?: string;
37
37
  copiedChatLabel?: string;
38
+ /** Optional back control (e.g. return to conversation list). */
39
+ backLabel?: string;
40
+ subtitle?: string;
38
41
  class?: string;
39
42
  result?: Snippet<[AssistantMessage]>;
40
43
  footerExtra?: Snippet;
41
44
  onsend?: () => void;
42
45
  onclose?: () => void;
43
46
  onnewchat?: () => void;
47
+ onback?: () => void;
44
48
  oncopychat?: () => void | Promise<void>;
45
49
  onmicclick?: () => void;
46
50
  onvoiceoutputchange?: (on: boolean) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/components",
3
- "version": "0.21.22",
3
+ "version": "0.21.23",
4
4
  "private": false,
5
5
  "description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
6
6
  "license": "MIT",