@streamscloud/kit 0.28.0 → 0.29.0

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.
@@ -15,7 +15,7 @@
15
15
  --sc-kit--color--bg--hover: light-dark(#f3f5f8, #{$color-dark-700});
16
16
  --sc-kit--color--bg--active: light-dark(#eef2f8, #{$color-dark-600});
17
17
  --sc-kit--color--bg--menu-active: light-dark(#{$color-blue-50}, #{$color-dark-500});
18
- --sc-kit--color--bg--images: light-dark(#{$color-neutral-300}, #{$color-neutral-700});
18
+ --sc-kit--color--bg--images: light-dark(#{$color-neutral-300}, #{$color-dark-50});
19
19
 
20
20
  // ============================================================
21
21
  // COLOR — TEXT
@@ -1,21 +1,27 @@
1
1
  <script lang="ts">"use strict";
2
- let { shape = 'rect', lines = 1, shimmer = false } = $props();
2
+ let { shape = 'rect', placeholder = false, lines = 1, shimmer = false } = $props();
3
3
  </script>
4
4
 
5
5
  {#if shape === 'text' && lines > 1}
6
6
  <span class="skeleton-stack">
7
7
  {#each Array(lines) as _, i (i)}
8
- <span class="skeleton skeleton--text" class:skeleton--shimmer={shimmer} class:skeleton--text-last={i === lines - 1}></span>
8
+ <span
9
+ class="skeleton skeleton--text"
10
+ class:skeleton--placeholder={placeholder}
11
+ class:skeleton--shimmer={shimmer}
12
+ class:skeleton--text-last={i === lines - 1}></span>
9
13
  {/each}
10
14
  </span>
11
15
  {:else}
12
- <span class="skeleton skeleton--{shape}" class:skeleton--shimmer={shimmer}></span>
16
+ <span class="skeleton skeleton--{shape}" class:skeleton--placeholder={placeholder} class:skeleton--shimmer={shimmer}></span>
13
17
  {/if}
14
18
 
15
19
  <!--
16
20
  @component
17
21
  Skeleton — content placeholder rendered while data is loading. Three shapes: `rect` (default — generic block), `circle` (avatars), `text` (one or more text lines via `lines` — the last line is naturally shorter to suggest a paragraph end). All dimensions are CSS-var driven; sizing is the consumer's concern.
18
22
 
23
+ `placeholder` swaps the fill for the image-backdrop color, so a media slot reads as an empty image / video frame rather than as loading content.
24
+
19
25
  ### CSS Custom Properties
20
26
  | Property | Description | Default |
21
27
  |---|---|---|
@@ -24,7 +30,7 @@ Skeleton — content placeholder rendered while data is loading. Three shapes: `
24
30
  | `--sc-kit--skeleton--text-height` | Per-line height in `shape='text'` | `0.75em` |
25
31
  | `--sc-kit--skeleton--text-last-width` | Width of the last line in multi-line text | `70%` |
26
32
  | `--sc-kit--skeleton--text-gap` | Vertical gap between text lines | `--sc-kit--space--2` |
27
- | `--sc-kit--skeleton--base-color` | Placeholder fill / shimmer darker stop | `--sc-kit--color--bg--active` |
33
+ | `--sc-kit--skeleton--base-color` | Placeholder fill / shimmer darker stop | `--sc-kit--color--bg--active`, or `--sc-kit--color--bg--images` with `placeholder` |
28
34
  | `--sc-kit--skeleton--highlight-color` | Shimmer peak (lighter stop) — `shimmer` only | `--sc-kit--color--bg--hover` |
29
35
  | `--sc-kit--skeleton--radius` | Corner radius (rect / text) | `--sc-kit--radius--sm` |
30
36
  | `--sc-kit--skeleton--duration` | Shimmer cycle length — `shimmer` only | `2.2s` |
@@ -43,6 +49,9 @@ Skeleton — content placeholder rendered while data is loading. Three shapes: `
43
49
  width: var(--_skeleton--width);
44
50
  height: var(--_skeleton--height);
45
51
  }
52
+ .skeleton--placeholder {
53
+ --_skeleton--base-color: var(--sc-kit--skeleton--base-color, var(--sc-kit--color--bg--images));
54
+ }
46
55
  .skeleton--shimmer {
47
56
  --_skeleton--highlight-color: var(--sc-kit--skeleton--highlight-color, var(--sc-kit--color--bg--hover));
48
57
  --_skeleton--duration: var(--sc-kit--skeleton--duration, 2.2s);
@@ -1,6 +1,8 @@
1
1
  type Props = {
2
2
  /** Shape variant. @default 'rect' */
3
3
  shape?: 'rect' | 'circle' | 'text';
4
+ /** Fill with the image-backdrop color, for a media slot standing in for an image or video rather than for loading content. @default false */
5
+ placeholder?: boolean;
4
6
  /** For `shape='text'` only — render N stacked text lines (last one naturally shorter to suggest paragraph end). @default 1 */
5
7
  lines?: number;
6
8
  /** Animate a shimmer sweep instead of a flat static placeholder. @default false */
@@ -9,6 +11,8 @@ type Props = {
9
11
  /**
10
12
  * Skeleton — content placeholder rendered while data is loading. Three shapes: `rect` (default — generic block), `circle` (avatars), `text` (one or more text lines via `lines` — the last line is naturally shorter to suggest a paragraph end). All dimensions are CSS-var driven; sizing is the consumer's concern.
11
13
  *
14
+ * `placeholder` swaps the fill for the image-backdrop color, so a media slot reads as an empty image / video frame rather than as loading content.
15
+ *
12
16
  * ### CSS Custom Properties
13
17
  * | Property | Description | Default |
14
18
  * |---|---|---|
@@ -17,7 +21,7 @@ type Props = {
17
21
  * | `--sc-kit--skeleton--text-height` | Per-line height in `shape='text'` | `0.75em` |
18
22
  * | `--sc-kit--skeleton--text-last-width` | Width of the last line in multi-line text | `70%` |
19
23
  * | `--sc-kit--skeleton--text-gap` | Vertical gap between text lines | `--sc-kit--space--2` |
20
- * | `--sc-kit--skeleton--base-color` | Placeholder fill / shimmer darker stop | `--sc-kit--color--bg--active` |
24
+ * | `--sc-kit--skeleton--base-color` | Placeholder fill / shimmer darker stop | `--sc-kit--color--bg--active`, or `--sc-kit--color--bg--images` with `placeholder` |
21
25
  * | `--sc-kit--skeleton--highlight-color` | Shimmer peak (lighter stop) — `shimmer` only | `--sc-kit--color--bg--hover` |
22
26
  * | `--sc-kit--skeleton--radius` | Corner radius (rect / text) | `--sc-kit--radius--sm` |
23
27
  * | `--sc-kit--skeleton--duration` | Shimmer cycle length — `shimmer` only | `2.2s` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",