@streamscloud/kit 0.93.7 → 0.94.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.
@@ -1,13 +1,23 @@
1
- <script lang="ts" module>export {};
2
- </script>
3
-
4
- <script lang="ts">import { Icon } from '../icon';
1
+ <script lang="ts">import { Icon, IconSlot } from '../icon';
2
+ import { Popover } from '../popover';
3
+ import NavMenuItem from './cmp.nav-menu-item.svelte';
4
+ import NavRailItem from './nav-rail-item.svelte';
5
5
  import { NavRailLocalization } from './nav-rail-localization';
6
6
  import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
7
7
  import IconChevronUp from '@fluentui/svg-icons/icons/chevron_up_20_regular.svg?raw';
8
- const { brand, children, footerToggles, 'aria-label': ariaLabel } = $props();
8
+ import IconMoreHorizontal from '@fluentui/svg-icons/icons/more_horizontal_20_regular.svg?raw';
9
+ const { brand, items, trailingItems, maxVisibleItems, showLabels = true, footerToggles, 'aria-label': ariaLabel } = $props();
9
10
  const localization = new NavRailLocalization();
10
11
  const SCROLL_STEP = 120;
12
+ const overflowItems = $derived(maxVisibleItems !== undefined && items.length > maxVisibleItems ? items.slice(maxVisibleItems) : []);
13
+ const visibleItems = $derived(overflowItems.length > 0 ? items.slice(0, maxVisibleItems) : items);
14
+ const moreItem = $derived({
15
+ id: 'more',
16
+ label: localization.more,
17
+ icon: IconMoreHorizontal,
18
+ active: overflowItems.some((item) => item.active)
19
+ });
20
+ let moreMenuOpened = $state(false);
11
21
  let listNode = $state(null);
12
22
  let canScrollUp = $state(false);
13
23
  let canScrollDown = $state(false);
@@ -18,11 +28,23 @@ const updateScrollState = (node) => {
18
28
  };
19
29
  const listMounted = (node) => {
20
30
  listNode = node;
21
- const observer = new ResizeObserver(() => updateScrollState(node));
22
- observer.observe(node);
31
+ const resizeObserver = new ResizeObserver(() => updateScrollState(node));
32
+ const observeListAndTiles = () => {
33
+ resizeObserver.disconnect();
34
+ resizeObserver.observe(node);
35
+ for (const child of node.children) {
36
+ resizeObserver.observe(child);
37
+ }
38
+ };
39
+ const mutationObserver = new MutationObserver(observeListAndTiles);
40
+ mutationObserver.observe(node, { childList: true });
41
+ observeListAndTiles();
23
42
  updateScrollState(node);
24
43
  return {
25
- destroy: () => observer.disconnect()
44
+ destroy: () => {
45
+ mutationObserver.disconnect();
46
+ resizeObserver.disconnect();
47
+ }
26
48
  };
27
49
  };
