@r2digisolutions/components 0.17.8 → 0.17.10

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.
@@ -44,14 +44,6 @@
44
44
  lg: 'px-5 py-5 sm:px-6 sm:py-6'
45
45
  };
46
46
 
47
- /** Lets nested `FormActions variant="bar"` bleed to the card edges. */
48
- const contentPadVars: Record<CardPadding, string> = {
49
- none: '',
50
- sm: '[--card-pad-x:0.75rem] [--card-pad-y:0.625rem]',
51
- md: '[--card-pad-x:1rem] [--card-pad-y:0.875rem] sm:[--card-pad-x:1.25rem] sm:[--card-pad-y:1rem]',
52
- lg: '[--card-pad-x:1.25rem] [--card-pad-y:1.25rem] sm:[--card-pad-x:1.5rem] sm:[--card-pad-y:1.5rem]'
53
- };
54
-
55
47
  const isClickable = $derived(!!onclick || hoverable);
56
48
  </script>
57
49
 
@@ -89,8 +81,7 @@
89
81
  <div
90
82
  class={[
91
83
  'flex min-w-0 flex-1 flex-col',
92
- padding !== 'none' ? paddingClasses[padding] : '',
93
- padding !== 'none' ? contentPadVars[padding] : ''
84
+ padding !== 'none' ? paddingClasses[padding] : ''
94
85
  ]}
95
86
  >
96
87
  {@render children()}
@@ -74,12 +74,11 @@
74
74
  class={[
75
75
  'gap-3 sm:flex-row sm:items-center flex w-full flex-col',
76
76
  alignClasses[align],
77
- variant === 'bar' &&
78
- [
79
- // Bleed through Card body padding when `--card-pad-*` is set; no-op otherwise.
80
- '-mx-[length:var(--card-pad-x,0px)] -mb-[length:var(--card-pad-y,0px)]',
81
- 'rounded-b-2xl border-t border-border bg-surface/50 px-4 py-3 sm:px-5'
82
- ],
77
+ /**
78
+ * `bar` is for a sibling of the padded body (Card `footer` snippet, or
79
+ * padding="none" + manual body pad). Never nest `bar` inside Card body padding.
80
+ */
81
+ variant === 'bar' && 'rounded-b-2xl border-t border-border bg-surface/50 px-4 py-3 sm:px-5',
83
82
  variant === 'sticky' &&
84
83
  'border-border bg-surface-elevated/95 px-4 py-3 backdrop-blur-md dark:shadow-black/30 sm:px-5 shrink-0 border-t shadow-[0_-8px_24px_rgb(0,0,0,0.06)]',
85
84
  variant === 'plain' && 'gap-2',
@@ -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 class={['min-h-0 relative flex-1', flush ? 'p-0 overflow-hidden' : 'p-3 overflow-auto']}>
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
@@ -188,7 +188,7 @@
188
188
 
189
189
  <div
190
190
  class={[
191
- 'rounded-2xl border-border bg-surface-elevated shadow-xl flex h-[min(560px,70vh)] w-[min(420px,calc(100vw-2rem))] shrink-0 flex-col overflow-hidden border',
191
+ '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
192
  className
193
193
  ]}
194
194
  role="complementary"
@@ -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
- // Prefer content height; keep a floor from the saved desktop span.
486
- const minH = Math.max(item.h * rowHeight, 160);
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 ? 'min-h-full w-full' : 'h-full w-full'}
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
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/components",
3
- "version": "0.17.8",
3
+ "version": "0.17.10",
4
4
  "private": false,
5
5
  "description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
6
6
  "license": "MIT",