@streamscloud/kit 0.96.0 → 0.97.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.
package/dist/fonts.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import '@fontsource-variable/geist/wght.css';
2
2
  import '@fontsource-variable/geist-mono/wght.css';
3
- export type KitFontFamily = 'sans' | 'mono' | 'display';
3
+ export type KitFontFamily = 'sans' | 'mono';
4
4
  /** Maps a `KitFontFamily` value to its kit CSS-var reference. */
5
5
  export declare const KIT_FONT_VARS: Record<KitFontFamily, string>;
package/dist/fonts.js CHANGED
@@ -8,6 +8,5 @@ import '@fontsource-variable/geist-mono/wght.css';
8
8
  /** Maps a `KitFontFamily` value to its kit CSS-var reference. */
9
9
  export const KIT_FONT_VARS = {
10
10
  sans: 'var(--sc-kit--font--sans)',
11
- mono: 'var(--sc-kit--font--mono)',
12
- display: 'var(--sc-kit--font--display)'
11
+ mono: 'var(--sc-kit--font--mono)'
13
12
  };
@@ -190,7 +190,6 @@
190
190
  --sc-kit--leading--relaxed: 1.65;
191
191
 
192
192
  --sc-kit--font--sans: 'Geist Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
193
- --sc-kit--font--display: var(--sc-kit--font--sans);
194
193
  --sc-kit--font--mono: 'Geist Mono Variable', ui-monospace, 'SF Mono', Menlo, monospace;
195
194
 
196
195
  // ============================================================
@@ -9,9 +9,19 @@ export {};
9
9
  <!--
10
10
  @component
11
11
  NavMenuGroup — visual grouping wrapper. Stacks a `NavMenuHeader` and `NavMenuItem`s in a flex
12
- column and adds vertical spacing between adjacent groups.
12
+ column and adds vertical spacing above every group but its container's first child.
13
+
14
+ ### CSS Custom Properties
15
+ | Property | Description | Default |
16
+ |---|---|---|
17
+ | `--sc-kit--nav-menu-group--margin-block-start` | Space above the group unless it is its container's first child; adds to the container's own gap | `var(--sc-kit--space--1)` |
13
18
  -->
14
19
  <style>.nav-menu-group {
20
+ --_nav-menu-group--margin-block-start: var(--sc-kit--nav-menu-group--margin-block-start, var(--sc-kit--space--1));
15
21
  display: flex;
16
22
  flex-direction: column;
23
+ margin-block-start: var(--_nav-menu-group--margin-block-start);
24
+ }
25
+ .nav-menu-group:first-child {
26
+ margin-block-start: 0;
17
27
  }</style>
@@ -4,7 +4,12 @@ type Props = {
4
4
  };
5
5
  /**
6
6
  * NavMenuGroup — visual grouping wrapper. Stacks a `NavMenuHeader` and `NavMenuItem`s in a flex
7
- * column and adds vertical spacing between adjacent groups.
7
+ * column and adds vertical spacing above every group but its container's first child.
8
+ *
9
+ * ### CSS Custom Properties
10
+ * | Property | Description | Default |
11
+ * |---|---|---|
12
+ * | `--sc-kit--nav-menu-group--margin-block-start` | Space above the group unless it is its container's first child; adds to the container's own gap | `var(--sc-kit--space--1)` |
8
13
  */
9
14
  declare const Cmp: import("svelte").Component<Props, {}, "">;
10
15
  type Cmp = ReturnType<typeof Cmp>;
@@ -1,4 +1,4 @@
1
- <script lang="ts">const { label, fontFamily = 'mono', tone = 'primary', divider = false } = $props();
1
+ <script lang="ts">const { label, fontFamily = 'sans', tone = 'secondary', divider = false } = $props();
2
2
  export {};
3
3
  </script>
4
4
 
@@ -6,7 +6,6 @@ export {};
6
6
  class="nav-menu-header"
7
7
  class:nav-menu-header--mono={fontFamily === 'mono'}
8
8
  class:nav-menu-header--sans={fontFamily === 'sans'}
9
- class:nav-menu-header--display={fontFamily === 'display'}
10
9
  class:nav-menu-header--primary={tone === 'primary'}
11
10
  class:nav-menu-header--secondary={tone === 'secondary'}
12
11
  class:nav-menu-header--divided={divider}>
@@ -15,8 +14,8 @@ export {};
15
14
 
