@streamscloud/kit 0.96.1 → 0.97.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.
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
  // ============================================================
@@ -1,10 +1,18 @@
1
1
  // Include first: the UA [popover] inset / margin / border / padding / overflow / colors otherwise override the host's box.
2
+ // Text is reset too: the surface lives in the trigger's DOM and otherwise inherits its font (a NavMenuHeader made its menu medium-weight).
2
3
  @mixin reset {
3
4
  inset: 0 auto auto 0;
4
5
  margin: 0;
5
6
  padding: 0;
6
7
  border: 0;
7
8
  overflow: visible;
8
- color: inherit;
9
+ color: var(--sc-kit--color--text--primary);
9
10
  background: transparent;
11
+ font-family: var(--sc-kit--font--sans), sans-serif;
12
+ font-size: var(--sc-kit--font-size--md);
13
+ font-style: normal;
14
+ font-weight: var(--sc-kit--font-weight--regular);
15
+ line-height: var(--sc-kit--leading--normal);
16
+ letter-spacing: normal;
17
+ text-transform: none;
10
18
  }
@@ -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,43 +1,83 @@
1
- <script lang="ts">const { label, fontFamily = 'mono', tone = 'primary', divider = false } = $props();
2
- export {};
1
+ <script lang="ts">import { Icon } from '../icon';
2
+ import { IconText } from '../icon-text';
3
+ import { Popover, PopoverItem } from '../popover';
4
+ import { NavMenuHeaderLocalization } from './nav-menu-header-localization';
5
+ import IconMoreVertical from '@fluentui/svg-icons/icons/more_vertical_20_regular.svg?raw';
6
+ const { label, actions = [], fontFamily = 'sans', tone = 'secondary', divider = false } = $props();
7
+ const localization = new NavMenuHeaderLocalization();
8
+ let actionsOpened = $state(false);
9
+ const actionsShown = $derived(actions.length > 0);
10
+ const handleActionsOpened = () => {
11
+ actionsOpened = true;
12
+ };
13
+ const handleActionsClosed = () => {
14
+ actionsOpened = false;
15
+ };
3
16
  </script>
4
17
 
5
18
  <div
6
19
  class="nav-menu-header"
7
20
  class:nav-menu-header--mono={fontFamily === 'mono'}
8
21
  class:nav-menu-header--sans={fontFamily === 'sans'}
9
- class:nav-menu-header--display={fontFamily === 'display'}
10
22
  class:nav-menu-header--primary={tone === 'primary'}
11
23
  class:nav-menu-header--secondary={tone === 'secondary'}
12
- class:nav-menu-header--divided={divider}>
24
+ class:nav-menu-header--divided={divider}
25
+ class:nav-menu-header--with-actions={actionsShown}
26
+ class:nav-menu-header--actions-opened={actionsOpened}>
13
27
  {label}
28
+
29
+ {#if actionsShown}
30
+ <div class="nav-menu-header__actions">
31
+ <Popover position="bottom-end" aria-label={localization.actionsFor(label)} on={{ opened: handleActionsOpened, closed: handleActionsClosed }}>
32
+ {#snippet trigger()}
33
+ <span class="nav-menu-header__actions-trigger">
34
+ <Icon src={IconMoreVertical} />
35
+ </span>
36
+ {/snippet}
37
+
38
+ {#each actions as action (action)}
39
+ <PopoverItem on={{ click: action.action }}>
40
+ <IconText icon={action.icon} size="sm">{action.name}</IconText>
41
+ </PopoverItem>
42
+ {/each}
43
+ </Popover>
44
+ </div>
45
+ {/if}
14
46
  </div>
15
47
 
16
48
  <!--
17
49
  @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.
50
+ NavMenuHeader — group label rendered above a stack of `NavMenuItem`s. Sans 500 in the secondary tone by default;
51
+ the mono family defaults to weight 400. `tone` switches the text between primary and secondary.
20
52
  Use one per `NavMenuGroup`. Pass `divider` to draw a bottom separator (same style as
21
53
  `NavMenuDivider`), so the header itself groups the items below it without a standalone divider and
22
- wider spacing.
54
+ wider spacing. `actions` add a "⋮" menu at the end of the label line, shown the same way as `NavMenuItem` actions;
55
+ it never changes the header height.
23
56
 
24
57
  ### CSS Custom Properties
25
58
  | Property | Description | Default |
26
59
  |---|---|---|
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) |
60
+ | `--sc-kit--nav-menu-header--font-family` | Label font family | `var(--sc-kit--font--sans)` |
61
+ | `--sc-kit--nav-menu-header--font-size` | Label font size | `var(--sc-kit--font-size--xs)` |
62
+ | `--sc-kit--nav-menu-header--font-weight` | Label font weight | `500` / `400` (mono) |
63
+ | `--sc-kit--nav-menu-header--color` | Label text color | `var(--sc-kit--color--text--secondary)` (tone-dependent) |
64
+ | `--sc-kit--nav-menu-header--actions--inset` | Space between the "⋮" button and the header's end edge | `var(--sc-kit--space--2)` |
30
65
  -->
31
66
  <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)));
