@streamscloud/kit 0.1.12 → 0.2.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/core/toastr/index.d.ts +1 -1
- package/dist/core/toastr/toastr.scss +38 -0
- package/dist/core/toastr/toastr.svelte.d.ts +1 -1
- package/dist/core/toastr/toastr.svelte.js +13 -6
- package/dist/core/toastr/types.d.ts +2 -0
- package/dist/core/transitions/slide-horizontally.js +1 -1
- package/dist/styles/_transitions.scss +24 -0
- package/dist/ui/button/resources/button-base.svelte +1 -1
- package/dist/ui/cropper/image-editor-dialog/cmp.image-editor-dialog.svelte +2 -2
- package/dist/ui/dialog/cmp.dialog-container.svelte +12 -12
- package/dist/ui/dialog/dialog-data.d.ts +2 -0
- package/dist/ui/dialog/dialog-mount.d.ts +1 -1
- package/dist/ui/dialog/dialog-mount.js +2 -2
- package/dist/ui/dialog/dialogs.svelte.d.ts +3 -0
- package/dist/ui/dialog/dialogs.svelte.js +21 -2
- package/dist/ui/dialog/index.d.ts +1 -1
- package/dist/ui/dialog/index.js +1 -1
- package/dist/ui/dialog/types.svelte.d.ts +3 -14
- package/dist/ui/dialog/types.svelte.js +3 -18
- package/dist/ui/dropdown/cmp.dropdown.svelte +20 -3
- package/dist/ui/form-group/cmp.form-group-label.svelte +25 -0
- package/dist/ui/form-group/cmp.form-group-label.svelte.d.ts +8 -0
- package/dist/ui/form-group/cmp.form-group-note.svelte +16 -0
- package/dist/ui/form-group/cmp.form-group-note.svelte.d.ts +7 -0
- package/dist/ui/form-group/cmp.form-group.svelte +16 -0
- package/dist/ui/form-group/cmp.form-group.svelte.d.ts +8 -0
- package/dist/ui/form-group/index.d.ts +3 -0
- package/dist/ui/form-group/index.js +3 -0
- package/dist/ui/html-block/cmp.html-block.svelte +112 -0
- package/dist/ui/html-block/cmp.html-block.svelte.d.ts +7 -0
- package/dist/ui/html-block/index.d.ts +1 -0
- package/dist/ui/html-block/index.js +1 -0
- package/dist/ui/media-viewer-dialog/cmp.media-viewer-dialog.svelte +50 -0
- package/dist/ui/media-viewer-dialog/cmp.media-viewer-dialog.svelte.d.ts +9 -0
- package/dist/ui/media-viewer-dialog/index.d.ts +14 -0
- package/dist/ui/media-viewer-dialog/index.js +18 -0
- package/dist/ui/media-viewer-dialog/media-viewer-item.svelte +61 -0
- package/dist/ui/media-viewer-dialog/media-viewer-item.svelte.d.ts +7 -0
- package/dist/ui/media-viewer-dialog/types.d.ts +15 -0
- package/dist/ui/media-viewer-dialog/types.js +1 -0
- package/dist/ui/player/carousel/cmp.carousel.svelte +27 -7
- package/dist/ui/player/carousel/cmp.carousel.svelte.d.ts +3 -1
- package/dist/ui/player/feed-slider/cmp.feed-slider.svelte +3 -5
- package/dist/ui/player/utils/index.d.ts +1 -0
- package/dist/ui/player/utils/index.js +1 -0
- package/dist/ui/player/{feed-slider → utils}/wheel-gestures-adapter.d.ts +6 -2
- package/dist/ui/player/{feed-slider → utils}/wheel-gestures-adapter.js +22 -13
- package/dist/ui/seek-bar/cmp.seek-bar.svelte +1 -1
- package/dist/ui/video/cmp.video.svelte +20 -9
- package/package.json +17 -1
|
@@ -26,3 +26,41 @@
|
|
|
26
26
|
color: var(--info-bg);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
// Theme classes — override svelte-sonner color variables per-toast.
|
|
31
|
+
// Applied via the `class` option when an explicit theme is passed to Toastr methods.
|
|
32
|
+
.sc-toast--light {
|
|
33
|
+
--normal-bg: #fff;
|
|
34
|
+
--normal-border: hsl(0, 0%, 93%);
|
|
35
|
+
--normal-text: hsl(0, 0%, 9%);
|
|
36
|
+
--success-bg: hsl(143, 85%, 96%);
|
|
37
|
+
--success-border: hsl(145, 92%, 87%);
|
|
38
|
+
--success-text: hsl(140, 100%, 27%);
|
|
39
|
+
--info-bg: hsl(208, 100%, 97%);
|
|
40
|
+
--info-border: hsl(221, 91%, 93%);
|
|
41
|
+
--info-text: hsl(210, 92%, 45%);
|
|
42
|
+
--warning-bg: hsl(49, 100%, 97%);
|
|
43
|
+
--warning-border: hsl(49, 91%, 84%);
|
|
44
|
+
--warning-text: hsl(31, 92%, 45%);
|
|
45
|
+
--error-bg: hsl(359, 100%, 97%);
|
|
46
|
+
--error-border: hsl(359, 100%, 94%);
|
|
47
|
+
--error-text: hsl(360, 100%, 45%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.sc-toast--dark {
|
|
51
|
+
--normal-bg: #000;
|
|
52
|
+
--normal-border: hsl(0, 0%, 20%);
|
|
53
|
+
--normal-text: hsl(0, 0%, 99%);
|
|
54
|
+
--success-bg: hsl(150, 100%, 6%);
|
|
55
|
+
--success-border: hsl(147, 100%, 12%);
|
|
56
|
+
--success-text: hsl(150, 86%, 65%);
|
|
57
|
+
--info-bg: hsl(215, 100%, 6%);
|
|
58
|
+
--info-border: hsl(223, 43%, 17%);
|
|
59
|
+
--info-text: hsl(216, 87%, 65%);
|
|
60
|
+
--warning-bg: hsl(64, 100%, 6%);
|
|
61
|
+
--warning-border: hsl(60, 100%, 9%);
|
|
62
|
+
--warning-text: hsl(46, 87%, 65%);
|
|
63
|
+
--error-bg: hsl(358, 76%, 10%);
|
|
64
|
+
--error-border: hsl(357, 89%, 16%);
|
|
65
|
+
--error-text: hsl(358, 100%, 81%);
|
|
66
|
+
}
|
|
@@ -4,5 +4,5 @@ export declare class Toastr {
|
|
|
4
4
|
static success(message: string, options?: ToastrOptions): Promise<void>;
|
|
5
5
|
static warning(message: string, options?: ToastrOptions): Promise<void>;
|
|
6
6
|
static info(message: string, options?: ToastrOptions): Promise<void>;
|
|
7
|
-
static promise<T>(promise: Promise<T> | (() => Promise<T>), messages: ToastrPromiseMessages<T
|
|
7
|
+
static promise<T>(promise: Promise<T> | (() => Promise<T>), messages: ToastrPromiseMessages<T>, options?: ToastrOptions): Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import { ToasterHost } from './toaster-host.svelte';
|
|
2
|
+
const toExternalToast = (options) => {
|
|
3
|
+
if (!options) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
const { theme, ...rest } = options;
|
|
7
|
+
return { ...rest, class: theme ? `sc-toast--${theme}` : undefined };
|
|
8
|
+
};
|
|
2
9
|
export class Toastr {
|
|
3
10
|
static async error(message, options) {
|
|
4
11
|
const toast = await ToasterHost.ensure();
|
|
5
|
-
toast.error(message, options);
|
|
12
|
+
toast.error(message, toExternalToast(options));
|
|
6
13
|
}
|
|
7
14
|
static async success(message, options) {
|
|
8
15
|
const toast = await ToasterHost.ensure();
|
|
9
|
-
toast.success(message, options);
|
|
16
|
+
toast.success(message, toExternalToast(options));
|
|
10
17
|
}
|
|
11
18
|
static async warning(message, options) {
|
|
12
19
|
const toast = await ToasterHost.ensure();
|
|
13
|
-
toast.warning(message, options);
|
|
20
|
+
toast.warning(message, toExternalToast(options));
|
|
14
21
|
}
|
|
15
22
|
static async info(message, options) {
|
|
16
23
|
const toast = await ToasterHost.ensure();
|
|
17
|
-
toast.info(message, options);
|
|
24
|
+
toast.info(message, toExternalToast(options));
|
|
18
25
|
}
|
|
19
|
-
static async promise(promise, messages) {
|
|
26
|
+
static async promise(promise, messages, options) {
|
|
20
27
|
const toast = await ToasterHost.ensure();
|
|
21
|
-
toast.promise(promise, messages);
|
|
28
|
+
toast.promise(promise, { ...messages, ...toExternalToast(options) });
|
|
22
29
|
}
|
|
23
30
|
}
|
|
@@ -2,10 +2,12 @@ export interface ToastrAction {
|
|
|
2
2
|
label: string;
|
|
3
3
|
onClick: () => void;
|
|
4
4
|
}
|
|
5
|
+
export type ToastrTheme = 'light' | 'dark';
|
|
5
6
|
export interface ToastrOptions {
|
|
6
7
|
action?: ToastrAction;
|
|
7
8
|
description?: string;
|
|
8
9
|
duration?: number;
|
|
10
|
+
theme?: ToastrTheme;
|
|
9
11
|
}
|
|
10
12
|
export interface ToastrPromiseMessages<T> {
|
|
11
13
|
loading: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sineInOut } from 'svelte/easing';
|
|
2
|
-
export const slideHorizontally = (node, { delay = 0, duration =
|
|
2
|
+
export const slideHorizontally = (node, { delay = 0, duration = 250, easing = sineInOut } = {}) => {
|
|
3
3
|
const style = getComputedStyle(node);
|
|
4
4
|
const isHtmlElement = (n) => n.nodeType === Node.ELEMENT_NODE;
|
|
5
5
|
const children = Array.from(node.children).filter(isHtmlElement);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
|
|
3
|
+
$transition-duration-fast: 150ms;
|
|
4
|
+
$transition-duration-base: 250ms;
|
|
5
|
+
$transition-duration-slow: 350ms;
|
|
6
|
+
|
|
7
|
+
$transition-easing-default: cubic-bezier(0.4, 0, 0.2, 1);
|
|
8
|
+
$transition-easing-in: cubic-bezier(0.4, 0, 1, 1);
|
|
9
|
+
$transition-easing-out: cubic-bezier(0, 0, 0.2, 1);
|
|
10
|
+
|
|
11
|
+
// Transition mixin
|
|
12
|
+
// Usage:
|
|
13
|
+
// @include transition(opacity);
|
|
14
|
+
// @include transition(background-color color, $transition-duration-fast);
|
|
15
|
+
// @include transition(width, $transition-duration-slow, linear);
|
|
16
|
+
@mixin transition($properties: all, $duration: $transition-duration-base, $easing: $transition-easing-default) {
|
|
17
|
+
$result: ();
|
|
18
|
+
|
|
19
|
+
@each $property in $properties {
|
|
20
|
+
$result: list.append($result, $property $duration $easing, comma);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
transition: $result;
|
|
24
|
+
}
|
|
@@ -53,7 +53,7 @@ export {};
|
|
|
53
53
|
justify-content: var(--_button--justify-content);
|
|
54
54
|
align-items: center;
|
|
55
55
|
vertical-align: middle;
|
|
56
|
-
transition: background-color
|
|
56
|
+
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1), color 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms cubic-bezier(0.4, 0, 0.2, 1), filter 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
57
57
|
white-space: nowrap;
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">import { FileWithBlobDataHelper } from '../../../core/files';
|
|
2
2
|
import { Toastr } from '../../../core/toastr';
|
|
3
|
-
import { Dialog, DialogButton, DialogCancelButton
|
|
3
|
+
import { Dialog, DialogButton, DialogCancelButton } from '../../dialog';
|
|
4
4
|
import { ImgCropper, ImgCropperControls, ImgCropperToolbar, ImgCropperView } from '../img-cropper';
|
|
5
5
|
import { ImageEditorDialogLocalization } from './image-editor-dialog-localization';
|
|
6
6
|
import { untrack } from 'svelte';
|
|
@@ -37,7 +37,7 @@ const cancel = () => {
|
|
|
37
37
|
};
|
|
38
38
|
$effect(() => untrack(() => {
|
|
39
39
|
controller.updateSettings({ closeOnClickOutside: false, closeOnEsc: true });
|
|
40
|
-
controller.updateContainerSettings({ size:
|
|
40
|
+
controller.updateContainerSettings({ size: 'fullhd' });
|
|
41
41
|
}));
|
|
42
42
|
</script>
|
|
43
43
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" generics="TResult = void, TCancelResult = void, TData = void">import { Dialogs } from './dialogs.svelte';
|
|
2
|
-
import {
|
|
2
|
+
import { DIALOG_SIZES } from './types.svelte';
|
|
3
3
|
import { untrack } from 'svelte';
|
|
4
4
|
let { dialog } = $props();
|
|
5
5
|
let dialogElement = $state();
|
|
@@ -57,7 +57,7 @@ $effect(() => {
|
|
|
57
57
|
});
|
|
58
58
|
const size = $derived(dialog.controller.containerSettings.size);
|
|
59
59
|
const position = $derived(dialog.controller.containerSettings.position);
|
|
60
|
-
const isCustomWidth = $derived(!
|
|
60
|
+
const isCustomWidth = $derived(!DIALOG_SIZES.includes(size));
|
|
61
61
|
const customWidth = $derived(isCustomWidth ? size : null);
|
|
62
62
|
</script>
|
|
63
63
|
|
|
@@ -65,16 +65,16 @@ const customWidth = $derived(isCustomWidth ? size : null);
|
|
|
65
65
|
bind:this={dialogElement}
|
|
66
66
|
class="dialog-container"
|
|
67
67
|
class:dialog-container--inactive={!isActive}
|
|
68
|
-
class:dialog-container--size-small={size ===
|
|
69
|
-
class:dialog-container--size-medium={size ===
|
|
70
|
-
class:dialog-container--size-default={size ===
|
|
71
|
-
class:dialog-container--size-large={size ===
|
|
72
|
-
class:dialog-container--size-fullhd={size ===
|
|
73
|
-
class:dialog-container--size-auto={size ===
|
|
74
|
-
class:dialog-container--position-center={position ===
|
|
75
|
-
class:dialog-container--position-center-top={position ===
|
|
76
|
-
class:dialog-container--position-full-screen={position ===
|
|
77
|
-
class:dialog-container--position-full-height={position ===
|
|
68
|
+
class:dialog-container--size-small={size === 'small'}
|
|
69
|
+
class:dialog-container--size-medium={size === 'medium'}
|
|
70
|
+
class:dialog-container--size-default={size === 'default'}
|
|
71
|
+
class:dialog-container--size-large={size === 'large'}
|
|
72
|
+
class:dialog-container--size-fullhd={size === 'fullhd'}
|
|
73
|
+
class:dialog-container--size-auto={size === 'auto'}
|
|
74
|
+
class:dialog-container--position-center={position === 'center'}
|
|
75
|
+
class:dialog-container--position-center-top={position === 'center-top'}
|
|
76
|
+
class:dialog-container--position-full-screen={position === 'full-screen'}
|
|
77
|
+
class:dialog-container--position-full-height={position === 'full-height'}
|
|
78
78
|
onkeydown={handleKeydown}
|
|
79
79
|
oncancel={handleCancel}
|
|
80
80
|
onclick={handleBackdropClick}
|
|
@@ -23,5 +23,7 @@ export type DialogInit<TData = void, TResult = void, TCancelResult = void> = {
|
|
|
23
23
|
data?: TData;
|
|
24
24
|
explicitSettings?: Partial<DialogSettings>;
|
|
25
25
|
containerSettings?: Partial<DialogContainerSettings>;
|
|
26
|
+
/** Mount target for the dialog element. Useful for shadow DOM isolation. Defaults to `document.body`. */
|
|
27
|
+
host?: ParentNode;
|
|
26
28
|
};
|
|
27
29
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AnyDialogData } from './dialog-data';
|
|
2
|
-
export declare const mountDialog: (dialog: AnyDialogData) => void;
|
|
2
|
+
export declare const mountDialog: (dialog: AnyDialogData, host?: ParentNode) => void;
|
|
3
3
|
export declare const unmountDialog: (dialog: AnyDialogData) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as DialogContainer } from './cmp.dialog-container.svelte';
|
|
2
2
|
import { mount, unmount } from 'svelte';
|
|
3
|
-
export const mountDialog = (dialog) => {
|
|
3
|
+
export const mountDialog = (dialog, host) => {
|
|
4
4
|
const hostElement = document.createElement('div');
|
|
5
5
|
hostElement.setAttribute('data-dialog-host', String(dialog.id));
|
|
6
|
-
document.body.appendChild(hostElement);
|
|
6
|
+
(host ?? document.body).appendChild(hostElement);
|
|
7
7
|
const component = mount(DialogContainer, {
|
|
8
8
|
target: hostElement,
|
|
9
9
|
props: { dialog }
|
|
@@ -3,11 +3,14 @@ import { type DialogResult } from './types.svelte';
|
|
|
3
3
|
export declare class DialogsContainer {
|
|
4
4
|
private _dialogs;
|
|
5
5
|
private _mountModule;
|
|
6
|
+
private _savedOverflow;
|
|
6
7
|
get all(): ReadonlyArray<AnyDialogData>;
|
|
7
8
|
get active(): AnyDialogData | null;
|
|
8
9
|
get count(): number;
|
|
9
10
|
open: <TData = void, TResult = void, TCancelResult = void>(init: DialogInit<TData, TResult, TCancelResult>, id?: number) => Promise<DialogResult<TResult, TCancelResult>>;
|
|
10
11
|
close: (id: number) => void;
|
|
11
12
|
closeAll: () => void;
|
|
13
|
+
private lockBodyScroll;
|
|
14
|
+
private unlockBodyScroll;
|
|
12
15
|
}
|
|
13
16
|
export declare const Dialogs: DialogsContainer;
|
|
@@ -5,6 +5,7 @@ import {} from './types.svelte';
|
|
|
5
5
|
export class DialogsContainer {
|
|
6
6
|
_dialogs = $state.raw([]);
|
|
7
7
|
_mountModule = null;
|
|
8
|
+
_savedOverflow = null;
|
|
8
9
|
get all() {
|
|
9
10
|
return this._dialogs;
|
|
10
11
|
}
|
|
@@ -18,7 +19,7 @@ export class DialogsContainer {
|
|
|
18
19
|
if (!this._mountModule) {
|
|
19
20
|
this._mountModule = await import('./dialog-mount');
|
|
20
21
|
}
|
|
21
|
-
const { view, data, explicitSettings, containerSettings } = init;
|
|
22
|
+
const { view, data, explicitSettings, containerSettings, host } = init;
|
|
22
23
|
const controller = new DialogController({
|
|
23
24
|
id,
|
|
24
25
|
onClose: () => {
|
|
@@ -26,6 +27,9 @@ export class DialogsContainer {
|
|
|
26
27
|
if (dialog) {
|
|
27
28
|
this._mountModule?.unmountDialog(dialog);
|
|
28
29
|
this._dialogs = this._dialogs.filter((d) => d.id !== id);
|
|
30
|
+
if (this._dialogs.length === 0) {
|
|
31
|
+
this.unlockBodyScroll();
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
},
|
|
31
35
|
settings: explicitSettings,
|
|
@@ -38,7 +42,8 @@ export class DialogsContainer {
|
|
|
38
42
|
controller
|
|
39
43
|
};
|
|
40
44
|
this._dialogs = [...this._dialogs, newDialog];
|
|
41
|
-
this.
|
|
45
|
+
this.lockBodyScroll();
|
|
46
|
+
this._mountModule.mountDialog(newDialog, host);
|
|
42
47
|
return controller.openedPromise;
|
|
43
48
|
};
|
|
44
49
|
close = (id) => {
|
|
@@ -53,6 +58,20 @@ export class DialogsContainer {
|
|
|
53
58
|
dialog.controller.cancel();
|
|
54
59
|
}
|
|
55
60
|
};
|
|
61
|
+
lockBodyScroll = () => {
|
|
62
|
+
if (this._savedOverflow !== null) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this._savedOverflow = document.documentElement.style.overflow;
|
|
66
|
+
document.documentElement.style.overflow = 'hidden';
|
|
67
|
+
};
|
|
68
|
+
unlockBodyScroll = () => {
|
|
69
|
+
if (this._savedOverflow === null) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
document.documentElement.style.overflow = this._savedOverflow;
|
|
73
|
+
this._savedOverflow = null;
|
|
74
|
+
};
|
|
56
75
|
}
|
|
57
76
|
const createDialogsSingleton = () => {
|
|
58
77
|
if (!isBrowser()) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Dialogs } from './dialogs.svelte';
|
|
2
2
|
export { DialogController } from './dialog-controller';
|
|
3
|
-
export {
|
|
3
|
+
export { DIALOG_SIZES, type DialogPosition, type DialogResult, type DialogSize } from './types.svelte';
|
|
4
4
|
export { default as Dialog } from './cmp.dialog.svelte';
|
|
5
5
|
export { default as DialogButton } from './cmp.dialog-button.svelte';
|
|
6
6
|
export { default as DialogCancelButton } from './cmp.dialog-cancel-button.svelte';
|
package/dist/ui/dialog/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Dialogs } from './dialogs.svelte';
|
|
2
2
|
export { DialogController } from './dialog-controller';
|
|
3
|
-
export {
|
|
3
|
+
export { DIALOG_SIZES } from './types.svelte';
|
|
4
4
|
export { default as Dialog } from './cmp.dialog.svelte';
|
|
5
5
|
export { default as DialogButton } from './cmp.dialog-button.svelte';
|
|
6
6
|
export { default as DialogCancelButton } from './cmp.dialog-cancel-button.svelte';
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Default = "default",
|
|
5
|
-
Large = "large",
|
|
6
|
-
FullHD = "fullhd",
|
|
7
|
-
Auto = "auto"
|
|
8
|
-
}
|
|
9
|
-
export declare enum DialogPosition {
|
|
10
|
-
Center = "center",
|
|
11
|
-
CenterTop = "center-top",
|
|
12
|
-
FullScreen = "full-screen",
|
|
13
|
-
FullHeight = "full-height"
|
|
14
|
-
}
|
|
1
|
+
export type DialogSize = 'small' | 'medium' | 'default' | 'large' | 'fullhd' | 'auto';
|
|
2
|
+
export type DialogPosition = 'center' | 'center-top' | 'full-screen' | 'full-height';
|
|
3
|
+
export declare const DIALOG_SIZES: readonly DialogSize[];
|
|
15
4
|
export declare class DialogSettings {
|
|
16
5
|
closeOnClickOutside: boolean;
|
|
17
6
|
closeOnEsc: boolean;
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
(function (DialogSize) {
|
|
3
|
-
DialogSize["Small"] = "small";
|
|
4
|
-
DialogSize["Medium"] = "medium";
|
|
5
|
-
DialogSize["Default"] = "default";
|
|
6
|
-
DialogSize["Large"] = "large";
|
|
7
|
-
DialogSize["FullHD"] = "fullhd";
|
|
8
|
-
DialogSize["Auto"] = "auto";
|
|
9
|
-
})(DialogSize || (DialogSize = {}));
|
|
10
|
-
export var DialogPosition;
|
|
11
|
-
(function (DialogPosition) {
|
|
12
|
-
DialogPosition["Center"] = "center";
|
|
13
|
-
DialogPosition["CenterTop"] = "center-top";
|
|
14
|
-
DialogPosition["FullScreen"] = "full-screen";
|
|
15
|
-
DialogPosition["FullHeight"] = "full-height";
|
|
16
|
-
})(DialogPosition || (DialogPosition = {}));
|
|
1
|
+
export const DIALOG_SIZES = ['small', 'medium', 'default', 'large', 'fullhd', 'auto'];
|
|
17
2
|
export class DialogSettings {
|
|
18
3
|
closeOnClickOutside = $state(false);
|
|
19
4
|
closeOnEsc = $state(false);
|
|
20
5
|
nonCancelable = $state(false);
|
|
21
6
|
}
|
|
22
7
|
export class DialogContainerSettings {
|
|
23
|
-
size = $state(
|
|
24
|
-
position = $state(
|
|
8
|
+
size = $state('default');
|
|
9
|
+
position = $state('center-top');
|
|
25
10
|
}
|
|
@@ -135,8 +135,10 @@ const initPopper = (node) => {
|
|
|
135
135
|
{/if}
|
|
136
136
|
</button>
|
|
137
137
|
{#if opened}
|
|
138
|
-
<div use:initPopper class="
|
|
139
|
-
|
|
138
|
+
<div use:initPopper class="dropdown__popper" role="tooltip" tabindex="-1">
|
|
139
|
+
<div class="dropdown__content">
|
|
140
|
+
{@render children()}
|
|
141
|
+
</div>
|
|
140
142
|
</div>
|
|
141
143
|
{/if}
|
|
142
144
|
</div>
|
|
@@ -179,10 +181,25 @@ A Popper.js-powered dropdown that positions content relative to a trigger elemen
|
|
|
179
181
|
opacity: 0.5;
|
|
180
182
|
pointer-events: none;
|
|
181
183
|
}
|
|
184
|
+
.dropdown__popper {
|
|
185
|
+
z-index: 999;
|
|
186
|
+
}
|
|
182
187
|
.dropdown__content {
|
|
183
188
|
width: max-content;
|
|
184
|
-
|
|
189
|
+
transform-origin: top left;
|
|
190
|
+
animation: dropdown-appear 150ms cubic-bezier(0, 0, 0.2, 1) both;
|
|
185
191
|
}
|
|
186
192
|
.dropdown :global([data-popper-escaped]) {
|
|
187
193
|
visibility: hidden !important;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@keyframes dropdown-appear {
|
|
197
|
+
from {
|
|
198
|
+
opacity: 0;
|
|
199
|
+
transform: scale(0.95) translateY(-4px);
|
|
200
|
+
}
|
|
201
|
+
to {
|
|
202
|
+
opacity: 1;
|
|
203
|
+
transform: scale(1) translateY(0);
|
|
204
|
+
}
|
|
188
205
|
}</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">let { withTooltip = false, children } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="form-group-label" class:form-group-label--with-tooltip={withTooltip}>
|
|
6
|
+
{@render children()}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<style>.form-group-label {
|
|
10
|
+
--_form-group--label--font-size: var(--sc-kit--form-group--label--font-size, 0.875rem);
|
|
11
|
+
--_form-group--label--font-weight: var(--sc-kit--form-group--label--font-weight, 400);
|
|
12
|
+
--_form-group--label--color: var(--sc-kit--form-group--label--color);
|
|
13
|
+
--_form-group--label--margin-bottom: var(--sc-kit--form-group--label--margin-bottom, 0.5rem);
|
|
14
|
+
font-size: var(--_form-group--label--font-size);
|
|
15
|
+
padding: 0;
|
|
16
|
+
margin-bottom: var(--_form-group--label--margin-bottom);
|
|
17
|
+
font-weight: var(--_form-group--label--font-weight);
|
|
18
|
+
display: block;
|
|
19
|
+
color: var(--_form-group--label--color);
|
|
20
|
+
}
|
|
21
|
+
.form-group-label--with-tooltip {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 0.25rem;
|
|
25
|
+
}</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">let { children } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="form-group-note">
|
|
6
|
+
{@render children()}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<style>.form-group-note {
|
|
10
|
+
--_form-group--note--font-size: var(--sc-kit--form-group--note--font-size, 0.875rem);
|
|
11
|
+
--_form-group--note--font-weight: var(--sc-kit--form-group--note--font-weight, 300);
|
|
12
|
+
margin-top: 0.5rem;
|
|
13
|
+
color: #9ca3af;
|
|
14
|
+
font-size: var(--_form-group--note--font-size);
|
|
15
|
+
font-weight: var(--_form-group--note--font-weight);
|
|
16
|
+
}</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">let { noMargin = false, children } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="form-group" class:form-group--no-margin={noMargin}>
|
|
6
|
+
{@render children()}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<style>.form-group {
|
|
10
|
+
--_form-group--margin-bottom: var(--sc-kit--form-group--margin-bottom, 1.25rem);
|
|
11
|
+
display: block;
|
|
12
|
+
margin-bottom: var(--_form-group--margin-bottom);
|
|
13
|
+
}
|
|
14
|
+
.form-group--no-margin {
|
|
15
|
+
margin-bottom: 0;
|
|
16
|
+
}</style>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script lang="ts">let { children } = $props();
|
|
2
|
+
export {};
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="html-block">
|
|
6
|
+
{@render children()}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<style>.html-block {
|
|
10
|
+
display: contents;
|
|
11
|
+
overflow-wrap: break-word;
|
|
12
|
+
font-size: 0.875em;
|
|
13
|
+
line-height: 1.4;
|
|
14
|
+
font-weight: normal;
|
|
15
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
16
|
+
}
|
|
17
|
+
.html-block :global(h1) {
|
|
18
|
+
font-size: 1.5em;
|
|
19
|
+
line-height: 1.4;
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
22
|
+
}
|
|
23
|
+
.html-block :global(h2) {
|
|
24
|
+
font-size: 1.375em;
|
|
25
|
+
line-height: 1.4;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
28
|
+
}
|
|
29
|
+
.html-block :global(h3) {
|
|
30
|
+
font-size: 1.25em;
|
|
31
|
+
line-height: 1.4;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
34
|
+
}
|
|
35
|
+
.html-block :global(h4) {
|
|
36
|
+
font-size: 1.125em;
|
|
37
|
+
line-height: 1.4;
|
|
38
|
+
font-weight: 500;
|
|
39
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
40
|
+
}
|
|
41
|
+
.html-block :global(h5) {
|
|
42
|
+
font-size: 1.0625em;
|
|
43
|
+
line-height: 1.4;
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
46
|
+
}
|
|
47
|
+
.html-block :global(h6) {
|
|
48
|
+
font-size: 1em;
|
|
49
|
+
line-height: 1.4;
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
52
|
+
}
|
|
53
|
+
.html-block :global(a) {
|
|
54
|
+
font-size: 1em;
|
|
55
|
+
line-height: 1.4;
|
|
56
|
+
font-weight: normal;
|
|
57
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
58
|
+
color: light-dark(#144ab0, #5a8dec);
|
|
59
|
+
}
|
|
60
|
+
.html-block :global(pre) {
|
|
61
|
+
font-family: monospace;
|
|
62
|
+
white-space: pre-wrap;
|
|
63
|
+
margin: 1em 0;
|
|
64
|
+
font-size: 1em;
|
|
65
|
+
line-height: 1;
|
|
66
|
+
font-weight: normal;
|
|
67
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
68
|
+
}
|
|
69
|
+
.html-block :global(ul) :global(> li),
|
|
70
|
+
.html-block :global(ol) :global(> li) {
|
|
71
|
+
list-style: inherit;
|
|
72
|
+
margin-left: 1em;
|
|
73
|
+
position: relative;
|
|
74
|
+
font-size: 1em;
|
|
75
|
+
line-height: 1.4;
|
|
76
|
+
font-weight: normal;
|
|
77
|
+
color: light-dark(#2e2e2e, #ffffff);
|
|
78
|
+
}
|
|
79
|
+
.html-block :global(ol) {
|
|
80
|
+
list-style-type: decimal;
|
|
81
|
+
}
|
|
82
|
+
.html-block :global(ol) :global(> li > ol) {
|
|
83
|
+
list-style-type: lower-alpha;
|
|
84
|
+
}
|
|
85
|
+
.html-block :global(table) {
|
|
86
|
+
max-width: 100%;
|
|
87
|
+
}
|
|
88
|
+
.html-block :global(table),
|
|
89
|
+
.html-block :global(tbody),
|
|
90
|
+
.html-block :global(thead),
|
|
91
|
+
.html-block :global(tr),
|
|
92
|
+
.html-block :global(th),
|
|
93
|
+
.html-block :global(td) {
|
|
94
|
+
border-width: initial;
|
|
95
|
+
border-style: inherit;
|
|
96
|
+
border-color: inherit;
|
|
97
|
+
}
|
|
98
|
+
.html-block :global(ul:not([style*='list-style-type'])),
|
|
99
|
+
.html-block :global(ul:not([style*='list-style-type']) > li > ul:not([style*='list-style-type'])) {
|
|
100
|
+
list-style-type: none;
|
|
101
|
+
}
|
|
102
|
+
.html-block :global(ul:not([style*='list-style-type']) > li:before),
|
|
103
|
+
.html-block :global(ul:not([style*='list-style-type']) > li > ul:not([style*='list-style-type']) > li:before) {
|
|
104
|
+
content: "-";
|
|
105
|
+
text-indent: -1em;
|
|
106
|
+
position: absolute;
|
|
107
|
+
font-weight: bold;
|
|
108
|
+
}
|
|
109
|
+
.html-block :global(ul[style*='list-style-type'] > li:before),
|
|
110
|
+
.html-block :global(ul > li > ul[style*='list-style-type'] > li:before) {
|
|
111
|
+
content: none;
|
|
112
|
+
}</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as HtmlBlock } from './cmp.html-block.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as HtmlBlock } from './cmp.html-block.svelte';
|