@functionalcms/svelte-components 2.0.7 → 2.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/components/Banner.svelte +17 -0
- package/dist/components/Banner.svelte.d.ts +19 -0
- package/dist/components/Layout.svelte +41 -0
- package/dist/components/Layout.svelte.d.ts +33 -0
- package/dist/components/Logo.svelte +19 -7
- package/dist/components/SimpleFooter.svelte +13 -15
- package/dist/components/Spacer.svelte +18 -0
- package/dist/components/Spacer.svelte.d.ts +18 -0
- package/dist/components/Styling.d.ts +47 -0
- package/dist/components/Styling.js +52 -0
- package/dist/components/Well.svelte +28 -0
- package/dist/components/Well.svelte.d.ts +19 -0
- package/dist/components/menu/FlatMenu.svelte +119 -0
- package/dist/components/menu/FlatMenu.svelte.d.ts +18 -0
- package/dist/components/menu/HamburgerMenu.svelte +84 -0
- package/dist/components/menu/HamburgerMenu.svelte.d.ts +22 -0
- package/dist/css/properties.css +144 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.js +10 -9
- package/package.json +2 -1
- package/dist/authStore.d.ts +0 -18
- package/dist/authStore.js +0 -72
- package/dist/components/Header.svelte +0 -37
- package/dist/components/Header.svelte.d.ts +0 -32
- package/dist/components/Hero.svelte +0 -19
- package/dist/components/Hero.svelte.d.ts +0 -22
- package/dist/components/Position.d.ts +0 -5
- package/dist/components/Position.js +0 -6
- package/dist/constants.d.ts +0 -5
- package/dist/constants.js +0 -6
- /package/dist/components/{HeaderNavigationItem.d.ts → menu/Menu.d.ts} +0 -0
- /package/dist/components/{HeaderNavigationItem.js → menu/Menu.js} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script>export let background = "";
|
|
2
|
+
export let css = "";
|
|
3
|
+
$:
|
|
4
|
+
klasses = [
|
|
5
|
+
"flex",
|
|
6
|
+
css ? css : ""
|
|
7
|
+
].filter((c) => c).join(" ");
|
|
8
|
+
</script>
|
|
9
|
+
<style>
|
|
10
|
+
div {
|
|
11
|
+
background: var(--functional-banner-background);
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
|
|
15
|
+
<div style="--functional-banner-background: {background};" class={klasses}>
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
background?: string | undefined;
|
|
5
|
+
css?: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type BannerProps = typeof __propDef.props;
|
|
15
|
+
export type BannerEvents = typeof __propDef.events;
|
|
16
|
+
export type BannerSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Banner extends SvelteComponent<BannerProps, BannerEvents, BannerSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
:global(html), :global(body), :global(body > div) {
|
|
3
|
+
height: 100%;
|
|
4
|
+
}
|
|
5
|
+
:global(body > div) {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
}
|
|
9
|
+
:global(body > footer) {
|
|
10
|
+
flex-shrink: 0;
|
|
11
|
+
}
|
|
12
|
+
div {
|
|
13
|
+
flex: 1 0 auto;
|
|
14
|
+
}
|
|
15
|
+
footer {
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
|
|
20
|
+
<div>
|
|
21
|
+
{#if $$slots.header}
|
|
22
|
+
<header>
|
|
23
|
+
<slot name="header" />
|
|
24
|
+
</header>
|
|
25
|
+
{/if}
|
|
26
|
+
<main>
|
|
27
|
+
<slot />
|
|
28
|
+
</main>
|
|
29
|
+
{#if $$slots.footer}
|
|
30
|
+
<footer>
|
|
31
|
+
<slot name="footer" />
|
|
32
|
+
</footer>
|
|
33
|
+
{/if}
|
|
34
|
+
<div id="drawer-root"></div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
{#if $$slots.sticky_footer}
|
|
38
|
+
<footer>
|
|
39
|
+
<slot name="sticky_footer" />
|
|
40
|
+
</footer>
|
|
41
|
+
{/if}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} LayoutProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} LayoutEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} LayoutSlots */
|
|
4
|
+
export default class Layout extends SvelteComponent<{
|
|
5
|
+
[x: string]: never;
|
|
6
|
+
}, {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
}, {
|
|
9
|
+
header: {};
|
|
10
|
+
default: {};
|
|
11
|
+
footer: {};
|
|
12
|
+
sticky_footer: {};
|
|
13
|
+
}> {
|
|
14
|
+
}
|
|
15
|
+
export type LayoutProps = typeof __propDef.props;
|
|
16
|
+
export type LayoutEvents = typeof __propDef.events;
|
|
17
|
+
export type LayoutSlots = typeof __propDef.slots;
|
|
18
|
+
import { SvelteComponent } from "svelte";
|
|
19
|
+
declare const __propDef: {
|
|
20
|
+
props: {
|
|
21
|
+
[x: string]: never;
|
|
22
|
+
};
|
|
23
|
+
events: {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
};
|
|
26
|
+
slots: {
|
|
27
|
+
header: {};
|
|
28
|
+
default: {};
|
|
29
|
+
footer: {};
|
|
30
|
+
sticky_footer: {};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
1
|
+
<style>
|
|
2
|
+
a {
|
|
3
|
+
display: var(--functional-logo-display, 'inline-block');
|
|
4
|
+
}
|
|
5
|
+
a img {
|
|
6
|
+
width: 80vw;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@media (min-width: 960px) {
|
|
10
|
+
a img {
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
</style>
|
|
15
|
+
|
|
16
|
+
<script>export let companyName;
|
|
3
17
|
export let logoUrl;
|
|
4
18
|
</script>
|
|
5
19
|
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</a>
|
|
10
|
-
</div>
|
|
20
|
+
<a href="/">
|
|
21
|
+
<img src={logoUrl} alt={companyName} />
|
|
22
|
+
</a>
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
aside {
|
|
3
|
+
text-align: center;
|
|
4
|
+
font-size: smaller;
|
|
5
|
+
}
|
|
6
|
+
</style>
|
|
7
|
+
|
|
1
8
|
<script>export let companyName = "";
|
|
2
9
|
export let motto = "";
|
|
3
10
|
export let logoUrl;
|
|
4
11
|
</script>
|
|
5
12
|
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</aside>
|
|
13
|
-
</footer>
|
|
14
|
-
|
|
15
|
-
<style>
|
|
16
|
-
footer {
|
|
17
|
-
text-align: center;
|
|
18
|
-
font-size: smaller;
|
|
19
|
-
}
|
|
20
|
-
</style>
|
|
13
|
+
<aside class="items-center grid-flow-col">
|
|
14
|
+
<img src={logoUrl} alt={companyName} />
|
|
15
|
+
<p>{motto}</p>
|
|
16
|
+
<p>Copyright © 2024 - All right reserved by {companyName}</p>
|
|
17
|
+
<p>Powerd by <a href="https://functional-cms.com">Functional CMS</a></p>
|
|
18
|
+
</aside>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
div {
|
|
3
|
+
display: block;
|
|
4
|
+
height: 100%;
|
|
5
|
+
}
|
|
6
|
+
</style>
|
|
7
|
+
|
|
8
|
+
<script>import { Sizes } from "./Styling";
|
|
9
|
+
export let width = Sizes.V0;
|
|
10
|
+
export let height = Sizes.V0;
|
|
11
|
+
const klasses = [
|
|
12
|
+
width ? `w${width}` : "",
|
|
13
|
+
height ? `h${height}` : ""
|
|
14
|
+
].filter((c) => c).join(" ");
|
|
15
|
+
</script>
|
|
16
|
+
<div class={klasses}>
|
|
17
|
+
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { Sizes } from "./Styling";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
width?: Sizes | undefined;
|
|
6
|
+
height?: Sizes | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export type SpacerProps = typeof __propDef.props;
|
|
14
|
+
export type SpacerEvents = typeof __propDef.events;
|
|
15
|
+
export type SpacerSlots = typeof __propDef.slots;
|
|
16
|
+
export default class Spacer extends SvelteComponent<SpacerProps, SpacerEvents, SpacerSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare enum Justify {
|
|
2
|
+
Start = "start",
|
|
3
|
+
End = "end",
|
|
4
|
+
Center = "center",
|
|
5
|
+
Between = "between",
|
|
6
|
+
Around = "around"
|
|
7
|
+
}
|
|
8
|
+
export declare enum Placement {
|
|
9
|
+
Start = "start",
|
|
10
|
+
End = "end",
|
|
11
|
+
Top = "top",
|
|
12
|
+
Up = "up",
|
|
13
|
+
Bottom = "bottom",
|
|
14
|
+
Content = "content"
|
|
15
|
+
}
|
|
16
|
+
export declare enum Orientation {
|
|
17
|
+
Row = "row",
|
|
18
|
+
Column = "column",
|
|
19
|
+
DynamicRow = "row-dynamic"
|
|
20
|
+
}
|
|
21
|
+
export declare enum Position {
|
|
22
|
+
Left = 0,
|
|
23
|
+
Middle = 1,
|
|
24
|
+
Right = 2
|
|
25
|
+
}
|
|
26
|
+
export declare enum Sizes {
|
|
27
|
+
V0 = 0,
|
|
28
|
+
V2 = 2,
|
|
29
|
+
V4 = 4,
|
|
30
|
+
V6 = 6,
|
|
31
|
+
V8 = 8,
|
|
32
|
+
V10 = 10,
|
|
33
|
+
V12 = 12,
|
|
34
|
+
V14 = 14,
|
|
35
|
+
V16 = 16,
|
|
36
|
+
V18 = 18,
|
|
37
|
+
V20 = 20,
|
|
38
|
+
V24 = 24,
|
|
39
|
+
V32 = 32,
|
|
40
|
+
V36 = 36,
|
|
41
|
+
V40 = 40,
|
|
42
|
+
V48 = 48,
|
|
43
|
+
V56 = 56,
|
|
44
|
+
V64 = 64,
|
|
45
|
+
V72 = 72,
|
|
46
|
+
V80 = 80
|
|
47
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export var Justify;
|
|
2
|
+
(function (Justify) {
|
|
3
|
+
Justify["Start"] = "start";
|
|
4
|
+
Justify["End"] = "end";
|
|
5
|
+
Justify["Center"] = "center";
|
|
6
|
+
Justify["Between"] = "between";
|
|
7
|
+
Justify["Around"] = "around";
|
|
8
|
+
})(Justify || (Justify = {}));
|
|
9
|
+
export var Placement;
|
|
10
|
+
(function (Placement) {
|
|
11
|
+
Placement["Start"] = "start";
|
|
12
|
+
Placement["End"] = "end";
|
|
13
|
+
Placement["Top"] = "top";
|
|
14
|
+
Placement["Up"] = "up";
|
|
15
|
+
Placement["Bottom"] = "bottom";
|
|
16
|
+
Placement["Content"] = "content";
|
|
17
|
+
})(Placement || (Placement = {}));
|
|
18
|
+
export var Orientation;
|
|
19
|
+
(function (Orientation) {
|
|
20
|
+
Orientation["Row"] = "row";
|
|
21
|
+
Orientation["Column"] = "column";
|
|
22
|
+
Orientation["DynamicRow"] = "row-dynamic";
|
|
23
|
+
})(Orientation || (Orientation = {}));
|
|
24
|
+
export var Position;
|
|
25
|
+
(function (Position) {
|
|
26
|
+
Position[Position["Left"] = 0] = "Left";
|
|
27
|
+
Position[Position["Middle"] = 1] = "Middle";
|
|
28
|
+
Position[Position["Right"] = 2] = "Right";
|
|
29
|
+
})(Position || (Position = {}));
|
|
30
|
+
export var Sizes;
|
|
31
|
+
(function (Sizes) {
|
|
32
|
+
Sizes[Sizes["V0"] = 0] = "V0";
|
|
33
|
+
Sizes[Sizes["V2"] = 2] = "V2";
|
|
34
|
+
Sizes[Sizes["V4"] = 4] = "V4";
|
|
35
|
+
Sizes[Sizes["V6"] = 6] = "V6";
|
|
36
|
+
Sizes[Sizes["V8"] = 8] = "V8";
|
|
37
|
+
Sizes[Sizes["V10"] = 10] = "V10";
|
|
38
|
+
Sizes[Sizes["V12"] = 12] = "V12";
|
|
39
|
+
Sizes[Sizes["V14"] = 14] = "V14";
|
|
40
|
+
Sizes[Sizes["V16"] = 16] = "V16";
|
|
41
|
+
Sizes[Sizes["V18"] = 18] = "V18";
|
|
42
|
+
Sizes[Sizes["V20"] = 20] = "V20";
|
|
43
|
+
Sizes[Sizes["V24"] = 24] = "V24";
|
|
44
|
+
Sizes[Sizes["V32"] = 32] = "V32";
|
|
45
|
+
Sizes[Sizes["V36"] = 36] = "V36";
|
|
46
|
+
Sizes[Sizes["V40"] = 40] = "V40";
|
|
47
|
+
Sizes[Sizes["V48"] = 48] = "V48";
|
|
48
|
+
Sizes[Sizes["V56"] = 56] = "V56";
|
|
49
|
+
Sizes[Sizes["V64"] = 64] = "V64";
|
|
50
|
+
Sizes[Sizes["V72"] = 72] = "V72";
|
|
51
|
+
Sizes[Sizes["V80"] = 80] = "V80";
|
|
52
|
+
})(Sizes || (Sizes = {}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
<style>
|
|
3
|
+
div {
|
|
4
|
+
width: 100%;
|
|
5
|
+
margin: 0px;
|
|
6
|
+
}
|
|
7
|
+
@media (min-width: 960px) {
|
|
8
|
+
div {
|
|
9
|
+
width: var(--functional-content-width);
|
|
10
|
+
margin: auto;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
|
|
15
|
+
<script>import { Orientation } from "../Styling";
|
|
16
|
+
export let css = "";
|
|
17
|
+
export let orientation = Orientation.Column;
|
|
18
|
+
$:
|
|
19
|
+
klasses = [
|
|
20
|
+
"flex",
|
|
21
|
+
css ? css : "",
|
|
22
|
+
`flex-${orientation}`
|
|
23
|
+
].filter((c) => c).join(" ");
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<div class={klasses}>
|
|
27
|
+
<slot />
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
css?: string | undefined;
|
|
5
|
+
orientation?: any;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type WellProps = typeof __propDef.props;
|
|
15
|
+
export type WellEvents = typeof __propDef.events;
|
|
16
|
+
export type WellSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Well extends SvelteComponent<WellProps, WellEvents, WellSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script>import { Visiblity } from "../../Visiblity";
|
|
2
|
+
import { HeaderNavigationItem } from "../../HeaderNavigationItem";
|
|
3
|
+
import { afterNavigate } from "$app/navigation";
|
|
4
|
+
import { page } from "$app/stores";
|
|
5
|
+
export let pages = [];
|
|
6
|
+
export let authentication = false;
|
|
7
|
+
export let css = "";
|
|
8
|
+
const selectVisible = (pages2, visiblity) => pages2.filter(
|
|
9
|
+
(page2) => page2?.visiblity === Visiblity.Always || page2?.visiblity === visiblity
|
|
10
|
+
);
|
|
11
|
+
$:
|
|
12
|
+
visibility = authentication ? Visiblity.Authenticated : Visiblity.NotAuthenticated;
|
|
13
|
+
$:
|
|
14
|
+
visibleNavItems = selectVisible(pages, visibility);
|
|
15
|
+
$:
|
|
16
|
+
selected = false;
|
|
17
|
+
afterNavigate((navigation) => selected = false);
|
|
18
|
+
</script>
|
|
19
|
+
<style>
|
|
20
|
+
nav > ul {
|
|
21
|
+
margin: var(--functional-menu-margin, 'auto');
|
|
22
|
+
padding: var(--functional-menu-padding);
|
|
23
|
+
background: var(--functional-menu-background);
|
|
24
|
+
|
|
25
|
+
display: none;
|
|
26
|
+
|
|
27
|
+
transition: all 1.25s;
|
|
28
|
+
}
|
|
29
|
+
nav > ul > li > a {
|
|
30
|
+
margin: var(--functional-menu-item-margin);
|
|
31
|
+
padding: var(--functional-menu-item-padding);
|
|
32
|
+
display: block;
|
|
33
|
+
text-align: center;
|
|
34
|
+
|
|
35
|
+
color: var(--functional-menu-item-color, var(--primary-color));
|
|
36
|
+
background: var(--functional-menu-item-background);
|
|
37
|
+
border-top: var(--functional-menu-item-border-top);
|
|
38
|
+
border-right: var(--functional-menu-item-border-right);
|
|
39
|
+
border-bottom: var(--functional-menu-item-border-bottom);
|
|
40
|
+
border-left: var(--functional-menu-item-border-left);
|
|
41
|
+
}
|
|
42
|
+
nav > ul > li > a:hover {
|
|
43
|
+
color: var(--functional-menu-item-color-hover, var(--primary-color));
|
|
44
|
+
background: var(--functional-menu-item-hover-background);
|
|
45
|
+
border-top: var(--functional-menu-item-hover-border-top);
|
|
46
|
+
border-right: var(--functional-menu-item-hover-border-right);
|
|
47
|
+
border-bottom: var(--functional-menu-item-hover-border-bottom);
|
|
48
|
+
border-left: var(--functional-menu-item-hover-border-left);
|
|
49
|
+
}
|
|
50
|
+
nav > ul > li[aria-current='true'] > a{
|
|
51
|
+
color: var(--functional-menu-item-color-selected, var(--primary-color));
|
|
52
|
+
background: var(--functional-menu-item-selected-background);
|
|
53
|
+
|
|
54
|
+
border-top: var(--functional-menu-item-selected-border-top);
|
|
55
|
+
border-right: var(--functional-menu-item-selected-border-right);
|
|
56
|
+
border-bottom: var(--functional-menu-item-selected-border-bottom);
|
|
57
|
+
border-left: var(--functional-menu-item-selected-border-left);
|
|
58
|
+
}
|
|
59
|
+
.show-menu {
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
.nav-icon {
|
|
63
|
+
display: inline-block;
|
|
64
|
+
font-size: 1.5em;
|
|
65
|
+
padding: 0.5em;
|
|
66
|
+
vertical-align: middle;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
input.checkbox-menu[type="checkbox"] {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
input.checkbox-menu[type="checkbox"]:checked ~ ul {
|
|
74
|
+
display: block;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media (max-width: 960px) {
|
|
78
|
+
nav > ul {
|
|
79
|
+
width: 100%;
|
|
80
|
+
position: absolute;
|
|
81
|
+
left: 0;
|
|
82
|
+
top: 0;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
@media (min-width: 960px) {
|
|
86
|
+
nav > ul {
|
|
87
|
+
position: relative;
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
}
|
|
91
|
+
nav > ul > li > a {
|
|
92
|
+
display: block;
|
|
93
|
+
text-align: center;
|
|
94
|
+
height: 100%;
|
|
95
|
+
}
|
|
96
|
+
.show-menu {
|
|
97
|
+
display: none;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
101
|
+
|
|
102
|
+
<nav class={css}>
|
|
103
|
+
<label for="id-show-menu" class="show-menu">
|
|
104
|
+
<div class="nav-icon">
|
|
105
|
+
☰
|
|
106
|
+
</div>
|
|
107
|
+
</label>
|
|
108
|
+
<input type="checkbox" id="id-show-menu" class="checkbox-menu" role="button" bind:checked={selected}>
|
|
109
|
+
<ul>
|
|
110
|
+
{#each visibleNavItems as pageItem}
|
|
111
|
+
<li aria-current={$page.url.pathname === pageItem.path}>
|
|
112
|
+
<span class="screenreader-only">Navigate to {pageItem.name}</span>
|
|
113
|
+
<a on:click={pageItem.action} href={pageItem.path}>
|
|
114
|
+
{pageItem.name}
|
|
115
|
+
</a>
|
|
116
|
+
</li>
|
|
117
|
+
{/each}
|
|
118
|
+
</ul>
|
|
119
|
+
</nav>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
pages?: HeaderNavigationItem[] | undefined;
|
|
5
|
+
authentication?: boolean | undefined;
|
|
6
|
+
css?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export type FlatMenuProps = typeof __propDef.props;
|
|
14
|
+
export type FlatMenuEvents = typeof __propDef.events;
|
|
15
|
+
export type FlatMenuSlots = typeof __propDef.slots;
|
|
16
|
+
export default class FlatMenu extends SvelteComponent<FlatMenuProps, FlatMenuEvents, FlatMenuSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.sticky {
|
|
3
|
+
display: block;
|
|
4
|
+
position: absolute;
|
|
5
|
+
}
|
|
6
|
+
:global(.no-border) {
|
|
7
|
+
border: none!important;;
|
|
8
|
+
}
|
|
9
|
+
:global(.dialog-content) {
|
|
10
|
+
background: var(--functional-menu-background)!important;
|
|
11
|
+
}
|
|
12
|
+
ul {
|
|
13
|
+
list-style: none;
|
|
14
|
+
}
|
|
15
|
+
:global(#menu-id) {
|
|
16
|
+
color: var(--functional-menu-item-color);
|
|
17
|
+
}
|
|
18
|
+
a {
|
|
19
|
+
display: block;
|
|
20
|
+
margin: var(--functional-menu-item-margin);
|
|
21
|
+
padding: var(--functional-menu-item-padding);
|
|
22
|
+
color: var(--functional-menu-item-color);
|
|
23
|
+
}
|
|
24
|
+
a:hover {
|
|
25
|
+
display: block;
|
|
26
|
+
margin: var(--functional-menu-item-hover-margin);
|
|
27
|
+
padding: var(--functional-menu-item-hover-padding);
|
|
28
|
+
color: var(--functional-menu-item-hover-color);
|
|
29
|
+
text-decoration: var(--functional-menu-item-hover-text-decoration);
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
32
|
+
|
|
33
|
+
<script>import { Visiblity, HeaderNavigationItem } from "./Menu.js";
|
|
34
|
+
import { afterNavigate } from "$app/navigation";
|
|
35
|
+
import { Drawer, Button } from "agnostic-svelte";
|
|
36
|
+
import { page } from "$app/stores";
|
|
37
|
+
import { Placement } from "../Styling.js";
|
|
38
|
+
export let pages = [];
|
|
39
|
+
export let authentication = false;
|
|
40
|
+
export let css = "";
|
|
41
|
+
export let noBorder = false;
|
|
42
|
+
export let placement = Placement.Start;
|
|
43
|
+
const selectVisible = (pages2, visiblity) => pages2.filter(
|
|
44
|
+
(page2) => page2?.visiblity === Visiblity.Always || page2?.visiblity === visiblity
|
|
45
|
+
);
|
|
46
|
+
$:
|
|
47
|
+
visibility = authentication ? Visiblity.Authenticated : Visiblity.NotAuthenticated;
|
|
48
|
+
$:
|
|
49
|
+
visibleNavItems = selectVisible(pages, visibility);
|
|
50
|
+
let drawer = null;
|
|
51
|
+
const assignDrawerRef = (ev) => {
|
|
52
|
+
drawer = ev.detail.instance;
|
|
53
|
+
};
|
|
54
|
+
afterNavigate((navigation) => drawer?.hide());
|
|
55
|
+
const klasses = [
|
|
56
|
+
css ? css : "",
|
|
57
|
+
noBorder ? "no-border" : ""
|
|
58
|
+
].filter((c) => c).join(" ");
|
|
59
|
+
</script>
|
|
60
|
+
<Button
|
|
61
|
+
type="button"
|
|
62
|
+
data-a11y-dialog-show="drawer-start-test"
|
|
63
|
+
mode="primary"
|
|
64
|
+
noBorder
|
|
65
|
+
css={klasses}>
|
|
66
|
+
☰
|
|
67
|
+
</Button>
|
|
68
|
+
<Drawer
|
|
69
|
+
id="drawer-start-test"
|
|
70
|
+
drawerRoot="#drawer-root"
|
|
71
|
+
placement={placement}
|
|
72
|
+
on:instance={assignDrawerRef}
|
|
73
|
+
title="Menu">
|
|
74
|
+
<ul>
|
|
75
|
+
{#each visibleNavItems as pageItem}
|
|
76
|
+
<li aria-current={$page.url.pathname === pageItem.path}>
|
|
77
|
+
<span class="screenreader-only">Navigate to {pageItem.name}</span>
|
|
78
|
+
<a on:click={pageItem.action} href={pageItem.path}>
|
|
79
|
+
{pageItem.name}
|
|
80
|
+
</a>
|
|
81
|
+
</li>
|
|
82
|
+
{/each}
|
|
83
|
+
</ul>
|
|
84
|
+
</Drawer>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { HeaderNavigationItem } from './Menu.js';
|
|
3
|
+
import { Placement } from '../Styling.js';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
pages?: HeaderNavigationItem[] | undefined;
|
|
7
|
+
authentication?: boolean | undefined;
|
|
8
|
+
css?: string | undefined;
|
|
9
|
+
noBorder?: boolean | undefined;
|
|
10
|
+
placement?: Placement | undefined;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export type HamburgerMenuProps = typeof __propDef.props;
|
|
18
|
+
export type HamburgerMenuEvents = typeof __propDef.events;
|
|
19
|
+
export type HamburgerMenuSlots = typeof __propDef.slots;
|
|
20
|
+
export default class HamburgerMenu extends SvelteComponent<HamburgerMenuProps, HamburgerMenuEvents, HamburgerMenuSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--functional-content-width: 70%;
|
|
3
|
+
|
|
4
|
+
--functional-logo-display: inline-block;
|
|
5
|
+
|
|
6
|
+
--functional-primary-color: black;
|
|
7
|
+
--functional-secondary-color: #888;
|
|
8
|
+
--functional-background-color: #fff;
|
|
9
|
+
|
|
10
|
+
--agnostic-primary-modelight: var(--primary-colour);
|
|
11
|
+
--agnostic-primary-modedark: var(--primary-colour);
|
|
12
|
+
|
|
13
|
+
--agnostic-radius: 2em;
|
|
14
|
+
|
|
15
|
+
--well-margin-size: 15%;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* define agnostic varaibles based on Functional ones
|
|
19
|
+
**/
|
|
20
|
+
:root {
|
|
21
|
+
--agnostic-font-color: var(--functional-primary-color);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Banner variables
|
|
25
|
+
**/
|
|
26
|
+
:root {
|
|
27
|
+
--functional-banner-margin: 0px auto;
|
|
28
|
+
--functional-banner-padding: 0px;
|
|
29
|
+
--functional-banner-background: var(--functional-background-color);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Menu variables
|
|
33
|
+
**/
|
|
34
|
+
:root {
|
|
35
|
+
--functional-menu-background: var(--functional-secondary-color);
|
|
36
|
+
--functional-menu-color: var(--agnostic-font-color);
|
|
37
|
+
--functional-menu-margin: 0px;
|
|
38
|
+
--functional-menu-padding: 0px;
|
|
39
|
+
--functional-menu-align-items: inherit;
|
|
40
|
+
--functional-menu-justify-content: inherit;
|
|
41
|
+
|
|
42
|
+
--functional-menu-item-color: #fff;
|
|
43
|
+
--functional-menu-item-margin: 0px var(--fluid-12);
|
|
44
|
+
--functional-menu-item-padding: var(--fluid-20) var(--fluid-20) var(--fluid-8) var(--fluid-20);
|
|
45
|
+
--functional-menu-item-background: var(--functional-background-color);
|
|
46
|
+
--functional-menu-item-font-size: var(--fluid-24);
|
|
47
|
+
--functional-menu-item-border-top: none;
|
|
48
|
+
--functional-menu-item-border-right: none;
|
|
49
|
+
--functional-menu-item-border-bottom: none;
|
|
50
|
+
--functional-menu-item-border-left: none;
|
|
51
|
+
|
|
52
|
+
--functional-menu-item-hover-margin: 0px var(--fluid-12);
|
|
53
|
+
--functional-menu-item-hover-padding: var(--fluid-20) var(--fluid-20) var(--fluid-8) var(--fluid-20);
|
|
54
|
+
--functional-menu-item-hover-font: bolder;
|
|
55
|
+
--functional-menu-item-hover-color: var(--functional-primary-color);
|
|
56
|
+
--functional-menu-item-hover-text-decoration: none;
|
|
57
|
+
--functional-menu-item-hover-background: #fff;
|
|
58
|
+
--functional-menu-item-hover-border: none;
|
|
59
|
+
--functional-menu-item-hover-border-top: none;
|
|
60
|
+
--functional-menu-item-hover-border-right: none;
|
|
61
|
+
--functional-menu-item-hover-border-bottom: none;
|
|
62
|
+
--functional-menu-item-hover-border-left: none;
|
|
63
|
+
|
|
64
|
+
--functional-menu-item-selected-text-decoration-hover: none;
|
|
65
|
+
--functional-menu-item-selected-background: #fff;
|
|
66
|
+
--functional-menu-item-selected-border-top: none;
|
|
67
|
+
--functional-menu-item-selected-border-right: none;
|
|
68
|
+
--functional-menu-item-selected-border-bottom: 6px solid var(--functional-primary-color);
|
|
69
|
+
--functional-menu-item-selected-border-left: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
html, body, body > div { height: 100%; }
|
|
73
|
+
|
|
74
|
+
.fw { width:100%; }
|
|
75
|
+
|
|
76
|
+
.flex-row { flex-direction: row; }
|
|
77
|
+
.flex-column { flex-direction: column; }
|
|
78
|
+
.flex-row-dynamic { flex-direction: column; }
|
|
79
|
+
|
|
80
|
+
.h0 { height: 0 !important; }
|
|
81
|
+
.h2 { height: var(--fluid-2) !important; }
|
|
82
|
+
.h4 { height: var(--fluid-4) !important; }
|
|
83
|
+
.h6 { height: var(--fluid-6) !important; }
|
|
84
|
+
.h8 { height: var(--fluid-8) !important; }
|
|
85
|
+
.h10 { height: var(--fluid-10) !important; }
|
|
86
|
+
.h12 { height: var(--fluid-12) !important; }
|
|
87
|
+
.h14 { height: var(--fluid-14) !important; }
|
|
88
|
+
.h16 { height: var(--fluid-16) !important; }
|
|
89
|
+
.h18 { height: var(--fluid-18) !important; }
|
|
90
|
+
.h20 { height: var(--fluid-20) !important; }
|
|
91
|
+
.h24 { height: var(--fluid-24) !important; }
|
|
92
|
+
.h32 { height: var(--fluid-32) !important; }
|
|
93
|
+
.h36 { height: var(--fluid-36) !important; }
|
|
94
|
+
.h40 { height: var(--fluid-40) !important; }
|
|
95
|
+
.h48 { height: var(--fluid-48) !important; }
|
|
96
|
+
.h56 { height: var(--fluid-56) !important; }
|
|
97
|
+
.h64 { height: var(--fluid-64) !important; }
|
|
98
|
+
|
|
99
|
+
.h33p { height: 33% !important; }
|
|
100
|
+
.h66p { height: 66% !important; }
|
|
101
|
+
.h25p { height: 25% !important; }
|
|
102
|
+
.h75p { height: 75% !important; }
|
|
103
|
+
.h50p { height: 50% !important; }
|
|
104
|
+
|
|
105
|
+
.w0 { width: 0 !important; }
|
|
106
|
+
.w2 { width: var(--fluid-2) !important; }
|
|
107
|
+
.w4 { width: var(--fluid-4) !important; }
|
|
108
|
+
.w6 { width: var(--fluid-6) !important; }
|
|
109
|
+
.w8 { width: var(--fluid-8) !important; }
|
|
110
|
+
.w10 { width: var(--fluid-10) !important; }
|
|
111
|
+
.w12 { width: var(--fluid-12) !important; }
|
|
112
|
+
.w14 { width: var(--fluid-14) !important; }
|
|
113
|
+
.w16 { width: var(--fluid-16) !important; }
|
|
114
|
+
.w18 { width: var(--fluid-18) !important; }
|
|
115
|
+
.w20 { width: var(--fluid-20) !important; }
|
|
116
|
+
.w24 { width: var(--fluid-24) !important; }
|
|
117
|
+
.w32 { width: var(--fluid-32) !important; }
|
|
118
|
+
.w36 { width: var(--fluid-36) !important; }
|
|
119
|
+
.w40 { width: var(--fluid-40) !important; }
|
|
120
|
+
.w48 { width: var(--fluid-48) !important; }
|
|
121
|
+
.w56 { width: var(--fluid-56) !important; }
|
|
122
|
+
.w64 { width: var(--fluid-64) !important; }
|
|
123
|
+
|
|
124
|
+
.w33p { width: 100% !important; }
|
|
125
|
+
.w66p { width: 100% !important; }
|
|
126
|
+
.w25p { width: 100% !important; }
|
|
127
|
+
.w75p { width: 100% !important; }
|
|
128
|
+
.w50p { width: 100% !important; }
|
|
129
|
+
|
|
130
|
+
@media (min-width: 960px) {
|
|
131
|
+
.flex-row-dynamic { flex-direction: row; }
|
|
132
|
+
|
|
133
|
+
.w33p { width: 33% !important; }
|
|
134
|
+
.w66p { width: 66% !important; }
|
|
135
|
+
.w25p { width: 25% !important; }
|
|
136
|
+
.w75p { width: 75% !important; }
|
|
137
|
+
.w50p { width: 50% !important; }
|
|
138
|
+
|
|
139
|
+
.h33p { height: 33% !important; }
|
|
140
|
+
.h66p { height: 66% !important; }
|
|
141
|
+
.h25p { height: 25% !important; }
|
|
142
|
+
.h75p { height: 75% !important; }
|
|
143
|
+
.h50p { height: 50% !important; }
|
|
144
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import FlatMenu from './components/menu/FlatMenu.svelte';
|
|
2
|
+
import HamburgerMenu from './components/menu/HamburgerMenu.svelte';
|
|
3
|
+
import { Visiblity, HeaderNavigationItem } from './components/menu/Menu.js';
|
|
4
|
+
import Banner from './components/Banner.svelte';
|
|
5
|
+
import Layout from './components/Layout.svelte';
|
|
6
|
+
import Logo from './components/Logo.svelte';
|
|
4
7
|
import SimpleFooter from './components/SimpleFooter.svelte';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
+
import Spacer from './components/Spacer.svelte';
|
|
9
|
+
import Well from './components/Well.svelte';
|
|
10
|
+
import { Justify, Placement, Orientation, Position, Sizes } from './components/Styling.js';
|
|
11
|
+
export { FlatMenu, HamburgerMenu, Visiblity, HeaderNavigationItem, Banner, Layout, Logo, SimpleFooter, Spacer, Well, Justify, Placement, Orientation, Position, Sizes };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// Reexport your entry components here
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import FlatMenu from './components/menu/FlatMenu.svelte';
|
|
3
|
+
import HamburgerMenu from './components/menu/HamburgerMenu.svelte';
|
|
4
|
+
import { Visiblity, HeaderNavigationItem } from './components/menu/Menu.js';
|
|
5
|
+
import Banner from './components/Banner.svelte';
|
|
6
|
+
import Layout from './components/Layout.svelte';
|
|
7
|
+
import Logo from './components/Logo.svelte';
|
|
5
8
|
import SimpleFooter from './components/SimpleFooter.svelte';
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import { Position } from './components/
|
|
9
|
-
export {
|
|
10
|
-
// authStore,
|
|
11
|
-
Visiblity, HeaderNavigationItem, Position };
|
|
9
|
+
import Spacer from './components/Spacer.svelte';
|
|
10
|
+
import Well from './components/Well.svelte';
|
|
11
|
+
import { Justify, Placement, Orientation, Position, Sizes } from './components/Styling.js';
|
|
12
|
+
export { FlatMenu, HamburgerMenu, Visiblity, HeaderNavigationItem, Banner, Layout, Logo, SimpleFooter, Spacer, Well, Justify, Placement, Orientation, Position, Sizes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@functionalcms/svelte-components",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run package",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@sveltejs/kit": "^2.0.6",
|
|
31
31
|
"@sveltejs/package": "^2.2.5",
|
|
32
32
|
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
|
33
|
+
"agnostic-svelte": "^1.1.27",
|
|
33
34
|
"publint": "^0.2.7",
|
|
34
35
|
"svelte": "^4.2.8",
|
|
35
36
|
"svelte-check": "^3.6.2",
|
package/dist/authStore.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/// <reference types="svelte" />
|
|
2
|
-
export type AuthConfig = {
|
|
3
|
-
tenant: string;
|
|
4
|
-
tenantId: string;
|
|
5
|
-
policy: string;
|
|
6
|
-
scopes: Array<string>;
|
|
7
|
-
clientId: string;
|
|
8
|
-
redirectUrl: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const authStore: {
|
|
11
|
-
isAuthenticated: import("svelte/store").Readable<boolean>;
|
|
12
|
-
userId: import("svelte/store").Readable<string>;
|
|
13
|
-
accessToken: import("svelte/store").Readable<string>;
|
|
14
|
-
username: import("svelte/store").Readable<string>;
|
|
15
|
-
initialise: (config: AuthConfig) => Promise<void>;
|
|
16
|
-
signIn: () => Promise<void>;
|
|
17
|
-
signOut: () => Promise<void>;
|
|
18
|
-
};
|
package/dist/authStore.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { get, readonly, writable } from "svelte/store";
|
|
2
|
-
import { PublicClientApplication } from "@azure/msal-browser";
|
|
3
|
-
const isAuthenticated = writable(false);
|
|
4
|
-
const accessToken = writable('');
|
|
5
|
-
const userId = writable('');
|
|
6
|
-
const username = writable('');
|
|
7
|
-
let msal;
|
|
8
|
-
let authConfig;
|
|
9
|
-
const getMSALConfig = (config) => {
|
|
10
|
-
return {
|
|
11
|
-
auth: {
|
|
12
|
-
clientId: config.clientId,
|
|
13
|
-
authority: `https://${config.tenant}.b2clogin.com/${config.tenant}.onmicrosoft.com/${config.policy}`,
|
|
14
|
-
knownAuthorities: [`${config.tenant}.b2clogin.com`], // array of URIs that are known to be valid,
|
|
15
|
-
redirectUri: config.redirectUrl
|
|
16
|
-
},
|
|
17
|
-
cache: {
|
|
18
|
-
cacheLocation: "sessionStorage", // Configures cache location. "sessionStorage" is more secure, but "localStorage" gives you SSO between tabs.
|
|
19
|
-
storeAuthStateInCookie: false, // If you wish to store cache items in cookies as well as browser cache, set this to "true".
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
const getLoginRequest = (config) => {
|
|
24
|
-
return {
|
|
25
|
-
scopes: ["openid", "offline_access", config.clientId, ...config.scopes]
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
const getTokenRequest = (config, account) => {
|
|
29
|
-
return {
|
|
30
|
-
scopes: ["openid", "offline_access", config.clientId, ...config.scopes],
|
|
31
|
-
forceRefresh: false,
|
|
32
|
-
account: account,
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
const handleToken = (token) => {
|
|
36
|
-
if (token !== null) {
|
|
37
|
-
isAuthenticated.set(true);
|
|
38
|
-
accessToken.set(token.accessToken);
|
|
39
|
-
userId.set(token.account.idTokenClaims.sub);
|
|
40
|
-
username.set(token.account.idTokenClaims.name);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
isAuthenticated.set(false);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const logUsingCookies = async (config) => {
|
|
47
|
-
const accounts = msal.getAllAccounts();
|
|
48
|
-
if (accounts.length > 0) {
|
|
49
|
-
const token = await msal.acquireTokenSilent(getTokenRequest(config, accounts[0]));
|
|
50
|
-
handleToken(token);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
export const authStore = {
|
|
54
|
-
isAuthenticated: readonly(isAuthenticated),
|
|
55
|
-
userId: readonly(userId),
|
|
56
|
-
accessToken: readonly(accessToken),
|
|
57
|
-
username: readonly(username),
|
|
58
|
-
initialise: async (config) => {
|
|
59
|
-
msal = new PublicClientApplication(getMSALConfig(config));
|
|
60
|
-
await msal.initialize();
|
|
61
|
-
await logUsingCookies(config);
|
|
62
|
-
authConfig = config;
|
|
63
|
-
},
|
|
64
|
-
signIn: async () => {
|
|
65
|
-
const loginResponse = await msal.loginPopup(getLoginRequest(authConfig));
|
|
66
|
-
handleToken(loginResponse);
|
|
67
|
-
},
|
|
68
|
-
signOut: async () => {
|
|
69
|
-
await msal.logoutPopup({});
|
|
70
|
-
isAuthenticated.set(false);
|
|
71
|
-
},
|
|
72
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<script>import { Header, HeaderNav, HeaderNavItem, MenuItem } from "agnostic-svelte";
|
|
2
|
-
import Logo from "./Logo.svelte";
|
|
3
|
-
import { Visiblity } from "./HeaderNavigationItem.js";
|
|
4
|
-
import { Position } from "./Position";
|
|
5
|
-
export let companyName;
|
|
6
|
-
export let pages = [];
|
|
7
|
-
export let authentication = false;
|
|
8
|
-
export let logoUrl;
|
|
9
|
-
export let logoPosition = Position.Left;
|
|
10
|
-
const selectVisible = (pages2, visiblity) => pages2.filter(
|
|
11
|
-
(page) => page?.visiblity === Visiblity.Always || page?.visiblity === visiblity
|
|
12
|
-
);
|
|
13
|
-
$:
|
|
14
|
-
visibility = authentication ? Visiblity.Authenticated : Visiblity.NotAuthenticated;
|
|
15
|
-
$:
|
|
16
|
-
visibleNavItems = selectVisible(pages, visibility);
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<header>
|
|
20
|
-
<Header>
|
|
21
|
-
{#if logoPosition == Position.Left}
|
|
22
|
-
<Logo slot="logoright" {logoUrl} {companyName} />
|
|
23
|
-
{/if}
|
|
24
|
-
<HeaderNav>
|
|
25
|
-
{#each visibleNavItems as page}
|
|
26
|
-
<HeaderNavItem>
|
|
27
|
-
<a on:click={page.action} href={page.path}>
|
|
28
|
-
{page.name}
|
|
29
|
-
</a>
|
|
30
|
-
</HeaderNavItem>
|
|
31
|
-
{/each}
|
|
32
|
-
</HeaderNav>
|
|
33
|
-
{#if logoPosition == Position.Right}
|
|
34
|
-
<Logo slot="logoright" {logoUrl} {companyName} />
|
|
35
|
-
{/if}
|
|
36
|
-
</Header>
|
|
37
|
-
</header>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { Position } from "./Position";
|
|
3
|
-
import type { HeaderNavigationItem } from './HeaderNavigationItem.js';
|
|
4
|
-
declare const __propDef: {
|
|
5
|
-
props: {
|
|
6
|
-
/**
|
|
7
|
-
* @type {string}
|
|
8
|
-
*/ companyName: string;
|
|
9
|
-
/**
|
|
10
|
-
* @type {HeaderNavigationItem[]}
|
|
11
|
-
*/ pages?: HeaderNavigationItem[] | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* @type {Readonly<bool>}
|
|
14
|
-
*/ authentication?: boolean | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* @type {string}
|
|
17
|
-
*/ logoUrl: string;
|
|
18
|
-
/**
|
|
19
|
-
* @type {Position}
|
|
20
|
-
*/ logoPosition?: Position | undefined;
|
|
21
|
-
};
|
|
22
|
-
events: {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {};
|
|
26
|
-
};
|
|
27
|
-
export type HeaderProps = typeof __propDef.props;
|
|
28
|
-
export type HeaderEvents = typeof __propDef.events;
|
|
29
|
-
export type HeaderSlots = typeof __propDef.slots;
|
|
30
|
-
export default class Header extends SvelteComponent<HeaderProps, HeaderEvents, HeaderSlots> {
|
|
31
|
-
}
|
|
32
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script>export let url;
|
|
2
|
-
</script>
|
|
3
|
-
|
|
4
|
-
<header class="hero">
|
|
5
|
-
<h1>
|
|
6
|
-
<slot name="header" />
|
|
7
|
-
</h1>
|
|
8
|
-
<p>
|
|
9
|
-
<slot />
|
|
10
|
-
</p>
|
|
11
|
-
<div>
|
|
12
|
-
<a class="item keychainify-checked" href={url}>
|
|
13
|
-
<slot name="link" />
|
|
14
|
-
</a>
|
|
15
|
-
</div>
|
|
16
|
-
</header>
|
|
17
|
-
|
|
18
|
-
<style>
|
|
19
|
-
</style>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
/**
|
|
5
|
-
* @type {string}
|
|
6
|
-
*/ url: string;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {
|
|
12
|
-
header: {};
|
|
13
|
-
default: {};
|
|
14
|
-
link: {};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export type HeroProps = typeof __propDef.props;
|
|
18
|
-
export type HeroEvents = typeof __propDef.events;
|
|
19
|
-
export type HeroSlots = typeof __propDef.slots;
|
|
20
|
-
export default class Hero extends SvelteComponent<HeroProps, HeroEvents, HeroSlots> {
|
|
21
|
-
}
|
|
22
|
-
export {};
|
package/dist/constants.d.ts
DELETED
package/dist/constants.js
DELETED
|
File without changes
|
|
File without changes
|