@functionalcms/svelte-components 3.5.19 → 4.0.0-pre
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/css/functional.css +1 -1
- package/css/functional.css.map +1 -1
- package/dist/auth/authenticationHandle.js +0 -4
- package/dist/auth/redisSessionProvider.js +1 -2
- package/dist/auth/sessionIdGenerator.d.ts +1 -1
- package/dist/components/form/Button.svelte +379 -0
- package/dist/components/form/Button.svelte.d.ts +27 -0
- package/dist/components/form/Input.d.ts +21 -0
- package/dist/components/form/Input.js +23 -0
- package/dist/components/form/Input.svelte +142 -177
- package/dist/components/form/Input.svelte.d.ts +24 -46
- package/dist/components/{Banner.svelte → layouts/Banner.svelte} +5 -5
- package/dist/components/layouts/DefaultLayout.svelte +5 -5
- package/dist/components/layouts/DefaultLayout.svelte.d.ts +4 -4
- package/dist/components/layouts/SimpleFooter.svelte +4 -4
- package/dist/components/layouts/SimpleFooter.svelte.d.ts +3 -3
- package/dist/components/layouts/Well.svelte +46 -0
- package/dist/components/layouts/Well.svelte.d.ts +12 -0
- package/dist/components/menu/CollapsibleMenu.svelte +2 -2
- package/dist/components/menu/CollapsibleMenu.svelte.d.ts +3 -16
- package/dist/components/menu/DynamicMenu.svelte +25 -13
- package/dist/components/menu/DynamicMenu.svelte.d.ts +10 -28
- package/dist/components/menu/HamburgerMenu.svelte +29 -21
- package/dist/components/menu/HamburgerMenu.svelte.d.ts +11 -24
- package/dist/components/menu/ListMenu.svelte +53 -0
- package/dist/components/menu/ListMenu.svelte.d.ts +17 -0
- package/dist/components/menu/{Menu.d.ts → types.d.ts} +2 -0
- package/dist/components/menu/{Menu.js → types.js} +5 -0
- package/dist/components/presentation/Card.svelte +77 -92
- package/dist/components/presentation/Card.svelte.d.ts +10 -13
- package/dist/components/presentation/{Carusele.d.ts → Carousel.d.ts} +1 -1
- package/dist/components/presentation/Carousel.svelte +98 -1
- package/dist/components/presentation/Carousel.svelte.d.ts +14 -15
- package/dist/components/presentation/Drawer.svelte +131 -0
- package/dist/components/presentation/Drawer.svelte.d.ts +13 -0
- package/dist/components/presentation/Gallery.svelte +7 -7
- package/dist/components/presentation/Gallery.svelte.d.ts +3 -3
- package/dist/components/presentation/ImageCompare.svelte +39 -46
- package/dist/components/presentation/ImageCompare.svelte.d.ts +8 -26
- package/dist/components/presentation/Link.svelte +362 -0
- package/dist/components/presentation/Link.svelte.d.ts +27 -0
- package/dist/components/presentation/Logo.svelte +36 -0
- package/dist/components/presentation/Logo.svelte.d.ts +8 -0
- package/dist/components/presentation/ShowItem.d.ts +7 -7
- package/dist/components/presentation/ShowItem.js +1 -8
- package/dist/index-server.d.ts +0 -1
- package/dist/index-server.js +0 -3
- package/dist/index.d.ts +16 -26
- package/dist/index.js +39 -57
- package/dist/server-side/getServices.d.ts +1 -1
- package/dist/server-side/types.d.ts +1 -2
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +54 -0
- package/package.json +27 -27
- package/dist/components/CssHelper.d.ts +0 -1
- package/dist/components/CssHelper.js +0 -3
- package/dist/components/Link.svelte +0 -349
- package/dist/components/Link.svelte.d.ts +0 -48
- package/dist/components/Logo.svelte +0 -38
- package/dist/components/Logo.svelte.d.ts +0 -28
- package/dist/components/Spacer.svelte +0 -22
- package/dist/components/Spacer.svelte.d.ts +0 -6
- package/dist/components/Well.svelte +0 -40
- package/dist/components/Well.svelte.d.ts +0 -12
- package/dist/components/agnostic/Button/Button.svelte +0 -371
- package/dist/components/agnostic/Button/Button.svelte.d.ts +0 -52
- package/dist/components/agnostic/Button/ButtonGroup.svelte +0 -21
- package/dist/components/agnostic/Button/ButtonGroup.svelte.d.ts +0 -32
- package/dist/components/agnostic/Button/button-base.css +0 -12
- package/dist/components/agnostic/Button/button-core.css +0 -237
- package/dist/components/agnostic/Button/button-empty.css +0 -31
- package/dist/components/agnostic/Button/button-group.css +0 -8
- package/dist/components/agnostic/Close/Close.svelte +0 -124
- package/dist/components/agnostic/Close/Close.svelte.d.ts +0 -25
- package/dist/components/agnostic/Close/api.d.ts +0 -1
- package/dist/components/agnostic/Disclose/Disclose.svelte +0 -116
- package/dist/components/agnostic/Disclose/Disclose.svelte.d.ts +0 -11
- package/dist/components/agnostic/Divider/Divider.svelte +0 -141
- package/dist/components/agnostic/Divider/Divider.svelte.d.ts +0 -24
- package/dist/components/agnostic/Divider/api.d.ts +0 -3
- package/dist/components/agnostic/Divider/api.js +0 -1
- package/dist/components/agnostic/Loader/Loader.svelte +0 -116
- package/dist/components/agnostic/Loader/Loader.svelte.d.ts +0 -22
- package/dist/components/agnostic/animation.css +0 -37
- package/dist/components/blog/BlogDescription.svelte +0 -9
- package/dist/components/blog/BlogDescription.svelte.d.ts +0 -23
- package/dist/components/blog/BlogPost.d.ts +0 -13
- package/dist/components/blog/BlogPost.js +0 -1
- package/dist/components/blog/BlogTitle.svelte +0 -19
- package/dist/components/blog/BlogTitle.svelte.d.ts +0 -23
- package/dist/components/blog/blog.d.ts +0 -8
- package/dist/components/blog/blog.js +0 -29
- package/dist/components/converters/ShowItemToNavigationItems.d.ts +0 -3
- package/dist/components/converters/ShowItemToNavigationItems.js +0 -10
- package/dist/components/form/DateTimePicker.svelte +0 -59
- package/dist/components/form/DateTimePicker.svelte.d.ts +0 -18
- package/dist/components/form/InputAddonItem.svelte +0 -42
- package/dist/components/form/InputAddonItem.svelte.d.ts +0 -31
- package/dist/components/form/InputTypes.d.ts +0 -9
- package/dist/components/form/InputTypes.js +0 -10
- package/dist/components/form/Select.svelte +0 -157
- package/dist/components/form/Select.svelte.d.ts +0 -34
- package/dist/components/form/Switch.svelte +0 -275
- package/dist/components/form/Switch.svelte.d.ts +0 -30
- package/dist/components/menu/Menu.svelte +0 -526
- package/dist/components/menu/Menu.svelte.d.ts +0 -33
- package/dist/components/menu/MenuItem.svelte +0 -121
- package/dist/components/menu/MenuItem.svelte.d.ts +0 -39
- package/dist/components/menu/NavigationItems.svelte +0 -44
- package/dist/components/menu/NavigationItems.svelte.d.ts +0 -32
- package/dist/components/menu/authentication.d.ts +0 -1
- package/dist/components/menu/authentication.js +0 -6
- package/dist/components/presentation/Carousel/carousel-content.svelte +0 -35
- package/dist/components/presentation/Carousel/carousel-content.svelte.d.ts +0 -28
- package/dist/components/presentation/Carousel/carousel-item.svelte +0 -25
- package/dist/components/presentation/Carousel/carousel-item.svelte.d.ts +0 -28
- package/dist/components/presentation/Carousel/carousel-next.svelte +0 -39
- package/dist/components/presentation/Carousel/carousel-next.svelte.d.ts +0 -18
- package/dist/components/presentation/Carousel/carousel-previous.svelte +0 -40
- package/dist/components/presentation/Carousel/carousel-previous.svelte.d.ts +0 -18
- package/dist/components/presentation/Carousel/carousel.svelte +0 -99
- package/dist/components/presentation/Carousel/carousel.svelte.d.ts +0 -31
- package/dist/components/presentation/Carousel/context.d.ts +0 -32
- package/dist/components/presentation/Carousel/context.js +0 -12
- package/dist/components/presentation/Carusele.js +0 -5
- /package/dist/components/{Markdown.svelte → content/Markdown.svelte} +0 -0
- /package/dist/components/{Markdown.svelte.d.ts → content/Markdown.svelte.d.ts} +0 -0
- /package/dist/components/{Banner.svelte.d.ts → layouts/Banner.svelte.d.ts} +0 -0
- /package/dist/components/{agnostic/Close/api.js → presentation/Carousel.js} +0 -0
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { page } from '$app/state';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
|
|
5
|
-
interface
|
|
6
|
-
headerIsSticky
|
|
7
|
-
canonicalUrl
|
|
5
|
+
interface Props {
|
|
6
|
+
headerIsSticky?: boolean;
|
|
7
|
+
canonicalUrl?: string;
|
|
8
8
|
header?: Snippet;
|
|
9
9
|
footer?: Snippet;
|
|
10
10
|
stickyFooter?: Snippet;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
stickyFooter,
|
|
19
19
|
headerIsSticky = false,
|
|
20
20
|
canonicalUrl = ''
|
|
21
|
-
}:
|
|
21
|
+
}: Props = $props();
|
|
22
22
|
|
|
23
23
|
let headerCss = $derived(headerIsSticky ? 'sticky' : '');
|
|
24
24
|
</script>
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
<style>
|
|
54
54
|
footer.sticky {
|
|
55
55
|
flex-shrink: 0;
|
|
56
|
-
background-color: var(--
|
|
56
|
+
background-color: var(--light-modelight);
|
|
57
57
|
flex-shrink: 0;
|
|
58
58
|
}
|
|
59
59
|
</style>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
interface
|
|
3
|
-
headerIsSticky
|
|
4
|
-
canonicalUrl
|
|
2
|
+
interface Props {
|
|
3
|
+
headerIsSticky?: boolean;
|
|
4
|
+
canonicalUrl?: string;
|
|
5
5
|
header?: Snippet;
|
|
6
6
|
footer?: Snippet;
|
|
7
7
|
stickyFooter?: Snippet;
|
|
8
8
|
children: Snippet;
|
|
9
9
|
}
|
|
10
|
-
declare const DefaultLayout: import("svelte").Component<
|
|
10
|
+
declare const DefaultLayout: import("svelte").Component<Props, {}, "">;
|
|
11
11
|
type DefaultLayout = ReturnType<typeof DefaultLayout>;
|
|
12
12
|
export default DefaultLayout;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
interface
|
|
2
|
+
interface Props {
|
|
3
3
|
companyName: string;
|
|
4
|
-
motto
|
|
4
|
+
motto?: string;
|
|
5
5
|
logoUrl?: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
let { companyName = '', motto = '', logoUrl }:
|
|
8
|
+
let { companyName = '', motto = '', logoUrl = '' }: Props = $props();
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
|
-
<aside class="
|
|
11
|
+
<aside class="grid-flow-col items-center">
|
|
12
12
|
<img src={logoUrl} alt={companyName} />
|
|
13
13
|
<p>{motto}</p>
|
|
14
14
|
<p>Copyright © 2025 - All right reserved by {companyName}</p>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface Props {
|
|
2
2
|
companyName: string;
|
|
3
|
-
motto
|
|
3
|
+
motto?: string;
|
|
4
4
|
logoUrl?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const SimpleFooter: import("svelte").Component<
|
|
6
|
+
declare const SimpleFooter: import("svelte").Component<Props, {}, "">;
|
|
7
7
|
type SimpleFooter = ReturnType<typeof SimpleFooter>;
|
|
8
8
|
export default SimpleFooter;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { cn } from '../../utils.js';
|
|
4
|
+
import { AlignItmes, Justify, Orientation } from '../Styling.js';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
css?: string;
|
|
8
|
+
orientation?: Orientation;
|
|
9
|
+
justify?: Justify;
|
|
10
|
+
alignItems?: AlignItmes;
|
|
11
|
+
children: Snippet;
|
|
12
|
+
}
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
css = '',
|
|
16
|
+
orientation = Orientation.Column,
|
|
17
|
+
justify = Justify.Start,
|
|
18
|
+
alignItems = AlignItmes.Start
|
|
19
|
+
}: Props = $props();
|
|
20
|
+
|
|
21
|
+
let klasses = cn(
|
|
22
|
+
'flex',
|
|
23
|
+
`${orientation}`,
|
|
24
|
+
`${justify}`,
|
|
25
|
+
`${alignItems}`,
|
|
26
|
+
css ? css : ''
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<div class={klasses}>
|
|
31
|
+
{@render children()}
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<style>
|
|
35
|
+
div {
|
|
36
|
+
width: var(--mobile-content-width, 95%);
|
|
37
|
+
margin: var(--mobile-content-margin, var(--fluid-8));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@media (min-width: 960px) {
|
|
41
|
+
div {
|
|
42
|
+
width: var(--content-width, 95%);
|
|
43
|
+
margin: var(--content-margin, var(--fluid-8));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import { AlignItmes, Justify, Orientation } from '../Styling.js';
|
|
3
|
+
interface Props {
|
|
4
|
+
css?: string;
|
|
5
|
+
orientation?: Orientation;
|
|
6
|
+
justify?: Justify;
|
|
7
|
+
alignItems?: AlignItmes;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
}
|
|
10
|
+
declare const Well: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type Well = ReturnType<typeof Well>;
|
|
12
|
+
export default Well;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<!-- <script lang="ts">
|
|
2
2
|
import { Orientation, Placement } from '../Styling.js';
|
|
3
3
|
import ColumnMenu from './NavigationItems.svelte';
|
|
4
4
|
import { HeaderNavigationItem, defaultCss } from './Menu.js';
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
<div aria-expanded={expanded}>
|
|
31
31
|
<ColumnMenu {localPages} {orientation} css={cssClasses} />
|
|
32
32
|
</div>
|
|
33
|
-
{/if}
|
|
33
|
+
{/if} -->
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { Orientation, Placement } from '../Styling.js';
|
|
2
|
-
import { HeaderNavigationItem } from './Menu.js';
|
|
3
1
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
2
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
3
|
$$bindings?: Bindings;
|
|
6
4
|
} & Exports;
|
|
7
|
-
(internal: unknown, props:
|
|
5
|
+
(internal: unknown, props: {
|
|
8
6
|
$$events?: Events;
|
|
9
7
|
$$slots?: Slots;
|
|
10
8
|
}): Exports & {
|
|
@@ -13,19 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
13
11
|
};
|
|
14
12
|
z_$$bindings?: Bindings;
|
|
15
13
|
}
|
|
16
|
-
declare const CollapsibleMenu: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
-
css?: {
|
|
18
|
-
buttonCss: string[];
|
|
19
|
-
container: string[];
|
|
20
|
-
link: string[];
|
|
21
|
-
};
|
|
22
|
-
contentPosition?: Placement;
|
|
23
|
-
orientation?: Orientation;
|
|
24
|
-
localPages?: Array<HeaderNavigationItem>;
|
|
25
|
-
}, {
|
|
14
|
+
declare const CollapsibleMenu: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
26
15
|
[evt: string]: CustomEvent<any>;
|
|
27
|
-
}, {
|
|
28
|
-
handle: {};
|
|
29
|
-
}, {}, string>;
|
|
16
|
+
}, {}, {}, string>;
|
|
30
17
|
type CollapsibleMenu = InstanceType<typeof CollapsibleMenu>;
|
|
31
18
|
export default CollapsibleMenu;
|
|
@@ -1,27 +1,39 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { cn } from '../../utils.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import { HeaderNavigationItem, isAuthenticated, selectVisible } from './types.js';
|
|
5
|
+
import { page } from '$app/state';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
interface Props {
|
|
8
|
+
mobile: Snippet<[Array<HeaderNavigationItem>]>;
|
|
9
|
+
desktop: Snippet<[Array<HeaderNavigationItem>]>;
|
|
10
|
+
localPages: Array<HeaderNavigationItem>;
|
|
11
|
+
css?: { container: string };
|
|
12
|
+
}
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
let {
|
|
15
|
+
mobile: mobile,
|
|
16
|
+
desktop: desktop,
|
|
17
|
+
css = { container: "" },
|
|
18
|
+
localPages = []
|
|
19
|
+
}: Props = $props();
|
|
12
20
|
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
let pagesVisiblity = $derived(isAuthenticated(page));
|
|
22
|
+
let visibleNavItems = $derived(selectVisible(localPages, pagesVisiblity));
|
|
15
23
|
|
|
16
|
-
|
|
24
|
+
let klasses = $derived(cn('flex', 'flex-dynamic-row', css.container));
|
|
17
25
|
</script>
|
|
18
26
|
|
|
19
27
|
<nav class={klasses}>
|
|
20
28
|
<div class="mobile">
|
|
21
|
-
|
|
29
|
+
{#if mobile}
|
|
30
|
+
{@render mobile(visibleNavItems)}
|
|
31
|
+
{/if}
|
|
22
32
|
</div>
|
|
23
33
|
<div class="desktop">
|
|
24
|
-
|
|
34
|
+
{#if desktop}
|
|
35
|
+
{@render desktop(visibleNavItems)}
|
|
36
|
+
{/if}
|
|
25
37
|
</div>
|
|
26
38
|
</nav>
|
|
27
39
|
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
$$events?: Events;
|
|
8
|
-
$$slots?: Slots;
|
|
9
|
-
}): Exports & {
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const DynamicMenu: $$__sveltets_2_IsomorphicComponent<{
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import { HeaderNavigationItem } from './types.js';
|
|
3
|
+
interface Props {
|
|
4
|
+
mobile: Snippet<[Array<HeaderNavigationItem>]>;
|
|
5
|
+
desktop: Snippet<[Array<HeaderNavigationItem>]>;
|
|
6
|
+
localPages: Array<HeaderNavigationItem>;
|
|
16
7
|
css?: {
|
|
17
|
-
container: string
|
|
18
|
-
};
|
|
19
|
-
localPages?: Array<HeaderNavigationItem>;
|
|
20
|
-
}, {
|
|
21
|
-
[evt: string]: CustomEvent<any>;
|
|
22
|
-
}, {
|
|
23
|
-
mobile: {
|
|
24
|
-
pages: any[];
|
|
8
|
+
container: string;
|
|
25
9
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, {}, string>;
|
|
30
|
-
type DynamicMenu = InstanceType<typeof DynamicMenu>;
|
|
10
|
+
}
|
|
11
|
+
declare const DynamicMenu: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type DynamicMenu = ReturnType<typeof DynamicMenu>;
|
|
31
13
|
export default DynamicMenu;
|
|
@@ -1,38 +1,46 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { HeaderNavigationItem, defaultCss } from './
|
|
2
|
+
import { HeaderNavigationItem, defaultCss } from './types.js';
|
|
3
3
|
import { afterNavigate } from '$app/navigation';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import
|
|
4
|
+
import { cn } from '../../utils.js';
|
|
5
|
+
import { Placement } from '../Styling.js';
|
|
6
|
+
import Button from '../form/Button.svelte';
|
|
7
|
+
import Drawer from '../presentation/Drawer.svelte';
|
|
8
|
+
import Menu from './ListMenu.svelte';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
interface Css {
|
|
11
|
+
buttonCss: string;
|
|
12
|
+
container: string;
|
|
13
|
+
link: string;
|
|
14
|
+
}
|
|
15
|
+
interface Props {
|
|
16
|
+
css?: Css;
|
|
17
|
+
noBorder?: boolean;
|
|
18
|
+
placement?: Placement;
|
|
19
|
+
localPages: Array<HeaderNavigationItem>;
|
|
20
|
+
}
|
|
17
21
|
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
let {
|
|
23
|
+
localPages = [],
|
|
24
|
+
css = { buttonCss: '', container: '', link: '' },
|
|
25
|
+
placement = Placement.Start
|
|
26
|
+
}: Props = $props();
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
let isOpen = $state(false);
|
|
29
|
+
let buttonCss = $derived(cn('hamburger-handle', css.buttonCss));
|
|
25
30
|
</script>
|
|
26
31
|
|
|
27
32
|
<Button
|
|
28
33
|
type="button"
|
|
29
|
-
data-a11y-dialog-show="hamburger-menu"
|
|
30
34
|
mode="primary"
|
|
31
|
-
noBorder
|
|
32
35
|
css={buttonCss}
|
|
33
36
|
>
|
|
34
37
|
☰
|
|
35
38
|
</Button>
|
|
39
|
+
|
|
40
|
+
<Drawer {placement} open={isOpen} clickAway={() => isOpen != isOpen}>
|
|
41
|
+
<Menu {localPages} {css}>
|
|
42
|
+
</Menu>
|
|
43
|
+
</Drawer>
|
|
36
44
|
<!-- <Drawer
|
|
37
45
|
id="hamburger-menu"
|
|
38
46
|
drawerRoot="#drawer-root"
|
|
@@ -1,29 +1,16 @@
|
|
|
1
|
-
import { HeaderNavigationItem } from './
|
|
1
|
+
import { HeaderNavigationItem } from './types.js';
|
|
2
2
|
import { Placement } from '../Styling.js';
|
|
3
|
-
interface
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(internal: unknown, props: Props & {
|
|
8
|
-
$$events?: Events;
|
|
9
|
-
$$slots?: Slots;
|
|
10
|
-
}): Exports & {
|
|
11
|
-
$set?: any;
|
|
12
|
-
$on?: any;
|
|
13
|
-
};
|
|
14
|
-
z_$$bindings?: Bindings;
|
|
3
|
+
interface Css {
|
|
4
|
+
buttonCss: string;
|
|
5
|
+
container: string;
|
|
6
|
+
link: string;
|
|
15
7
|
}
|
|
16
|
-
|
|
17
|
-
css?:
|
|
18
|
-
buttonCss: string[];
|
|
19
|
-
container: string[];
|
|
20
|
-
link: string[];
|
|
21
|
-
};
|
|
8
|
+
interface Props {
|
|
9
|
+
css?: Css;
|
|
22
10
|
noBorder?: boolean;
|
|
23
11
|
placement?: Placement;
|
|
24
|
-
localPages
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type HamburgerMenu = InstanceType<typeof HamburgerMenu>;
|
|
12
|
+
localPages: Array<HeaderNavigationItem>;
|
|
13
|
+
}
|
|
14
|
+
declare const HamburgerMenu: import("svelte").Component<Props, {}, "">;
|
|
15
|
+
type HamburgerMenu = ReturnType<typeof HamburgerMenu>;
|
|
29
16
|
export default HamburgerMenu;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type HeaderNavigationItem, isSelected } from './types.js';
|
|
3
|
+
import { Orientation } from '../Styling.js';
|
|
4
|
+
import { cn } from '../../utils.js';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
|
+
import { page } from '$app/state';
|
|
7
|
+
|
|
8
|
+
interface CssProps {
|
|
9
|
+
container?: string;
|
|
10
|
+
link?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
localPages: Array<HeaderNavigationItem>;
|
|
15
|
+
subItemRender?: Snippet<[Array<HeaderNavigationItem>]>;
|
|
16
|
+
css?: CssProps;
|
|
17
|
+
orientation?: Orientation;
|
|
18
|
+
includeSubpagesForSelect?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
subItemRender = undefined,
|
|
23
|
+
css = { container: '', link: '' },
|
|
24
|
+
localPages = [],
|
|
25
|
+
orientation = Orientation.Column,
|
|
26
|
+
includeSubpagesForSelect = true
|
|
27
|
+
}: Props = $props();
|
|
28
|
+
|
|
29
|
+
let containerCss = cn('flex', orientation, css.container ?? '');
|
|
30
|
+
let linkCss = cn(css.link ?? '');
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<ul class={containerCss} role="menu" aria-label="menu">
|
|
34
|
+
{#each localPages as pageItem}
|
|
35
|
+
<li
|
|
36
|
+
data-selected={isSelected(includeSubpagesForSelect, page, pageItem)}
|
|
37
|
+
class={linkCss}
|
|
38
|
+
role="none"
|
|
39
|
+
>
|
|
40
|
+
<span class="screenreader-only">Navigate to {pageItem.name}</span>
|
|
41
|
+
<a href={pageItem.path} role="menuitem">
|
|
42
|
+
{pageItem.name}
|
|
43
|
+
</a>
|
|
44
|
+
|
|
45
|
+
{#if subItemRender}
|
|
46
|
+
{@render subItemRender(pageItem.subItems ?? [])}
|
|
47
|
+
{/if}
|
|
48
|
+
</li>
|
|
49
|
+
{/each}
|
|
50
|
+
</ul>
|
|
51
|
+
|
|
52
|
+
<style>
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type HeaderNavigationItem } from './types.js';
|
|
2
|
+
import { Orientation } from '../Styling.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
interface CssProps {
|
|
5
|
+
container?: string;
|
|
6
|
+
link?: string;
|
|
7
|
+
}
|
|
8
|
+
interface Props {
|
|
9
|
+
localPages: Array<HeaderNavigationItem>;
|
|
10
|
+
subItemRender?: Snippet<[Array<HeaderNavigationItem>]>;
|
|
11
|
+
css?: CssProps;
|
|
12
|
+
orientation?: Orientation;
|
|
13
|
+
includeSubpagesForSelect?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const ListMenu: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type ListMenu = ReturnType<typeof ListMenu>;
|
|
17
|
+
export default ListMenu;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Page } from "@sveltejs/kit";
|
|
1
2
|
type ClickAction = () => void;
|
|
2
3
|
export declare enum Visiblity {
|
|
3
4
|
Always = 0,
|
|
@@ -18,4 +19,5 @@ export declare const defaultCss: {
|
|
|
18
19
|
container: never[];
|
|
19
20
|
link: never[];
|
|
20
21
|
};
|
|
22
|
+
export declare function isAuthenticated(page: Page): Visiblity.Authenticated | Visiblity.NotAuthenticated;
|
|
21
23
|
export {};
|
|
@@ -28,3 +28,8 @@ export const defaultCss = {
|
|
|
28
28
|
container: [],
|
|
29
29
|
link: []
|
|
30
30
|
};
|
|
31
|
+
export function isAuthenticated(page) {
|
|
32
|
+
const isAuthenticated = page?.data?.session != null;
|
|
33
|
+
const visibility = isAuthenticated ? Visiblity.Authenticated : Visiblity.NotAuthenticated;
|
|
34
|
+
return visibility;
|
|
35
|
+
}
|