@streamscloud/kit 0.46.0 → 0.48.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/styles/_semantic.scss +9 -3
- package/dist/ui/button/cmp.button.svelte +7 -2
- package/dist/ui/chip-group/cmp.chip-group.svelte +5 -2
- package/dist/ui/date-picker/cmp.date-picker.svelte +5 -1
- package/dist/ui/document-tabs/cmp.document-tabs.svelte +245 -0
- package/dist/ui/document-tabs/cmp.document-tabs.svelte.d.ts +80 -0
- package/dist/ui/document-tabs/document-tab.svelte +212 -0
- package/dist/ui/document-tabs/document-tab.svelte.d.ts +34 -0
- package/dist/ui/document-tabs/document-tabs-localization.d.ts +6 -0
- package/dist/ui/document-tabs/document-tabs-localization.js +33 -0
- package/dist/ui/document-tabs/index.d.ts +3 -0
- package/dist/ui/document-tabs/index.js +2 -0
- package/dist/ui/document-tabs/types.d.ts +20 -0
- package/dist/ui/document-tabs/types.js +1 -0
- package/dist/ui/emoji-picker/cmp.emoji-panel.svelte +1 -1
- package/dist/ui/grid-card/fields/cmp.grid-card-select-field.svelte +1 -0
- package/dist/ui/handle-input/cmp.handle-input.svelte +0 -1
- package/dist/ui/icon/cmp.icon.svelte +2 -2
- package/dist/ui/icon/cmp.icon.svelte.d.ts +3 -3
- package/dist/ui/icon-picker/cmp.icon-picker.svelte +1 -1
- package/dist/ui/icon-text/cmp.icon-text.svelte +4 -0
- package/dist/ui/icon-text/cmp.icon-text.svelte.d.ts +2 -2
- package/dist/ui/input/cmp.input.svelte +5 -1
- package/dist/ui/numeral-input/cmp.numeral-input.svelte +5 -1
- package/dist/ui/option-pill/cmp.option-pill.svelte +1 -1
- package/dist/ui/page-layout/cmp.page-panel-sidebars.svelte +29 -3
- package/dist/ui/page-layout/cmp.page-panel-sidebars.svelte.d.ts +8 -0
- package/dist/ui/page-layout/cmp.page-panel.svelte +66 -42
- package/dist/ui/page-toolbar/cmp.toolbar-icon-button.svelte +1 -1
- package/dist/ui/page-toolbar/cmp.toolbar-option.svelte +4 -1
- package/dist/ui/page-toolbar/cmp.toolbar-sort-select.svelte.d.ts +1 -1
- package/dist/ui/page-toolbar/cmp.toolbar-value-stepper.svelte +4 -0
- package/dist/ui/page-toolbar/cmp.toolbar-view-controls.svelte.d.ts +1 -1
- package/dist/ui/segmented-control/cmp.segmented-control.svelte +5 -2
- package/dist/ui/select/_select-trigger.scss +5 -1
- package/dist/ui/select/cmp.input-suggest.svelte +5 -1
- package/dist/ui/select/cmp.singleselect-async.svelte +5 -1
- package/dist/ui/select/multiselect-base.svelte +5 -1
- package/dist/ui/slider/cmp.slider.svelte +1 -0
- package/dist/ui/tabs/cmp.tabs.svelte +6 -14
- package/dist/ui/tabs/cmp.tabs.svelte.d.ts +5 -11
- package/dist/ui/tabs/tab.svelte +18 -76
- package/dist/ui/tabs/tab.svelte.d.ts +0 -1
- package/dist/ui/tabs/types.d.ts +1 -1
- package/dist/ui/url-input/cmp.url-input.svelte +0 -1
- package/dist/ui/website-input/cmp.website-input.svelte +0 -1
- package/package.json +5 -1
- package/dist/ui/tabs/tabs-localization.d.ts +0 -3
- package/dist/ui/tabs/tabs-localization.js +0 -12
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
<script lang="ts" generics="T">import { IconSlot } from '../icon';
|
|
2
|
+
import { DocumentTabsLocalization } from './document-tabs-localization';
|
|
3
|
+
import IconDismiss from '@fluentui/svg-icons/icons/dismiss_20_regular.svg?raw';
|
|
4
|
+
const { tab, active, closable, on } = $props();
|
|
5
|
+
const localization = new DocumentTabsLocalization();
|
|
6
|
+
const ariaLabel = $derived(tab.dirty ? `${tab.label} — ${localization.unsavedChanges}` : undefined);
|
|
7
|
+
const handleClick = () => {
|
|
8
|
+
if (tab.disabled || active) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
on?.select?.(tab.value);
|
|
12
|
+
};
|
|
13
|
+
const handleClose = () => {
|
|
14
|
+
on?.close?.(tab.value);
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div
|
|
19
|
+
class="document-tab"
|
|
20
|
+
class:document-tab--active={active}
|
|
21
|
+
class:document-tab--disabled={tab.disabled}
|
|
22
|
+
class:document-tab--hoverable={!active && !tab.disabled}
|
|
23
|
+
class:document-tab--dirty={tab.dirty}
|
|
24
|
+
class:document-tab--closable={closable}
|
|
25
|
+
class:document-tab--tone-gray={tab.tone === 'gray'}
|
|
26
|
+
class:document-tab--tone-blue={tab.tone === 'blue'}
|
|
27
|
+
class:document-tab--tone-green={tab.tone === 'green'}
|
|
28
|
+
class:document-tab--tone-red={tab.tone === 'red'}
|
|
29
|
+
class:document-tab--tone-orange={tab.tone === 'orange'}
|
|
30
|
+
class:document-tab--tone-teal={tab.tone === 'teal'}
|
|
31
|
+
role="presentation">
|
|
32
|
+
<button
|
|
33
|
+
type="button"
|
|
34
|
+
class="document-tab__button"
|
|
35
|
+
role="tab"
|
|
36
|
+
aria-selected={active}
|
|
37
|
+
aria-label={ariaLabel}
|
|
38
|
+
tabindex={active ? 0 : -1}
|
|
39
|
+
disabled={tab.disabled}
|
|
40
|
+
title={tab.tooltip}
|
|
41
|
+
onclick={handleClick}
|
|
42
|
+
onkeydown={on?.keydown}>
|
|
43
|
+
{#if tab.icon}
|
|
44
|
+
<span class="document-tab__icon"><IconSlot icon={tab.icon} fallbacks={{ size: 'control-sm' }} /></span>
|
|
45
|
+
{/if}
|
|
46
|
+
<span class="document-tab__label">{tab.label}</span>
|
|
47
|
+
</button>
|
|
48
|
+
{#if tab.dirty || closable}
|
|
49
|
+
<span class="document-tab__trailing">
|
|
50
|
+
<span class="document-tab__dot" class:document-tab__dot--hidden={!tab.dirty}></span>
|
|
51
|
+
{#if closable}
|
|
52
|
+
<button type="button" class="document-tab__close" tabindex={active ? 0 : -1} aria-label={localization.close} onclick={handleClose}>
|
|
53
|
+
<IconSlot icon={IconDismiss} fallbacks={{ size: 'sm' }} />
|
|
54
|
+
</button>
|
|
55
|
+
{/if}
|
|
56
|
+
</span>
|
|
57
|
+
{/if}
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<style>.document-tab {
|
|
61
|
+
--_document-tab--height: var(--sc-kit--document-tabs--height, 1.8125rem);
|
|
62
|
+
--_document-tab--padding-inline: var(--sc-kit--document-tabs--padding-inline, 0.625rem);
|
|
63
|
+
--_document-tab--min-width: var(--sc-kit--document-tabs--min-width, 7rem);
|
|
64
|
+
--_document-tab--max-width: var(--sc-kit--document-tabs--max-width, 12.5rem);
|
|
65
|
+
--_document-tab--gap: var(--sc-kit--document-tabs--tab--gap, 0.5rem);
|
|
66
|
+
--_document-tab--radius: var(--sc-kit--document-tabs--radius, var(--sc-kit--radius--sm));
|
|
67
|
+
--_document-tab--border-width: var(--sc-kit--document-tabs--border-width, 1px);
|
|
68
|
+
--_document-tab--border-color: var(--sc-kit--document-tabs--border-color, var(--sc-kit--color--border));
|
|
69
|
+
--_document-tab--baseline-overlap: var(--sc-kit--document-tabs--baseline-overlap, 1px);
|
|
70
|
+
--_document-tab--background: var(--_document-tab--tone-background, var(--sc-kit--document-tabs--background, var(--sc-kit--color--bg--app)));
|
|
71
|
+
--_document-tab--background-hover: var(
|
|
72
|
+
--_document-tab--tone-background-hover,
|
|
73
|
+
var(--sc-kit--document-tabs--background--hover, var(--sc-kit--color--bg--hover))
|
|
74
|
+
);
|
|
75
|
+
--_document-tab--color: var(--sc-kit--document-tabs--color, var(--sc-kit--color--text--secondary));
|
|
76
|
+
--_document-tab--font-size: var(--sc-kit--document-tabs--font-size, var(--sc-kit--font-size--sm));
|
|
77
|
+
--_document-tab--font-weight: var(--sc-kit--document-tabs--font-weight, var(--sc-kit--font-weight--regular));
|
|
78
|
+
--_document-tab--cursor: pointer;
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: var(--_document-tab--gap);
|
|
82
|
+
block-size: var(--_document-tab--height);
|
|
83
|
+
min-inline-size: var(--_document-tab--min-width);
|
|
84
|
+
max-inline-size: var(--_document-tab--max-width);
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
padding-inline: var(--_document-tab--padding-inline);
|
|
87
|
+
padding-block-start: 1px;
|
|
88
|
+
margin-block-end: var(--_document-tab--baseline-overlap);
|
|
89
|
+
background: var(--_document-tab--background);
|
|
90
|
+
border: var(--_document-tab--border-width) solid var(--_document-tab--border-color);
|
|
91
|
+
border-block-end: 0;
|
|
92
|
+
border-start-start-radius: var(--_document-tab--radius);
|
|
93
|
+
border-start-end-radius: var(--_document-tab--radius);
|
|
94
|
+
color: var(--_document-tab--color);
|
|
95
|
+
transition: color var(--sc-kit--duration--base) var(--sc-kit--ease--default), background-color var(--sc-kit--duration--base) var(--sc-kit--ease--default);
|
|
96
|
+
}
|
|
97
|
+
.document-tab--tone-gray {
|
|
98
|
+
--_document-tab--tone-background: var(--sc-kit--tone--gray--bg);
|
|
99
|
+
--_document-tab--tone-background-hover: color-mix(in srgb, var(--sc-kit--tone--gray--fg) 10%, var(--sc-kit--tone--gray--bg));
|
|
100
|
+
}
|
|
101
|
+
.document-tab--tone-blue {
|
|
102
|
+
--_document-tab--tone-background: var(--sc-kit--tone--blue--bg);
|
|
103
|
+
--_document-tab--tone-background-hover: color-mix(in srgb, var(--sc-kit--tone--blue--fg) 10%, var(--sc-kit--tone--blue--bg));
|
|
104
|
+
}
|
|
105
|
+
.document-tab--tone-green {
|
|
106
|
+
--_document-tab--tone-background: var(--sc-kit--tone--green--bg);
|
|
107
|
+
--_document-tab--tone-background-hover: color-mix(in srgb, var(--sc-kit--tone--green--fg) 10%, var(--sc-kit--tone--green--bg));
|
|
108
|
+
}
|
|
109
|
+
.document-tab--tone-red {
|
|
110
|
+
--_document-tab--tone-background: var(--sc-kit--tone--red--bg);
|
|
111
|
+
--_document-tab--tone-background-hover: color-mix(in srgb, var(--sc-kit--tone--red--fg) 10%, var(--sc-kit--tone--red--bg));
|
|
112
|
+
}
|
|
113
|
+
.document-tab--tone-orange {
|
|
114
|
+
--_document-tab--tone-background: var(--sc-kit--tone--orange--bg);
|
|
115
|
+
--_document-tab--tone-background-hover: color-mix(in srgb, var(--sc-kit--tone--orange--fg) 10%, var(--sc-kit--tone--orange--bg));
|
|
116
|
+
}
|
|
117
|
+
.document-tab--tone-teal {
|
|
118
|
+
--_document-tab--tone-background: var(--sc-kit--tone--teal--bg);
|
|
119
|
+
--_document-tab--tone-background-hover: color-mix(in srgb, var(--sc-kit--tone--teal--fg) 10%, var(--sc-kit--tone--teal--bg));
|
|
120
|
+
}
|
|
121
|
+
.document-tab--active {
|
|
122
|
+
--_document-tab--height: var(--sc-kit--document-tabs--height--active, 2rem);
|
|
123
|
+
--_document-tab--background: var(--_document-tab--tone-background, var(--sc-kit--document-tabs--background--active, var(--sc-kit--color--bg--panel)));
|
|
124
|
+
--_document-tab--color: var(--sc-kit--document-tabs--color--active, var(--sc-kit--color--text--primary));
|
|
125
|
+
margin-block-end: 0;
|
|
126
|
+
padding-block-start: 0;
|
|
127
|
+
}
|
|
128
|
+
.document-tab--hoverable:hover {
|
|
129
|
+
--_document-tab--background: var(--_document-tab--background-hover);
|
|
130
|
+
--_document-tab--color: var(--sc-kit--document-tabs--color--hover, var(--sc-kit--color--text--primary));
|
|
131
|
+
}
|
|
132
|
+
.document-tab--disabled {
|
|
133
|
+
--_document-tab--color: var(--sc-kit--document-tabs--color--disabled, var(--sc-kit--color--text--muted));
|
|
134
|
+
--_document-tab--cursor: default;
|
|
135
|
+
}
|
|
136
|
+
.document-tab--closable:hover, .document-tab--closable:focus-within {
|
|
137
|
+
--_document-tab--dot-visibility: hidden;
|
|
138
|
+
--_document-tab--close-display: inline-flex;
|
|
139
|
+
}
|
|
140
|
+
.document-tab__button {
|
|
141
|
+
display: inline-flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
gap: var(--_document-tab--gap);
|
|
144
|
+
flex: 1;
|
|
145
|
+
min-inline-size: 0;
|
|
146
|
+
block-size: 100%;
|
|
147
|
+
padding: 0;
|
|
148
|
+
background: none;
|
|
149
|
+
border: none;
|
|
150
|
+
color: inherit;
|
|
151
|
+
font-family: inherit;
|
|
152
|
+
font-size: var(--_document-tab--font-size);
|
|
153
|
+
font-weight: var(--_document-tab--font-weight);
|
|
154
|
+
line-height: var(--sc-kit--line-height--control--sm);
|
|
155
|
+
cursor: var(--_document-tab--cursor);
|
|
156
|
+
}
|
|
157
|
+
.document-tab__button:focus-visible {
|
|
158
|
+
outline: 2px solid var(--sc-kit--color--border--focus);
|
|
159
|
+
outline-offset: -2px;
|
|
160
|
+
}
|
|
161
|
+
.document-tab__icon {
|
|
162
|
+
display: inline-flex;
|
|
163
|
+
flex-shrink: 0;
|
|
164
|
+
}
|
|
165
|
+
.document-tab__label {
|
|
166
|
+
text-overflow: ellipsis;
|
|
167
|
+
max-width: 100%;
|
|
168
|
+
white-space: nowrap;
|
|
169
|
+
overflow: hidden;
|
|
170
|
+
}
|
|
171
|
+
.document-tab__trailing {
|
|
172
|
+
position: relative;
|
|
173
|
+
display: inline-flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
flex-shrink: 0;
|
|
177
|
+
inline-size: 1.125rem;
|
|
178
|
+
block-size: 1.125rem;
|
|
179
|
+
}
|
|
180
|
+
.document-tab__dot {
|
|
181
|
+
display: inline-flex;
|
|
182
|
+
visibility: var(--_document-tab--dot-visibility, visible);
|
|
183
|
+
inline-size: 0.375rem;
|
|
184
|
+
block-size: 0.375rem;
|
|
185
|
+
background: currentcolor;
|
|
186
|
+
border-radius: 50%;
|
|
187
|
+
}
|
|
188
|
+
.document-tab__dot--hidden {
|
|
189
|
+
visibility: hidden;
|
|
190
|
+
}
|
|
191
|
+
.document-tab__close {
|
|
192
|
+
display: var(--_document-tab--close-display, none);
|
|
193
|
+
position: absolute;
|
|
194
|
+
inset: 0;
|
|
195
|
+
align-items: center;
|
|
196
|
+
justify-content: center;
|
|
197
|
+
padding: 1px;
|
|
198
|
+
background: none;
|
|
199
|
+
border: none;
|
|
200
|
+
border-radius: var(--sc-kit--radius--sm);
|
|
201
|
+
color: var(--sc-kit--color--text--secondary);
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
transition: color var(--sc-kit--duration--base) var(--sc-kit--ease--default), background-color var(--sc-kit--duration--base) var(--sc-kit--ease--default);
|
|
204
|
+
}
|
|
205
|
+
.document-tab__close:hover {
|
|
206
|
+
background: var(--sc-kit--color--bg--hover);
|
|
207
|
+
color: var(--sc-kit--color--text--primary);
|
|
208
|
+
}
|
|
209
|
+
.document-tab__close:focus-visible {
|
|
210
|
+
outline: 2px solid var(--sc-kit--color--border--focus);
|
|
211
|
+
outline-offset: 1px;
|
|
212
|
+
}</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { DocumentTab } from './types';
|
|
2
|
+
declare function $$render<T>(): {
|
|
3
|
+
props: {
|
|
4
|
+
tab: DocumentTab<T>;
|
|
5
|
+
active: boolean;
|
|
6
|
+
closable: boolean;
|
|
7
|
+
on?: {
|
|
8
|
+
select?: (value: T) => void;
|
|
9
|
+
close?: (value: T) => void;
|
|
10
|
+
keydown?: (event: KeyboardEvent) => void;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
exports: {};
|
|
14
|
+
bindings: "";
|
|
15
|
+
slots: {};
|
|
16
|
+
events: {};
|
|
17
|
+
};
|
|
18
|
+
declare class __sveltets_Render<T> {
|
|
19
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
20
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
21
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
22
|
+
bindings(): "";
|
|
23
|
+
exports(): {};
|
|
24
|
+
}
|
|
25
|
+
interface $$IsomorphicComponent {
|
|
26
|
+
new <T>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
27
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
28
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
29
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
30
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
31
|
+
}
|
|
32
|
+
declare const DocumentTab: $$IsomorphicComponent;
|
|
33
|
+
type DocumentTab<T> = InstanceType<typeof DocumentTab<T>>;
|
|
34
|
+
export default DocumentTab;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AppLocale } from '../../core/locale';
|
|
2
|
+
const loc = {
|
|
3
|
+
close: {
|
|
4
|
+
en: 'Close tab',
|
|
5
|
+
no: 'Lukk fane'
|
|
6
|
+
},
|
|
7
|
+
unsavedChanges: {
|
|
8
|
+
en: 'unsaved changes',
|
|
9
|
+
no: 'ulagrede endringer'
|
|
10
|
+
},
|
|
11
|
+
scrollBack: {
|
|
12
|
+
en: 'Scroll back',
|
|
13
|
+
no: 'Rull tilbake'
|
|
14
|
+
},
|
|
15
|
+
scrollForward: {
|
|
16
|
+
en: 'Scroll forward',
|
|
17
|
+
no: 'Rull fremover'
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export class DocumentTabsLocalization {
|
|
21
|
+
get close() {
|
|
22
|
+
return loc.close[AppLocale.current];
|
|
23
|
+
}
|
|
24
|
+
get unsavedChanges() {
|
|
25
|
+
return loc.unsavedChanges[AppLocale.current];
|
|
26
|
+
}
|
|
27
|
+
get scrollBack() {
|
|
28
|
+
return loc.scrollBack[AppLocale.current];
|
|
29
|
+
}
|
|
30
|
+
get scrollForward() {
|
|
31
|
+
return loc.scrollForward[AppLocale.current];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IconProp } from '../icon';
|
|
2
|
+
export declare const DOCUMENT_TAB_TONES: readonly ["gray", "blue", "green", "red", "orange", "teal"];
|
|
3
|
+
export type DocumentTabTone = (typeof DOCUMENT_TAB_TONES)[number];
|
|
4
|
+
export type DocumentTabsOverflow = 'visible' | 'scroll';
|
|
5
|
+
export type DocumentTab<TValue = unknown> = {
|
|
6
|
+
value: TValue;
|
|
7
|
+
label: string;
|
|
8
|
+
/** Leading glyph — a file-type mark, typically. */
|
|
9
|
+
icon?: IconProp;
|
|
10
|
+
/** Unsaved changes: a dot in the trailing slot, which the close button takes over on hover. */
|
|
11
|
+
dirty?: boolean;
|
|
12
|
+
/** Set `false` to keep one tab open while its neighbours stay closable. @default true (whenever `on.close` is provided) */
|
|
13
|
+
closable?: boolean;
|
|
14
|
+
/** Tints the tab so it reads as a different kind of thing from the documents beside it — a live preview, a diff, a terminal. */
|
|
15
|
+
tone?: DocumentTabTone;
|
|
16
|
+
/** Full text for a label that truncates — the complete file path, typically. */
|
|
17
|
+
tooltip?: string;
|
|
18
|
+
/** Non-interactive — click does nothing. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DOCUMENT_TAB_TONES = ['gray', 'blue', 'green', 'red', 'orange', 'teal'];
|
|
@@ -115,7 +115,7 @@ can be embedded directly by input components.
|
|
|
115
115
|
width: 100%;
|
|
116
116
|
height: var(--sc-kit--field--height--sm);
|
|
117
117
|
font-size: var(--sc-kit--font-size--sm);
|
|
118
|
-
line-height: var(--sc-kit--
|
|
118
|
+
line-height: var(--sc-kit--line-height--control--sm);
|
|
119
119
|
padding: 0 var(--sc-kit--field--padding-inline--md);
|
|
120
120
|
border: 1px solid var(--_emoji-panel--border-color);
|
|
121
121
|
border-radius: var(--sc-kit--radius--pill);
|
|
@@ -60,6 +60,7 @@ trigger down to the row's own typography and drops its border, so a plain row li
|
|
|
60
60
|
--_gcsf--chevron-size: var(--sc-kit--grid-card-select-field--chevron--size, 0.75rem);
|
|
61
61
|
--sc-kit--select--trigger--height: var(--_gcsf--height);
|
|
62
62
|
--sc-kit--select--trigger--font-size: var(--_gcsf--font-size);
|
|
63
|
+
--sc-kit--select--trigger--line-height: var(--_gcsf--line-height);
|
|
63
64
|
--sc-kit--select--trigger--padding-inline: 0;
|
|
64
65
|
--sc-kit--select--trigger--gap: var(--_gcsf--gap);
|
|
65
66
|
--sc-kit--select--trigger--icon--size: var(--_gcsf--chevron-size);
|
|
@@ -76,7 +76,6 @@ Plus every public CSS variable exposed by `<Input>`.
|
|
|
76
76
|
background: var(--_hi--prefix-background);
|
|
77
77
|
color: var(--_hi--prefix-color);
|
|
78
78
|
border-inline-end: 1px solid var(--_hi--prefix-border-color);
|
|
79
|
-
line-height: var(--sc-kit--leading--tight);
|
|
80
79
|
user-select: none;
|
|
81
80
|
white-space: nowrap;
|
|
82
81
|
}
|
|
@@ -60,8 +60,8 @@ Renders an inline SVG icon with configurable size, color presets, and optional s
|
|
|
60
60
|
| `icon--md` | `1.25rem` (20px) |
|
|
61
61
|
| `icon--lg` | `2rem` (32px) |
|
|
62
62
|
| `icon--xlg` | `3rem` (48px) |
|
|
63
|
-
| `icon--control-xs` | `var(--sc-kit--field--icon--size--xs)` (
|
|
64
|
-
| `icon--control-sm` | `var(--sc-kit--field--icon--size--sm)` (
|
|
63
|
+
| `icon--control-xs` | `var(--sc-kit--field--icon--size--xs)` (14px) |
|
|
64
|
+
| `icon--control-sm` | `var(--sc-kit--field--icon--size--sm)` (15px) |
|
|
65
65
|
| `icon--control-md` | `var(--sc-kit--field--icon--size--md)` (16px) |
|
|
66
66
|
| `icon--control-lg` | `var(--sc-kit--field--icon--size--lg)` (18px) |
|
|
67
67
|
| `icon--control-xl` | `var(--sc-kit--field--icon--size--xl)` (20px) |
|
|
@@ -6,7 +6,7 @@ interface Props {
|
|
|
6
6
|
color?: IconColor | null;
|
|
7
7
|
/**
|
|
8
8
|
* Size preset. Standalone visual weight `sm | md | lg | xlg` = 14 / 20 / 32 / 48 px;
|
|
9
|
-
* control-paired `control-xs | control-sm | control-md | control-lg | control-xl` =
|
|
9
|
+
* control-paired `control-xs | control-sm | control-md | control-lg | control-xl` = 14 / 15 / 16 / 18 / 20 px.
|
|
10
10
|
* Omit to fall through to the CSS cascade (default 1.25rem = 20px).
|
|
11
11
|
*/
|
|
12
12
|
size?: IconSize | null;
|
|
@@ -36,8 +36,8 @@ interface Props {
|
|
|
36
36
|
* | `icon--md` | `1.25rem` (20px) |
|
|
37
37
|
* | `icon--lg` | `2rem` (32px) |
|
|
38
38
|
* | `icon--xlg` | `3rem` (48px) |
|
|
39
|
-
* | `icon--control-xs` | `var(--sc-kit--field--icon--size--xs)` (
|
|
40
|
-
* | `icon--control-sm` | `var(--sc-kit--field--icon--size--sm)` (
|
|
39
|
+
* | `icon--control-xs` | `var(--sc-kit--field--icon--size--xs)` (14px) |
|
|
40
|
+
* | `icon--control-sm` | `var(--sc-kit--field--icon--size--sm)` (15px) |
|
|
41
41
|
* | `icon--control-md` | `var(--sc-kit--field--icon--size--md)` (16px) |
|
|
42
42
|
* | `icon--control-lg` | `var(--sc-kit--field--icon--size--lg)` (18px) |
|
|
43
43
|
* | `icon--control-xl` | `var(--sc-kit--field--icon--size--xl)` (20px) |
|
|
@@ -68,7 +68,7 @@ styling all come from Singleselect.
|
|
|
68
68
|
| `--sc-kit--icon-picker--selection--icon--size` | Leading icon size in the trigger selection | `1.125rem` |
|
|
69
69
|
-->
|
|
70
70
|
<style>.icon-picker__selection {
|
|
71
|
-
display:
|
|
71
|
+
display: flex;
|
|
72
72
|
align-items: center;
|
|
73
73
|
gap: var(--sc-kit--space--2);
|
|
74
74
|
min-width: 0;
|
|
@@ -71,16 +71,20 @@ status" dropdown-trigger patterns. Each icon prop accepts a string SVG source, a
|
|
|
71
71
|
}
|
|
72
72
|
.icon-text--sm {
|
|
73
73
|
--sc-kit--icon-text--text--font-size: var(--sc-kit--font-size--sm);
|
|
74
|
+
--_icon-text--text--line-height: var(--sc-kit--line-height--control--sm);
|
|
74
75
|
}
|
|
75
76
|
.icon-text--md {
|
|
76
77
|
--sc-kit--icon-text--text--font-size: var(--sc-kit--font-size--md);
|
|
78
|
+
--_icon-text--text--line-height: var(--sc-kit--line-height--control--md);
|
|
77
79
|
}
|
|
78
80
|
.icon-text--lg {
|
|
79
81
|
--sc-kit--icon-text--text--font-size: var(--sc-kit--font-size--lg);
|
|
82
|
+
--_icon-text--text--line-height: var(--sc-kit--line-height--control--lg);
|
|
80
83
|
}
|
|
81
84
|
.icon-text__text {
|
|
82
85
|
font-size: var(--_icon-text--text--font-size);
|
|
83
86
|
display: var(--_icon-text--text--display);
|
|
87
|
+
line-height: var(--_icon-text--text--line-height);
|
|
84
88
|
}
|
|
85
89
|
.icon-text__text--trim {
|
|
86
90
|
display: block;
|
|
@@ -11,9 +11,9 @@ type Props = {
|
|
|
11
11
|
trimText?: boolean;
|
|
12
12
|
/** Hide text, showing only the icon(s) */
|
|
13
13
|
hideText?: boolean;
|
|
14
|
-
/** Size preset matching `Button` of the same size — text/icon px: sm 12/
|
|
14
|
+
/** Size preset matching `Button` of the same size — text/icon px: sm 12/15, md 14/16, lg 16/18. Unset: text + icon follow the inherited font size (`1em`). */
|
|
15
15
|
size?: 'sm' | 'md' | 'lg';
|
|
16
|
-
/** Bump the icon(s) one step up the scale relative to `size`, text unchanged (sm
|
|
16
|
+
/** Bump the icon(s) one step up the scale relative to `size`, text unchanged (sm 15→16, md 16→18, lg 18→20). @default 'default' */
|
|
17
17
|
iconScale?: 'default' | 'large';
|
|
18
18
|
children?: Snippet;
|
|
19
19
|
};
|
|
@@ -212,6 +212,7 @@ or the clear button (see `HandleInput`'s availability pill).
|
|
|
212
212
|
--_in--border-radius: var(--sc-kit--input--border-radius, var(--_in--size-border-radius, var(--sc-kit--field--border-radius--md)));
|
|
213
213
|
--_in--underline-color: var(--sc-kit--input--underline-color, transparent);
|
|
214
214
|
--_in--font-size: var(--sc-kit--input--font-size, var(--_in--size-font-size, var(--sc-kit--font-size--md)));
|
|
215
|
+
--_in--line-height: var(--_in--size-line-height, var(--sc-kit--line-height--control--md));
|
|
215
216
|
--_in--color: var(--sc-kit--input--color, var(--sc-kit--color--text--primary));
|
|
216
217
|
--_in--placeholder-color: var(--sc-kit--input--placeholder--color, var(--sc-kit--color--text--placeholder));
|
|
217
218
|
--_in--icon-color: var(--sc-kit--input--icon--color, var(--sc-kit--color--text--muted));
|
|
@@ -236,7 +237,7 @@ or the clear button (see `HandleInput`'s availability pill).
|
|
|
236
237
|
border-radius: var(--_in--border-radius);
|
|
237
238
|
color: var(--_in--color);
|
|
238
239
|
font-size: var(--_in--font-size);
|
|
239
|
-
line-height: var(--
|
|
240
|
+
line-height: var(--_in--line-height);
|
|
240
241
|
cursor: text;
|
|
241
242
|
position: relative;
|
|
242
243
|
overflow: hidden;
|
|
@@ -256,6 +257,7 @@ or the clear button (see `HandleInput`'s availability pill).
|
|
|
256
257
|
--_in--size-height: var(--sc-kit--field--height--sm);
|
|
257
258
|
--_in--size-padding-inline: var(--sc-kit--field--padding-inline--sm);
|
|
258
259
|
--_in--size-font-size: var(--sc-kit--font-size--sm);
|
|
260
|
+
--_in--size-line-height: var(--sc-kit--line-height--control--sm);
|
|
259
261
|
--_in--size-icon-size: var(--sc-kit--field--icon--size--sm);
|
|
260
262
|
--_in--size-border-radius: var(--sc-kit--field--border-radius--sm);
|
|
261
263
|
}
|
|
@@ -263,6 +265,7 @@ or the clear button (see `HandleInput`'s availability pill).
|
|
|
263
265
|
--_in--size-height: var(--sc-kit--field--height--md);
|
|
264
266
|
--_in--size-padding-inline: var(--sc-kit--field--padding-inline--md);
|
|
265
267
|
--_in--size-font-size: var(--sc-kit--font-size--md);
|
|
268
|
+
--_in--size-line-height: var(--sc-kit--line-height--control--md);
|
|
266
269
|
--_in--size-icon-size: var(--sc-kit--field--icon--size--md);
|
|
267
270
|
--_in--size-border-radius: var(--sc-kit--field--border-radius--md);
|
|
268
271
|
}
|
|
@@ -270,6 +273,7 @@ or the clear button (see `HandleInput`'s availability pill).
|
|
|
270
273
|
--_in--size-height: var(--sc-kit--field--height--lg);
|
|
271
274
|
--_in--size-padding-inline: var(--sc-kit--field--padding-inline--lg);
|
|
272
275
|
--_in--size-font-size: var(--sc-kit--font-size--lg);
|
|
276
|
+
--_in--size-line-height: var(--sc-kit--line-height--control--lg);
|
|
273
277
|
--_in--size-icon-size: var(--sc-kit--field--icon--size--lg);
|
|
274
278
|
--_in--size-border-radius: var(--sc-kit--field--border-radius--md);
|
|
275
279
|
}
|
|
@@ -219,6 +219,7 @@ requires a non-null value. CSS API mirrors `Input` for visual-language compatibi
|
|
|
219
219
|
--_ni--border-radius: var(--sc-kit--numeral-input--border-radius, var(--_ni--size-border-radius, var(--sc-kit--field--border-radius--md)));
|
|
220
220
|
--_ni--underline-color: var(--sc-kit--numeral-input--underline-color, transparent);
|
|
221
221
|
--_ni--font-size: var(--sc-kit--numeral-input--font-size, var(--_ni--size-font-size, var(--sc-kit--font-size--md)));
|
|
222
|
+
--_ni--line-height: var(--_ni--size-line-height, var(--sc-kit--line-height--control--md));
|
|
222
223
|
--_ni--color: var(--sc-kit--numeral-input--color, var(--sc-kit--color--text--primary));
|
|
223
224
|
--_ni--placeholder-color: var(--sc-kit--numeral-input--placeholder--color, var(--sc-kit--color--text--placeholder));
|
|
224
225
|
--_ni--icon-color: var(--sc-kit--numeral-input--icon--color, var(--sc-kit--color--text--muted));
|
|
@@ -243,7 +244,7 @@ requires a non-null value. CSS API mirrors `Input` for visual-language compatibi
|
|
|
243
244
|
border-radius: var(--_ni--border-radius);
|
|
244
245
|
color: var(--_ni--color);
|
|
245
246
|
font-size: var(--_ni--font-size);
|
|
246
|
-
line-height: var(--
|
|
247
|
+
line-height: var(--_ni--line-height);
|
|
247
248
|
cursor: text;
|
|
248
249
|
box-shadow: inset 0 calc(-1 * max(2px, 0.125em)) var(--_ni--underline-color);
|
|
249
250
|
transition: background-color var(--sc-kit--duration--base) var(--sc-kit--ease--default), border-color var(--sc-kit--duration--base) var(--sc-kit--ease--default), color var(--sc-kit--duration--base) var(--sc-kit--ease--default), box-shadow var(--sc-kit--duration--base) var(--sc-kit--ease--default);
|
|
@@ -252,6 +253,7 @@ requires a non-null value. CSS API mirrors `Input` for visual-language compatibi
|
|
|
252
253
|
--_ni--size-height: var(--sc-kit--field--height--sm);
|
|
253
254
|
--_ni--size-padding-inline: var(--sc-kit--field--padding-inline--sm);
|
|
254
255
|
--_ni--size-font-size: var(--sc-kit--font-size--sm);
|
|
256
|
+
--_ni--size-line-height: var(--sc-kit--line-height--control--sm);
|
|
255
257
|
--_ni--size-icon-size: var(--sc-kit--field--icon--size--sm);
|
|
256
258
|
--_ni--size-border-radius: var(--sc-kit--field--border-radius--sm);
|
|
257
259
|
}
|
|
@@ -259,6 +261,7 @@ requires a non-null value. CSS API mirrors `Input` for visual-language compatibi
|
|
|
259
261
|
--_ni--size-height: var(--sc-kit--field--height--md);
|
|
260
262
|
--_ni--size-padding-inline: var(--sc-kit--field--padding-inline--md);
|
|
261
263
|
--_ni--size-font-size: var(--sc-kit--font-size--md);
|
|
264
|
+
--_ni--size-line-height: var(--sc-kit--line-height--control--md);
|
|
262
265
|
--_ni--size-icon-size: var(--sc-kit--field--icon--size--md);
|
|
263
266
|
--_ni--size-border-radius: var(--sc-kit--field--border-radius--md);
|
|
264
267
|
}
|
|
@@ -266,6 +269,7 @@ requires a non-null value. CSS API mirrors `Input` for visual-language compatibi
|
|
|
266
269
|
--_ni--size-height: var(--sc-kit--field--height--lg);
|
|
267
270
|
--_ni--size-padding-inline: var(--sc-kit--field--padding-inline--lg);
|
|
268
271
|
--_ni--size-font-size: var(--sc-kit--font-size--lg);
|
|
272
|
+
--_ni--size-line-height: var(--sc-kit--line-height--control--lg);
|
|
269
273
|
--_ni--size-icon-size: var(--sc-kit--field--icon--size--lg);
|
|
270
274
|
--_ni--size-border-radius: var(--sc-kit--field--border-radius--md);
|
|
271
275
|
}
|
|
@@ -95,7 +95,7 @@ or `type="multi"` with `value: T[]`. Provide `compare` for non-primitive values.
|
|
|
95
95
|
border: 1px solid var(--_op--border-color);
|
|
96
96
|
border-radius: var(--sc-kit--radius--pill);
|
|
97
97
|
font-family: inherit;
|
|
98
|
-
line-height: var(--sc-kit--
|
|
98
|
+
line-height: var(--sc-kit--line-height--control--md);
|
|
99
99
|
white-space: nowrap;
|
|
100
100
|
overflow: hidden;
|
|
101
101
|
cursor: pointer;
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
<script lang="ts">import { slideHorizontally, transitionDuration } from '../../core/transitions';
|
|
2
2
|
import PagePanel from './cmp.page-panel.svelte';
|
|
3
3
|
import { untrack } from 'svelte';
|
|
4
|
-
const { panelState, children, sidebarLeft, sidebarRight, sidebarLeftIsValid = true, sidebarRightIsValid = true, title, actionsLeft, actionsCenter, actionsRight, balanceHeaderCenter = false, toggle } = $props();
|
|
4
|
+
const { panelState, children, sidebarLeft, sidebarRight, sidebarLeftIsValid = true, sidebarRightIsValid = true, title, actionsLeft, actionsCenter, actionsRight, balanceHeaderCenter = false, alignActionsLeftToContent = false, toggle } = $props();
|
|
5
5
|
let leftPanel = $state(null);
|
|
6
6
|
let rightPanel = $state(null);
|
|
7
|
+
let sidebarLeftWidth = $state(0);
|
|
8
|
+
const sidebarLeftMounted = (node) => {
|
|
9
|
+
const measure = () => {
|
|
10
|
+
const divider = parseFloat(getComputedStyle(node).borderInlineEndWidth) || 0;
|
|
11
|
+
sidebarLeftWidth = Math.max(0, node.offsetWidth - divider);
|
|
12
|
+
};
|
|
13
|
+
const observer = new ResizeObserver(measure);
|
|
14
|
+
observer.observe(node);
|
|
15
|
+
measure();
|
|
16
|
+
return {
|
|
17
|
+
destroy: () => {
|
|
18
|
+
observer.disconnect();
|
|
19
|
+
sidebarLeftWidth = 0;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
7
23
|
$effect(() => {
|
|
8
24
|
const hasLeft = !!sidebarLeft;
|
|
9
25
|
untrack(() => {
|
|
@@ -69,10 +85,14 @@ $effect(() => {
|
|
|
69
85
|
actionsCenter={actionsCenter}
|
|
70
86
|
actionsRight={actionsRight}
|
|
71
87
|
balanceHeaderCenter={balanceHeaderCenter}
|
|
72
|
-
collapseButtons={collapseButtons}
|
|
88
|
+
collapseButtons={collapseButtons}
|
|
89
|
+
--_--page-panel--content-start="{alignActionsLeftToContent ? sidebarLeftWidth : 0}px">
|
|
73
90
|
<div class="page-panel-sidebars">
|
|
74
91
|
{#if sidebarLeft && !leftCollapsed}
|
|
75
|
-
<div
|
|
92
|
+
<div
|
|
93
|
+
class="page-panel-sidebars__sidebar page-panel-sidebars__sidebar--left"
|
|
94
|
+
use:sidebarLeftMounted
|
|
95
|
+
transition:slideHorizontally|local={{ duration: transitionDuration.slow }}>
|
|
76
96
|
{@render sidebarLeft()}
|
|
77
97
|
</div>
|
|
78
98
|
{/if}
|
|
@@ -97,6 +117,12 @@ Pass a `SidebarsToggle` instance as `toggle` to drive an external "collapse both
|
|
|
97
117
|
top-bar button) without `bind:this` or a local collapsed flag — read `toggleBoth` / `allCollapsed`
|
|
98
118
|
off that same instance.
|
|
99
119
|
|
|
120
|
+
`alignActionsLeftToContent` starts the header's scrolling left track at the content column rather
|
|
121
|
+
than right after the collapse button: whatever sits in `actionsLeft` begins exactly where the
|
|
122
|
+
content pane begins, and follows that edge as the sidebar resizes, collapses, or isn't there at all.
|
|
123
|
+
The track starts on the sidebar's divider rather than after it, so a bordered child lands on that
|
|
124
|
+
line instead of doubling it. The collapse button stays put outside that track.
|
|
125
|
+
|
|
100
126
|
### CSS Custom Properties
|
|
101
127
|
| Property | Description | Default |
|
|
102
128
|
|---|---|---|
|
|
@@ -14,6 +14,8 @@ type Props = {
|
|
|
14
14
|
actionsRight?: Snippet;
|
|
15
15
|
/** Lay the inner panel header out as a 3-column grid so `actionsCenter` is centered against the panel width. @default false */
|
|
16
16
|
balanceHeaderCenter?: boolean;
|
|
17
|
+
/** Start the header's left track at the content column instead of right after the collapse button, so `actionsLeft` begins where the content pane begins and follows the sidebar as it resizes or collapses. @default false */
|
|
18
|
+
alignActionsLeftToContent?: boolean;
|
|
17
19
|
/** Shared collapse target for an external "collapse both sidebars" control (e.g. `PageLayout`'s `editorControls.panelsToggle`). */
|
|
18
20
|
toggle?: SidebarsToggle;
|
|
19
21
|
};
|
|
@@ -26,6 +28,12 @@ type Props = {
|
|
|
26
28
|
* top-bar button) without `bind:this` or a local collapsed flag — read `toggleBoth` / `allCollapsed`
|
|
27
29
|
* off that same instance.
|
|
28
30
|
*
|
|
31
|
+
* `alignActionsLeftToContent` starts the header's scrolling left track at the content column rather
|
|
32
|
+
* than right after the collapse button: whatever sits in `actionsLeft` begins exactly where the
|
|
33
|
+
* content pane begins, and follows that edge as the sidebar resizes, collapses, or isn't there at all.
|
|
34
|
+
* The track starts on the sidebar's divider rather than after it, so a bordered child lands on that
|
|
35
|
+
* line instead of doubling it. The collapse button stays put outside that track.
|
|
36
|
+
*
|
|
29
37
|
* ### CSS Custom Properties
|
|
30
38
|
* | Property | Description | Default |
|
|
31
39
|
* |---|---|---|
|