@r2digisolutions/components 0.17.9 → 0.17.11
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/components/molecules/WidgetFrame/WidgetFrame.svelte +20 -1
- package/dist/components/organisms/AssistantChat/AssistantChat.svelte +16 -1
- package/dist/components/organisms/AssistantChat/AssistantChat.svelte.d.ts +3 -0
- package/dist/components/organisms/DashboardGrid/DashboardGrid.stories.js +1 -1
- package/dist/components/organisms/DashboardGrid/DashboardGrid.svelte +3 -4
- package/package.json +1 -1
|
@@ -485,6 +485,18 @@
|
|
|
485
485
|
: [];
|
|
486
486
|
return [...base, 'h-auto', 'max-h-fit', 'w-full', 'shrink-0'].join(' ');
|
|
487
487
|
});
|
|
488
|
+
|
|
489
|
+
/** Content-sized frames (e.g. DashboardGrid stacked KPIs) must not clip or scroll the body. */
|
|
490
|
+
const contentFit = $derived(
|
|
491
|
+
collapsed ||
|
|
492
|
+
(typeof className === 'string' &&
|
|
493
|
+
className
|
|
494
|
+
.split(/\s+/)
|
|
495
|
+
.some((token) => token === 'h-auto' || token === 'max-h-fit'))
|
|
496
|
+
);
|
|
497
|
+
const bodyOverflowClass = $derived(
|
|
498
|
+
contentFit ? 'overflow-visible' : flush ? 'overflow-hidden' : 'overflow-auto'
|
|
499
|
+
);
|
|
488
500
|
</script>
|
|
489
501
|
|
|
490
502
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
@@ -607,7 +619,14 @@
|
|
|
607
619
|
{/if}
|
|
608
620
|
|
|
609
621
|
{#if !collapsed}
|
|
610
|
-
<div
|
|
622
|
+
<div
|
|
623
|
+
class={[
|
|
624
|
+
'relative',
|
|
625
|
+
contentFit ? 'flex-none' : 'min-h-0 flex-1',
|
|
626
|
+
flush ? 'p-0' : 'p-3',
|
|
627
|
+
bodyOverflowClass
|
|
628
|
+
]}
|
|
629
|
+
>
|
|
611
630
|
{#if busy}
|
|
612
631
|
{#if loadingMode === 'spinner'}
|
|
613
632
|
<div
|
|
@@ -30,6 +30,9 @@
|
|
|
30
30
|
suggestions?: string[];
|
|
31
31
|
/** Chips shown under the conversation (after the user has messages). */
|
|
32
32
|
followUpSuggestions?: string[];
|
|
33
|
+
/** Active CRM query, shown under the header (e.g. «Presupuestos · María · el mes pasado»). */
|
|
34
|
+
contextLabel?: string;
|
|
35
|
+
contextAriaLabel?: string;
|
|
33
36
|
messages?: AssistantMessage[];
|
|
34
37
|
draft?: string;
|
|
35
38
|
loading?: boolean;
|
|
@@ -69,6 +72,8 @@
|
|
|
69
72
|
emptyHint = '¿En qué puedo ayudarte?',
|
|
70
73
|
suggestions = [],
|
|
71
74
|
followUpSuggestions = [],
|
|
75
|
+
contextLabel = '',
|
|
76
|
+
contextAriaLabel = '',
|
|
72
77
|
messages = [],
|
|
73
78
|
draft = $bindable(''),
|
|
74
79
|
loading = false,
|
|
@@ -188,7 +193,7 @@
|
|
|
188
193
|
|
|
189
194
|
<div
|
|
190
195
|
class={[
|
|
191
|
-
'rounded-2xl border-border bg-surface-elevated shadow-xl flex h-[min(560px,
|
|
196
|
+
'rounded-2xl border-border bg-surface-elevated shadow-xl flex h-[min(560px,calc(100dvh-5.5rem))] max-h-[calc(100dvh-5.5rem)] w-[min(420px,calc(100vw-2rem))] shrink-0 flex-col overflow-hidden border',
|
|
192
197
|
className
|
|
193
198
|
]}
|
|
194
199
|
role="complementary"
|
|
@@ -229,6 +234,16 @@
|
|
|
229
234
|
</IconButton>
|
|
230
235
|
</header>
|
|
231
236
|
|
|
237
|
+
{#if contextLabel}
|
|
238
|
+
<div
|
|
239
|
+
class="border-border bg-surface-overlay px-3 py-1.5 leading-snug text-muted truncate border-b text-[11px]"
|
|
240
|
+
title={contextLabel}
|
|
241
|
+
aria-label={contextAriaLabel || contextLabel}
|
|
242
|
+
>
|
|
243
|
+
{contextLabel}
|
|
244
|
+
</div>
|
|
245
|
+
{/if}
|
|
246
|
+
|
|
232
247
|
<!-- Body -->
|
|
233
248
|
<div bind:this={scrollEl} class="min-h-0 px-3 py-3 flex-1 overflow-y-auto">
|
|
234
249
|
{#if isEmpty}
|
|
@@ -13,6 +13,9 @@ interface AssistantChatProps {
|
|
|
13
13
|
suggestions?: string[];
|
|
14
14
|
/** Chips shown under the conversation (after the user has messages). */
|
|
15
15
|
followUpSuggestions?: string[];
|
|
16
|
+
/** Active CRM query, shown under the header (e.g. «Presupuestos · María · el mes pasado»). */
|
|
17
|
+
contextLabel?: string;
|
|
18
|
+
contextAriaLabel?: string;
|
|
16
19
|
messages?: AssistantMessage[];
|
|
17
20
|
draft?: string;
|
|
18
21
|
loading?: boolean;
|
|
@@ -7,7 +7,7 @@ const meta = {
|
|
|
7
7
|
layout: 'padded',
|
|
8
8
|
docs: {
|
|
9
9
|
description: {
|
|
10
|
-
component: 'Responsive dashboard grid. Use `stackBelow` (default `960`, or `false` to disable) to collapse into a single-column reading-order stack when the **grid container** is narrow (ResizeObserver; sidebar-aware). Drag/resize are disabled while stacked.'
|
|
10
|
+
component: 'Responsive dashboard grid. Use `stackBelow` (default `960`, or `false` to disable) to collapse into a single-column reading-order stack when the **grid container** is narrow (ResizeObserver; sidebar-aware). While stacked, all widgets size to content (desktop row spans ignored) so the page has a single scroll. Drag/resize are disabled while stacked.'
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
},
|
|
@@ -482,9 +482,8 @@
|
|
|
482
482
|
|
|
483
483
|
function styleFor(item: GridItem): string {
|
|
484
484
|
if (stacked) {
|
|
485
|
-
//
|
|
486
|
-
|
|
487
|
-
return `width:100%;min-height:${minH}px;height:auto;`;
|
|
485
|
+
// Tablet/narrow: ignore desktop row spans entirely — one page scroll, no nested card scroll.
|
|
486
|
+
return 'width:100%;height:auto;';
|
|
488
487
|
}
|
|
489
488
|
const x = item.x + 1;
|
|
490
489
|
const y = item.y + 1;
|
|
@@ -666,7 +665,7 @@
|
|
|
666
665
|
loading={meta.loading}
|
|
667
666
|
empty={meta.empty}
|
|
668
667
|
onreload={meta.onReload}
|
|
669
|
-
class={stacked ? '
|
|
668
|
+
class={stacked ? 'h-auto w-full' : 'h-full w-full'}
|
|
670
669
|
ondragstart={(e) => onDragStart(item.id, e)}
|
|
671
670
|
onresizestart={(e, edge) => onResizeStart(item.id, e, edge)}
|
|
672
671
|
>
|