16
15
  <!--
17
16
  @component
18
- NavMenuHeader — group label rendered above a stack of `NavMenuItem`s. Monospace 400 by default;
19
- non-mono families default to weight 500. `tone` switches the text between primary and secondary.
17
+ NavMenuHeader — group label rendered above a stack of `NavMenuItem`s. Sans 500 in the secondary tone by default;
18
+ the mono family defaults to weight 400. `tone` switches the text between primary and secondary.
20
19
  Use one per `NavMenuGroup`. Pass `divider` to draw a bottom separator (same style as
21
20
  `NavMenuDivider`), so the header itself groups the items below it without a standalone divider and
22
21
  wider spacing.
@@ -24,20 +23,22 @@ wider spacing.
24
23
  ### CSS Custom Properties
25
24
  | Property | Description | Default |
26
25
  |---|---|---|
27
- | `--sc-kit--nav-menu-header--font-family` | Label font family | `var(--sc-kit--font--mono)` |
28
- | `--sc-kit--nav-menu-header--font-weight` | Label font weight | `400` (mono) / `500` (other families) |
29
- | `--sc-kit--nav-menu-header--color` | Label text color | `var(--sc-kit--color--text--primary)` (tone-dependent) |
26
+ | `--sc-kit--nav-menu-header--font-family` | Label font family | `var(--sc-kit--font--sans)` |
27
+ | `--sc-kit--nav-menu-header--font-size` | Label font size | `var(--sc-kit--font-size--xs)` |
28
+ | `--sc-kit--nav-menu-header--font-weight` | Label font weight | `500` / `400` (mono) |
29
+ | `--sc-kit--nav-menu-header--color` | Label text color | `var(--sc-kit--color--text--secondary)` (tone-dependent) |
30
30
  -->
31
31
  <style>.nav-menu-header {
32
- --_nav-menu-header--font-family: var(--sc-kit--nav-menu-header--font-family, var(--_nav-menu-header--font-family-default, var(--sc-kit--font--mono)));
32
+ --_nav-menu-header--font-family: var(--sc-kit--nav-menu-header--font-family, var(--_nav-menu-header--font-family-default, var(--sc-kit--font--sans)));
33
+ --_nav-menu-header--font-size: var(--sc-kit--nav-menu-header--font-size, var(--sc-kit--font-size--xs));
33
34
  --_nav-menu-header--font-weight: var(
34
35
  --sc-kit--nav-menu-header--font-weight,
35
- var(--_nav-menu-header--font-weight-default, var(--sc-kit--font-weight--regular))
36
+ var(--_nav-menu-header--font-weight-default, var(--sc-kit--font-weight--medium))
36
37
  );
37
- --_nav-menu-header--color: var(--sc-kit--nav-menu-header--color, var(--_nav-menu-header--color-default, var(--sc-kit--color--text--primary)));
38
+ --_nav-menu-header--color: var(--sc-kit--nav-menu-header--color, var(--_nav-menu-header--color-default, var(--sc-kit--color--text--secondary)));
38
39
  padding: var(--sc-kit--space--2) var(--sc-kit--space--5);
39
40
  font-family: var(--_nav-menu-header--font-family), sans-serif;
40
- font-size: var(--sc-kit--font-size--md);
41
+ font-size: var(--_nav-menu-header--font-size);
41
42
  font-weight: var(--_nav-menu-header--font-weight);
42
43
  line-height: var(--sc-kit--leading--tight);
43
44
  color: var(--_nav-menu-header--color);
@@ -50,10 +51,6 @@ wider spacing.
50
51
  --_nav-menu-header--font-family-default: var(--sc-kit--font--sans);
51
52
  --_nav-menu-header--font-weight-default: var(--sc-kit--font-weight--medium);
52
53
  }
53
- .nav-menu-header--display {
54
- --_nav-menu-header--font-family-default: var(--sc-kit--font--display);
55
- --_nav-menu-header--font-weight-default: var(--sc-kit--font-weight--medium);
56
- }
57
54
  .nav-menu-header--primary {
58
55
  --_nav-menu-header--color-default: var(--sc-kit--color--text--primary);
59
56
  }
@@ -1,16 +1,16 @@
1
1
  import type { KitFontFamily } from '../../fonts';
