@functionalcms/svelte-components 5.26.0 → 5.26.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.
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ButtonGroup, Spinner } from '@functionalcms/svelte-components';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
children: Snippet<[Array<any>]>;
|
|
7
|
+
buttons: Snippet;
|
|
8
|
+
header: string;
|
|
9
|
+
content: Promise<any>;
|
|
10
|
+
loading: string;
|
|
11
|
+
error: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
children,
|
|
16
|
+
buttons,
|
|
17
|
+
header,
|
|
18
|
+
content,
|
|
19
|
+
loading = 'Loading...',
|
|
20
|
+
error = 'An error occurred'
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
{#await content}
|
|
25
|
+
<div class="w-full h-full flex flex-col items-center justify-center">
|
|
26
|
+
<p>{loading}</p>
|
|
27
|
+
<Spinner size="16" type="bars" />
|
|
28
|
+
</div>
|
|
29
|
+
{:then items}
|
|
30
|
+
<article>
|
|
31
|
+
<header>
|
|
32
|
+
<h1>{header}</h1>
|
|
33
|
+
<ButtonGroup>
|
|
34
|
+
{@render buttons?.()}
|
|
35
|
+
</ButtonGroup>
|
|
36
|
+
</header>
|
|
37
|
+
<div>
|
|
38
|
+
{@render children?.(items)}
|
|
39
|
+
</div>
|
|
40
|
+
</article>
|
|
41
|
+
{:catch err}
|
|
42
|
+
<p>{error}: {err.message}</p>
|
|
43
|
+
{/await}
|
|
44
|
+
|
|
45
|
+
<style>
|
|
46
|
+
@reference "tailwindcss";
|
|
47
|
+
article {
|
|
48
|
+
height: 100%;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
}
|
|
52
|
+
article > div {
|
|
53
|
+
flex: 1;
|
|
54
|
+
min-height: 0;
|
|
55
|
+
}
|
|
56
|
+
header {
|
|
57
|
+
@apply mt-6 flex shrink-0;
|
|
58
|
+
}
|
|
59
|
+
h1 {
|
|
60
|
+
@apply uppercase w-1/5;
|
|
61
|
+
}
|
|
62
|
+
</style>
|
package/dist/index.d.ts
CHANGED
|
@@ -25,3 +25,4 @@ export { type getTags } from './components/blog/blogService.js';
|
|
|
25
25
|
export { getPosts } from './components/blog/blogService.js';
|
|
26
26
|
export { Tree } from '@keenmate/svelte-treeview';
|
|
27
27
|
export { default as EmptyState } from './components/content/EmptyState.svelte';
|
|
28
|
+
export { default as Page } from './components/content/Page.svelte';
|
package/dist/index.js
CHANGED
|
@@ -24,3 +24,4 @@ export {} from './components/blog/blogService.js';
|
|
|
24
24
|
export { getPosts } from './components/blog/blogService.js';
|
|
25
25
|
export { Tree } from '@keenmate/svelte-treeview';
|
|
26
26
|
export { default as EmptyState } from './components/content/EmptyState.svelte';
|
|
27
|
+
export { default as Page } from './components/content/Page.svelte';
|
package/package.json
CHANGED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { m } from "../../paraglide/messages";
|
|
3
|
-
import {
|
|
4
|
-
ButtonGroup,
|
|
5
|
-
Spinner,
|
|
6
|
-
} from "@functionalcms/svelte-components";
|
|
7
|
-
import type { Snippet } from "svelte";
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
children: Snippet<[Array<any>]>;
|
|
11
|
-
buttons: Snippet;
|
|
12
|
-
header: string;
|
|
13
|
-
content: Promise<any>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let { children, buttons, header, content }: Props = $props();
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
{#await content}
|
|
20
|
-
<div class="w-full h-full flex flex-col items-center justify-center">
|
|
21
|
-
<p>{m.common_loading({ item: "files" })}</p>
|
|
22
|
-
<Spinner size="16" type="bars" />
|
|
23
|
-
</div>
|
|
24
|
-
{:then items}
|
|
25
|
-
<article>
|
|
26
|
-
<header>
|
|
27
|
-
<h1>{header}</h1>
|
|
28
|
-
<ButtonGroup>
|
|
29
|
-
{@render buttons?.()}
|
|
30
|
-
</ButtonGroup>
|
|
31
|
-
</header>
|
|
32
|
-
<div>
|
|
33
|
-
{@render children?.(items)}
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
</article>
|
|
37
|
-
{:catch err}
|
|
38
|
-
<p>Error: {err.message}</p>
|
|
39
|
-
{/await}
|
|
40
|
-
|
|
41
|
-
<style>
|
|
42
|
-
@reference "tailwindcss";
|
|
43
|
-
article {
|
|
44
|
-
height: 100%;
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
}
|
|
48
|
-
article > div {
|
|
49
|
-
flex: 1;
|
|
50
|
-
min-height: 0;
|
|
51
|
-
}
|
|
52
|
-
header {
|
|
53
|
-
@apply mt-6 flex shrink-0;
|
|
54
|
-
}
|
|
55
|
-
h1 {
|
|
56
|
-
@apply uppercase w-1/5;
|
|
57
|
-
}
|
|
58
|
-
</style>
|
|
File without changes
|