67
+ --_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)));
68
+ --_nav-menu-header--font-size: var(--sc-kit--nav-menu-header--font-size, var(--sc-kit--font-size--xs));
33
69
  --_nav-menu-header--font-weight: var(
34
70
  --sc-kit--nav-menu-header--font-weight,
35
- var(--_nav-menu-header--font-weight-default, var(--sc-kit--font-weight--regular))
71
+ var(--_nav-menu-header--font-weight-default, var(--sc-kit--font-weight--medium))
36
72
  );
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
- padding: var(--sc-kit--space--2) var(--sc-kit--space--5);
73
+ --_nav-menu-header--color: var(--sc-kit--nav-menu-header--color, var(--_nav-menu-header--color-default, var(--sc-kit--color--text--secondary)));
74
+ --_nav-menu-header--actions-inset: var(--sc-kit--nav-menu-header--actions--inset, var(--sc-kit--space--2));
75
+ --_nav-menu-header--actions-size: 1.5rem;
76
+ --_nav-menu-header--padding-block: var(--sc-kit--space--2);
77
+ position: relative;
78
+ padding: var(--_nav-menu-header--padding-block) var(--sc-kit--space--5);
39
79
  font-family: var(--_nav-menu-header--font-family), sans-serif;
40
- font-size: var(--sc-kit--font-size--md);
80
+ font-size: var(--_nav-menu-header--font-size);
41
81
  font-weight: var(--_nav-menu-header--font-weight);
42
82
  line-height: var(--sc-kit--leading--tight);
43
83
  color: var(--_nav-menu-header--color);
@@ -50,16 +90,28 @@ wider spacing.
50
90
  --_nav-menu-header--font-family-default: var(--sc-kit--font--sans);
51
91
  --_nav-menu-header--font-weight-default: var(--sc-kit--font-weight--medium);
52
92
  }
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
93
  .nav-menu-header--primary {
58
94
  --_nav-menu-header--color-default: var(--sc-kit--color--text--primary);
59
95
  }
60
96
  .nav-menu-header--secondary {
61
97
  --_nav-menu-header--color-default: var(--sc-kit--color--text--secondary);
62
98
  }
99
+ .nav-menu-header--with-actions {
100
+ padding-inline-end: calc(var(--_nav-menu-header--actions-size) + var(--_nav-menu-header--actions-inset) * 2);
101
+ }
102
+ @media (any-hover: hover) {
103
+ .nav-menu-header--with-actions:not(:hover, :has(:global(:focus-visible)), .nav-menu-header--actions-opened) .nav-menu-header__actions {
104
+ position: absolute;
105
+ width: 1px;
106
+ height: 1px;
107
+ margin: -1px;
108
+ padding: 0;
109
+ overflow: hidden;
110
+ clip-path: inset(50%);
111
+ white-space: nowrap;
112
+ border: 0;
113
+ }
114
+ }
63
115
  .nav-menu-header--divided::after {
64
116
  content: "";
65
117
  display: block;
@@ -67,4 +119,26 @@ wider spacing.
67
119
  margin-block-start: var(--sc-kit--space--2);
68
120
  margin-inline: calc(var(--sc-kit--space--4) - var(--sc-kit--space--5));
69
121
  background: var(--sc-kit--color--border);
122
+ }
123
+ .nav-menu-header__actions {
124
+ position: absolute;
125
+ top: calc(var(--_nav-menu-header--padding-block) + var(--_nav-menu-header--font-size) * var(--sc-kit--leading--tight) / 2);
126
+ right: var(--_nav-menu-header--actions-inset);
127
+ display: flex;
128
+ translate: 0 -50%;
129
+ }
130
+ .nav-menu-header__actions-trigger {
131
+ --sc-kit--icon--size: 1rem;
132
+ display: inline-flex;
133
+ align-items: center;
134
+ justify-content: center;
135
+ width: var(--_nav-menu-header--actions-size);
136
+ height: var(--_nav-menu-header--actions-size);
137
+ border-radius: var(--sc-kit--radius--sm);
138
+ color: var(--sc-kit--color--text--secondary);
139
+ transition: color var(--sc-kit--duration--base) var(--sc-kit--ease--default), background-color var(--sc-kit--duration--base) var(--sc-kit--ease--default);
140
+ }
141
+ .nav-menu-header__actions-trigger:hover {
142
+ background: var(--sc-kit--color--bg--active);
143
+ color: var(--sc-kit--color--text--primary);
70
144
  }</style>
