@streamscloud/kit 0.2.11 → 0.2.13
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/core/local-storage/index.d.ts +1 -0
- package/dist/core/local-storage/index.js +1 -0
- package/dist/core/local-storage/local-storage-item.d.ts +10 -0
- package/dist/core/local-storage/local-storage-item.js +27 -0
- package/dist/styles/_responsive.scss +48 -0
- package/dist/ui/button/cmp.button.svelte +2 -2
- package/dist/ui/button/cmp.button.svelte.d.ts +2 -2
- package/dist/ui/button/cmp.options-button.svelte +2 -2
- package/dist/ui/button/resources/button-base.svelte +3 -3
- package/dist/ui/button/resources/button-theme.svelte +2 -2
- package/dist/ui/dropdown/cmp.dropdown.svelte +8 -3
- package/dist/ui/icon-text/cmp.icon-text.svelte +2 -2
- package/dist/ui/icon-text/cmp.icon-text.svelte.d.ts +2 -0
- package/dist/ui/page-toolbar/cmp.reorderable-toggle-list.svelte +160 -0
- package/dist/ui/page-toolbar/cmp.reorderable-toggle-list.svelte.d.ts +20 -0
- package/dist/ui/page-toolbar/cmp.toolbar-button-item.svelte +34 -0
- package/dist/ui/page-toolbar/cmp.toolbar-button-item.svelte.d.ts +18 -0
- package/dist/ui/page-toolbar/cmp.toolbar-checkbox-item.svelte +21 -0
- package/dist/ui/page-toolbar/cmp.toolbar-checkbox-item.svelte.d.ts +12 -0
- package/dist/ui/page-toolbar/cmp.toolbar-dropdown.svelte +29 -0
- package/dist/ui/page-toolbar/cmp.toolbar-dropdown.svelte.d.ts +17 -0
- package/dist/ui/page-toolbar/cmp.toolbar-panel.svelte +58 -0
- package/dist/ui/page-toolbar/cmp.toolbar-panel.svelte.d.ts +19 -0
- package/dist/ui/page-toolbar/cmp.toolbar-search-input.svelte +49 -0
- package/dist/ui/page-toolbar/cmp.toolbar-search-input.svelte.d.ts +20 -0
- package/dist/ui/page-toolbar/cmp.toolbar-segmented-control.svelte +40 -0
- package/dist/ui/page-toolbar/cmp.toolbar-segmented-control.svelte.d.ts +39 -0
- package/dist/ui/page-toolbar/cmp.toolbar-switch-item.svelte +51 -0
- package/dist/ui/page-toolbar/cmp.toolbar-switch-item.svelte.d.ts +43 -0
- package/dist/ui/page-toolbar/cmp.toolbar-toggle-item.svelte +45 -0
- package/dist/ui/page-toolbar/cmp.toolbar-toggle-item.svelte.d.ts +19 -0
- package/dist/ui/page-toolbar/index.d.ts +10 -0
- package/dist/ui/page-toolbar/index.js +9 -0
- package/dist/ui/page-toolbar/types.d.ts +6 -0
- package/dist/ui/page-toolbar/types.js +1 -0
- package/dist/ui/player/carousel/cmp.carousel.svelte +20 -11
- package/dist/ui/player/carousel/cmp.carousel.svelte.d.ts +4 -0
- package/dist/ui/seek-bar/cmp.seek-bar.svelte +5 -3
- package/dist/ui/segmented-control/cmp.segmented-control.svelte +97 -0
- package/dist/ui/segmented-control/cmp.segmented-control.svelte.d.ts +52 -0
- package/dist/ui/segmented-control/index.d.ts +1 -0
- package/dist/ui/segmented-control/index.js +1 -0
- package/dist/ui/table/cmp.table.svelte +5 -3
- package/dist/ui/table/index.d.ts +1 -1
- package/dist/ui/table/table-cells/table-text-cell.svelte +2 -2
- package/dist/ui/table/table-columns-manager/cmp.table-columns-manager.svelte +77 -38
- package/dist/ui/table/table-columns-manager/cmp.table-columns-manager.svelte.d.ts +16 -6
- package/dist/ui/table/table-columns-manager/table-columns-manager-localization.d.ts +4 -0
- package/dist/ui/table/table-columns-manager/table-columns-manager-localization.js +19 -0
- package/dist/ui/table/table-group-actions/cmp.table-group-actions.svelte +3 -1
- package/dist/ui/table/table-group-actions/table-group-actions-localization.d.ts +3 -0
- package/dist/ui/table/table-group-actions/table-group-actions-localization.js +12 -0
- package/dist/ui/table/table-headers/table-header-sortable-localization.d.ts +7 -0
- package/dist/ui/table/table-headers/table-header-sortable-localization.js +40 -0
- package/dist/ui/table/table-headers/table-header-sortable.svelte +7 -5
- package/dist/ui/table/table-localization.d.ts +6 -0
- package/dist/ui/table/table-localization.js +33 -0
- package/dist/ui/table/table-model.svelte.d.ts +1 -0
- package/dist/ui/table/table-model.svelte.js +3 -0
- package/dist/ui/table/types.d.ts +5 -0
- package/package.json +13 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LocalStorageItem } from './local-storage-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LocalStorageItem } from './local-storage-item';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class LocalStorageItem<T, TFallback = null> {
|
|
2
|
+
readonly key: string;
|
|
3
|
+
private readonly _fallback;
|
|
4
|
+
private constructor();
|
|
5
|
+
static of: <T_1>(key: string) => LocalStorageItem<T_1>;
|
|
6
|
+
static withDefault: <T_1>(key: string, fallback: T_1) => LocalStorageItem<T_1, T_1>;
|
|
7
|
+
get(): T | TFallback;
|
|
8
|
+
remove(): void;
|
|
9
|
+
set(value: T): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class LocalStorageItem {
|
|
2
|
+
key;
|
|
3
|
+
_fallback;
|
|
4
|
+
constructor(key, fallback) {
|
|
5
|
+
this.key = key;
|
|
6
|
+
this._fallback = fallback;
|
|
7
|
+
}
|
|
8
|
+
static of = (key) => {
|
|
9
|
+
return new LocalStorageItem(key, null);
|
|
10
|
+
};
|
|
11
|
+
static withDefault = (key, fallback) => {
|
|
12
|
+
return new LocalStorageItem(key, fallback);
|
|
13
|
+
};
|
|
14
|
+
get() {
|
|
15
|
+
const stringValue = localStorage.getItem(this.key);
|
|
16
|
+
if (!stringValue) {
|
|
17
|
+
return this._fallback;
|
|
18
|
+
}
|
|
19
|
+
return JSON.parse(stringValue);
|
|
20
|
+
}
|
|
21
|
+
remove() {
|
|
22
|
+
localStorage.removeItem(this.key);
|
|
23
|
+
}
|
|
24
|
+
set(value) {
|
|
25
|
+
localStorage.setItem(this.key, JSON.stringify(value));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -68,3 +68,51 @@ $layout-breakpoints: (
|
|
|
68
68
|
@content;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
@mixin layout($breakpoint) {
|
|
73
|
+
@media screen and (max-width: map.get($layout-breakpoints, $breakpoint)) {
|
|
74
|
+
@content;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@mixin layout-mobile() {
|
|
79
|
+
@include layout(sm) {
|
|
80
|
+
@content;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@mixin layout-tablet() {
|
|
85
|
+
@include layout(md) {
|
|
86
|
+
@content;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@mixin layout-laptop() {
|
|
91
|
+
@include layout(lg) {
|
|
92
|
+
@content;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@mixin layout-narrow-desktop() {
|
|
97
|
+
@include layout(xl) {
|
|
98
|
+
@content;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@mixin layout-desktop() {
|
|
103
|
+
@include layout(xxl) {
|
|
104
|
+
@content;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@mixin layout-fhd() {
|
|
109
|
+
@include layout(fhd) {
|
|
110
|
+
@content;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@mixin layout-fhd-p() {
|
|
115
|
+
@include layout(fhd-p) {
|
|
116
|
+
@content;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -31,8 +31,8 @@ A themed button component combining `ButtonBase` (structure) and `ButtonTheme` (
|
|
|
31
31
|
| `--sc-kit--button--border` | Border shorthand | `none` |
|
|
32
32
|
| `--sc-kit--button--border--disabled` | Border when disabled | inherits `--border` |
|
|
33
33
|
| `--sc-kit--button--border-radius` | Corner rounding | `0.25em` |
|
|
34
|
-
| `--sc-kit--button--padding--
|
|
35
|
-
| `--sc-kit--button--padding--
|
|
34
|
+
| `--sc-kit--button--padding--block` | Block (vertical) padding | `0` |
|
|
35
|
+
| `--sc-kit--button--padding--inline` | Inline (horizontal) padding | `1em` |
|
|
36
36
|
| `--sc-kit--button--min-width` | Minimum width | `0` |
|
|
37
37
|
| `--sc-kit--button--width` | Explicit width | `auto` |
|
|
38
38
|
| `--sc-kit--button--height` | Button height | `2em` |
|
|
@@ -35,8 +35,8 @@ type Props = {
|
|
|
35
35
|
* | `--sc-kit--button--border` | Border shorthand | `none` |
|
|
36
36
|
* | `--sc-kit--button--border--disabled` | Border when disabled | inherits `--border` |
|
|
37
37
|
* | `--sc-kit--button--border-radius` | Corner rounding | `0.25em` |
|
|
38
|
-
* | `--sc-kit--button--padding--
|
|
39
|
-
* | `--sc-kit--button--padding--
|
|
38
|
+
* | `--sc-kit--button--padding--block` | Block (vertical) padding | `0` |
|
|
39
|
+
* | `--sc-kit--button--padding--inline` | Inline (horizontal) padding | `1em` |
|
|
40
40
|
* | `--sc-kit--button--min-width` | Minimum width | `0` |
|
|
41
41
|
* | `--sc-kit--button--width` | Explicit width | `auto` |
|
|
42
42
|
* | `--sc-kit--button--height` | Button height | `2em` |
|
|
@@ -134,7 +134,7 @@ Inherits all `--sc-kit--button--*` base and variant properties from `Button`.
|
|
|
134
134
|
--_options-button--border: var(--sc-kit--button--border, none);
|
|
135
135
|
--_options-button--border-radius: var(--sc-kit--button--border-radius, 0.25em);
|
|
136
136
|
--_options-button--box-shadow: var(--sc-kit--button--box-shadow, none);
|
|
137
|
-
--_options-button--padding--
|
|
137
|
+
--_options-button--padding--block: var(--sc-kit--button--padding--block, 0);
|
|
138
138
|
--_options-button--min-width: var(--sc-kit--button--min-width, 0);
|
|
139
139
|
--_options-button--height: var(--sc-kit--button--height, 2em);
|
|
140
140
|
--_options-button--separator--border: 1px solid var(--_options-button--font--color);
|
|
@@ -186,7 +186,7 @@ Inherits all `--sc-kit--button--*` base and variant properties from `Button`.
|
|
|
186
186
|
height: 100%;
|
|
187
187
|
font-size: var(--_options-button--text--font-size);
|
|
188
188
|
border-radius: var(--_options-button--border-radius);
|
|
189
|
-
padding: var(--_options-button--padding--
|
|
189
|
+
padding: var(--_options-button--padding--block) 0.5em;
|
|
190
190
|
color: inherit;
|
|
191
191
|
background: transparent;
|
|
192
192
|
border: none;
|
|
@@ -30,15 +30,15 @@ export {};
|
|
|
30
30
|
--_button--border: var(--sc-kit--button--border, none);
|
|
31
31
|
--_button--border--disabled: var(--sc-kit--button--border--disabled, var(--_button--border));
|
|
32
32
|
--_button--border-radius: var(--sc-kit--button--border-radius, 0.25em);
|
|
33
|
-
--_button--padding--
|
|
34
|
-
--_button--padding--
|
|
33
|
+
--_button--padding--block: var(--sc-kit--button--padding--block, 0);
|
|
34
|
+
--_button--padding--inline: var(--sc-kit--button--padding--inline, 1em);
|
|
35
35
|
--_button--min-width: var(--sc-kit--button--min-width, 0);
|
|
36
36
|
--_button--width: var(--sc-kit--button--width, auto);
|
|
37
37
|
--_button--height: var(--sc-kit--button--height, 2em);
|
|
38
38
|
--_button--box-shadow: var(--sc-kit--button--box-shadow, none);
|
|
39
39
|
font-size: var(--_button--font--size);
|
|
40
40
|
font-weight: var(--_button--font-weight);
|
|
41
|
-
padding: var(--_button--padding--
|
|
41
|
+
padding: var(--_button--padding--block) var(--_button--padding--inline);
|
|
42
42
|
color: var(--_button--font--color);
|
|
43
43
|
background: var(--_button--background);
|
|
44
44
|
box-shadow: var(--_button--box-shadow);
|
|
@@ -323,13 +323,13 @@ export {};
|
|
|
323
323
|
--sc-kit--button--height: 2.5em;
|
|
324
324
|
--sc-kit--button--text--font-size: 1.125em;
|
|
325
325
|
--sc-kit--button--icon--font-size: 1.25em;
|
|
326
|
-
--sc-kit--button--padding--
|
|
326
|
+
--sc-kit--button--padding--inline: 1.5em;
|
|
327
327
|
--sc-kit--button--border-radius: 0.375em;
|
|
328
328
|
--_button--shadow-y: 3px;
|
|
329
329
|
}
|
|
330
330
|
.button-theme--size-small {
|
|
331
331
|
--sc-kit--button--height: 1.75em;
|
|
332
332
|
--sc-kit--button--text--font-size: 0.75em;
|
|
333
|
-
--sc-kit--button--padding--
|
|
333
|
+
--sc-kit--button--padding--inline: 0.75em;
|
|
334
334
|
--_button--shadow-y: 1.5px;
|
|
335
335
|
}</style>
|
|
@@ -6,6 +6,7 @@ import { untrack } from 'svelte';
|
|
|
6
6
|
let { position = 'bottom-start', disabled = false, keepDropdownOpen = false, fixedPosition = false, offset = 4, boundaryMargin = 8, backdrop = false, isOpenRequested, matchTriggerWidth = false, panel = true, on, children, trigger } = $props();
|
|
7
7
|
let opened = $state(false);
|
|
8
8
|
let dropdownEl = $state(null);
|
|
9
|
+
let triggerEl = $state(null);
|
|
9
10
|
let actualPlacement = $state(untrack(() => position));
|
|
10
11
|
$effect(() => untrack(() => {
|
|
11
12
|
on?.mounted?.({
|
|
@@ -68,7 +69,9 @@ const handleClick = (event) => {
|
|
|
68
69
|
open();
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
71
|
-
|
|
72
|
+
const target = event.target;
|
|
73
|
+
const isTriggerClick = triggerEl?.contains(target) ?? false;
|
|
74
|
+
if (isTriggerClick || canClose(target, event.currentTarget)) {
|
|
72
75
|
close();
|
|
73
76
|
}
|
|
74
77
|
};
|
|
@@ -86,7 +89,9 @@ const canClose = (target, container) => {
|
|
|
86
89
|
return true;
|
|
87
90
|
};
|
|
88
91
|
const initPopper = (node) => {
|
|
89
|
-
|
|
92
|
+
if (!triggerEl) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
90
95
|
const popper = createPopper(triggerEl, node, {
|
|
91
96
|
placement: position,
|
|
92
97
|
strategy: fixedPosition ? 'fixed' : 'absolute',
|
|
@@ -145,7 +150,7 @@ const initPopper = (node) => {
|
|
|
145
150
|
</div>
|
|
146
151
|
{/if}
|
|
147
152
|
<div class="dropdown" class:dropdown--disabled={disabled} bind:this={dropdownEl} onclick={handleClick} onkeydown={() => ({})} role="none">
|
|
148
|
-
<button type="button" class="dropdown__trigger">
|
|
153
|
+
<button type="button" class="dropdown__trigger" bind:this={triggerEl}>
|
|
149
154
|
{#if trigger}
|
|
150
155
|
{@render trigger()}
|
|
151
156
|
{:else}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">import { Icon } from '../icon';
|
|
2
|
-
let { icon, iconColor, iconPosition = 'left', secondaryIcon, secondaryIconColor, trimText = false, children } = $props();
|
|
2
|
+
let { icon, iconColor, iconPosition = 'left', secondaryIcon, secondaryIconColor, trimText = false, hideText = false, children } = $props();
|
|
3
3
|
const iconAsSnippet = $derived(icon && typeof icon === 'function' ? icon : null);
|
|
4
4
|
const iconAsString = $derived(icon && typeof icon !== 'function' ? icon : null);
|
|
5
5
|
const secondaryIconAsSnippet = $derived(secondaryIcon && typeof secondaryIcon === 'function' ? secondaryIcon : null);
|
|
@@ -14,7 +14,7 @@ const secondaryIconAsString = $derived(secondaryIcon && typeof secondaryIcon !==
|
|
|
14
14
|
<Icon src={iconAsString} color={iconColor} />
|
|
15
15
|
{/if}
|
|
16
16
|
</span>
|
|
17
|
-
{#if children}
|
|
17
|
+
{#if children && !hideText}
|
|
18
18
|
<span class="icon-text__text" class:icon-text__text--trim={trimText}>
|
|
19
19
|
{@render children()}
|
|
20
20
|
</span>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<script lang="ts">import { Icon } from '../icon';
|
|
2
|
+
import { Toggle } from '../toggle';
|
|
3
|
+
import IconReorderDotsVertical from '@fluentui/svg-icons/icons/re_order_dots_vertical_20_regular.svg?raw';
|
|
4
|
+
import { flip } from 'svelte/animate';
|
|
5
|
+
import { dndzone } from 'svelte-dnd-action';
|
|
6
|
+
let { items, on } = $props();
|
|
7
|
+
const reorderableItems = $derived(items.filter((i) => !i.fixed));
|
|
8
|
+
const fixedItems = $derived(items.filter((i) => i.fixed));
|
|
9
|
+
let dndItems = $state.raw([]);
|
|
10
|
+
$effect(() => {
|
|
11
|
+
dndItems = reorderableItems.map(({ id, label, enabled }) => ({ id, label, enabled }));
|
|
12
|
+
});
|
|
13
|
+
const flipDurationMs = 200;
|
|
14
|
+
const emitChange = (reordered) => {
|
|
15
|
+
const merged = [
|
|
16
|
+
...fixedItems.map(({ id, label, enabled, fixed }) => ({ id, label, enabled, fixed })),
|
|
17
|
+
...reordered.map(({ id, label, enabled }) => ({ id, label, enabled }))
|
|
18
|
+
];
|
|
19
|
+
on.change(merged);
|
|
20
|
+
};
|
|
21
|
+
const handleConsider = (e) => {
|
|
22
|
+
dndItems = e.detail.items;
|
|
23
|
+
};
|
|
24
|
+
const handleFinalize = (e) => {
|
|
25
|
+
emitChange(e.detail.items);
|
|
26
|
+
};
|
|
27
|
+
const handleToggle = (id, enabled) => {
|
|
28
|
+
emitChange(dndItems.map((i) => (i.id === id ? { ...i, enabled } : i)));
|
|
29
|
+
};
|
|
30
|
+
const handleFixedToggle = (id, enabled) => {
|
|
31
|
+
const updatedFixed = fixedItems.map(({ id: fId, label, enabled: fEnabled, fixed }) => ({
|
|
32
|
+
id: fId,
|
|
33
|
+
label,
|
|
34
|
+
enabled: fId === id ? enabled : fEnabled,
|
|
35
|
+
fixed
|
|
36
|
+
}));
|
|
37
|
+
on.change([...updatedFixed, ...dndItems.map(({ id, label, enabled }) => ({ id, label, enabled }))]);
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<div class="reorderable-toggle-list">
|
|
42
|
+
{#each fixedItems as item (item.id)}
|
|
43
|
+
<div class="reorderable-toggle-list__item">
|
|
44
|
+
<div class="reorderable-toggle-list__drag-handle reorderable-toggle-list__drag-handle--hidden">
|
|
45
|
+
<Icon src={IconReorderDotsVertical} />
|
|
46
|
+
</div>
|
|
47
|
+
<div class="reorderable-toggle-list__label">
|
|
48
|
+
{item.label}
|
|
49
|
+
</div>
|
|
50
|
+
<div class="reorderable-toggle-list__toggle">
|
|
51
|
+
<Toggle
|
|
52
|
+
isOn={item.enabled}
|
|
53
|
+
on={{
|
|
54
|
+
change: (value) => handleFixedToggle(item.id, value)
|
|
55
|
+
}} />
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
{/each}
|
|
59
|
+
<div
|
|
60
|
+
class="reorderable-toggle-list__dnd"
|
|
61
|
+
use:dndzone={{
|
|
62
|
+
items: dndItems,
|
|
63
|
+
dropTargetStyle: {},
|
|
64
|
+
flipDurationMs,
|
|
65
|
+
morphDisabled: true
|
|
66
|
+
}}
|
|
67
|
+
onconsider={handleConsider}
|
|
68
|
+
onfinalize={handleFinalize}>
|
|
69
|
+
{#each dndItems as item (item.id)}
|
|
70
|
+
<div class="reorderable-toggle-list__item" animate:flip={{ duration: flipDurationMs }}>
|
|
71
|
+
<div class="reorderable-toggle-list__drag-handle">
|
|
72
|
+
<Icon src={IconReorderDotsVertical} />
|
|
73
|
+
</div>
|
|
74
|
+
<div class="reorderable-toggle-list__label">
|
|
75
|
+
{item.label}
|
|
76
|
+
</div>
|
|
77
|
+
<div class="reorderable-toggle-list__toggle">
|
|
78
|
+
<Toggle
|
|
79
|
+
isOn={item.enabled}
|
|
80
|
+
on={{
|
|
81
|
+
change: (value) => handleToggle(item.id, value)
|
|
82
|
+
}} />
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
{/each}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<!--
|
|
90
|
+
@component
|
|
91
|
+
A reorderable list of toggle items with drag-and-drop support. Fixed items appear above the reorderable zone.
|
|
92
|
+
|
|
93
|
+
### CSS Custom Properties
|
|
94
|
+
| Property | Description | Default |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| `--sc-kit--reorderable-toggle-list--label--color` | Label text color | `var(--sc-color--text-primary, light-dark(black, white))` |
|
|
97
|
+
| `--sc-kit--reorderable-toggle-list--handle--color` | Drag handle icon color | `var(--sc-color--text-secondary, light-dark(neutral-500, neutral-300))` |
|
|
98
|
+
| `--sc-kit--reorderable-toggle-list--handle--background` | Drag handle background | `var(--sc-color--bg-element, light-dark(neutral-50, dark-800))` |
|
|
99
|
+
-->
|
|
100
|
+
|
|
101
|
+
<style>.reorderable-toggle-list {
|
|
102
|
+
--_reorderable-toggle-list--label--color: var(
|
|
103
|
+
--sc-kit--reorderable-toggle-list--label--color,
|
|
104
|
+
var(--sc-color--text-primary, light-dark(#000000, #ffffff))
|
|
105
|
+
);
|
|
106
|
+
--_reorderable-toggle-list--handle--color: var(
|
|
107
|
+
--sc-kit--reorderable-toggle-list--handle--color,
|
|
108
|
+
var(--sc-color--text-secondary, light-dark(#6b7280, #d1d5db))
|
|
109
|
+
);
|
|
110
|
+
--_reorderable-toggle-list--handle--background: var(
|
|
111
|
+
--sc-kit--reorderable-toggle-list--handle--background,
|
|
112
|
+
var(--sc-color--bg-element, light-dark(#f9fafb, #1e1e1e))
|
|
113
|
+
);
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
gap: 0.75rem;
|
|
117
|
+
}
|
|
118
|
+
.reorderable-toggle-list__dnd {
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
gap: 0.75rem;
|
|
122
|
+
}
|
|
123
|
+
.reorderable-toggle-list__item {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: 0.75rem;
|
|
127
|
+
padding: 0.25rem 0.5rem;
|
|
128
|
+
}
|
|
129
|
+
.reorderable-toggle-list__drag-handle {
|
|
130
|
+
--sc-kit--icon--size: 1rem;
|
|
131
|
+
--sc-kit--icon--color: var(--_reorderable-toggle-list--handle--color);
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
height: 1.375rem;
|
|
136
|
+
padding-inline: 0.1875rem;
|
|
137
|
+
border-radius: 0.3125rem 0 0 0.3125rem;
|
|
138
|
+
cursor: grab;
|
|
139
|
+
background: var(--_reorderable-toggle-list--handle--background);
|
|
140
|
+
}
|
|
141
|
+
.reorderable-toggle-list__drag-handle:active {
|
|
142
|
+
cursor: grabbing;
|
|
143
|
+
}
|
|
144
|
+
.reorderable-toggle-list__drag-handle--hidden {
|
|
145
|
+
visibility: hidden;
|
|
146
|
+
}
|
|
147
|
+
.reorderable-toggle-list__label {
|
|
148
|
+
flex: 1;
|
|
149
|
+
min-width: 0;
|
|
150
|
+
font-size: 0.875rem;
|
|
151
|
+
font-weight: 400;
|
|
152
|
+
line-height: 1.25rem;
|
|
153
|
+
color: var(--_reorderable-toggle-list--label--color);
|
|
154
|
+
}
|
|
155
|
+
.reorderable-toggle-list__toggle {
|
|
156
|
+
flex-shrink: 0;
|
|
157
|
+
margin-left: auto;
|
|
158
|
+
--sc-kit--toggle--switch--height: 1.125rem;
|
|
159
|
+
--sc-kit--toggle--switch--width: 2.3125rem;
|
|
160
|
+
}</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReorderableToggleItem } from './types';
|
|
2
|
+
type Props = {
|
|
3
|
+
items: ReorderableToggleItem[];
|
|
4
|
+
on: {
|
|
5
|
+
change: (items: ReorderableToggleItem[]) => void;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A reorderable list of toggle items with drag-and-drop support. Fixed items appear above the reorderable zone.
|
|
10
|
+
*
|
|
11
|
+
* ### CSS Custom Properties
|
|
12
|
+
* | Property | Description | Default |
|
|
13
|
+
* |---|---|---|
|
|
14
|
+
* | `--sc-kit--reorderable-toggle-list--label--color` | Label text color | `var(--sc-color--text-primary, light-dark(black, white))` |
|
|
15
|
+
* | `--sc-kit--reorderable-toggle-list--handle--color` | Drag handle icon color | `var(--sc-color--text-secondary, light-dark(neutral-500, neutral-300))` |
|
|
16
|
+
* | `--sc-kit--reorderable-toggle-list--handle--background` | Drag handle background | `var(--sc-color--bg-element, light-dark(neutral-50, dark-800))` |
|
|
17
|
+
*/
|
|
18
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
19
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
20
|
+
export default Cmp;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script lang="ts">const { children, on } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<button type="button" class="toolbar-button-item" onclick={() => on?.click?.()}>
|
|
6
|
+
{@render children()}
|
|
7
|
+
</button>
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
@component
|
|
11
|
+
A simple button item for toolbar panels. Renders children as clickable text.
|
|
12
|
+
|
|
13
|
+
### CSS Custom Properties
|
|
14
|
+
| Property | Description | Default |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `--sc-kit--toolbar-button-item--color` | Text color | `var(--sc-color--text-primary, light-dark(black, white))` |
|
|
17
|
+
-->
|
|
18
|
+
|
|
19
|
+
<style>.toolbar-button-item {
|
|
20
|
+
--_toolbar-button-item--color: var(
|
|
21
|
+
--sc-kit--toolbar-button-item--color,
|
|
22
|
+
var(--sc-color--text-primary, light-dark(#000000, #ffffff))
|
|
23
|
+
);
|
|
24
|
+
font-size: 0.875rem;
|
|
25
|
+
font-weight: 400;
|
|
26
|
+
line-height: 1.25rem;
|
|
27
|
+
color: var(--_toolbar-button-item--color);
|
|
28
|
+
padding: 0.25rem 0.5rem;
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
text-overflow: ellipsis;
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type Props = {
|
|
3
|
+
children: Snippet;
|
|
4
|
+
on?: {
|
|
5
|
+
click?: () => void;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A simple button item for toolbar panels. Renders children as clickable text.
|
|
10
|
+
*
|
|
11
|
+
* ### CSS Custom Properties
|
|
12
|
+
* | Property | Description | Default |
|
|
13
|
+
* |---|---|---|
|
|
14
|
+
* | `--sc-kit--toolbar-button-item--color` | Text color | `var(--sc-color--text-primary, light-dark(black, white))` |
|
|
15
|
+
*/
|
|
16
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
17
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
18
|
+
export default Cmp;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">import { Checkbox } from '../checkbox';
|
|
2
|
+
const { checked, children, on } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="toolbar-checkbox-item">
|
|
6
|
+
<Checkbox checked={checked} on={{ change: (value) => on?.change?.(value) }}>
|
|
7
|
+
{@render children()}
|
|
8
|
+
</Checkbox>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<!--
|
|
12
|
+
@component
|
|
13
|
+
A checkbox item for toolbar panels. Wraps the kit Checkbox with toolbar-appropriate sizing.
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
<style>.toolbar-checkbox-item {
|
|
17
|
+
padding: 0.25rem 0.5rem;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
--sc-kit--checkbox--gap: 1.25rem;
|
|
20
|
+
--sc-kit--checkbox--icon--size: 1.125rem;
|
|
21
|
+
}</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type Props = {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
children: Snippet;
|
|
5
|
+
on?: {
|
|
6
|
+
change?: (value: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
/** A checkbox item for toolbar panels. Wraps the kit Checkbox with toolbar-appropriate sizing. */
|
|
10
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
12
|
+
export default Cmp;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">import { Button } from '../button';
|
|
2
|
+
import { Dropdown } from '../dropdown';
|
|
3
|
+
import { IconText } from '../icon-text';
|
|
4
|
+
import ToolbarPanel from './cmp.toolbar-panel.svelte';
|
|
5
|
+
import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
|
|
6
|
+
const { title, triggerLabel, icon, iconColor, position = 'bottom-end', children, footer } = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div class="toolbar-dropdown">
|
|
10
|
+
<Dropdown position={position} keepDropdownOpen>
|
|
11
|
+
{#snippet trigger()}
|
|
12
|
+
<Button variant="standard" size="small">
|
|
13
|
+
<IconText icon={icon} iconColor={iconColor} secondaryIcon={IconChevronDown}>{triggerLabel}</IconText>
|
|
14
|
+
</Button>
|
|
15
|
+
{/snippet}
|
|
16
|
+
<ToolbarPanel title={title} footer={footer}>
|
|
17
|
+
{@render children()}
|
|
18
|
+
</ToolbarPanel>
|
|
19
|
+
</Dropdown>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<!--
|
|
23
|
+
@component
|
|
24
|
+
A toolbar dropdown button. Opens a panel with a title, body content, and optional footer.
|
|
25
|
+
-->
|
|
26
|
+
|
|
27
|
+
<style>.toolbar-dropdown {
|
|
28
|
+
display: contents;
|
|
29
|
+
}</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DropdownPosition } from '../dropdown';
|
|
2
|
+
import type { IconColor } from '../icon';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
type Props = {
|
|
5
|
+
title: string;
|
|
6
|
+
triggerLabel: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
iconColor?: IconColor;
|
|
9
|
+
/** @default 'bottom-end' */
|
|
10
|
+
position?: DropdownPosition;
|
|
11
|
+
children: Snippet;
|
|
12
|
+
footer?: Snippet;
|
|
13
|
+
};
|
|
14
|
+
/** A toolbar dropdown button. Opens a panel with a title, body content, and optional footer. */
|
|
15
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
17
|
+
export default Cmp;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script lang="ts">const { title, children, footer } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="toolbar-panel">
|
|
6
|
+
<div class="toolbar-panel__title">{title}</div>
|
|
7
|
+
<div class="toolbar-panel__body">
|
|
8
|
+
{@render children()}
|
|
9
|
+
{#if footer}
|
|
10
|
+
<div class="toolbar-panel__divider"></div>
|
|
11
|
+
{@render footer()}
|
|
12
|
+
{/if}
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<!--
|
|
17
|
+
@component
|
|
18
|
+
A panel container used inside toolbar dropdowns. Provides a title, body area, and optional footer.
|
|
19
|
+
|
|
20
|
+
### CSS Custom Properties
|
|
21
|
+
| Property | Description | Default |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `--sc-kit--toolbar-panel--width` | Panel width | `21.875rem` |
|
|
24
|
+
| `--sc-kit--toolbar-panel--title--color` | Title text color | `var(--sc-color--text-primary, light-dark(black, white))` |
|
|
25
|
+
| `--sc-kit--toolbar-panel--divider--color` | Divider line color | `var(--sc-color--border-primary, light-dark(neutral-100, dark-800))` |
|
|
26
|
+
-->
|
|
27
|
+
|
|
28
|
+
<style>.toolbar-panel {
|
|
29
|
+
--_toolbar-panel--width: var(--sc-kit--toolbar-panel--width, 21.875rem);
|
|
30
|
+
--_toolbar-panel--title--color: var(
|
|
31
|
+
--sc-kit--toolbar-panel--title--color,
|
|
32
|
+
var(--sc-color--text-primary, light-dark(#000000, #ffffff))
|
|
33
|
+
);
|
|
34
|
+
--_toolbar-panel--divider--color: var(
|
|
35
|
+
--sc-kit--toolbar-panel--divider--color,
|
|
36
|
+
var(--sc-color--border-primary, light-dark(#f2f2f3, #1e1e1e))
|
|
37
|
+
);
|
|
38
|
+
width: var(--_toolbar-panel--width);
|
|
39
|
+
padding: 1.5rem;
|
|
40
|
+
}
|
|
41
|
+
.toolbar-panel__title {
|
|
42
|
+
font-size: 0.875rem;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
line-height: 1.25rem;
|
|
45
|
+
color: var(--_toolbar-panel--title--color);
|
|
46
|
+
margin-bottom: 0.5rem;
|
|
47
|
+
}
|
|
48
|
+
.toolbar-panel__body {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: 1rem;
|
|
52
|
+
padding-block: 0.5rem;
|
|
53
|
+
}
|
|
54
|
+
.toolbar-panel__divider {
|
|
55
|
+
height: 1px;
|
|
56
|
+
background: var(--_toolbar-panel--divider--color);
|
|
57
|
+
margin: 0.25rem 0.5rem;
|
|
58
|
+
}</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type Props = {
|
|
3
|
+
title: string;
|
|
4
|
+
children: Snippet;
|
|
5
|
+
footer?: Snippet;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* A panel container used inside toolbar dropdowns. Provides a title, body area, and optional footer.
|
|
9
|
+
*
|
|
10
|
+
* ### CSS Custom Properties
|
|
11
|
+
* | Property | Description | Default |
|
|
12
|
+
* |---|---|---|
|
|
13
|
+
* | `--sc-kit--toolbar-panel--width` | Panel width | `21.875rem` |
|
|
14
|
+
* | `--sc-kit--toolbar-panel--title--color` | Title text color | `var(--sc-color--text-primary, light-dark(black, white))` |
|
|
15
|
+
* | `--sc-kit--toolbar-panel--divider--color` | Divider line color | `var(--sc-color--border-primary, light-dark(neutral-100, dark-800))` |
|
|
16
|
+
*/
|
|
17
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
18
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
19
|
+
export default Cmp;
|