@streamscloud/kit 0.1.12 → 0.2.0-1772458135351

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.
Files changed (53) hide show
  1. package/dist/core/toastr/index.d.ts +1 -1
  2. package/dist/core/toastr/toastr.scss +38 -0
  3. package/dist/core/toastr/toastr.svelte.d.ts +1 -1
  4. package/dist/core/toastr/toastr.svelte.js +13 -6
  5. package/dist/core/toastr/types.d.ts +2 -0
  6. package/dist/core/transitions/slide-horizontally.js +1 -1
  7. package/dist/styles/_mixins.scss +2 -2
  8. package/dist/styles/_transitions.scss +24 -0
  9. package/dist/styles/reset.css +1 -1
  10. package/dist/ui/button/resources/button-base.svelte +1 -1
  11. package/dist/ui/cropper/image-editor-dialog/cmp.image-editor-dialog.svelte +2 -2
  12. package/dist/ui/dialog/cmp.dialog-container.svelte +12 -12
  13. package/dist/ui/dialog/cmp.dialog.svelte +1 -1
  14. package/dist/ui/dialog/dialog-data.d.ts +2 -0
  15. package/dist/ui/dialog/dialog-mount.d.ts +1 -1
  16. package/dist/ui/dialog/dialog-mount.js +2 -2
  17. package/dist/ui/dialog/dialogs.svelte.d.ts +3 -0
  18. package/dist/ui/dialog/dialogs.svelte.js +21 -2
  19. package/dist/ui/dialog/index.d.ts +1 -1
  20. package/dist/ui/dialog/index.js +1 -1
  21. package/dist/ui/dialog/types.svelte.d.ts +3 -14
  22. package/dist/ui/dialog/types.svelte.js +3 -18
  23. package/dist/ui/dropdown/cmp.dropdown.svelte +20 -3
  24. package/dist/ui/form-group/cmp.form-group-label.svelte +25 -0
  25. package/dist/ui/form-group/cmp.form-group-label.svelte.d.ts +8 -0
  26. package/dist/ui/form-group/cmp.form-group-note.svelte +16 -0
  27. package/dist/ui/form-group/cmp.form-group-note.svelte.d.ts +7 -0
  28. package/dist/ui/form-group/cmp.form-group.svelte +16 -0
  29. package/dist/ui/form-group/cmp.form-group.svelte.d.ts +8 -0
  30. package/dist/ui/form-group/index.d.ts +3 -0
  31. package/dist/ui/form-group/index.js +3 -0
  32. package/dist/ui/html-block/cmp.html-block.svelte +112 -0
  33. package/dist/ui/html-block/cmp.html-block.svelte.d.ts +7 -0
  34. package/dist/ui/html-block/index.d.ts +1 -0
  35. package/dist/ui/html-block/index.js +1 -0
  36. package/dist/ui/media-viewer-dialog/cmp.media-viewer-dialog.svelte +50 -0
  37. package/dist/ui/media-viewer-dialog/cmp.media-viewer-dialog.svelte.d.ts +9 -0
  38. package/dist/ui/media-viewer-dialog/index.d.ts +15 -0
  39. package/dist/ui/media-viewer-dialog/index.js +20 -0
  40. package/dist/ui/media-viewer-dialog/media-viewer-item.svelte +61 -0
  41. package/dist/ui/media-viewer-dialog/media-viewer-item.svelte.d.ts +7 -0
  42. package/dist/ui/media-viewer-dialog/types.d.ts +15 -0
  43. package/dist/ui/media-viewer-dialog/types.js +1 -0
  44. package/dist/ui/player/carousel/cmp.carousel.svelte +27 -7
  45. package/dist/ui/player/carousel/cmp.carousel.svelte.d.ts +3 -1
  46. package/dist/ui/player/feed-slider/cmp.feed-slider.svelte +3 -5
  47. package/dist/ui/player/utils/index.d.ts +1 -0
  48. package/dist/ui/player/utils/index.js +1 -0
  49. package/dist/ui/player/{feed-slider → utils}/wheel-gestures-adapter.d.ts +6 -2
  50. package/dist/ui/player/{feed-slider → utils}/wheel-gestures-adapter.js +22 -13
  51. package/dist/ui/seek-bar/cmp.seek-bar.svelte +1 -1
  52. package/dist/ui/video/cmp.video.svelte +20 -9
  53. package/package.json +17 -1
@@ -1,3 +1,3 @@
1
1
  import './toastr.scss';
2
2
  export { Toastr } from './toastr.svelte';
3
- export type { ToastrAction, ToastrOptions, ToastrPromiseMessages } from './types';
3
+ export type { ToastrAction, ToastrOptions, ToastrPromiseMessages, ToastrTheme } from './types';
@@ -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>): Promise<void>;
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 = 400, easing = sineInOut } = {}) => {
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);
@@ -70,14 +70,14 @@
70
70
  max-height: 100%;
71
71
  }
72
72
 
