@functionalcms/svelte-components 2.33.2 → 2.34.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.
- package/dist/components/Link.svelte +290 -290
- package/dist/components/agnostic/Alert/Alert.svelte +310 -0
- package/dist/components/agnostic/Alert/Alert.svelte.d.ts +31 -0
- package/dist/components/agnostic/Avatar/Avatar.svelte +123 -0
- package/dist/components/agnostic/Avatar/Avatar.svelte.d.ts +26 -0
- package/dist/components/agnostic/Avatar/AvatarGroup.svelte +106 -0
- package/dist/components/agnostic/Avatar/AvatarGroup.svelte.d.ts +29 -0
- package/dist/components/agnostic/Breadcrumb/Breadcrumb.svelte +56 -0
- package/dist/components/agnostic/Breadcrumb/Breadcrumb.svelte.d.ts +20 -0
- package/dist/components/agnostic/Breadcrumb/api.d.ts +4 -0
- package/dist/components/agnostic/Breadcrumb/api.js +1 -0
- package/dist/components/agnostic/Button/Button.svelte +345 -0
- package/dist/components/agnostic/Button/Button.svelte.d.ts +43 -0
- package/dist/components/agnostic/Button/ButtonGroup.svelte +20 -0
- package/dist/components/agnostic/Button/ButtonGroup.svelte.d.ts +23 -0
- package/dist/components/agnostic/Button/button-base.css +12 -0
- package/dist/components/agnostic/Button/button-core.css +237 -0
- package/dist/components/agnostic/Button/button-empty.css +31 -0
- package/dist/components/agnostic/Button/button-group.css +8 -0
- package/dist/components/agnostic/Card/Card.svelte +133 -0
- package/dist/components/agnostic/Card/Card.svelte.d.ts +31 -0
- package/dist/components/agnostic/ChoiceInput/ChoiceInput.svelte +337 -0
- package/dist/components/agnostic/ChoiceInput/ChoiceInput.svelte.d.ts +37 -0
- package/dist/components/agnostic/ChoiceInput/api.d.ts +7 -0
- package/dist/components/agnostic/ChoiceInput/api.js +1 -0
- package/dist/components/agnostic/Close/Close.svelte +120 -0
- package/dist/components/agnostic/Close/Close.svelte.d.ts +23 -0
- package/dist/components/agnostic/Close/api.d.ts +1 -0
- package/dist/components/agnostic/Close/api.js +1 -0
- package/dist/components/agnostic/Dialog/Dialog.svelte +265 -0
- package/dist/components/agnostic/Dialog/Dialog.svelte.d.ts +39 -0
- package/dist/components/agnostic/Dialog/SvelteA11yDialog.svelte +103 -0
- package/dist/components/agnostic/Dialog/SvelteA11yDialog.svelte.d.ts +30 -0
- package/dist/components/agnostic/Dialog/a11y-dialog.d.ts +56 -0
- package/dist/components/agnostic/Dialog/a11y-dialog.js +216 -0
- package/dist/components/agnostic/Dialog/dom-utils.d.ts +26 -0
- package/dist/components/agnostic/Dialog/dom-utils.js +206 -0
- package/dist/components/agnostic/Disclose/Disclose.svelte +102 -0
- package/dist/components/agnostic/Disclose/Disclose.svelte.d.ts +23 -0
- package/dist/components/agnostic/Divider/Divider.svelte +139 -0
- package/dist/components/agnostic/Divider/Divider.svelte.d.ts +25 -0
- package/dist/components/agnostic/Divider/api.d.ts +3 -0
- package/dist/components/agnostic/Divider/api.js +1 -0
- package/dist/components/agnostic/Drawer/Drawer.svelte +30 -0
- package/dist/components/agnostic/Drawer/Drawer.svelte.d.ts +28 -0
- package/dist/components/agnostic/Drawer/api.d.ts +1 -0
- package/dist/components/agnostic/Drawer/api.js +1 -0
- package/dist/components/agnostic/EmptyState/EmptyState.svelte +46 -0
- package/dist/components/agnostic/EmptyState/EmptyState.svelte.d.ts +23 -0
- package/dist/components/agnostic/Header/Header.svelte +104 -0
- package/dist/components/agnostic/Header/Header.svelte.d.ts +26 -0
- package/dist/components/agnostic/Header/HeaderNav.svelte +28 -0
- package/dist/components/agnostic/Header/HeaderNav.svelte.d.ts +20 -0
- package/dist/components/agnostic/Header/HeaderNavItem.svelte +30 -0
- package/dist/components/agnostic/Header/HeaderNavItem.svelte.d.ts +20 -0
- package/dist/components/agnostic/Icon/Icon.svelte +180 -0
- package/dist/components/agnostic/Icon/Icon.svelte.d.ts +23 -0
- package/dist/components/agnostic/Icon/api.d.ts +2 -0
- package/dist/components/agnostic/Icon/api.js +1 -0
- package/dist/components/agnostic/Input/Input.svelte +415 -0
- package/dist/components/agnostic/Input/Input.svelte.d.ts +45 -0
- package/dist/components/agnostic/Input/InputAddonItem.svelte +42 -0
- package/dist/components/agnostic/Input/InputAddonItem.svelte.d.ts +33 -0
- package/dist/components/agnostic/Loader/Loader.svelte +113 -0
- package/dist/components/agnostic/Loader/Loader.svelte.d.ts +20 -0
- package/dist/components/agnostic/Menu/Menu.svelte +466 -0
- package/dist/components/agnostic/Menu/Menu.svelte.d.ts +31 -0
- package/dist/components/agnostic/Menu/MenuItem.svelte +117 -0
- package/dist/components/agnostic/Menu/MenuItem.svelte.d.ts +29 -0
- package/dist/components/agnostic/Progress/Progress.svelte +50 -0
- package/dist/components/agnostic/Progress/Progress.svelte.d.ts +20 -0
- package/dist/components/agnostic/Select/Select.svelte +141 -0
- package/dist/components/agnostic/Select/Select.svelte.d.ts +32 -0
- package/dist/components/agnostic/Spinner/Spinner.svelte +105 -0
- package/dist/components/agnostic/Spinner/Spinner.svelte.d.ts +19 -0
- package/dist/components/agnostic/Switch/Switch.svelte +275 -0
- package/dist/components/agnostic/Switch/Switch.svelte.d.ts +45 -0
- package/dist/components/agnostic/Table/Table.svelte +508 -0
- package/dist/components/agnostic/Table/Table.svelte.d.ts +36 -0
- package/dist/components/agnostic/Table/TableCustomRenderComponent.svelte +13 -0
- package/dist/components/agnostic/Table/TableCustomRenderComponent.svelte.d.ts +25 -0
- package/dist/components/agnostic/Tabs/TabButtonCustom.svelte +65 -0
- package/dist/components/agnostic/Tabs/TabButtonCustom.svelte.d.ts +35 -0
- package/dist/components/agnostic/Tabs/Tabs.svelte +330 -0
- package/dist/components/agnostic/Tabs/Tabs.svelte.d.ts +34 -0
- package/dist/components/agnostic/Tabs/api.d.ts +10 -0
- package/dist/components/agnostic/Tabs/api.js +1 -0
- package/dist/components/agnostic/Tag/Tag.svelte +74 -0
- package/dist/components/agnostic/Tag/Tag.svelte.d.ts +23 -0
- package/dist/components/agnostic/Tag/TagSlots.svelte +51 -0
- package/dist/components/agnostic/Tag/TagSlots.svelte.d.ts +16 -0
- package/dist/components/agnostic/Toasts/Toasts.svelte +46 -0
- package/dist/components/agnostic/Toasts/Toasts.svelte.d.ts +22 -0
- package/dist/components/agnostic/Tooltip/Tooltip.svelte +103 -0
- package/dist/components/agnostic/Tooltip/Tooltip.svelte.d.ts +23 -0
- package/dist/components/agnostic/Tooltip/TooltipSlots.svelte +81 -0
- package/dist/components/agnostic/Tooltip/TooltipSlots.svelte.d.ts +16 -0
- package/dist/components/agnostic/Tooltip/api.d.ts +1 -0
- package/dist/components/agnostic/Tooltip/api.js +1 -0
- package/dist/components/agnostic/animation.css +37 -0
- package/dist/index.d.ts +30 -1
- package/dist/index.js +30 -1
- package/package.json +1 -4
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
<script>export let isVertical = false;
|
|
2
|
+
export let justify = "";
|
|
3
|
+
export let type = "";
|
|
4
|
+
export let size = "";
|
|
5
|
+
let slots = $$props.$$slots;
|
|
6
|
+
const dividerClasses = [
|
|
7
|
+
"divider",
|
|
8
|
+
isVertical ? "divider-vertical" : "",
|
|
9
|
+
justify ? `divider-justify-${justify}` : "",
|
|
10
|
+
size ? `divider-${size}` : "",
|
|
11
|
+
type ? `divider-${type}` : ""
|
|
12
|
+
].filter((cl) => cl.length).join(" ");
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div class={dividerClasses}>
|
|
16
|
+
{#if slots && slots.dividerContent}
|
|
17
|
+
<div class="divider-content">
|
|
18
|
+
<slot name="dividerContent" />
|
|
19
|
+
</div>
|
|
20
|
+
{/if}
|
|
21
|
+
</div>
|
|
22
|
+
<style>
|
|
23
|
+
.divider {
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.divider::before,
|
|
32
|
+
.divider::after {
|
|
33
|
+
content: "";
|
|
34
|
+
background-color: var(--functional-gray-mid);
|
|
35
|
+
height: var(--fluid-2);
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.divider-small::before,
|
|
40
|
+
.divider-small::after {
|
|
41
|
+
height: 1px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.divider-large::before,
|
|
45
|
+
.divider-large::after {
|
|
46
|
+
height: var(--fluid-4);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.divider-xlarge::before,
|
|
50
|
+
.divider-xlarge::after {
|
|
51
|
+
height: var(--fluid-6);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.divider-justify-end::after,
|
|
55
|
+
.divider-justify-start::before {
|
|
56
|
+
flex-grow: 0;
|
|
57
|
+
flex-basis: 3%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.divider-content {
|
|
61
|
+
padding-inline-start: var(--fluid-16);
|
|
62
|
+
padding-inline-end: var(--fluid-16);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.divider-vertical {
|
|
66
|
+
height: auto;
|
|
67
|
+
margin: 0 var(--fluid-16);
|
|
68
|
+
width: var(--fluid-16);
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
align-self: stretch;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.divider-vertical::before,
|
|
74
|
+
.divider-vertical::after {
|
|
75
|
+
width: var(--fluid-2);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.divider-vertical.divider-small::before,
|
|
79
|
+
.divider-vertical.divider-small::after {
|
|
80
|
+
width: 1px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.divider-vertical.divider-large::before,
|
|
84
|
+
.divider-vertical.divider-large::after {
|
|
85
|
+
width: var(--fluid-4);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.divider-vertical.divider-xlarge::before,
|
|
89
|
+
.divider-vertical.divider-xlarge::after {
|
|
90
|
+
width: var(--fluid-6);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.divider-vertical .divider-content {
|
|
94
|
+
padding-inline-start: var(--fluid-24);
|
|
95
|
+
padding-inline-end: var(--fluid-24);
|
|
96
|
+
|
|
97
|
+
/* Since we're vertical we need space from line above/below */
|
|
98
|
+
padding-block-start: var(--fluid-6);
|
|
99
|
+
padding-block-end: var(--fluid-6);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.divider-warning::before,
|
|
103
|
+
.divider-warning::after {
|
|
104
|
+
background-color: var(--functional-warning-border);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.divider-warning .divider-content {
|
|
108
|
+
color: var(--functional-warning-border);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.divider-error::before,
|
|
112
|
+
.divider-error::after {
|
|
113
|
+
background-color: var(--functional-error);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.divider-error .divider-content {
|
|
117
|
+
color: var(--functional-error);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.divider-success::before,
|
|
121
|
+
.divider-success::after {
|
|
122
|
+
background-color: var(--functional-action);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.divider-success .divider-content {
|
|
126
|
+
color: var(--functional-action);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.divider-info::before,
|
|
130
|
+
.divider-info::after {
|
|
131
|
+
background-color: var(--functional-primary);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.divider-info .divider-content {
|
|
135
|
+
color: var(--functional-primary);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
</style>
|
|
139
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { DividerJustify, DividerTypes, DividerSizes } from './api';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
isVertical?: boolean | undefined;
|
|
7
|
+
justify?: DividerJustify | undefined;
|
|
8
|
+
type?: DividerTypes | undefined;
|
|
9
|
+
size?: DividerSizes | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {
|
|
15
|
+
dividerContent: {};
|
|
16
|
+
};
|
|
17
|
+
exports?: undefined;
|
|
18
|
+
bindings?: undefined;
|
|
19
|
+
};
|
|
20
|
+
export type DividerProps = typeof __propDef.props;
|
|
21
|
+
export type DividerEvents = typeof __propDef.events;
|
|
22
|
+
export type DividerSlots = typeof __propDef.slots;
|
|
23
|
+
export default class Divider extends SvelteComponent<DividerProps, DividerEvents, DividerSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script>import Dialog from "../Dialog/Dialog.svelte";
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
let drawerInstance;
|
|
5
|
+
const assignDrawerRef = (ev) => {
|
|
6
|
+
drawerInstance = ev.detail.instance;
|
|
7
|
+
dispatch("instance", {
|
|
8
|
+
instance: drawerInstance
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export let id;
|
|
12
|
+
export let drawerRoot;
|
|
13
|
+
export let placement;
|
|
14
|
+
export let title;
|
|
15
|
+
export let role = "dialog";
|
|
16
|
+
export let isAnimationFadeIn = true;
|
|
17
|
+
</script>
|
|
18
|
+
<Dialog
|
|
19
|
+
id={id}
|
|
20
|
+
dialogRoot={drawerRoot}
|
|
21
|
+
drawerPlacement={placement}
|
|
22
|
+
titleId="{`${title.replaceAll(' ', '-').toLowerCase()}-id`}"
|
|
23
|
+
role={role}
|
|
24
|
+
title={title}
|
|
25
|
+
on:instance={assignDrawerRef}
|
|
26
|
+
isAnimationFadeIn={isAnimationFadeIn}
|
|
27
|
+
closeButtonLabel="Close drawer"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
</Dialog>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { DrawerRoles } from './api';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
id: any;
|
|
6
|
+
drawerRoot: any;
|
|
7
|
+
placement: any;
|
|
8
|
+
title: any;
|
|
9
|
+
role?: DrawerRoles;
|
|
10
|
+
isAnimationFadeIn?: boolean;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
instance: CustomEvent<any>;
|
|
14
|
+
} & {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {
|
|
18
|
+
default: {};
|
|
19
|
+
};
|
|
20
|
+
exports?: {} | undefined;
|
|
21
|
+
bindings?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
export type DrawerProps = typeof __propDef.props;
|
|
24
|
+
export type DrawerEvents = typeof __propDef.events;
|
|
25
|
+
export type DrawerSlots = typeof __propDef.slots;
|
|
26
|
+
export default class Drawer extends SvelteComponent<DrawerProps, DrawerEvents, DrawerSlots> {
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DrawerRoles = 'alertdialog' | 'dialog';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.empty-base,
|
|
3
|
+
.empty {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-flow: column wrap;
|
|
6
|
+
align-items: center;
|
|
7
|
+
text-align: center;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.empty {
|
|
12
|
+
padding: calc(2 * var(--functional-side-padding));
|
|
13
|
+
background: var(--functional-gray-extra-light);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.empty-bordered {
|
|
17
|
+
background: transparent;
|
|
18
|
+
border: 1px solid var(--functional-gray-light);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.empty-rounded {
|
|
22
|
+
border-radius: var(--functional-radius);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.empty-actions {
|
|
26
|
+
margin-block-start: var(--spacing-24);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
</style>
|
|
30
|
+
|
|
31
|
+
<script>export let isRounded = false;
|
|
32
|
+
export let isBordered = false;
|
|
33
|
+
const emptyClasses = [
|
|
34
|
+
"empty",
|
|
35
|
+
isRounded ? "empty-rounded" : "",
|
|
36
|
+
isBordered ? "empty-bordered" : ""
|
|
37
|
+
].filter((cl) => cl.length).join(" ");
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<div class={emptyClasses}>
|
|
41
|
+
<slot name="header" />
|
|
42
|
+
<slot name="body" />
|
|
43
|
+
<div class="empty-actions">
|
|
44
|
+
<slot name="footer" />
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
isRounded?: boolean;
|
|
5
|
+
isBordered?: boolean;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
header: {};
|
|
12
|
+
body: {};
|
|
13
|
+
footer: {};
|
|
14
|
+
};
|
|
15
|
+
exports?: {} | undefined;
|
|
16
|
+
bindings?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
export type EmptyStateProps = typeof __propDef.props;
|
|
19
|
+
export type EmptyStateEvents = typeof __propDef.events;
|
|
20
|
+
export type EmptyStateSlots = typeof __propDef.slots;
|
|
21
|
+
export default class EmptyState extends SvelteComponent<EmptyStateProps, EmptyStateEvents, EmptyStateSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.header,
|
|
3
|
+
.header-base {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.header-base :global(img),
|
|
8
|
+
.header :global(img) {
|
|
9
|
+
max-width: 100%;
|
|
10
|
+
height: auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.header,
|
|
14
|
+
.header-skin {
|
|
15
|
+
background-color: var(--functional-header-background-color, var(--functional-light));
|
|
16
|
+
box-shadow:
|
|
17
|
+
var(--functional-header-box-shadow-hor, 0) var(--functional-header-box-shadow-ver, 1px)
|
|
18
|
+
var(--functional-header-box-shadow-blur, 5px) var(--functional-header-box-shadow-spread, 2px)
|
|
19
|
+
var(--functional-header-box-shadow-color, rgb(0 0 0 / 10%));
|
|
20
|
+
font-family: var(--functional-header-font-family, var(--functional-font-family-body));
|
|
21
|
+
border-bottom: 1px solid var(--functional-header-border-color, var(--functional-gray-light));
|
|
22
|
+
padding-block-start: var(--functional-vertical-pad, 0.5rem);
|
|
23
|
+
padding-block-end: var(--functional-vertical-pad, 0.5rem);
|
|
24
|
+
padding-inline-start: var(--fluid-24);
|
|
25
|
+
padding-inline-end: var(--fluid-24);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.header-content {
|
|
29
|
+
width: var(--functional-header-content-width, 960px);
|
|
30
|
+
max-width: 100%;
|
|
31
|
+
margin: 0 auto;
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: space-around;
|
|
34
|
+
align-items: center;
|
|
35
|
+
flex-flow: wrap column;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* If you make your header sticky, you should likely consider that jump links
|
|
40
|
+
* e.g. <h1 id="Jump-Here">... will tuck underneath the header! Here's a recommendation
|
|
41
|
+
* for how to circumnavigate this issue via scroll-margin-top:
|
|
42
|
+
h1[id],
|
|
43
|
+
h2[id],
|
|
44
|
+
h3[id],
|
|
45
|
+
h4[id],
|
|
46
|
+
h5[id],
|
|
47
|
+
h6[id] {
|
|
48
|
+
scroll-margin-top: 80px;
|
|
49
|
+
}
|
|
50
|
+
* In this case I have a 64px tall header so I've added 16px for clearance -- you'll need
|
|
51
|
+
* to curate your own use case, but scroll-margin-top is super useful for this use case.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
.header-sticky {
|
|
55
|
+
position: relative;
|
|
56
|
+
top: 0;
|
|
57
|
+
z-index: 10;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media (min-width: 960px) {
|
|
61
|
+
.header-sticky {
|
|
62
|
+
position: sticky;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.header-content {
|
|
66
|
+
flex-direction: row;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.header-content-start {
|
|
71
|
+
justify-content: flex-start;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.header-content-end {
|
|
75
|
+
justify-content: flex-end;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
</style>
|
|
80
|
+
|
|
81
|
+
<script>export let isSticky = false;
|
|
82
|
+
export let isSkinned = true;
|
|
83
|
+
export let isHeaderContentStart = false;
|
|
84
|
+
export let isHeaderContentEnd = false;
|
|
85
|
+
export let css = "";
|
|
86
|
+
const klasses = [
|
|
87
|
+
isSkinned ? "header" : "header-base",
|
|
88
|
+
isSticky ? "header-sticky" : "",
|
|
89
|
+
css ? `${css}` : ""
|
|
90
|
+
].filter((cl) => cl.length).join(" ");
|
|
91
|
+
const headerContentClasses = [
|
|
92
|
+
"header-content",
|
|
93
|
+
isHeaderContentStart ? "header-content-start" : "",
|
|
94
|
+
isHeaderContentEnd ? "header-content-end" : ""
|
|
95
|
+
].filter((cl) => cl.length).join(" ");
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<nav class={klasses}>
|
|
99
|
+
<div class={headerContentClasses}>
|
|
100
|
+
<slot name="logoleft" />
|
|
101
|
+
<slot />
|
|
102
|
+
<slot name="logoright" />
|
|
103
|
+
</div>
|
|
104
|
+
</nav>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
isSticky?: boolean;
|
|
5
|
+
isSkinned?: boolean;
|
|
6
|
+
isHeaderContentStart?: boolean;
|
|
7
|
+
isHeaderContentEnd?: boolean;
|
|
8
|
+
css?: string;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {
|
|
14
|
+
logoleft: {};
|
|
15
|
+
default: {};
|
|
16
|
+
logoright: {};
|
|
17
|
+
};
|
|
18
|
+
exports?: {} | undefined;
|
|
19
|
+
bindings?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type HeaderProps = typeof __propDef.props;
|
|
22
|
+
export type HeaderEvents = typeof __propDef.events;
|
|
23
|
+
export type HeaderSlots = typeof __propDef.slots;
|
|
24
|
+
export default class Header extends SvelteComponent<HeaderProps, HeaderEvents, HeaderSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
/* Goes on the <ul> */
|
|
3
|
+
.header-nav {
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (min-width: 960px) {
|
|
12
|
+
.header-nav {
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
</style>
|
|
18
|
+
|
|
19
|
+
<script>export let css = "";
|
|
20
|
+
const containerClasses = [css ? `${css}` : ""].filter((c) => c.length);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<nav class={containerClasses}>
|
|
24
|
+
<ul class="header-nav">
|
|
25
|
+
<slot />
|
|
26
|
+
</ul>
|
|
27
|
+
</nav>
|
|
28
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
css?: string;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {
|
|
10
|
+
default: {};
|
|
11
|
+
};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type HeaderNavProps = typeof __propDef.props;
|
|
16
|
+
export type HeaderNavEvents = typeof __propDef.events;
|
|
17
|
+
export type HeaderNavSlots = typeof __propDef.slots;
|
|
18
|
+
export default class HeaderNav extends SvelteComponent<HeaderNavProps, HeaderNavEvents, HeaderNavSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
.header-nav-item {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.header-nav-item:not(:last-child) {
|
|
7
|
+
margin-inline-end: initial;
|
|
8
|
+
margin-block-end: var(--fluid-8);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.header-nav-item :global(a) {
|
|
12
|
+
color: var(--functional-header-color, var(--functional-font-color));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (min-width: 960px) {
|
|
16
|
+
.header-nav-item:not(:last-child) {
|
|
17
|
+
margin-inline-end: var(--functional-header-nav-spacing, var(--fluid-32));
|
|
18
|
+
margin-block-end: initial;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
</style>
|
|
23
|
+
|
|
24
|
+
<script>export let css = "";
|
|
25
|
+
let klasses = ["header-nav-item", css ? `${css}` : ""].filter((cl) => cl && cl.length).join(" ");
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<li class={klasses}>
|
|
29
|
+
<slot />
|
|
30
|
+
</li>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
css?: string;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {
|
|
10
|
+
default: {};
|
|
11
|
+
};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type HeaderNavItemProps = typeof __propDef.props;
|
|
16
|
+
export type HeaderNavItemEvents = typeof __propDef.events;
|
|
17
|
+
export type HeaderNavItemSlots = typeof __propDef.slots;
|
|
18
|
+
export default class HeaderNavItem extends SvelteComponent<HeaderNavItemProps, HeaderNavItemEvents, HeaderNavItemSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|