@streamscloud/kit 0.97.0 → 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/ui/_internal/_top-layer.scss +9 -1
- package/dist/ui/navigation/cmp.nav-menu-header.svelte +82 -5
- package/dist/ui/navigation/cmp.nav-menu-header.svelte.d.ts +6 -1
- package/dist/ui/navigation/cmp.nav-menu-item.svelte +0 -6
- package/dist/ui/navigation/nav-menu-header-localization.d.ts +3 -0
- package/dist/ui/navigation/nav-menu-header-localization.js +12 -0
- package/dist/ui/navigation/types.d.ts +1 -1
- package/dist/ui/popover/cmp.popover.svelte +16 -2
- package/dist/ui/select/select-listbox.svelte +8 -1
- package/dist/ui/tooltip/cmp.tooltip.svelte +8 -1
- package/dist/ui/tree/cmp.tree-node-view.svelte +17 -6
- package/dist/ui/tree/cmp.tree.svelte +7 -0
- package/dist/ui/tree/cmp.tree.svelte.d.ts +7 -0
- package/package.json +1 -1
|
@@ -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:
|
|
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
|
}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
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
|
|
@@ -8,8 +21,28 @@ export {};
|
|
|
8
21
|
class:nav-menu-header--sans={fontFamily === 'sans'}
|
|
9
22
|
class:nav-menu-header--primary={tone === 'primary'}
|
|
10
23
|
class:nav-menu-header--secondary={tone === 'secondary'}
|
|
11
|
-
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}>
|
|
12
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}
|
|
13
46
|
</div>
|
|
14
47
|
|
|
15
48
|
<!--
|
|
@@ -18,7 +51,8 @@ NavMenuHeader — group label rendered above a stack of `NavMenuItem`s. Sans 500
|
|
|
18
51
|
the mono family defaults to weight 400. `tone` switches the text between primary and secondary.
|
|
19
52
|
Use one per `NavMenuGroup`. Pass `divider` to draw a bottom separator (same style as
|
|
20
53
|
`NavMenuDivider`), so the header itself groups the items below it without a standalone divider and
|
|
21
|
-
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.
|
|
22
56
|
|
|
23
57
|
### CSS Custom Properties
|
|
24
58
|
| Property | Description | Default |
|
|
@@ -27,6 +61,7 @@ wider spacing.
|
|
|
27
61
|
| `--sc-kit--nav-menu-header--font-size` | Label font size | `var(--sc-kit--font-size--xs)` |
|
|
28
62
|
| `--sc-kit--nav-menu-header--font-weight` | Label font weight | `500` / `400` (mono) |
|
|
29
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
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)));
|
|
@@ -36,7 +71,11 @@ wider spacing.
|
|
|
36
71
|
var(--_nav-menu-header--font-weight-default, var(--sc-kit--font-weight--medium))
|
|
37
72
|
);
|
|
38
73
|
--_nav-menu-header--color: var(--sc-kit--nav-menu-header--color, var(--_nav-menu-header--color-default, var(--sc-kit--color--text--secondary)));
|
|
39
|
-
|
|
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);
|
|
40
79
|
font-family: var(--_nav-menu-header--font-family), sans-serif;
|
|
41
80
|
font-size: var(--_nav-menu-header--font-size);
|
|
42
81
|
font-weight: var(--_nav-menu-header--font-weight);
|
|
@@ -57,6 +96,22 @@ wider spacing.
|
|
|
57
96
|
.nav-menu-header--secondary {
|
|
58
97
|
--_nav-menu-header--color-default: var(--sc-kit--color--text--secondary);
|
|
59
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
|
+
}
|
|
60
115
|
.nav-menu-header--divided::after {
|
|
61
116
|
content: "";
|
|
62
117
|
display: block;
|
|
@@ -64,4 +119,26 @@ wider spacing.
|
|
|
64
119
|
margin-block-start: var(--sc-kit--space--2);
|
|
65
120
|
margin-inline: calc(var(--sc-kit--space--4) - var(--sc-kit--space--5));
|
|
66
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);
|
|
67
144
|
}</style>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { KitFontFamily } from '../../fonts';
|
|
2
|
+
import type { NavMenuItemAction } from './types';
|
|
2
3
|
type Props = {
|
|
3
4
|
label: string;
|
|
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[];
|
|
4
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
9
|
/** Text tone. Overridable via `--sc-kit--nav-menu-header--color`. @default 'secondary' */
|
|
@@ -13,7 +16,8 @@ type Props = {
|
|
|
13
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 |
|
|
@@ -22,6 +26,7 @@ type Props = {
|
|
|
22
26
|
* | `--sc-kit--nav-menu-header--font-size` | Label font size | `var(--sc-kit--font-size--xs)` |
|
|
23
27
|
* | `--sc-kit--nav-menu-header--font-weight` | Label font weight | `500` / `400` (mono) |
|
|
24
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)` |
|
|
25
30
|
*/
|
|
26
31
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
27
32
|
type Cmp = ReturnType<typeof Cmp>;
|
|
@@ -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;
|
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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(--
|
|
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(--
|
|
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(--
|
|
334
|
-
background: var(--
|
|
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(--
|
|
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(--
|
|
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>;
|