2
2
  type Props = {
3
3
  label: string;
4
- /** Label font family; each family carries its own default weight (mono → 400, others → 500). Overridable via `--sc-kit--nav-menu-header--font-family`. @default 'mono' */
4
+ /** Label font family; each family carries its own default weight (sans → 500, mono → 400). Overridable via `--sc-kit--nav-menu-header--font-family`. @default 'sans' */
5
5
  fontFamily?: KitFontFamily;
6
- /** Text tone. Overridable via `--sc-kit--nav-menu-header--color`. @default 'primary' */
6
+ /** Text tone. Overridable via `--sc-kit--nav-menu-header--color`. @default 'secondary' */
7
7
  tone?: 'primary' | 'secondary';
8
8
  /** Draw a bottom separator (same style as `NavMenuDivider`) under the label. @default false */
9
9
  divider?: boolean;
10
10
  };
11
11
  /**
12
- * NavMenuHeader — group label rendered above a stack of `NavMenuItem`s. Monospace 400 by default;
13
- * non-mono families default to weight 500. `tone` switches the text between primary and secondary.
12
+ * NavMenuHeader — group label rendered above a stack of `NavMenuItem`s. Sans 500 in the secondary tone by default;
13
+ * the mono family defaults to weight 400. `tone` switches the text between primary and secondary.
14
14
  * Use one per `NavMenuGroup`. Pass `divider` to draw a bottom separator (same style as
15
15
  * `NavMenuDivider`), so the header itself groups the items below it without a standalone divider and
16
16
  * wider spacing.
@@ -18,9 +18,10 @@ type Props = {
18
18
  * ### CSS Custom Properties
19
19
  * | Property | Description | Default |
20
20
  * |---|---|---|
21
- * | `--sc-kit--nav-menu-header--font-family` | Label font family | `var(--sc-kit--font--mono)` |
22
- * | `--sc-kit--nav-menu-header--font-weight` | Label font weight | `400` (mono) / `500` (other families) |
23
- * | `--sc-kit--nav-menu-header--color` | Label text color | `var(--sc-kit--color--text--primary)` (tone-dependent) |
21
+ * | `--sc-kit--nav-menu-header--font-family` | Label font family | `var(--sc-kit--font--sans)` |
22
+ * | `--sc-kit--nav-menu-header--font-size` | Label font size | `var(--sc-kit--font-size--xs)` |
23
+ * | `--sc-kit--nav-menu-header--font-weight` | Label font weight | `500` / `400` (mono) |
24
+ * | `--sc-kit--nav-menu-header--color` | Label text color | `var(--sc-kit--color--text--secondary)` (tone-dependent) |
24
25
  */
25
26
  declare const Cmp: import("svelte").Component<Props, {}, "">;
26
27
  type Cmp = ReturnType<typeof Cmp>;
@@ -99,7 +99,7 @@ signal and hover keeps working on the active row; `'filled'` plates it and suppr
99
99
  ### CSS Custom Properties
100
100
  | Property | Description | Default |
101
101
  |---|---|---|
102
- | `--sc-kit--nav-menu-item--gap` | Gap between icon and label | `18px` |
102
+ | `--sc-kit--nav-menu-item--gap` | Gap between icon and label | `var(--sc-kit--space--3)` |
103
103
  | `--sc-kit--nav-menu-item--icon-size` | Icon size (box + glyph) | `18px` |
104
104
  | `--sc-kit--nav-menu-item--radius` | Row radius | `--sc-kit--radius--sm` |
105
105
  | `--sc-kit--nav-menu-item--color` | Idle text/icon color | `--sc-kit--color--text--secondary` |
@@ -112,7 +112,7 @@ signal and hover keeps working on the active row; `'filled'` plates it and suppr
112
112
  | `--sc-kit--nav-menu-item--badge--color` | Badge text color | `--sc-kit--color--text--on-accent` |
113
113
  -->