28
50
  const scrollUp = () => {
@@ -33,7 +55,7 @@ const scrollDown = () => {
33
55
  };
34
56
  </script>
35
57
 
36
- <div class="nav-rail" role="navigation" aria-label={ariaLabel}>
58
+ <div class="nav-rail" class:nav-rail--icons-only={!showLabels} role="navigation" aria-label={ariaLabel}>
37
59
  {#if brand}
38
60
  <div class="nav-rail__brand">
39
61
  {@render brand()}
@@ -52,7 +74,35 @@ const scrollDown = () => {
52
74
  class:nav-rail__list--mask-both={canScrollUp && canScrollDown}
53
75
  use:listMounted
54
76
  onscroll={(e) => updateScrollState(e.currentTarget)}>
55
- {@render children()}
77
+ {#each visibleItems as item (item.id)}
78
+ <NavRailItem item={item} showLabel={showLabels} />
79
+ {/each}
80
+ {#if overflowItems.length > 0}
81
+ <Popover
82
+ position="right-start"
83
+ on={{ opened: () => (moreMenuOpened = true), closed: () => (moreMenuOpened = false) }}
84
+ trigger={{ custom: moreTrigger }}>
85
+ <div class="nav-rail__more-menu">
86
+ {#each overflowItems as item (item.id)}
87
+ <NavMenuItem
88
+ label={item.label}
89
+ icon={item.icon}
90
+ href={item.href}
91
+ active={item.active}
92
+ disabled={item.disabled}
93
+ target={item.target}
94
+ rel={item.rel}
95
+ on={item.on} />
96
+ {/each}
97
+ </div>
98
+ </Popover>
99
+ {/if}
100
+ {#if trailingItems && trailingItems.length > 0}
101
+ <div class="nav-rail__divider" role="separator"></div>
102
+ {#each trailingItems as item (item.id)}
103
+ <NavRailItem item={item} showLabel={showLabels} />
104
+ {/each}
105
+ {/if}
56
106
  </div>
57
107
  {#if canScrollDown}
58
108
  <button type="button" class="nav-rail__scroll-btn nav-rail__scroll-btn--down" tabindex="-1" onclick={scrollDown} aria-label={localization.scrollDown}>
@@ -64,40 +114,48 @@ const scrollDown = () => {
64
114
  <div class="nav-rail__footer">
65
115
  {#each footerToggles as toggle, i (i)}
66
116
  <button type="button" class="nav-rail__footer-btn" onclick={toggle.callback} aria-label={toggle.aria}>
67
- <Icon src={toggle.icon} />
117
+ <IconSlot icon={toggle.icon} />
68
118
  </button>
69
119
  {/each}
70
120
  </div>
71
121
  {/if}
72
122
  </div>
73
123
 
124
+ {#snippet moreTrigger()}
125
+ <NavRailItem item={moreItem} showLabel={showLabels} expanded={moreMenuOpened} />
126
+ {/snippet}
127
+
74
128
  <!--
75
129
  @component
76
- NavRail — first-level icon-and-label navigation column for app shells. 70px wide by default;
77
- brand / body / footer slots. Scroll buttons and edge-fade masks appear automatically when the
78
- body overflows. Pass `footerToggles` to render a stack of icon-only buttons at the bottom (e.g. an
79
- expand toggle). Compose with `NavRailItem` for each tile. Consumer owns active-state, routing, and
80
- feature gating — the rail is purely presentational.
130
+ NavRail — first-level icon-and-label navigation column for app shells, with scroll buttons and edge fades when its tiles overflow.
131
+ Purely presentational: the consumer owns active state, routing and feature gating.
81
132
 
82
133
  ### CSS Custom Properties
83
134
  | Property | Description | Default |
84
135
  |---|---|---|
85
136
  | `--sc-kit--nav-rail--width` | Rail width | `70px` |
86
- | `--sc-kit--nav-rail--item-gap` | Vertical gap between tiles | `26px` |
137
+ | `--sc-kit--nav-rail--item-gap` | Vertical gap between tiles | `26px`; `12px` with `showLabels={false}` |
87
138
  | `--sc-kit--nav-rail--background` | Rail background | `--sc-kit--color--bg--panel` |
88
- | `--sc-kit--nav-rail--border-color` | Right border color | `--sc-kit--color--border` |
89
- | `--sc-kit--nav-rail--item-width` | Tile width (read by `NavRailItem`) | `58px` |
90
- | `--sc-kit--nav-rail--item-icon-size` | Tile icon size (read by `NavRailItem`) | `24px` |
91
- | `--sc-kit--nav-rail--item-label-size` | Tile label font size (read by `NavRailItem`) | `10px` |
139
+ | `--sc-kit--nav-rail--divider-color` | Divider before `trailingItems` | `--sc-kit--color--border` |
140
+ | `--sc-kit--nav-rail--item-width` | Tile width | `58px` |
141
+ | `--sc-kit--nav-rail--item-icon-size` | Tile icon size (box + glyph) | `24px` |
142
+ | `--sc-kit--nav-rail--item-label-size` | Tile label font size | `10px` |
143
+ | `--sc-kit--nav-rail--item-radius` | Tile radius | `--sc-kit--radius--sm` |
144
+ | `--sc-kit--nav-rail--item-color` | Idle tile text/icon color | `--sc-kit--color--text--secondary` |
145
+ | `--sc-kit--nav-rail--item-color--active` | Active tile text/icon color | `--sc-kit--color--text--primary` |
146
+ | `--sc-kit--nav-rail--item-color--error` | Error tile text/icon color | `--sc-kit--color--danger` |
147
+ | `--sc-kit--nav-rail--item-background--active` | Active tile background | `--sc-kit--color--bg--menu-active` |
148
+ | `--sc-kit--nav-rail--item-background--hover` | Hover tile background (non-active tiles) | `transparent` |
92
149
  | `--sc-kit--nav-rail--footer-btn--color` | Footer toggle idle color | `--sc-kit--color--text--secondary` |
93
150
  | `--sc-kit--nav-rail--footer-btn--color--hover` | Footer toggle hover color | `--sc-kit--color--text--primary` |
94
151
  | `--sc-kit--nav-rail--footer-btn--background--hover` | Footer toggle hover background | `--sc-kit--color--bg--menu-active` |
95
152
  -->
96
153
  <style>.nav-rail {
154
+ --_nav-rail--item-gap-default: 1.625rem;
97
155
  --_nav-rail--width: var(--sc-kit--nav-rail--width, 4.375rem);
98
- --_nav-rail--item-gap: var(--sc-kit--nav-rail--item-gap, 1.625rem);
156
+ --_nav-rail--item-gap: var(--sc-kit--nav-rail--item-gap, var(--_nav-rail--item-gap-default));
99
157
  --_nav-rail--background: var(--sc-kit--nav-rail--background, var(--sc-kit--color--bg--panel));
100
- --_nav-rail--border-color: var(--sc-kit--nav-rail--border-color, var(--sc-kit--color--border));
158
+ --_nav-rail--divider-color: var(--sc-kit--nav-rail--divider-color, var(--sc-kit--color--border));
101
159
  display: flex;
102
160
  flex-direction: column;
103
161
  align-items: stretch;
@@ -105,9 +163,11 @@ feature gating — the rail is purely presentational.
105
163
  flex-shrink: 0;
106
164
  height: 100%;
107
165
  background: var(--_nav-rail--background);
108
- border-right: 1px solid var(--_nav-rail--border-color);
109
166
  padding: 0.25rem 0.25rem 0;
110
167
  }
168
+ .nav-rail--icons-only {
169
+ --_nav-rail--item-gap-default: 0.75rem;
170
+ }
111
171
 
112
172
  .nav-rail__brand {
113
173
  display: flex;
@@ -129,6 +189,7 @@ feature gating — the rail is purely presentational.
129
189
 
130
190
  .nav-rail__list {
131
191
  --_mask-size: 2.5rem;
192
+ --sc-kit--popover--width: max-content;
132
193
  display: flex;
133
194
  flex-direction: column;
134
195
  align-items: center;
@@ -151,6 +212,20 @@ feature gating — the rail is purely presentational.
151
212
  mask-image: linear-gradient(to bottom, transparent 0%, black var(--_mask-size), black calc(100% - var(--_mask-size)), transparent 100%);
152
213
  }
153
214
 
215
+ .nav-rail__more-menu {
216
+ display: flex;
217
+ flex-direction: column;
218
+ min-width: 12.5rem;
219
+ padding: var(--sc-kit--space--1);
220
+ }
221
+
222
+ .nav-rail__divider {
223
+ flex-shrink: 0;
224
+ width: 2rem;
225
+ height: 1px;
226
+ background: var(--_nav-rail--divider-color);
227
+ }
228
+
154
229
  .nav-rail__scroll-btn {
155
230
  position: absolute;
156
231
  left: 0;
@@ -1,38 +1,41 @@
1
- export type NavRailFooterToggle = {
2
- /** Raw SVG source string (e.g. a fluent-icon `?raw` import). */
3
- icon: string;
4
- /** Accessible label for the icon-only button. */
5
- aria: string;
6
- callback: () => void;
7
- };
1
+ import type { NavRailFooterToggle, NavRailItemData } from './types';
8
2
  import type { Snippet } from 'svelte';
9
3
  type Props = {
10
4
  /** Optional brand block at the top (logo / home link). */
11
5
  brand?: Snippet;
12
- /** Rail body — typically a stack of `NavRailItem`s. */
13
- children: Snippet;
6
+ /** Rail tiles, in display order. */
7
+ items: NavRailItemData[];
8
+ /** Tiles after a divider that follows `items` and the "More" tile. Never counted by `maxVisibleItems` and never moved into "More". */
9
+ trailingItems?: NavRailItemData[];
10
+ /** Number of `items` shown as tiles; the rest move into a trailing "More" tile that opens them in a menu. All tiles show when not set. */
11
+ maxVisibleItems?: number;
12
+ /** Show the label under each tile icon. Without it a tile is icon-only, shorter, and shows its label in a tooltip; the "More" menu keeps its labels. @default true */
13
+ showLabels?: boolean;
14
14
  /** Icon-only toggle buttons stacked at the bottom of the rail (e.g. expand panel, account). */
15
15
  footerToggles?: NavRailFooterToggle[];
16
16
  /** Accessible name of the navigation landmark — needed when the page has more than one navigation. */
17
17
  'aria-label'?: string;
18
18
  };
19
19
  /**
20
- * NavRail — first-level icon-and-label navigation column for app shells. 70px wide by default;
21
- * brand / body / footer slots. Scroll buttons and edge-fade masks appear automatically when the
22
- * body overflows. Pass `footerToggles` to render a stack of icon-only buttons at the bottom (e.g. an
23
- * expand toggle). Compose with `NavRailItem` for each tile. Consumer owns active-state, routing, and
24
- * feature gating — the rail is purely presentational.
20
+ * NavRail — first-level icon-and-label navigation column for app shells, with scroll buttons and edge fades when its tiles overflow.
21
+ * Purely presentational: the consumer owns active state, routing and feature gating.
25
22
  *
26
23
  * ### CSS Custom Properties
27
24
  * | Property | Description | Default |
28
25
  * |---|---|---|
29
26
  * | `--sc-kit--nav-rail--width` | Rail width | `70px` |
30
- * | `--sc-kit--nav-rail--item-gap` | Vertical gap between tiles | `26px` |
27
+ * | `--sc-kit--nav-rail--item-gap` | Vertical gap between tiles | `26px`; `12px` with `showLabels={false}` |
31
28
  * | `--sc-kit--nav-rail--background` | Rail background | `--sc-kit--color--bg--panel` |
32
- * | `--sc-kit--nav-rail--border-color` | Right border color | `--sc-kit--color--border` |
33
- * | `--sc-kit--nav-rail--item-width` | Tile width (read by `NavRailItem`) | `58px` |
34
- * | `--sc-kit--nav-rail--item-icon-size` | Tile icon size (read by `NavRailItem`) | `24px` |
35
- * | `--sc-kit--nav-rail--item-label-size` | Tile label font size (read by `NavRailItem`) | `10px` |
29
+ * | `--sc-kit--nav-rail--divider-color` | Divider before `trailingItems` | `--sc-kit--color--border` |
30
+ * | `--sc-kit--nav-rail--item-width` | Tile width | `58px` |
31
+ * | `--sc-kit--nav-rail--item-icon-size` | Tile icon size (box + glyph) | `24px` |
32
+ * | `--sc-kit--nav-rail--item-label-size` | Tile label font size | `10px` |
33
+ * | `--sc-kit--nav-rail--item-radius` | Tile radius | `--sc-kit--radius--sm` |
34
+ * | `--sc-kit--nav-rail--item-color` | Idle tile text/icon color | `--sc-kit--color--text--secondary` |
35
+ * | `--sc-kit--nav-rail--item-color--active` | Active tile text/icon color | `--sc-kit--color--text--primary` |
36
+ * | `--sc-kit--nav-rail--item-color--error` | Error tile text/icon color | `--sc-kit--color--danger` |
37
+ * | `--sc-kit--nav-rail--item-background--active` | Active tile background | `--sc-kit--color--bg--menu-active` |
38
+ * | `--sc-kit--nav-rail--item-background--hover` | Hover tile background (non-active tiles) | `transparent` |
36
39
  * | `--sc-kit--nav-rail--footer-btn--color` | Footer toggle idle color | `--sc-kit--color--text--secondary` |
37
40
  * | `--sc-kit--nav-rail--footer-btn--color--hover` | Footer toggle hover color | `--sc-kit--color--text--primary` |
38
41
  * | `--sc-kit--nav-rail--footer-btn--background--hover` | Footer toggle hover background | `--sc-kit--color--bg--menu-active` |
@@ -4,5 +4,5 @@ export { default as NavMenuDivider } from './cmp.nav-menu-divider.svelte';
4
4
  export { default as NavMenuGroup } from './cmp.nav-menu-group.svelte';
5
5
  export { default as NavMenuHeader } from './cmp.nav-menu-header.svelte';
6
6
  export { default as NavMenuItem } from './cmp.nav-menu-item.svelte';
7
- export { default as NavRail, type NavRailFooterToggle } from './cmp.nav-rail.svelte';
8
- export { default as NavRailItem } from './cmp.nav-rail-item.svelte';
7
+ export { default as NavRail } from './cmp.nav-rail.svelte';
8
+ export type { NavRailFooterToggle, NavRailItemData } from './types';
@@ -5,4 +5,3 @@ export { default as NavMenuGroup } from './cmp.nav-menu-group.svelte';
5
5
  export { default as NavMenuHeader } from './cmp.nav-menu-header.svelte';
6
6
  export { default as NavMenuItem } from './cmp.nav-menu-item.svelte';
7
7
  export { default as NavRail } from './cmp.nav-rail.svelte';
8
- export { default as NavRailItem } from './cmp.nav-rail-item.svelte';
@@ -1,70 +1,62 @@
1
1
  <script lang="ts">import { IconSlot } from '../icon';
2
+ import { Tooltip } from '../tooltip';
2
3
  import { NavRailItemLocalization } from './nav-rail-item-localization';
3
- const { label, icon, href, active = false, error = false, disabled = false, target, rel, on } = $props();
4
+ const { item, showLabel, expanded } = $props();
4
5
  const localization = new NavRailItemLocalization();
5
6
  const handleClick = (event) => {
6
- if (disabled) {
7
+ if (item.disabled) {
7
8
  return;
8
9
  }
9
- on?.click?.(event);
10
+ item.on?.click?.(event);
10
11
  };
11
12
  </script>
12
13
 
13
- {#snippet tile()}
14
- <span class="nav-rail-item__icon" aria-hidden="true"><IconSlot icon={icon} /></span>
15
- <span class="nav-rail-item__label">{label}</span>
16
- {#if error}
14
+ {#snippet content()}
15
+ <span class="nav-rail-item__icon" aria-hidden="true"><IconSlot icon={item.icon} /></span>
16
+ <span class="nav-rail-item__label" class:nav-rail-item__label--hidden={!showLabel}>{item.label}</span>
17
+ {#if item.error}
17
18
  <span class="nav-rail-item__error-text">{localization.hasError}</span>
18
19
  {/if}
19
20
  {/snippet}
20
21
 
21
- {#if href && !disabled}
22
- <a
23
- class="nav-rail-item"
24
- class:nav-rail-item--active={active}
25
- class:nav-rail-item--error={error}
26
- href={href}
27
- target={target}
28
- rel={rel}
29
- aria-current={active ? 'page' : undefined}
30
- onclick={handleClick}>
31
- {@render tile()}
32
- </a>
22
+ {#snippet tile()}
23
+ {#if item.href && !item.disabled}
24
+ <a
25
+ class="nav-rail-item"
26
+ class:nav-rail-item--active={item.active}
27
+ class:nav-rail-item--error={item.error}
28
+ href={item.href}
29
+ target={item.target}
30
+ rel={item.rel}
31
+ aria-current={item.active ? 'page' : undefined}
32
+ onclick={handleClick}>
33
+ {@render content()}
34
+ </a>
35
+ {:else}
36
+ <button
37
+ type="button"
38
+ class="nav-rail-item"
39
+ class:nav-rail-item--active={item.active}
40
+ class:nav-rail-item--error={item.error}
41
+ class:nav-rail-item--disabled={item.disabled}
42
+ disabled={item.disabled}
43
+ aria-current={item.active && expanded === undefined ? 'page' : undefined}
44
+ aria-haspopup={expanded === undefined ? undefined : 'dialog'}
45
+ aria-expanded={expanded}
46
+ onclick={handleClick}>
47
+ {@render content()}
48
+ </button>
49
+ {/if}
50
+ {/snippet}
51
+
52
+ {#if showLabel || expanded !== undefined}
53
+ {@render tile()}
33
54
  {:else}
34
- <button
35
- type="button"
36
- class="nav-rail-item"
37
- class:nav-rail-item--active={active}
38
- class:nav-rail-item--error={error}
39
- class:nav-rail-item--disabled={disabled}
40
- disabled={disabled}
41
- aria-current={active ? 'page' : undefined}
42
- onclick={handleClick}>
55
+ <Tooltip text={item.label} placement="right">
43
56
  {@render tile()}
44
- </button>
57
+ </Tooltip>
45
58
  {/if}
46
59
 
47
- <!--
48
- @component
49
- NavRailItem — one icon-and-label tile inside a `NavRail`. Renders as `<a>` when `href` is set and
50
- enabled, `<button>` otherwise; `on.click` fires in both forms with the `MouseEvent` and the link
51
- default is left intact. Active state is consumer-controlled (`active` prop). The icon accepts an SVG
52
- source string or a snippet. Tile dimensions are controlled via the `--sc-kit--nav-rail--item-*`
53
- CSS variables (settable on the parent rail or any ancestor).
54
-
55
- ### CSS Custom Properties
56
- | Property | Description | Default |
57
- |---|---|---|
58
- | `--sc-kit--nav-rail--item-width` | Tile width | `58px` |
59
- | `--sc-kit--nav-rail--item-icon-size` | Icon size (box + glyph) | `24px` |
60
- | `--sc-kit--nav-rail--item-label-size` | Label font size | `10px` |
61
- | `--sc-kit--nav-rail--item-radius` | Tile radius | `--sc-kit--radius--sm` |
62
- | `--sc-kit--nav-rail--item-color` | Idle text/icon color | `--sc-kit--color--text--secondary` |
63
- | `--sc-kit--nav-rail--item-color--active` | Active text/icon color | `--sc-kit--color--text--primary` |
64
- | `--sc-kit--nav-rail--item-color--error` | Error text/icon color | `--sc-kit--color--danger` |
65
- | `--sc-kit--nav-rail--item-background--active` | Active tile background | `--sc-kit--color--bg--menu-active` |
66
- | `--sc-kit--nav-rail--item-background--hover` | Hover tile background (non-active tiles) | `transparent` |
67
- -->
68
60
  <style>.nav-rail-item {
69
61
  --_nav-rail--item-width: var(--sc-kit--nav-rail--item-width, 3.625rem);
70
62
  --_nav-rail--item-icon-size: var(--sc-kit--nav-rail--item-icon-size, 1.5rem);
@@ -75,6 +67,7 @@ CSS variables (settable on the parent rail or any ancestor).
75
67
  --_nav-rail--item-color-error: var(--sc-kit--nav-rail--item-color--error, var(--sc-kit--color--danger));
76
68
  --_nav-rail--item-background-active: var(--sc-kit--nav-rail--item-background--active, var(--sc-kit--color--bg--menu-active));
77
69
  --_nav-rail--item-background-hover: var(--sc-kit--nav-rail--item-background--hover, transparent);
70
+ position: relative;
78
71
  display: flex;
79
72
  flex-direction: column;
80
73
  align-items: center;
@@ -128,6 +121,17 @@ CSS variables (settable on the parent rail or any ancestor).
128
121
  line-height: var(--sc-kit--leading--tight);
129
122
  white-space: nowrap;
130
123
  }
124
+ .nav-rail-item__label--hidden {
125
+ position: absolute;
126
+ width: 1px;
127
+ height: 1px;
128
+ margin: -1px;
129
+ padding: 0;
130
+ overflow: hidden;
131
+ clip-path: inset(50%);
132
+ white-space: nowrap;
133
+ border: 0;
134
+ }
131
135
 
132
136
  .nav-rail-item__error-text {
133
137
  position: absolute;
@@ -0,0 +1,10 @@
1
+ import type { NavRailItemData } from './types';
2
+ type Props = {
3
+ item: NavRailItemData;
4
+ showLabel: boolean;
5
+ /** Set on a tile that opens a popover: announces the popup and its open state. Such a tile gets no label tooltip — it would cover the popover. */
6
+ expanded?: boolean;
7
+ };
8
+ declare const NavRailItem: import("svelte").Component<Props, {}, "">;
9
+ type NavRailItem = ReturnType<typeof NavRailItem>;
10
+ export default NavRailItem;
@@ -1,4 +1,5 @@
1
1
  export declare class NavRailLocalization {
2
2
  get scrollUp(): string;
3
3
  get scrollDown(): string;
4
+ get more(): string;
4
5
  }
@@ -7,6 +7,10 @@ const loc = {
7
7
  scrollDown: {
8
8
  en: 'Scroll down',
9
9
  no: 'Rull ned'
10
+ },
11
+ more: {
12
+ en: 'More',
13
+ no: 'Mer'
10
14
  }
11
15
  };
12
16
  export class NavRailLocalization {
@@ -16,4 +20,7 @@ export class NavRailLocalization {
16
20
  get scrollDown() {
17
21
  return loc.scrollDown[AppLocale.current];
18
22
  }
23
+ get more() {
24
+ return loc.more[AppLocale.current];
25
+ }
19
26
  }
@@ -0,0 +1,29 @@
1
+ import type { IconProp } from '../icon';
2
+ export type NavRailItemData = {
3
+ /** Stable key of the tile. */
4
+ id: string;
5
+ label: string;
6
+ /** Icon — string SVG source, `{ src, color?, size? }` object, or custom snippet. */
7
+ icon: IconProp;
8
+ /** Render as `<a href>` — unless `disabled`, which falls back to the button form. `on.click` still fires; `event.preventDefault()` keeps the click from navigating. */
9
+ href?: string;
10
+ /** Highlight as the current section. Consumer-controlled. */
11
+ active?: boolean;
12
+ /** Paint the tile in the danger color to signal an error in its section; screen readers hear it as part of the label. */
13
+ error?: boolean;
14
+ disabled?: boolean;
15
+ /** Anchor target — only relevant when `href` is set. */
16
+ target?: string;
17
+ /** Anchor rel — only relevant when `href` is set. */
18
+ rel?: string;
19
+ on?: {
20
+ click?: (event: MouseEvent) => void;
21
+ };
22
+ };
23
+ export type NavRailFooterToggle = {
24
+ /** Icon — string SVG source, `{ src, color?, size? }` object, or custom snippet. */
25
+ icon: IconProp;
26
+ /** Accessible label for the icon-only button. */
27
+ aria: string;
28
+ callback: () => void;
29
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.93.7",
3
+ "version": "0.94.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,43 +0,0 @@
1
- import { type IconProp } from '../icon';
2
- type Props = {
3
- label: string;
4
- /** Icon — string SVG source, `{ src, color?, size? }` object, or custom snippet. */
5
- icon: IconProp;
6
- /** Render as `<a href>` — unless `disabled`, which falls back to the button form. `on.click` still fires; `event.preventDefault()` keeps the click from navigating. */
7
- href?: string;
8
- /** Highlight as the current section. Consumer-controlled. @default false */
9
- active?: boolean;
10
- /** Paint the tile in the danger color to signal an error in its section; screen readers hear it as part of the label. @default false */
11
- error?: boolean;
12
- disabled?: boolean;
13
- /** Anchor target — only relevant when `href` is set. */
14
- target?: string;
15
- /** Anchor rel — only relevant when `href` is set. */
16
- rel?: string;
17
- on?: {
18
- click?: (event: MouseEvent) => void;
19
- };
20
- };
21
- /**
22
- * NavRailItem — one icon-and-label tile inside a `NavRail`. Renders as `<a>` when `href` is set and
23
- * enabled, `<button>` otherwise; `on.click` fires in both forms with the `MouseEvent` and the link
24
- * default is left intact. Active state is consumer-controlled (`active` prop). The icon accepts an SVG
25
- * source string or a snippet. Tile dimensions are controlled via the `--sc-kit--nav-rail--item-*`
26
- * CSS variables (settable on the parent rail or any ancestor).
27
- *
28
- * ### CSS Custom Properties
29
- * | Property | Description | Default |
30
- * |---|---|---|
31
- * | `--sc-kit--nav-rail--item-width` | Tile width | `58px` |
32
- * | `--sc-kit--nav-rail--item-icon-size` | Icon size (box + glyph) | `24px` |
33
- * | `--sc-kit--nav-rail--item-label-size` | Label font size | `10px` |
34
- * | `--sc-kit--nav-rail--item-radius` | Tile radius | `--sc-kit--radius--sm` |
35
- * | `--sc-kit--nav-rail--item-color` | Idle text/icon color | `--sc-kit--color--text--secondary` |
36
- * | `--sc-kit--nav-rail--item-color--active` | Active text/icon color | `--sc-kit--color--text--primary` |
37
- * | `--sc-kit--nav-rail--item-color--error` | Error text/icon color | `--sc-kit--color--danger` |
38
- * | `--sc-kit--nav-rail--item-background--active` | Active tile background | `--sc-kit--color--bg--menu-active` |
39
- * | `--sc-kit--nav-rail--item-background--hover` | Hover tile background (non-active tiles) | `transparent` |
40
- */
41
- declare const Cmp: import("svelte").Component<Props, {}, "">;
42
- type Cmp = ReturnType<typeof Cmp>;
43
- export default Cmp;