@ims360/svelte-ivory 0.2.1 → 0.2.2
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.
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
children: Snippet;
|
|
16
16
|
placement?: DrawerPlacement;
|
|
17
17
|
closeOnOutsideClick?: boolean;
|
|
18
|
+
/** Overwrites entire content of the drawer */
|
|
19
|
+
inner?: Snippet;
|
|
18
20
|
};
|
|
19
21
|
</script>
|
|
20
22
|
|
|
@@ -29,6 +31,7 @@
|
|
|
29
31
|
fly(e, { x: placement === 'right' ? '100%' : '-100%', duration: 200 }),
|
|
30
32
|
outTransition = (e) =>
|
|
31
33
|
fly(e, { x: placement === 'right' ? '100%' : '-100%', duration: 200 }),
|
|
34
|
+
inner,
|
|
32
35
|
...rest
|
|
33
36
|
}: DrawerProps = $props();
|
|
34
37
|
|
|
@@ -68,21 +71,25 @@
|
|
|
68
71
|
out:outTransition|global
|
|
69
72
|
{...rest}
|
|
70
73
|
>
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{title}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
{#if inner}
|
|
75
|
+
{@render inner()}
|
|
76
|
+
{:else}
|
|
77
|
+
<div class="flex flex-row items-center justify-between gap-8">
|
|
78
|
+
{#if title}
|
|
79
|
+
<Heading class="flex grow flex-row items-center gap-4">
|
|
80
|
+
{#if typeof title === 'function'}
|
|
81
|
+
{@render title()}
|
|
82
|
+
{:else}
|
|
83
|
+
{title}
|
|
84
|
+
{/if}
|
|
85
|
+
</Heading>
|
|
86
|
+
{/if}
|
|
87
|
+
<button class="group ml-auto flex justify-end" type="button" onclick={close}>
|
|
88
|
+
<X class="h-full w-auto transition-[stroke-width] group-hover:stroke-3" />
|
|
89
|
+
</button>
|
|
90
|
+
</div>
|
|
91
|
+
{@render children()}
|
|
92
|
+
{/if}
|
|
86
93
|
</div>
|
|
87
94
|
</HiddenBackground>
|
|
88
95
|
{/if}
|
|
@@ -7,6 +7,8 @@ export type DrawerProps = TransitionProps & {
|
|
|
7
7
|
children: Snippet;
|
|
8
8
|
placement?: DrawerPlacement;
|
|
9
9
|
closeOnOutsideClick?: boolean;
|
|
10
|
+
/** Overwrites entire content of the drawer */
|
|
11
|
+
inner?: Snippet;
|
|
10
12
|
};
|
|
11
13
|
declare const Drawer: import("svelte").Component<DrawerProps, {
|
|
12
14
|
close: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/drawer/Drawer.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAKtC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Drawer.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/drawer/Drawer.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAKtC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAwEN,QAAA,MAAM,MAAM;;;;;MAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
children: Snippet;
|
|
16
16
|
placement?: DrawerPlacement;
|
|
17
17
|
closeOnOutsideClick?: boolean;
|
|
18
|
+
/** Overwrites entire content of the drawer */
|
|
19
|
+
inner?: Snippet;
|
|
18
20
|
};
|
|
19
21
|
</script>
|
|
20
22
|
|
|
@@ -29,6 +31,7 @@
|
|
|
29
31
|
fly(e, { x: placement === 'right' ? '100%' : '-100%', duration: 200 }),
|
|
30
32
|
outTransition = (e) =>
|
|
31
33
|
fly(e, { x: placement === 'right' ? '100%' : '-100%', duration: 200 }),
|
|
34
|
+
inner,
|
|
32
35
|
...rest
|
|
33
36
|
}: DrawerProps = $props();
|
|
34
37
|
|
|
@@ -68,21 +71,25 @@
|
|
|
68
71
|
out:outTransition|global
|
|
69
72
|
{...rest}
|
|
70
73
|
>
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{title}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
{#if inner}
|
|
75
|
+
{@render inner()}
|
|
76
|
+
{:else}
|
|
77
|
+
<div class="flex flex-row items-center justify-between gap-8">
|
|
78
|
+
{#if title}
|
|
79
|
+
<Heading class="flex grow flex-row items-center gap-4">
|
|
80
|
+
{#if typeof title === 'function'}
|
|
81
|
+
{@render title()}
|
|
82
|
+
{:else}
|
|
83
|
+
{title}
|
|
84
|
+
{/if}
|
|
85
|
+
</Heading>
|
|
86
|
+
{/if}
|
|
87
|
+
<button class="group ml-auto flex justify-end" type="button" onclick={close}>
|
|
88
|
+
<X class="h-full w-auto transition-[stroke-width] group-hover:stroke-3" />
|
|
89
|
+
</button>
|
|
90
|
+
</div>
|
|
91
|
+
{@render children()}
|
|
92
|
+
{/if}
|
|
86
93
|
</div>
|
|
87
94
|
</HiddenBackground>
|
|
88
95
|
{/if}
|