73
- @mixin scrollbar($thumb-color: var(--scrollbar--thumb-color, #7d7d7d), $track-color: var(--scrollbar--track-color, transparent)) {
73
+ @mixin scrollbar($thumb-color: var(--scrollbar--thumb-color, light-dark(#999999, #333333)), $track-color: var(--scrollbar--track-color, transparent)) {
74
74
  --_cross-browser-scrollbar--thumb-color: #{$thumb-color};
75
75
  --_cross-browser-scrollbar--track-color: #{$track-color};
76
76
 
77
77
  @include _cross-browser-scrollbar;
78
78
  }
79
79
 
80
- @mixin scrollbar-on-hover($thumb-color: var(--scrollbar--thumb-color, #7d7d7d), $track-color: var(--scrollbar--track-color, transparent)) {
80
+ @mixin scrollbar-on-hover($thumb-color: var(--scrollbar--thumb-color, light-dark(#999999, #333333)), $track-color: var(--scrollbar--track-color, transparent)) {
81
81
  --_cross-browser-scrollbar--thumb-color: transparent;
82
82
  --_cross-browser-scrollbar--track-color: transparent;
83
83
 
@@ -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
+ }
@@ -121,7 +121,7 @@ input[type=number] {
121
121
  textarea {
122
122
  vertical-align: top;
123
123
  resize: vertical;
124
- --_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, #7d7d7d);
124
+ --_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, light-dark(#999999, #333333));
125
125
  --_cross-browser-scrollbar--track-color: var(--scrollbar--track-color, transparent);
126
126
  }
127
127
  textarea::-webkit-scrollbar {
@@ -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 linear 0.2s, color linear 0.2s, border-color linear 0.2s, filter linear 0.2s;
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, DialogSize } from '../../dialog';
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: DialogSize.FullHD });
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 { DialogPosition, DialogSize } from './types.svelte';
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(!Object.values(DialogSize).includes(size));
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 === DialogSize.Small}
69
- class:dialog-container--size-medium={size === DialogSize.Medium}
70
- class:dialog-container--size-default={size === DialogSize.Default}
71
- class:dialog-container--size-large={size === DialogSize.Large}
72
- class:dialog-container--size-fullhd={size === DialogSize.FullHD}
73
- class:dialog-container--size-auto={size === DialogSize.Auto}
74
- class:dialog-container--position-center={position === DialogPosition.Center}
75
- class:dialog-container--position-center-top={position === DialogPosition.CenterTop}
76
- class:dialog-container--position-full-screen={position === DialogPosition.FullScreen}
77
- class:dialog-container--position-full-height={position === DialogPosition.FullHeight}
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}
@@ -104,7 +104,7 @@ A structured dialog panel with header (title + close button), scrollable body, a
104
104
  min-height: 0;
105
105
  overflow-y: auto;
106
106
  padding: var(--_dialog--body--padding-block) var(--_dialog--body--padding-inline);
107
- --_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, #7d7d7d);
107
+ --_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, light-dark(#999999, #333333));
108
108
  --_cross-browser-scrollbar--track-color: var(--scrollbar--track-color, transparent);
109
109
  }
110
110
  .dialog__body::-webkit-scrollbar {
@@ -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._mountModule.mountDialog(newDialog);
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 { DialogSize, DialogPosition, type DialogResult } from './types.svelte';
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';
@@ -1,6 +1,6 @@
1
1
  export { Dialogs } from './dialogs.svelte';
2
2
  export { DialogController } from './dialog-controller';
3
- export { DialogSize, DialogPosition } from './types.svelte';
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 declare enum DialogSize {
2
- Small = "small",
3
- Medium = "medium",
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 var DialogSize;
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(DialogSize.Default);
24
- position = $state(DialogPosition.CenterTop);
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="dropdown__content" role="tooltip" tabindex="-1">
139
- {@render children()}
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
- z-index: 999;
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,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type Props = {
3
+ withTooltip?: boolean;
4
+ children: Snippet;
5
+ };
6
+ declare const Cmp: import("svelte").Component<Props, {}, "">;
7
+ type Cmp = ReturnType<typeof Cmp>;
8
+ export default Cmp;
@@ -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,7 @@
1
+ import type { Snippet } from 'svelte';
2
+ type Props = {
3
+ children: Snippet;
4
+ };
5
+ declare const Cmp: import("svelte").Component<Props, {}, "">;
6
+ type Cmp = ReturnType<typeof Cmp>;
7
+ export default Cmp;
@@ -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,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type Props = {
3
+ noMargin?: boolean;
4
+ children: Snippet;
5
+ };
6
+ declare const Cmp: import("svelte").Component<Props, {}, "">;
7
+ type Cmp = ReturnType<typeof Cmp>;
8
+ export default Cmp;
@@ -0,0 +1,3 @@
1
+ export { default as FormGroup } from './cmp.form-group.svelte';
2
+ export { default as FormGroupLabel } from './cmp.form-group-label.svelte';
3
+ export { default as FormGroupNote } from './cmp.form-group-note.svelte';
@@ -0,0 +1,3 @@
1
+ export { default as FormGroup } from './cmp.form-group.svelte';
2
+ export { default as FormGroupLabel } from './cmp.form-group-label.svelte';
3
+ export { default as FormGroupNote } from './cmp.form-group-note.svelte';