@@ -1,26 +1,32 @@
1
1
  import type { KitFontFamily } from '../../fonts';
2
+ import type { NavMenuItemAction } from './types';
2
3
  type Props = {
3
4
  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' */
5
+ /** Group menu behind a "⋮" button at the end of the header, revealed on hover, keyboard focus, while open and on touch screens. */
6
+ actions?: NavMenuItemAction[];
7
+ /** 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
8
  fontFamily?: KitFontFamily;
6
- /** Text tone. Overridable via `--sc-kit--nav-menu-header--color`. @default 'primary' */
9
+ /** Text tone. Overridable via `--sc-kit--nav-menu-header--color`. @default 'secondary' */
7
10
  tone?: 'primary' | 'secondary';
8
11
  /** Draw a bottom separator (same style as `NavMenuDivider`) under the label. @default false */
9
12
  divider?: boolean;
10
13
  };
11
14
  /**
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.
15
+ * NavMenuHeader — group label rendered above a stack of `NavMenuItem`s. Sans 500 in the secondary tone by default;
16
+ * the mono family defaults to weight 400. `tone` switches the text between primary and secondary.
14
17
  * Use one per `NavMenuGroup`. Pass `divider` to draw a bottom separator (same style as
15
18
  * `NavMenuDivider`), so the header itself groups the items below it without a standalone divider and
16
- * wider spacing.
19
+ * wider spacing. `actions` add a "⋮" menu at the end of the label line, shown the same way as `NavMenuItem` actions;
20
+ * it never changes the header height.
17
21
  *
18
22
  * ### CSS Custom Properties
19
23
  * | Property | Description | Default |
20
24
  * |---|---|---|
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) |
25
+ * | `--sc-kit--nav-menu-header--font-family` | Label font family | `var(--sc-kit--font--sans)` |
26
+ * | `--sc-kit--nav-menu-header--font-size` | Label font size | `var(--sc-kit--font-size--xs)` |
27
+ * | `--sc-kit--nav-menu-header--font-weight` | Label font weight | `500` / `400` (mono) |
28
+ * | `--sc-kit--nav-menu-header--color` | Label text color | `var(--sc-kit--color--text--secondary)` (tone-dependent) |
29
+ * | `--sc-kit--nav-menu-header--actions--inset` | Space between the "⋮" button and the header's end edge | `var(--sc-kit--space--2)` |
24
30
  */
25
31
  declare const Cmp: import("svelte").Component<Props, {}, "">;
26
32
  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));
@@ -156,7 +156,6 @@ signal and hover keeps working on the active row; `'filled'` plates it and suppr
156
156
  border: 0;
157
157
  }
158
158
  }