114
114
  <style>.nav-menu-item {
115
- --_nav-menu-item--gap: var(--sc-kit--nav-menu-item--gap, 1.125rem);
115
+ --_nav-menu-item--gap: var(--sc-kit--nav-menu-item--gap, var(--sc-kit--space--3));
116
116
  --_nav-menu-item--icon-size: var(--sc-kit--nav-menu-item--icon-size, 1.125rem);
117
117
  --_nav-menu-item--radius: var(--sc-kit--nav-menu-item--radius, var(--sc-kit--radius--sm));
118
118
  --_nav-menu-item--color: var(--sc-kit--nav-menu-item--color, var(--sc-kit--color--text--secondary));
@@ -36,7 +36,7 @@ type Props = {
36
36
  * ### CSS Custom Properties
37
37
  * | Property | Description | Default |
38
38
  * |---|---|---|
39
- * | `--sc-kit--nav-menu-item--gap` | Gap between icon and label | `18px` |
39
+ * | `--sc-kit--nav-menu-item--gap` | Gap between icon and label | `var(--sc-kit--space--3)` |
40
40
  * | `--sc-kit--nav-menu-item--icon-size` | Icon size (box + glyph) | `18px` |
41
41
  * | `--sc-kit--nav-menu-item--radius` | Row radius | `--sc-kit--radius--sm` |
42
42
  * | `--sc-kit--nav-menu-item--color` | Idle text/icon color | `--sc-kit--color--text--secondary` |
@@ -33,6 +33,7 @@ routing, or feature gating. Compose with `NavMenuGroup`, `NavMenuHeader`, `NavMe
33
33
  | `--sc-kit--nav-menu--border-color` | Right (panel) border color | `--sc-kit--color--border` |
34
34
  | `--sc-kit--nav-menu--header--border-color` | Header bottom-border color | `transparent` |
35
35
  | `--sc-kit--nav-menu--footer--border-color` | Footer top-border color | `--sc-kit--color--border` |
36
+ | `--sc-kit--nav-menu--body--padding-block-start` | Space above the body content | `20px` |
36
37
  -->
37
38
  <style>.nav-menu {
38
39
  --_nav-menu--width: var(--sc-kit--nav-menu--width, 15rem);
@@ -40,6 +41,7 @@ routing, or feature gating. Compose with `NavMenuGroup`, `NavMenuHeader`, `NavMe
40
41
  --_nav-menu--border-color: var(--sc-kit--nav-menu--border-color, var(--sc-kit--color--border));
41
42
  --_nav-menu--header-border-color: var(--sc-kit--nav-menu--header--border-color, transparent);
42
43
  --_nav-menu--footer-border-color: var(--sc-kit--nav-menu--footer--border-color, var(--sc-kit--color--border));
44
+ --_nav-menu--body-padding-block-start: var(--sc-kit--nav-menu--body--padding-block-start, 1.25rem);
43
45
  display: flex;
44
46
  flex-direction: column;
45
47
  width: var(--_nav-menu--width);
@@ -63,6 +65,7 @@ routing, or feature gating. Compose with `NavMenuGroup`, `NavMenuHeader`, `NavMe
63
65
  gap: var(--sc-kit--space--3);
64
66
  overflow-y: auto;
65
67
  padding: var(--sc-kit--space--2);
68
+ padding-block-start: var(--_nav-menu--body-padding-block-start);
66
69
  --_cross-browser-scrollbar--thumb-color: transparent;
67
70
  --_cross-browser-scrollbar--track-color: transparent;
68
71
  }
@@ -21,6 +21,7 @@ type Props = {
21
21
  * | `--sc-kit--nav-menu--border-color` | Right (panel) border color | `--sc-kit--color--border` |
22
22
  * | `--sc-kit--nav-menu--header--border-color` | Header bottom-border color | `transparent` |
23
23
  * | `--sc-kit--nav-menu--footer--border-color` | Footer top-border color | `--sc-kit--color--border` |
24
+ * | `--sc-kit--nav-menu--body--padding-block-start` | Space above the body content | `20px` |
24
25
  */
25
26
  declare const Cmp: import("svelte").Component<Props, {}, "">;
26
27
  type Cmp = ReturnType<typeof Cmp>;
@@ -6,7 +6,7 @@ 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
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
+ const { brand, items, trailingItems, maxVisibleItems, showLabels = true, edgeShadow = false, footerToggles, 'aria-label': ariaLabel } = $props();
10
10
  const localization = new NavRailLocalization();
11
11
  const SCROLL_STEP = 120;
12
12
  const overflowItems = $derived(maxVisibleItems !== undefined && items.length > maxVisibleItems ? items.slice(maxVisibleItems) : []);
@@ -55,7 +55,7 @@ const scrollDown = () => {
55
55
  };
56
56
  </script>
57
57
 
58
- <div class="nav-rail" class:nav-rail--icons-only={!showLabels} role="navigation" aria-label={ariaLabel}>
58
+ <div class="nav-rail" class:nav-rail--icons-only={!showLabels} class:nav-rail--edge-shadow={edgeShadow} role="navigation" aria-label={ariaLabel}>
59
59
  {#if brand}
60
60
  <div class="nav-rail__brand">
61
61
  {@render brand()}
@@ -139,6 +139,7 @@ Purely presentational: the consumer owns active state, routing and feature gatin
139
139
  | `--sc-kit--nav-rail--item-gap` | Vertical gap between tiles | `26px`; `--sc-kit--space--4` with `showLabels={false}` |
140
140
  | `--sc-kit--nav-rail--background` | Rail background | `--sc-kit--color--bg--panel` |
141
141
  | `--sc-kit--nav-rail--divider-color` | Divider before `trailingItems` | `--sc-kit--color--border` |
142
+ | `--sc-kit--nav-rail--edge-shadow` | Right-edge shadow with `edgeShadow` | `inset -6px 0 20px -10px light-dark(rgb(0 0 0 / 8%), rgb(0 0 0 / 40%))` |
142
143
  | `--sc-kit--nav-rail--brand--padding-block-start` | Space above the `brand` block | `24px` |
143
144
  | `--sc-kit--nav-rail--brand--padding-block-end` | Space below the `brand` block | `24px` |
144
145
  | `--sc-kit--nav-rail--scroll-area--padding-block-start` | Space above the first tile | `8px` |
@@ -164,6 +165,7 @@ Purely presentational: the consumer owns active state, routing and feature gatin
164
165
  --_nav-rail--brand-padding-block-start: var(--sc-kit--nav-rail--brand--padding-block-start, 1.5rem);
165
166
  --_nav-rail--brand-padding-block-end: var(--sc-kit--nav-rail--brand--padding-block-end, 1.5rem);
166
167
  --_nav-rail--scroll-area-padding-block-start: var(--sc-kit--nav-rail--scroll-area--padding-block-start, 0.5rem);
168
+ --_nav-rail--edge-shadow: var(--sc-kit--nav-rail--edge-shadow, inset -6px 0 20px -10px light-dark(rgb(0 0 0 / 8%), rgb(0 0 0 / 40%)));
167
169
  display: flex;
168
170
  flex-direction: column;
169
171
  align-items: stretch;
@@ -176,6 +178,9 @@ Purely presentational: the consumer owns active state, routing and feature gatin
176
178
  .nav-rail--icons-only {
177
179
  --_nav-rail--item-gap-default: var(--sc-kit--space--4);
178
180
  }
181
+ .nav-rail--edge-shadow {
182
+ box-shadow: var(--_nav-rail--edge-shadow);
183
+ }
179
184
 
180
185
  .nav-rail__brand {
181
186
  display: flex;
@@ -11,6 +11,8 @@ type Props = {
11
11
  maxVisibleItems?: number;
12
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
13
  showLabels?: boolean;
14
+ /** Inset shadow along the rail's right edge, as if cast by the panel next to it. */
15
+ edgeShadow?: boolean;
14
16
  /** Icon-only toggle buttons stacked at the bottom of the rail (e.g. expand panel, account). */
15
17
  footerToggles?: NavRailFooterToggle[];
16
18
  /** Accessible name of the navigation landmark — needed when the page has more than one navigation. */
@@ -27,6 +29,7 @@ type Props = {
27
29
  * | `--sc-kit--nav-rail--item-gap` | Vertical gap between tiles | `26px`; `--sc-kit--space--4` with `showLabels={false}` |
28
30
  * | `--sc-kit--nav-rail--background` | Rail background | `--sc-kit--color--bg--panel` |
29
31
  * | `--sc-kit--nav-rail--divider-color` | Divider before `trailingItems` | `--sc-kit--color--border` |
32
+ * | `--sc-kit--nav-rail--edge-shadow` | Right-edge shadow with `edgeShadow` | `inset -6px 0 20px -10px light-dark(rgb(0 0 0 / 8%), rgb(0 0 0 / 40%))` |
30
33
  * | `--sc-kit--nav-rail--brand--padding-block-start` | Space above the `brand` block | `24px` |
31
34
  * | `--sc-kit--nav-rail--brand--padding-block-end` | Space below the `brand` block | `24px` |
32
35
  * | `--sc-kit--nav-rail--scroll-area--padding-block-start` | Space above the first tile | `8px` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.96.0",
3
+ "version": "0.97.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",