@celar-ui/svelte 0.0.18 → 0.1.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/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { default as Card } from './containment/Card.svelte';
|
|
|
9
9
|
export { default as Breadcrumb } from './containment/Breadcrumb.svelte';
|
|
10
10
|
export { default as Avatar } from './containment/Avatar.svelte';
|
|
11
11
|
export { default as Dialog } from './overlay/Dialog.svelte';
|
|
12
|
+
export { default as MinimalDialog } from './overlay/MinimalDialog.svelte';
|
|
12
13
|
export { default as Gap } from './misc/Gap.svelte';
|
|
13
14
|
export { default as DuckSpinner } from './misc/DuckSpinner.svelte';
|
|
14
15
|
export { default as DotSpinner } from './misc/DotSpinner.svelte';
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { default as Card } from './containment/Card.svelte';
|
|
|
10
10
|
export { default as Breadcrumb } from './containment/Breadcrumb.svelte';
|
|
11
11
|
export { default as Avatar } from './containment/Avatar.svelte';
|
|
12
12
|
export { default as Dialog } from './overlay/Dialog.svelte';
|
|
13
|
+
export { default as MinimalDialog } from './overlay/MinimalDialog.svelte';
|
|
13
14
|
export { default as Gap } from './misc/Gap.svelte';
|
|
14
15
|
export { default as DuckSpinner } from './misc/DuckSpinner.svelte';
|
|
15
16
|
export { default as DotSpinner } from './misc/DotSpinner.svelte';
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
sm?: boolean;
|
|
14
14
|
md?: boolean;
|
|
15
15
|
fluid?: boolean;
|
|
16
|
+
transitionDuration?: number;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
let {
|
|
@@ -25,10 +26,9 @@
|
|
|
25
26
|
sm,
|
|
26
27
|
md,
|
|
27
28
|
fluid,
|
|
29
|
+
transitionDuration = 200,
|
|
28
30
|
...rest
|
|
29
31
|
}: DialogProps = $props();
|
|
30
|
-
|
|
31
|
-
let duration = 200;
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<BitDialog.Root {...rest} bind:open>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<BitDialog.Overlay forceMount data-celar-dialog-overlay>
|
|
42
42
|
{#snippet child({ props, open })}
|
|
43
43
|
{#if open}
|
|
44
|
-
<div {...props} transition:fade={{ duration }}></div>
|
|
44
|
+
<div {...props} transition:fade={{ duration: transitionDuration }}></div>
|
|
45
45
|
{/if}
|
|
46
46
|
{/snippet}
|
|
47
47
|
</BitDialog.Overlay>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
>
|
|
56
56
|
{#snippet child({ props, open })}
|
|
57
57
|
{#if open}
|
|
58
|
-
<div {...props} transition:fly={{ duration, y: 50 }}>
|
|
58
|
+
<div {...props} transition:fly={{ duration: transitionDuration, y: 50 }}>
|
|
59
59
|
<div data-dialog-header>
|
|
60
60
|
<BitDialog.Title children={title} data-celar-dialog-title />
|
|
61
61
|
<BitDialog.Close>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import './styles/dialog.scss';
|
|
3
|
+
import { fade, fly } from 'svelte/transition';
|
|
4
|
+
import { Dialog as BitDialog, type DialogRootProps } from 'bits-ui';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
|
+
|
|
7
|
+
type MinimalDialogProps = DialogRootProps & {
|
|
8
|
+
trigger?: Snippet<[{ props: Record<string, unknown> }]>;
|
|
9
|
+
xs?: boolean;
|
|
10
|
+
sm?: boolean;
|
|
11
|
+
md?: boolean;
|
|
12
|
+
fluid?: boolean;
|
|
13
|
+
transitionDuration?: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
open = $bindable(false),
|
|
18
|
+
trigger,
|
|
19
|
+
children,
|
|
20
|
+
xs,
|
|
21
|
+
sm,
|
|
22
|
+
md,
|
|
23
|
+
fluid,
|
|
24
|
+
transitionDuration = 200,
|
|
25
|
+
...rest
|
|
26
|
+
}: MinimalDialogProps = $props();
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<BitDialog.Root {...rest} bind:open>
|
|
30
|
+
<BitDialog.Trigger>
|
|
31
|
+
{#snippet child({ props })}
|
|
32
|
+
{@render trigger?.({ props })}
|
|
33
|
+
{/snippet}
|
|
34
|
+
</BitDialog.Trigger>
|
|
35
|
+
<BitDialog.Portal>
|
|
36
|
+
<BitDialog.Overlay forceMount data-celar-dialog-overlay>
|
|
37
|
+
{#snippet child({ props, open })}
|
|
38
|
+
{#if open}
|
|
39
|
+
<div {...props} transition:fade={{ duration: transitionDuration }}></div>
|
|
40
|
+
{/if}
|
|
41
|
+
{/snippet}
|
|
42
|
+
</BitDialog.Overlay>
|
|
43
|
+
<BitDialog.Content
|
|
44
|
+
forceMount
|
|
45
|
+
data-xs={xs}
|
|
46
|
+
data-sm={sm}
|
|
47
|
+
data-md={md}
|
|
48
|
+
data-fluid={fluid}
|
|
49
|
+
data-celar-dialog-content
|
|
50
|
+
>
|
|
51
|
+
{#snippet child({ props, open })}
|
|
52
|
+
{#if open}
|
|
53
|
+
<div {...props} transition:fly={{ duration: transitionDuration, y: 50 }}>
|
|
54
|
+
<div data-dialog-body>
|
|
55
|
+
{@render children?.()}
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
{/if}
|
|
59
|
+
{/snippet}
|
|
60
|
+
</BitDialog.Content>
|
|
61
|
+
</BitDialog.Portal>
|
|
62
|
+
</BitDialog.Root>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './styles/dialog.scss';
|
|
2
|
+
import { type DialogRootProps } from 'bits-ui';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
type MinimalDialogProps = DialogRootProps & {
|
|
5
|
+
trigger?: Snippet<[{
|
|
6
|
+
props: Record<string, unknown>;
|
|
7
|
+
}]>;
|
|
8
|
+
xs?: boolean;
|
|
9
|
+
sm?: boolean;
|
|
10
|
+
md?: boolean;
|
|
11
|
+
fluid?: boolean;
|
|
12
|
+
transitionDuration?: number;
|
|
13
|
+
};
|
|
14
|
+
declare const MinimalDialog: import("svelte").Component<MinimalDialogProps, {}, "open">;
|
|
15
|
+
type MinimalDialog = ReturnType<typeof MinimalDialog>;
|
|
16
|
+
export default MinimalDialog;
|