159
-
160
159
  .nav-menu-item__control {
161
160
  display: flex;
162
161
  align-items: center;
@@ -182,7 +181,6 @@ signal and hover keeps working on the active row; `'filled'` plates it and suppr
182
181
  .nav-menu-item__control--with-actions {
183
182
  padding-right: calc(var(--_nav-menu-item--actions-size) + var(--_nav-menu-item--actions-inset) * 2);
184
183
  }
185
-
186
184
  .nav-menu-item__icon {
187
185
  --sc-kit--icon--size: var(--_nav-menu-item--icon-size);
188
186
  position: relative;
@@ -194,7 +192,6 @@ signal and hover keeps working on the active row; `'filled'` plates it and suppr
194
192
  height: var(--_nav-menu-item--icon-size);
195
193
  line-height: 0;
196
194
  }
197
-
198
195
  .nav-menu-item__badge {
199
196
  position: absolute;
200
197
  top: -0.375rem;
@@ -212,7 +209,6 @@ signal and hover keeps working on the active row; `'filled'` plates it and suppr
212
209
  font-weight: var(--sc-kit--font-weight--medium);
213
210
  line-height: var(--sc-kit--leading--tight);
214
211
  }
215
-
216
212
  .nav-menu-item__label {
217
213
  flex: 1;
218
214
  min-width: 0;
@@ -226,7 +222,6 @@ signal and hover keeps working on the active row; `'filled'` plates it and suppr
226
222
  .nav-menu-item__label--active-plain {
227
223
  font-weight: var(--_nav-menu-item--font-weight-active);
228
224
  }
229
-
230
225
  .nav-menu-item__actions {
231
226
  position: absolute;
232
227
  top: 50%;
@@ -234,7 +229,6 @@ signal and hover keeps working on the active row; `'filled'` plates it and suppr
234
229
  display: flex;
235
230
  translate: 0 -50%;
236
231
  }
237
-
238
232
  .nav-menu-item__actions-trigger {
239
233
  --sc-kit--icon--size: 1rem;
240
234
  display: inline-flex;
@@ -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` |
@@ -0,0 +1,3 @@
1
+ export declare class NavMenuHeaderLocalization {
2
+ actionsFor: (label: string) => string;
3
+ }
@@ -0,0 +1,12 @@
1
+ import { AppLocale } from '../../core/locale';
2
+ const loc = {
3
+ actionsFor: {
4
+ en: (label) => `Actions for ${label}`,
5
+ no: (label) => `Handlinger for ${label}`
6
+ }
7
+ };
8
+ export class NavMenuHeaderLocalization {
9
+ actionsFor = (label) => {
10
+ return loc.actionsFor[AppLocale.current](label);
11
+ };
12
+ }
@@ -20,7 +20,7 @@ export type NavRailItemData = {
20
20
  click?: (event: MouseEvent) => void;
21
21
  };
22
22
  };
23
- /** One entry of a `NavMenuItem` "⋮" menu. */
23
+ /** One entry of a `NavMenuItem` or `NavMenuHeader` "⋮" menu. */
24
24
  export type NavMenuItemAction = {
25
25
  name: string;
26
26
  icon?: IconProp;
@@ -318,8 +318,15 @@ Props for keeping the popover open during interaction:
318
318
  padding: 0;
319
319
  border: 0;
320
320
  overflow: visible;
321
- color: inherit;
321
+ color: var(--sc-kit--color--text--primary);
322
322
  background: transparent;
323
+ font-family: var(--sc-kit--font--sans), sans-serif;
324
+ font-size: var(--sc-kit--font-size--md);
325
+ font-style: normal;
326
+ font-weight: var(--sc-kit--font-weight--regular);
327
+ line-height: var(--sc-kit--leading--normal);
328
+ letter-spacing: normal;
329
+ text-transform: none;
323
330
  position: fixed;
324
331
  inset: 0;
325
332
  width: auto;
@@ -394,8 +401,15 @@ Props for keeping the popover open during interaction:
394
401
  padding: 0;
395
402
  border: 0;
396
403
  overflow: visible;
397
- color: inherit;
404
+ color: var(--sc-kit--color--text--primary);
398
405
  background: transparent;
406
+ font-family: var(--sc-kit--font--sans), sans-serif;
407
+ font-size: var(--sc-kit--font-size--md);
408
+ font-style: normal;
409
+ font-weight: var(--sc-kit--font-weight--regular);
410
+ line-height: var(--sc-kit--leading--normal);
411
+ letter-spacing: normal;
412
+ text-transform: none;
399
413
  position: fixed;
400
414
  width: max-content;
401
415
  min-width: var(--_dd--content-min-width);
@@ -270,8 +270,15 @@ dismiss events upward. Floating UI handles placement with autoUpdate on scroll/r
270
270
  padding: 0;
271
271
  border: 0;
272
272
  overflow: visible;
273
- color: inherit;
273
+ color: var(--sc-kit--color--text--primary);
274
274
  background: transparent;
275
+ font-family: var(--sc-kit--font--sans), sans-serif;
276
+ font-size: var(--sc-kit--font-size--md);
277
+ font-style: normal;
278
+ font-weight: var(--sc-kit--font-weight--regular);
279
+ line-height: var(--sc-kit--leading--normal);
280
+ letter-spacing: normal;
281
+ text-transform: none;
275
282
  font-size: var(--_lb--font-size);
276
283
  display: flex;
277
284
  flex-direction: column;
@@ -152,8 +152,15 @@ or plain text. Bubble flips and shifts on viewport collision; an arrow points to
152
152
  padding: 0;
153
153
  border: 0;
154
154
  overflow: visible;
155
- color: inherit;
155
+ color: var(--sc-kit--color--text--primary);
156
156
  background: transparent;
157
+ font-family: var(--sc-kit--font--sans), sans-serif;
158
+ font-size: var(--sc-kit--font-size--md);
159
+ font-style: normal;
160
+ font-weight: var(--sc-kit--font-weight--regular);
161
+ line-height: var(--sc-kit--leading--normal);
162
+ letter-spacing: normal;
163
+ text-transform: none;
157
164
  position: fixed;
158
165
  width: max-content;
159
166
  max-width: var(--_tt--max-width);
@@ -305,13 +305,20 @@ const handleActionsClosed = () => {
305
305
  <style>.tree-node {
306
306
  --_tree-node--icon-size: var(--sc-kit--tree-node--icon--size, 1.25rem);
307
307
  --_tree-node--font-size: var(--sc-kit--tree-node--font-size, var(--sc-kit--font-size--sm));
308
+ --_tree-node--line-height: var(--sc-kit--tree-node--line-height, var(--sc-kit--leading--normal));
308
309
  --_tree-node--padding-inline: var(--sc-kit--tree-node--padding-inline, 0.5rem);
309
310
  --_tree-node--padding-block: var(--sc-kit--tree-node--padding-block, 0.375rem);
310
311
  --_tree-node--indent: var(--sc-kit--tree-node--indent, 1rem);
312
+ --_tree-node--gap: var(--sc-kit--tree-node--gap, var(--sc-kit--space--2));
313
+ --_tree-node--color: var(--sc-kit--tree-node--color, var(--sc-kit--color--text--primary));
314
+ --_tree-node--color-active: var(--sc-kit--tree-node--color--active, var(--sc-kit--color--text--primary));
315
+ --_tree-node--icon-color: var(--sc-kit--tree-node--icon--color, var(--sc-kit--color--text--muted));
316
+ --_tree-node--background-active: var(--sc-kit--tree-node--background--active, var(--sc-kit--color--bg--active));
317
+ --_tree-node--background-active-hover: var(--sc-kit--tree-node--background--active-hover, var(--_tree-node--background-active));
311
318
  --_tree-node--trailing-size: 1.5rem;
312
319
  position: relative;
313
320
  width: 100%;
314
- color: var(--sc-kit--color--text--primary);
321
+ color: var(--_tree-node--color);
315
322
  }
316
323
  .tree-node__leaf {
317
324
  position: relative;
@@ -326,12 +333,15 @@ const handleActionsClosed = () => {
326
333
  transition: background-color var(--sc-kit--duration--base) var(--sc-kit--ease--default), color var(--sc-kit--duration--base) var(--sc-kit--ease--default);
327
334
  }
328
335
  .tree-node__leaf:hover {
329
- color: var(--sc-kit--color--text--primary);
336
+ color: var(--_tree-node--color-active);
330
337
  background: var(--sc-kit--color--bg--hover);
331
338
  }
332
339
  .tree-node__leaf--active {
333
- color: var(--sc-kit--color--text--primary);
334
- background: var(--sc-kit--color--bg--active);
340
+ color: var(--_tree-node--color-active);
341
+ background: var(--_tree-node--background-active);
342
+ }
343
+ .tree-node__leaf--active:hover {
344
+ background: var(--_tree-node--background-active-hover);
335
345
  }
336
346
  @media (any-hover: hover) {
337
347
  .tree-node__leaf--with-actions:not(:hover, :has(:global(:focus-visible)), :has(.node-actions--opened)) .node-actions, .tree-node__leaf--with-actions:is(:hover, :has(:global(:focus-visible)), :has(.node-actions--opened)) .tree-node__count {
@@ -389,7 +399,7 @@ const handleActionsClosed = () => {
389
399
  display: flex;
390
400
  flex: 1;
391
401
  align-items: center;
392
- gap: var(--sc-kit--space--2);
402
+ gap: var(--_tree-node--gap);
393
403
  min-width: 0;
394
404
  padding: var(--_tree-node--padding-block) 0;
395
405
  outline: none;
@@ -405,7 +415,7 @@ const handleActionsClosed = () => {
405
415
  flex-shrink: 0;
406
416
  width: var(--_tree-node--icon-size);
407
417
  height: var(--_tree-node--icon-size);
408
- color: var(--sc-kit--color--text--muted);
418
+ color: var(--_tree-node--icon-color);
409
419
  }
410
420
  .tree-node__check {
411
421
  display: flex;
@@ -417,6 +427,7 @@ const handleActionsClosed = () => {
417
427
  flex: 1;
418
428
  min-width: 0;
419
429
  font-size: var(--_tree-node--font-size);
430
+ line-height: var(--_tree-node--line-height);
420
431
  text-overflow: ellipsis;
421
432
  max-width: 100%;
422
433
  white-space: nowrap;
@@ -37,9 +37,16 @@ Home/End jump to first/last, Enter/Space select, F2 renames. In rename mode Ente
37
37
  |---|---|---|
38
38
  | `--sc-kit--tree-node--icon--size` | Node icon box | `20px` |
39
39
  | `--sc-kit--tree-node--font-size` | Node label font size | `--sc-kit--font-size--sm` |
40
+ | `--sc-kit--tree-node--line-height` | Node label line height | `--sc-kit--leading--normal` |
40
41
  | `--sc-kit--tree-node--padding-inline` | Row inline padding | `8px` |
41
42
  | `--sc-kit--tree-node--padding-block` | Row vertical padding | `6px` |
42
43
  | `--sc-kit--tree-node--indent` | Per-level indent | `16px` |
44
+ | `--sc-kit--tree-node--gap` | Gap between the node icon and its label | `--sc-kit--space--2` |
45
+ | `--sc-kit--tree-node--color` | Idle node text color | `--sc-kit--color--text--primary` |
46
+ | `--sc-kit--tree-node--color--active` | Hovered / selected node text color | `--sc-kit--color--text--primary` |
47
+ | `--sc-kit--tree-node--icon--color` | Node icon color (`currentColor` follows the text) | `--sc-kit--color--text--muted` |
48
+ | `--sc-kit--tree-node--background--active` | Selected node background | `--sc-kit--color--bg--active` |
49
+ | `--sc-kit--tree-node--background--active-hover` | Selected node background on hover | `--sc-kit--tree-node--background--active` |
43
50
  -->
44
51
  <style>.tree {
45
52
  -webkit-user-drag: none;
@@ -25,9 +25,16 @@ type Props = {
25
25
  * |---|---|---|
26
26
  * | `--sc-kit--tree-node--icon--size` | Node icon box | `20px` |
27
27
  * | `--sc-kit--tree-node--font-size` | Node label font size | `--sc-kit--font-size--sm` |
28
+ * | `--sc-kit--tree-node--line-height` | Node label line height | `--sc-kit--leading--normal` |
28
29
  * | `--sc-kit--tree-node--padding-inline` | Row inline padding | `8px` |
29
30
  * | `--sc-kit--tree-node--padding-block` | Row vertical padding | `6px` |
30
31
  * | `--sc-kit--tree-node--indent` | Per-level indent | `16px` |
32
+ * | `--sc-kit--tree-node--gap` | Gap between the node icon and its label | `--sc-kit--space--2` |
33
+ * | `--sc-kit--tree-node--color` | Idle node text color | `--sc-kit--color--text--primary` |
34
+ * | `--sc-kit--tree-node--color--active` | Hovered / selected node text color | `--sc-kit--color--text--primary` |
35
+ * | `--sc-kit--tree-node--icon--color` | Node icon color (`currentColor` follows the text) | `--sc-kit--color--text--muted` |
36
+ * | `--sc-kit--tree-node--background--active` | Selected node background | `--sc-kit--color--bg--active` |
37
+ * | `--sc-kit--tree-node--background--active-hover` | Selected node background on hover | `--sc-kit--tree-node--background--active` |
31
38
  */
32
39
  declare const Cmp: import("svelte").Component<Props, {}, "">;
33
40
  type Cmp = ReturnType<typeof Cmp>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.96.1",
3
+ "version": "0.97.1",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",