@streamscloud/kit 0.9.15 → 0.9.17
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.
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script lang="ts">import { default as Button } from '../button/cmp.button.svelte';
|
|
2
|
-
let { type = 'button', disabled = false, variant = 'primary', icon, on, children } = $props();
|
|
2
|
+
let { type = 'button', disabled = false, loading = false, variant = 'primary', icon, on, children } = $props();
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<div class="dialog-button">
|
|
6
|
-
<Button type={type} disabled={disabled} variant={variant} icon={icon} on={on}>
|
|
6
|
+
<Button type={type} disabled={disabled} loading={loading} variant={variant} icon={icon} on={on}>
|
|
7
7
|
{@render children()}
|
|
8
8
|
</Button>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<!--
|
|
12
12
|
@component
|
|
13
|
-
DialogButton — action button for a dialog footer with a minimum width preset. Defaults to the `primary` variant. Wraps `<Button>` and exposes the same callback / disabled / type / icon contract.
|
|
13
|
+
DialogButton — action button for a dialog footer with a minimum width preset. Defaults to the `primary` variant. Wraps `<Button>` and exposes the same callback / disabled / loading / type / icon contract.
|
|
14
14
|
|
|
15
15
|
### CSS Custom Properties
|
|
16
16
|
| Property | Description | Default |
|
|
@@ -5,6 +5,8 @@ type Props = {
|
|
|
5
5
|
/** @default 'button' */
|
|
6
6
|
type?: 'button' | 'submit' | 'reset';
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
/** Renders a spinner in place of the icon and blocks clicks. Passed through to Button. @default false */
|
|
9
|
+
loading?: boolean;
|
|
8
10
|
/** Button color variant @default 'primary' */
|
|
9
11
|
variant?: ButtonVariant;
|
|
10
12
|
/** Leading icon — passed through to Button. */
|
|
@@ -15,7 +17,7 @@ type Props = {
|
|
|
15
17
|
children: Snippet;
|
|
16
18
|
};
|
|
17
19
|
/**
|
|
18
|
-
* DialogButton — action button for a dialog footer with a minimum width preset. Defaults to the `primary` variant. Wraps `<Button>` and exposes the same callback / disabled / type / icon contract.
|
|
20
|
+
* DialogButton — action button for a dialog footer with a minimum width preset. Defaults to the `primary` variant. Wraps `<Button>` and exposes the same callback / disabled / loading / type / icon contract.
|
|
19
21
|
*
|
|
20
22
|
* ### CSS Custom Properties
|
|
21
23
|
* | Property | Description | Default |
|
|
@@ -4,6 +4,7 @@ import { untrack } from 'svelte';
|
|
|
4
4
|
let { dialog } = $props();
|
|
5
5
|
let dialogElement = $state();
|
|
6
6
|
const isActive = $derived(Dialogs.active(dialog.containerId)?.id === dialog.id);
|
|
7
|
+
const isStacked = $derived(Dialogs.dialogs(dialog.containerId).findIndex((d) => d.id === dialog.id) > 0);
|
|
7
8
|
const canDismiss = $derived(!dialog.controller.settings.nonCancelable && dialog.controller.settings.closeOnEsc);
|
|
8
9
|
const DialogView = $derived(dialog.view);
|
|
9
10
|
// TEMP: Workaround for Chromium bug where preventDefault() on cancel event
|
|
@@ -65,6 +66,7 @@ const isStretchContent = $derived(position === 'full-screen' || position === 'fu
|
|
|
65
66
|
bind:this={dialogElement}
|
|
66
67
|
class="dialog-container"
|
|
67
68
|
class:dialog-container--inactive={!isActive}
|
|
69
|
+
class:dialog-container--stacked={isStacked}
|
|
68
70
|
class:dialog-container--size-small={size === 'small'}
|
|
69
71
|
class:dialog-container--size-medium={size === 'medium'}
|
|
70
72
|
class:dialog-container--size-default={size === 'default'}
|
|
@@ -150,6 +152,9 @@ DialogContainer — wraps the native `<dialog>` element with sizing, positioning
|
|
|
150
152
|
background: var(--_dialog-container--backdrop);
|
|
151
153
|
animation: dialog-container-backdrop-fade-in var(--sc-kit--duration--slow) var(--sc-kit--ease--out) both;
|
|
152
154
|
}
|
|
155
|
+
.dialog-container--stacked::backdrop {
|
|
156
|
+
animation: none;
|
|
157
|
+
}
|
|
153
158
|
.dialog-container--inactive::backdrop {
|
|
154
159
|
background: transparent;
|
|
155
160
|
}
|