@streamscloud/kit 0.28.0 → 0.29.1

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,5 +1,6 @@
1
1
  <script lang="ts">import { IconSlot } from '../icon';
2
- const { label, icon, href, active = false, disabled = false, badge, target, rel, on } = $props();
2
+ const { label, icon, href, active = false, activeStyle = 'plain', disabled = false, badge, target, rel, on } = $props();
3
+ const activeFilled = $derived(active && activeStyle === 'filled');
3
4
  const badgeText = $derived(typeof badge === 'number' && badge > 99 ? '99+' : badge);
4
5
  const hasBadge = $derived(badge !== undefined && badge !== null && badge !== '');
5
6
  const handleClick = () => {
@@ -24,6 +25,7 @@ const handleClick = () => {
24
25
  <a
25
26
  class="nav-menu-item"
26
27
  class:nav-menu-item--active={active}
28
+ class:nav-menu-item--active-filled={activeFilled}
27
29
  class:nav-menu-item--disabled={disabled}
28
30
  href={href}
29
31
  target={target}
@@ -38,6 +40,7 @@ const handleClick = () => {
38
40
  type="button"
39
41
  class="nav-menu-item"
40
42
  class:nav-menu-item--active={active}
43
+ class:nav-menu-item--active-filled={activeFilled}
41
44
  class:nav-menu-item--disabled={disabled}
42
45
  disabled={disabled}
43
46
  aria-current={active ? 'page' : undefined}
@@ -51,7 +54,9 @@ const handleClick = () => {
51
54
  NavMenuItem — single row inside a `NavMenuGroup`. Icon + label, optional badge in the top-right of
52
55
  the icon (numbers > 99 truncate to `99+`). The icon accepts an SVG source string or a snippet.
53
56
  Renders as `<a>` when `href` is set, `<button>` otherwise. Active state is consumer-controlled
54
- (`active` prop) — wire it to your router's pathname matching upstream.
57
+ (`active` prop) — wire it to your router's pathname matching upstream. `activeStyle` picks how the
58
+ active row reads: `'plain'` (default) leaves color as the only signal and keeps the hover background
59
+ working on the active row, `'filled'` plates it and suppresses hover there.
55
60
 
56
61
  ### CSS Custom Properties
57
62
  | Property | Description | Default |
@@ -63,7 +68,7 @@ Renders as `<a>` when `href` is set, `<button>` otherwise. Active state is consu
63
68
  | `--sc-kit--nav-menu-item--color--active` | Active / hover text color | `--sc-kit--color--text--primary` |
64
69
  | `--sc-kit--nav-menu-item--color--disabled` | Disabled text color | `--sc-kit--color--text--muted` |
65
70
  | `--sc-kit--nav-menu-item--background--hover` | Hover background | `--sc-kit--color--bg--hover` |
66
- | `--sc-kit--nav-menu-item--background--active` | Active background | `--sc-kit--color--bg--menu-active` |
71
+ | `--sc-kit--nav-menu-item--background--active` | Active background — `activeStyle="filled"` only | `--sc-kit--color--bg--menu-active` |
67
72
  | `--sc-kit--nav-menu-item--badge--background` | Badge background | `--sc-kit--color--accent` |
68
73
  | `--sc-kit--nav-menu-item--badge--color` | Badge text color | `--sc-kit--color--text--on-accent` |
69
74
  -->
@@ -93,13 +98,13 @@ Renders as `<a>` when `href` is set, `<button>` otherwise. Active state is consu
93
98
  text-align: left;
94
99
  transition: color var(--sc-kit--duration--base) var(--sc-kit--ease--default), background-color var(--sc-kit--duration--base) var(--sc-kit--ease--default);
95
100
  }
96
- .nav-menu-item:hover:not(.nav-menu-item--active):not(.nav-menu-item--disabled):not(:disabled) {
101
+ .nav-menu-item:hover:not(.nav-menu-item--active-filled):not(.nav-menu-item--disabled):not(:disabled) {
97
102
  background: var(--_nav-menu-item--background-hover);
98
103
  }
99
104
  .nav-menu-item:hover:not(.nav-menu-item--disabled):not(:disabled), .nav-menu-item--active {
100
105
  color: var(--_nav-menu-item--color-active);
101
106
  }
102
- .nav-menu-item--active {
107
+ .nav-menu-item--active-filled {
103
108
  background: var(--_nav-menu-item--background-active);
104
109
  }
105
110
  .nav-menu-item--disabled, .nav-menu-item:disabled {
@@ -7,6 +7,8 @@ type Props = {
7
7
  href?: string;
8
8
  /** Highlight as the current item. Consumer-controlled. @default false */
9
9
  active?: boolean;
10
+ /** Active row visuals — `'plain'` uses color only and keeps hover, `'filled'` paints the active background (no hover on it). @default 'plain' */
11
+ activeStyle?: 'filled' | 'plain';
10
12
  disabled?: boolean;
11
13
  /** Notification badge on the icon (top-right corner). Numbers > 99 render as `99+`; strings render as-is. */
12
14
  badge?: number | string;
@@ -22,7 +24,9 @@ type Props = {
22
24
  * NavMenuItem — single row inside a `NavMenuGroup`. Icon + label, optional badge in the top-right of
23
25
  * the icon (numbers > 99 truncate to `99+`). The icon accepts an SVG source string or a snippet.
24
26
  * Renders as `<a>` when `href` is set, `<button>` otherwise. Active state is consumer-controlled
25
- * (`active` prop) — wire it to your router's pathname matching upstream.
27
+ * (`active` prop) — wire it to your router's pathname matching upstream. `activeStyle` picks how the
28
+ * active row reads: `'plain'` (default) leaves color as the only signal and keeps the hover background
29
+ * working on the active row, `'filled'` plates it and suppresses hover there.
26
30
  *
27
31
  * ### CSS Custom Properties
28
32
  * | Property | Description | Default |
@@ -34,7 +38,7 @@ type Props = {
34
38
  * | `--sc-kit--nav-menu-item--color--active` | Active / hover text color | `--sc-kit--color--text--primary` |
35
39
  * | `--sc-kit--nav-menu-item--color--disabled` | Disabled text color | `--sc-kit--color--text--muted` |
36
40
  * | `--sc-kit--nav-menu-item--background--hover` | Hover background | `--sc-kit--color--bg--hover` |
37
- * | `--sc-kit--nav-menu-item--background--active` | Active background | `--sc-kit--color--bg--menu-active` |
41
+ * | `--sc-kit--nav-menu-item--background--active` | Active background — `activeStyle="filled"` only | `--sc-kit--color--bg--menu-active` |
38
42
  * | `--sc-kit--nav-menu-item--badge--background` | Badge background | `--sc-kit--color--accent` |
39
43
  * | `--sc-kit--nav-menu-item--badge--color` | Badge text color | `--sc-kit--color--text--on-accent` |
40
44
  */
@@ -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.1",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",