@functionalcms/svelte-components 4.36.10 → 5.0.0-beta2
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 +48 -1
- package/dist/auth/getMachineAccessToken.d.ts +1 -1
- package/dist/auth/getMachineAccessToken.js +1 -2
- package/dist/auth/machineAuthenticationProvider.d.ts +1 -1
- package/dist/auth/machineAuthenticationProvider.js +1 -2
- package/dist/auth/tokenRefresh.d.ts +1 -1
- package/dist/auth/tokenRefresh.js +4 -5
- package/dist/auth/types.js +4 -8
- package/dist/auth/userAuthenticationProvider.d.ts +1 -1
- package/dist/auth/userAuthenticationProvider.js +1 -2
- package/dist/components/Icon.svelte +16 -0
- package/dist/components/Icon.svelte.d.ts +9 -0
- package/dist/components/content/Markdown.svelte +2 -2
- package/dist/components/content/Markdown.svelte.d.ts +17 -4
- package/dist/components/form/Dropzone.svelte +2 -5
- package/dist/components/form/SmartForm.svelte +206 -60
- package/dist/components/form/SmartForm.svelte.d.ts +2 -2
- package/dist/components/form/form.d.ts +87 -17
- package/dist/components/form/form.js +86 -6
- package/dist/components/icons.d.ts +763 -0
- package/dist/components/icons.js +765 -0
- package/dist/components/integrations/EasyTools.svelte +1 -1
- package/dist/components/layouts/DefaultLayout.svelte +92 -41
- package/dist/components/layouts/DefaultLayout.svelte.d.ts +17 -8
- package/dist/components/layouts/FlexBox.svelte +73 -0
- package/dist/components/layouts/FlexBox.svelte.d.ts +17 -0
- package/dist/components/layouts/MenuLayout.svelte +39 -201
- package/dist/components/layouts/MenuLayout.svelte.d.ts +2 -10
- package/dist/components/layouts/StyleBox.svelte +17 -0
- package/dist/components/layouts/StyleBox.svelte.d.ts +7 -0
- package/dist/components/layouts/Well.svelte +8 -34
- package/dist/components/layouts/Well.svelte.d.ts +4 -8
- package/dist/components/layouts/menuItems.d.ts +29 -0
- package/dist/components/layouts/menuItems.js +28 -0
- package/dist/index-server.d.ts +2 -1
- package/dist/index-server.js +2 -1
- package/dist/index.d.ts +9 -47
- package/dist/index.js +8 -59
- package/dist/server-side/getServices.d.ts +8 -8
- package/dist/server-side/getServices.js +16 -27
- package/dist/server-side/handlers/paraglideHandler.d.ts +2 -0
- package/dist/server-side/handlers/paraglideHandler.js +13 -0
- package/dist/server-side/handlers/redirectPipelineHandler.d.ts +5 -0
- package/dist/server-side/{getRedirectPipeline.js → handlers/redirectPipelineHandler.js} +1 -2
- package/dist/utils/stringHash.d.ts +1 -0
- package/dist/utils/stringHash.js +7 -0
- package/package.json +28 -39
- package/css/functional.css.map +0 -1
- package/dist/components/MaterialIconSet.d.ts +0 -3819
- package/dist/components/MaterialIconSet.js +0 -3823
- package/dist/components/Styling.d.ts +0 -59
- package/dist/components/Styling.js +0 -66
- package/dist/components/blog/blog.d.ts +0 -20
- package/dist/components/blog/blog.js +0 -29
- package/dist/components/dynamic/CopyToClipboard.svelte +0 -16
- package/dist/components/dynamic/CopyToClipboard.svelte.d.ts +0 -36
- package/dist/components/dynamic/DynamicButton.d.ts +0 -1
- package/dist/components/dynamic/DynamicButton.js +0 -10
- package/dist/components/dynamic/DynamicButton.svelte +0 -33
- package/dist/components/dynamic/DynamicButton.svelte.d.ts +0 -9
- package/dist/components/form/Button.svelte +0 -389
- package/dist/components/form/Button.svelte.d.ts +0 -30
- package/dist/components/form/ChoiceInput.svelte +0 -375
- package/dist/components/form/ChoiceInput.svelte.d.ts +0 -3
- package/dist/components/form/Input.svelte +0 -461
- package/dist/components/form/Input.svelte.d.ts +0 -30
- package/dist/components/form/Select.svelte +0 -163
- package/dist/components/form/Select.svelte.d.ts +0 -21
- package/dist/components/form/Switch.svelte +0 -293
- package/dist/components/form/Switch.svelte.d.ts +0 -14
- package/dist/components/indicators/Loader.svelte +0 -114
- package/dist/components/indicators/Loader.svelte.d.ts +0 -30
- package/dist/components/indicators/Spinner.svelte +0 -109
- package/dist/components/indicators/Spinner.svelte.d.ts +0 -28
- package/dist/components/layouts/Banner.svelte +0 -26
- package/dist/components/layouts/Banner.svelte.d.ts +0 -8
- package/dist/components/layouts/FoldablePanel.svelte +0 -16
- package/dist/components/layouts/FoldablePanel.svelte.d.ts +0 -7
- package/dist/components/layouts/SimpleFooter.svelte +0 -23
- package/dist/components/layouts/SimpleFooter.svelte.d.ts +0 -8
- package/dist/components/layouts/Tabs.svelte +0 -362
- package/dist/components/layouts/Tabs.svelte.d.ts +0 -11
- package/dist/components/layouts/TwoColumnsLayout.svelte +0 -44
- package/dist/components/layouts/TwoColumnsLayout.svelte.d.ts +0 -13
- package/dist/components/layouts/menuLayout.d.ts +0 -12
- package/dist/components/layouts/menuLayout.js +0 -1
- package/dist/components/layouts/tabs.d.ts +0 -21
- package/dist/components/layouts/tabs.js +0 -13
- package/dist/components/menu/CollapsibleMenu.svelte +0 -66
- package/dist/components/menu/CollapsibleMenu.svelte.d.ts +0 -18
- package/dist/components/menu/DynamicMenu.svelte +0 -55
- package/dist/components/menu/DynamicMenu.svelte.d.ts +0 -13
- package/dist/components/menu/HamburgerMenu.svelte +0 -62
- package/dist/components/menu/HamburgerMenu.svelte.d.ts +0 -14
- package/dist/components/menu/ListMenu.svelte +0 -61
- package/dist/components/menu/ListMenu.svelte.d.ts +0 -17
- package/dist/components/menu/NavigationDrawer.svelte +0 -53
- package/dist/components/menu/NavigationDrawer.svelte.d.ts +0 -18
- package/dist/components/menu/types.d.ts +0 -23
- package/dist/components/menu/types.js +0 -35
- package/dist/components/presentation/Accordion.svelte +0 -82
- package/dist/components/presentation/Accordion.svelte.d.ts +0 -11
- package/dist/components/presentation/Card.svelte +0 -147
- package/dist/components/presentation/Card.svelte.d.ts +0 -15
- package/dist/components/presentation/Carousel.d.ts +0 -5
- package/dist/components/presentation/Carousel.js +0 -1
- package/dist/components/presentation/Carousel.svelte +0 -119
- package/dist/components/presentation/Carousel.svelte.d.ts +0 -17
- package/dist/components/presentation/Dialog.svelte +0 -75
- package/dist/components/presentation/Dialog.svelte.d.ts +0 -22
- package/dist/components/presentation/Disclose.svelte +0 -116
- package/dist/components/presentation/Disclose.svelte.d.ts +0 -11
- package/dist/components/presentation/Drawer.svelte +0 -118
- package/dist/components/presentation/Drawer.svelte.d.ts +0 -13
- package/dist/components/presentation/EmptyState.svelte +0 -67
- package/dist/components/presentation/EmptyState.svelte.d.ts +0 -10
- package/dist/components/presentation/Gallery.svelte +0 -35
- package/dist/components/presentation/Gallery.svelte.d.ts +0 -14
- package/dist/components/presentation/Link.svelte +0 -362
- package/dist/components/presentation/Link.svelte.d.ts +0 -27
- package/dist/components/utils.d.ts +0 -3
- package/dist/components/utils.js +0 -1
- package/dist/index.server.d.ts +0 -11
- package/dist/index.server.js +0 -10
- package/dist/server-side/getRedirectPipeline.d.ts +0 -6
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -3
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { HeaderNavigationItem, defaultCss } from './types.js';
|
|
3
|
-
import { afterNavigate } from '$app/navigation';
|
|
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 ListMenu from './ListMenu.svelte';
|
|
9
|
-
|
|
10
|
-
interface Css {
|
|
11
|
-
buttonCss: string;
|
|
12
|
-
container: string;
|
|
13
|
-
link: string;
|
|
14
|
-
}
|
|
15
|
-
interface Props {
|
|
16
|
-
css: Partial<Css>;
|
|
17
|
-
noBorder: boolean;
|
|
18
|
-
placement: Placement;
|
|
19
|
-
localPages: Array<HeaderNavigationItem>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let {
|
|
23
|
-
localPages = [],
|
|
24
|
-
css = { buttonCss: '', container: '', link: '' },
|
|
25
|
-
placement = Placement.Start
|
|
26
|
-
}: Partial<Props> = $props();
|
|
27
|
-
|
|
28
|
-
let isOpen = $state(false);
|
|
29
|
-
let buttonCss = $derived(cn('hamburger-handle', css.buttonCss ?? ''));
|
|
30
|
-
|
|
31
|
-
function toggleDrawer() {
|
|
32
|
-
isOpen = !isOpen;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const close = () => (isOpen = false);
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<Button type="button" isPrimary css={buttonCss} click={() => toggleDrawer()}>☰</Button>
|
|
39
|
-
|
|
40
|
-
<Drawer {placement} open={isOpen} clickAway={() => isOpen != isOpen}>
|
|
41
|
-
<div class="flex flex-row justify-between">
|
|
42
|
-
<ListMenu {localPages} {css} click={() => close()}></ListMenu>
|
|
43
|
-
<Button css="close" click={() => close()}>X</Button>
|
|
44
|
-
</div>
|
|
45
|
-
</Drawer>
|
|
46
|
-
|
|
47
|
-
<style>
|
|
48
|
-
:global(#hamburger-menu) {
|
|
49
|
-
z-index: 10001;
|
|
50
|
-
}
|
|
51
|
-
:global(.hamburger-handle) {
|
|
52
|
-
background: none !important;
|
|
53
|
-
border: none !important;
|
|
54
|
-
}
|
|
55
|
-
:global(.btn.close) {
|
|
56
|
-
position: fixed;
|
|
57
|
-
top: var(--hamburger-menu-margin, 25px);
|
|
58
|
-
right: var(--hamburger-menu-margin, 25px);
|
|
59
|
-
background: none !important;
|
|
60
|
-
border: none !important;
|
|
61
|
-
}
|
|
62
|
-
</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { HeaderNavigationItem } from './types.js';
|
|
2
|
-
import { Placement } from '../Styling.js';
|
|
3
|
-
declare const HamburgerMenu: import("svelte").Component<Partial<{
|
|
4
|
-
css: Partial<{
|
|
5
|
-
buttonCss: string;
|
|
6
|
-
container: string;
|
|
7
|
-
link: string;
|
|
8
|
-
}>;
|
|
9
|
-
noBorder: boolean;
|
|
10
|
-
placement: Placement;
|
|
11
|
-
localPages: Array<HeaderNavigationItem>;
|
|
12
|
-
}>, {}, "">;
|
|
13
|
-
type HamburgerMenu = ReturnType<typeof HamburgerMenu>;
|
|
14
|
-
export default HamburgerMenu;
|
|
@@ -1,61 +0,0 @@
|
|
|
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
|
-
itemRender: Snippet<[HeaderNavigationItem]>;
|
|
16
|
-
subItemRender: Snippet<[Array<HeaderNavigationItem>]>;
|
|
17
|
-
css: CssProps;
|
|
18
|
-
orientation: Orientation;
|
|
19
|
-
includeSubpagesForSelect: boolean;
|
|
20
|
-
click: () => void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
let {
|
|
24
|
-
subItemRender = undefined,
|
|
25
|
-
itemRender = undefined,
|
|
26
|
-
css = { container: '', link: '' },
|
|
27
|
-
localPages = [],
|
|
28
|
-
orientation = Orientation.Column,
|
|
29
|
-
includeSubpagesForSelect = true,
|
|
30
|
-
click = () => {}
|
|
31
|
-
}: Partial<Props> = $props();
|
|
32
|
-
|
|
33
|
-
let containerCss = cn('flex', orientation, css.container ?? '');
|
|
34
|
-
let linkCss = cn(css.link ?? '');
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<ul class={containerCss} role="menu" aria-label="menu">
|
|
38
|
-
{#each localPages as pageItem}
|
|
39
|
-
<li
|
|
40
|
-
data-selected={isSelected(includeSubpagesForSelect, page, pageItem)}
|
|
41
|
-
class={linkCss}
|
|
42
|
-
role="none"
|
|
43
|
-
>
|
|
44
|
-
{#if itemRender}
|
|
45
|
-
{@render itemRender(pageItem)}
|
|
46
|
-
{:else}
|
|
47
|
-
<span class="screenreader-only">Navigate to {pageItem.name}</span>
|
|
48
|
-
<a href={pageItem.path} role="menuitem" onclick={click}>
|
|
49
|
-
{pageItem.name}
|
|
50
|
-
</a>
|
|
51
|
-
{/if}
|
|
52
|
-
|
|
53
|
-
{#if subItemRender}
|
|
54
|
-
{@render subItemRender(pageItem.subItems ?? [])}
|
|
55
|
-
{/if}
|
|
56
|
-
</li>
|
|
57
|
-
{/each}
|
|
58
|
-
</ul>
|
|
59
|
-
|
|
60
|
-
<style>
|
|
61
|
-
</style>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type HeaderNavigationItem } from './types.js';
|
|
2
|
-
import { Orientation } from '../Styling.js';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
|
-
declare const ListMenu: import("svelte").Component<Partial<{
|
|
5
|
-
localPages: Array<HeaderNavigationItem>;
|
|
6
|
-
itemRender: Snippet<[HeaderNavigationItem]>;
|
|
7
|
-
subItemRender: Snippet<[Array<HeaderNavigationItem>]>;
|
|
8
|
-
css: {
|
|
9
|
-
container?: string;
|
|
10
|
-
link?: string;
|
|
11
|
-
};
|
|
12
|
-
orientation: Orientation;
|
|
13
|
-
includeSubpagesForSelect: boolean;
|
|
14
|
-
click: () => void;
|
|
15
|
-
}>, {}, "">;
|
|
16
|
-
type ListMenu = ReturnType<typeof ListMenu>;
|
|
17
|
-
export default ListMenu;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<!-- <script lang="ts">
|
|
2
|
-
import { HeaderNavigationItem, defaultCss } from './types.js';
|
|
3
|
-
import { afterNavigate } from '$app/navigation';
|
|
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 ListMenu from './ListMenu.svelte';
|
|
9
|
-
|
|
10
|
-
interface Css {
|
|
11
|
-
buttonCss: string;
|
|
12
|
-
container: string;
|
|
13
|
-
link: string;
|
|
14
|
-
}
|
|
15
|
-
interface Props {
|
|
16
|
-
css: Partial<Css>;
|
|
17
|
-
noBorder: boolean;
|
|
18
|
-
placement: Placement;
|
|
19
|
-
localPages: Array<HeaderNavigationItem>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let {
|
|
23
|
-
localPages = [],
|
|
24
|
-
css = { buttonCss: '', container: '', link: '' },
|
|
25
|
-
placement = Placement.Start
|
|
26
|
-
}: Partial<Props> = $props();
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const close = () => (isOpen = false);
|
|
30
|
-
</script>
|
|
31
|
-
<Drawer {placement} open={isOpen} clickAway={() => isOpen != isOpen}>
|
|
32
|
-
<div class="flex flex-row justify-between">
|
|
33
|
-
<ListMenu {localPages} {css} click={() => close()}></ListMenu>
|
|
34
|
-
<Button css="close" click={() => close()}>X</Button>
|
|
35
|
-
</div>
|
|
36
|
-
</Drawer>
|
|
37
|
-
|
|
38
|
-
<style>
|
|
39
|
-
:global(#hamburger-menu) {
|
|
40
|
-
z-index: 10001;
|
|
41
|
-
}
|
|
42
|
-
:global(.hamburger-handle) {
|
|
43
|
-
background: none !important;
|
|
44
|
-
border: none !important;
|
|
45
|
-
}
|
|
46
|
-
:global(.btn.close) {
|
|
47
|
-
position: fixed;
|
|
48
|
-
top: var(--hamburger-menu-margin, 25px);
|
|
49
|
-
right: var(--hamburger-menu-margin, 25px);
|
|
50
|
-
background: none !important;
|
|
51
|
-
border: none !important;
|
|
52
|
-
}
|
|
53
|
-
</style> -->
|
|
@@ -1,18 +0,0 @@
|
|
|
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> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const NavigationDrawer: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type NavigationDrawer = InstanceType<typeof NavigationDrawer>;
|
|
18
|
-
export default NavigationDrawer;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Page } from "@sveltejs/kit";
|
|
2
|
-
type ClickAction = (event: MouseEvent) => void;
|
|
3
|
-
export declare enum Visiblity {
|
|
4
|
-
Always = 0,
|
|
5
|
-
Authenticated = 1,
|
|
6
|
-
NotAuthenticated = 2
|
|
7
|
-
}
|
|
8
|
-
export declare class HeaderNavigationItem {
|
|
9
|
-
name: string;
|
|
10
|
-
path?: string | undefined;
|
|
11
|
-
action?: ClickAction | undefined;
|
|
12
|
-
visiblity: Visiblity;
|
|
13
|
-
subItems?: HeaderNavigationItem[];
|
|
14
|
-
}
|
|
15
|
-
export declare function selectVisible(pages: Array<HeaderNavigationItem>, visiblity: Visiblity): HeaderNavigationItem[];
|
|
16
|
-
export declare function isSelected(includeSubpagesForSelect: boolean, page: any, item: HeaderNavigationItem): any;
|
|
17
|
-
export declare const defaultCss: {
|
|
18
|
-
buttonCss: never[];
|
|
19
|
-
container: never[];
|
|
20
|
-
link: never[];
|
|
21
|
-
};
|
|
22
|
-
export declare function isAuthenticated(page: Page): Visiblity.Authenticated | Visiblity.NotAuthenticated;
|
|
23
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export var Visiblity;
|
|
2
|
-
(function (Visiblity) {
|
|
3
|
-
Visiblity[Visiblity["Always"] = 0] = "Always";
|
|
4
|
-
Visiblity[Visiblity["Authenticated"] = 1] = "Authenticated";
|
|
5
|
-
Visiblity[Visiblity["NotAuthenticated"] = 2] = "NotAuthenticated";
|
|
6
|
-
})(Visiblity || (Visiblity = {}));
|
|
7
|
-
export class HeaderNavigationItem {
|
|
8
|
-
name;
|
|
9
|
-
path;
|
|
10
|
-
action;
|
|
11
|
-
visiblity = Visiblity.Always;
|
|
12
|
-
subItems = [];
|
|
13
|
-
}
|
|
14
|
-
export function selectVisible(pages, visiblity) {
|
|
15
|
-
return pages.filter((page) => page?.visiblity === Visiblity.Always ||
|
|
16
|
-
page?.visiblity === visiblity);
|
|
17
|
-
}
|
|
18
|
-
export function isSelected(includeSubpagesForSelect, page, item) {
|
|
19
|
-
if (page?.url?.pathname === '/') {
|
|
20
|
-
return page?.url?.pathname === item.path;
|
|
21
|
-
}
|
|
22
|
-
return includeSubpagesForSelect
|
|
23
|
-
? (page?.url.pathname.startsWith(item.path ?? '-') && item.path !== '/')
|
|
24
|
-
: page?.url.pathname === item.path;
|
|
25
|
-
}
|
|
26
|
-
export const defaultCss = {
|
|
27
|
-
buttonCss: [],
|
|
28
|
-
container: [],
|
|
29
|
-
link: []
|
|
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
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
import Icon from "@iconify/svelte";
|
|
4
|
-
|
|
5
|
-
interface AccordionProps {
|
|
6
|
-
children: Snippet;
|
|
7
|
-
isOpenByDefault: boolean;
|
|
8
|
-
animationDurationMs: number;
|
|
9
|
-
title: string;
|
|
10
|
-
cheveronPosition: "left" | "right";
|
|
11
|
-
css: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
let {
|
|
15
|
-
children,
|
|
16
|
-
title = "",
|
|
17
|
-
isOpenByDefault = true,
|
|
18
|
-
animationDurationMs = 300,
|
|
19
|
-
cheveronPosition = "right",
|
|
20
|
-
css = "",
|
|
21
|
-
}: Partial<AccordionProps> = $props();
|
|
22
|
-
|
|
23
|
-
let isOpen = $state(isOpenByDefault);
|
|
24
|
-
let contentElement: HTMLDivElement;
|
|
25
|
-
|
|
26
|
-
const toggleAccordion = () => {
|
|
27
|
-
isOpen = !isOpen;
|
|
28
|
-
};
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
{#snippet cheveron()}
|
|
32
|
-
{#if isOpen}
|
|
33
|
-
<Icon icon="mdi:chevron-up" width="1rem" />
|
|
34
|
-
{:else}
|
|
35
|
-
<Icon icon="mdi:chevron-down" width="1rem" />
|
|
36
|
-
{/if}
|
|
37
|
-
{/snippet}
|
|
38
|
-
|
|
39
|
-
<article class={css}>
|
|
40
|
-
<header onclick={toggleAccordion} role="button" tabindex="0" onkeydown={(e) => e.key === 'Enter' && toggleAccordion()}>
|
|
41
|
-
{#if cheveronPosition === 'left'}
|
|
42
|
-
{@render cheveron?.()}
|
|
43
|
-
{/if}
|
|
44
|
-
{title}
|
|
45
|
-
{#if cheveronPosition === 'right'}
|
|
46
|
-
{@render cheveron?.()}
|
|
47
|
-
{/if}
|
|
48
|
-
</header>
|
|
49
|
-
<div
|
|
50
|
-
bind:this={contentElement}
|
|
51
|
-
class="content"
|
|
52
|
-
class:folded={!isOpen}
|
|
53
|
-
style={`max-height: ${isOpen ? contentElement?.scrollHeight + 'px' : '0'}; transition: max-height 500ms ease-in-out, opacity 500ms ease-in-out;`}>
|
|
54
|
-
{@render children?.()}
|
|
55
|
-
</div>
|
|
56
|
-
</article>
|
|
57
|
-
|
|
58
|
-
<style>
|
|
59
|
-
header {
|
|
60
|
-
cursor: pointer;
|
|
61
|
-
user-select: none;
|
|
62
|
-
display: flex;
|
|
63
|
-
justify-content: space-between;
|
|
64
|
-
align-items: center;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.toggle-icon {
|
|
68
|
-
font-weight: bold;
|
|
69
|
-
font-size: 1.2em;
|
|
70
|
-
transition: transform 500ms ease-in-out;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.content {
|
|
74
|
-
overflow: hidden;
|
|
75
|
-
opacity: 1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.folded {
|
|
79
|
-
opacity: 0;
|
|
80
|
-
max-height: 0 !important;
|
|
81
|
-
}
|
|
82
|
-
</style>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
declare const Accordion: import("svelte").Component<Partial<{
|
|
3
|
-
children: Snippet;
|
|
4
|
-
isOpenByDefault: boolean;
|
|
5
|
-
animationDurationMs: number;
|
|
6
|
-
title: string;
|
|
7
|
-
cheveronPosition: "left" | "right";
|
|
8
|
-
css: string;
|
|
9
|
-
}>, {}, "">;
|
|
10
|
-
type Accordion = ReturnType<typeof Accordion>;
|
|
11
|
-
export default Accordion;
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cn } from '../../utils.js';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
children: Snippet;
|
|
7
|
-
isAnimated: boolean;
|
|
8
|
-
isSkinned: boolean;
|
|
9
|
-
isStacked: boolean;
|
|
10
|
-
isShadow: boolean;
|
|
11
|
-
isBorder: boolean;
|
|
12
|
-
isRounded?: boolean;
|
|
13
|
-
isWrapped: boolean;
|
|
14
|
-
type: string;
|
|
15
|
-
css: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
let {
|
|
19
|
-
children,
|
|
20
|
-
isAnimated = false,
|
|
21
|
-
isSkinned = true,
|
|
22
|
-
isStacked = false,
|
|
23
|
-
isShadow = false,
|
|
24
|
-
isBorder = false,
|
|
25
|
-
isRounded = false,
|
|
26
|
-
isWrapped = true,
|
|
27
|
-
type = '',
|
|
28
|
-
css = '',
|
|
29
|
-
...restProps
|
|
30
|
-
}: Partial<Props> = $props();
|
|
31
|
-
|
|
32
|
-
let klasses = cn(
|
|
33
|
-
isSkinned ? 'card' : 'base',
|
|
34
|
-
isAnimated ? 'animated' : '',
|
|
35
|
-
isStacked ? 'stacked' : '',
|
|
36
|
-
isShadow ? 'shadow' : '',
|
|
37
|
-
isRounded ? 'rounded' : '',
|
|
38
|
-
isBorder ? 'border' : '',
|
|
39
|
-
isWrapped ? 'wrapped': '',
|
|
40
|
-
type ? `${type}` : '',
|
|
41
|
-
css ? `${css}` : '');
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
<div class={klasses} {...restProps}>
|
|
45
|
-
{@render children?.()}
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<style>
|
|
49
|
-
.card,
|
|
50
|
-
.base {
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
position: relative;
|
|
54
|
-
box-sizing: border-box;
|
|
55
|
-
width: 100%;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.wrapped {
|
|
59
|
-
flex-wrap: wrap;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.border {
|
|
63
|
-
border: 1px solid var(--border-color);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.rounded {
|
|
67
|
-
border-radius: var(--radius, 0.25rem);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.shadow {
|
|
71
|
-
box-shadow:
|
|
72
|
-
var(--boxshadow1-offset-x, 0) var(--boxshadow1-offset-y, 0.375rem)
|
|
73
|
-
var(--boxshadow1-blur, 0.5625rem)
|
|
74
|
-
var(--boxshadow1-color, rgb(6 6 6 / 7.5%)),
|
|
75
|
-
var(--boxshadow2-offset-x, 0) var(--boxshadow2-offset-y, 0)
|
|
76
|
-
var(--boxshadow2-blur, 1px)
|
|
77
|
-
var(--boxshadow2-color, rgb(5 5 5 / 10%));
|
|
78
|
-
border-radius: var(radius, 0.25rem);
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.shadow:hover {
|
|
83
|
-
box-shadow:
|
|
84
|
-
var(--boxshadow1-offset-x, 0) var(--boxshadow1-offset-y, 0.375rem)
|
|
85
|
-
var(--boxshadow1-blur, 0.875rem)
|
|
86
|
-
var(--boxshadow1-color, rgb(4 4 4 / 10%)),
|
|
87
|
-
var(--boxshadow2-offset-x, 0) var(--boxshadow2-offset-y, 0)
|
|
88
|
-
var(--boxshadow2-blur, 2px)
|
|
89
|
-
var(--boxshadow2-color, rgb(3 3 3 / 10%));
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.animated {
|
|
93
|
-
transition:
|
|
94
|
-
box-shadow ease-out 5s,
|
|
95
|
-
transform var(--timing-fast)
|
|
96
|
-
cubic-bezier(
|
|
97
|
-
var(--cubic-1,),
|
|
98
|
-
var(--cubic-2,),
|
|
99
|
-
var(--cubic-3,),
|
|
100
|
-
var(--cubic-4,)
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.animated:hover {
|
|
105
|
-
transform: translateY(var(--translate-y-hover, -3px));
|
|
106
|
-
transition:
|
|
107
|
-
box-shadow ease-out var(--timing-fast),
|
|
108
|
-
transform var(--timing-slow)
|
|
109
|
-
cubic-bezier(
|
|
110
|
-
var(--cubic-1,),
|
|
111
|
-
var(--cubic-2,),
|
|
112
|
-
var(--cubic-3,),
|
|
113
|
-
var(--cubic-4,)
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@media (prefers-reduced-motion), (update: slow) {
|
|
118
|
-
.animated,
|
|
119
|
-
.animated:hover {
|
|
120
|
-
transition-duration: 0.001ms !important;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.stacked {
|
|
125
|
-
flex-direction: column;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.success {
|
|
129
|
-
background: var(--action-light);
|
|
130
|
-
color: var(--action-dark);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.info {
|
|
134
|
-
background: var(--primary-light);
|
|
135
|
-
color: var(--primary-dark);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.error {
|
|
139
|
-
background: var(--error-light);
|
|
140
|
-
color: var(--error-dark);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.warning {
|
|
144
|
-
background: var(--warning-light);
|
|
145
|
-
color: var(--warning-dark);
|
|
146
|
-
}
|
|
147
|
-
</style>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
declare const Card: import("svelte").Component<Partial<{
|
|
3
|
-
children: Snippet;
|
|
4
|
-
isAnimated: boolean;
|
|
5
|
-
isSkinned: boolean;
|
|
6
|
-
isStacked: boolean;
|
|
7
|
-
isShadow: boolean;
|
|
8
|
-
isBorder: boolean;
|
|
9
|
-
isRounded?: boolean;
|
|
10
|
-
isWrapped: boolean;
|
|
11
|
-
type: string;
|
|
12
|
-
css: string;
|
|
13
|
-
}>, {}, "">;
|
|
14
|
-
type Card = ReturnType<typeof Card>;
|
|
15
|
-
export default Card;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { onMount, type Snippet } from 'svelte';
|
|
3
|
-
import emblaCarouselSvelte from 'embla-carousel-svelte';
|
|
4
|
-
import EmblaCarousel, { type EmblaOptionsType } from 'embla-carousel';
|
|
5
|
-
import { cn } from '../../utils.js';
|
|
6
|
-
import Button from '../form/Button.svelte';
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
child: Snippet<[any]>;
|
|
10
|
-
items: Array<any>;
|
|
11
|
-
next?: Snippet;
|
|
12
|
-
prev?: Snippet;
|
|
13
|
-
css?: { slide: string; container: string };
|
|
14
|
-
perPage?: number;
|
|
15
|
-
slideGaps: string;
|
|
16
|
-
disableDrag: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
let {
|
|
20
|
-
child,
|
|
21
|
-
next,
|
|
22
|
-
prev,
|
|
23
|
-
items,
|
|
24
|
-
perPage = 1,
|
|
25
|
-
slideGaps = '20px;',
|
|
26
|
-
disableDrag = false,
|
|
27
|
-
css = {slide: "", container: ""},
|
|
28
|
-
loop = false
|
|
29
|
-
}: Props = $props();
|
|
30
|
-
|
|
31
|
-
let options: EmblaOptionsType = {
|
|
32
|
-
loop: loop,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
if(disableDrag) {
|
|
36
|
-
options.watchDrag = false;
|
|
37
|
-
}
|
|
38
|
-
let slideStyle = cn('flex: 0 0 ' + 100 / perPage + '%;', css.slide);
|
|
39
|
-
let containerCss = cn('flex', 'fw', css.container);
|
|
40
|
-
|
|
41
|
-
let embla = {
|
|
42
|
-
scrollPrev: () => console.log('prev'),
|
|
43
|
-
scrollNext: () => console.log('next')
|
|
44
|
-
};
|
|
45
|
-
let viewportNode: HTMLElement | undefined = undefined;
|
|
46
|
-
|
|
47
|
-
onMount(() => {
|
|
48
|
-
if (viewportNode != undefined) {
|
|
49
|
-
embla = EmblaCarousel(viewportNode, options);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<div class="carousel flex flex-row" use:emblaCarouselSvelte>
|
|
55
|
-
<div class="carousel__viewport" bind:this={viewportNode}>
|
|
56
|
-
<div class={containerCss}>
|
|
57
|
-
{#each items as item}
|
|
58
|
-
<div class="carousel__slide" style={slideStyle}>
|
|
59
|
-
{@render child(item)}
|
|
60
|
-
</div>
|
|
61
|
-
{/each}
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
<Button
|
|
65
|
-
type="button"
|
|
66
|
-
css="carousel__prev"
|
|
67
|
-
ariaLabel="Previous item on Carousele"
|
|
68
|
-
style="order: -1 !important;width: 50px;height: 100%;background: none;border: none !important;align-self: center;"
|
|
69
|
-
click={() => embla.scrollPrev()}
|
|
70
|
-
>
|
|
71
|
-
{#if prev}
|
|
72
|
-
{@render prev()}
|
|
73
|
-
{:else}
|
|
74
|
-
<svg
|
|
75
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
76
|
-
width="24"
|
|
77
|
-
height="24"
|
|
78
|
-
viewBox="0 0 24 24"
|
|
79
|
-
fill="none"
|
|
80
|
-
stroke="currentColor"
|
|
81
|
-
stroke-width="2"
|
|
82
|
-
stroke-linecap="round"
|
|
83
|
-
stroke-linejoin="round"
|
|
84
|
-
class="lucide lucide-arrow-left"><path d="m12 19-7-7 7-7" /><path d="M19 12H5" /></svg
|
|
85
|
-
>
|
|
86
|
-
{/if}
|
|
87
|
-
</Button>
|
|
88
|
-
<Button
|
|
89
|
-
type="button"
|
|
90
|
-
css="carousel__next"
|
|
91
|
-
ariaLabel="Next item on Carousele"
|
|
92
|
-
style="order: 1000 !important;width: 50px;height: 100%;background: none; border: none !important;align-self: center;"
|
|
93
|
-
click={() => embla.scrollNext()}
|
|
94
|
-
>
|
|
95
|
-
{#if next}
|
|
96
|
-
{@render next()}
|
|
97
|
-
{:else}
|
|
98
|
-
<svg
|
|
99
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
100
|
-
width="24"
|
|
101
|
-
height="24"
|
|
102
|
-
viewBox="0 0 24 24"
|
|
103
|
-
fill="none"
|
|
104
|
-
stroke="currentColor"
|
|
105
|
-
stroke-width="2"
|
|
106
|
-
stroke-linecap="round"
|
|
107
|
-
stroke-linejoin="round"
|
|
108
|
-
class="lucide lucide-arrow-right"><path d="M5 12h14" /><path d="m12 5 7 7-7 7" /></svg
|
|
109
|
-
>
|
|
110
|
-
{/if}
|
|
111
|
-
</Button>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
<style>.carousel .carousel__viewport {
|
|
115
|
-
overflow: hidden;
|
|
116
|
-
}
|
|
117
|
-
.carousel .carousel__slide {
|
|
118
|
-
min-width: 0;
|
|
119
|
-
}</style>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Snippet } from 'svelte';
|
|
2
|
-
interface Props {
|
|
3
|
-
child: Snippet<[any]>;
|
|
4
|
-
items: Array<any>;
|
|
5
|
-
next?: Snippet;
|
|
6
|
-
prev?: Snippet;
|
|
7
|
-
css?: {
|
|
8
|
-
slide: string;
|
|
9
|
-
container: string;
|
|
10
|
-
};
|
|
11
|
-
perPage?: number;
|
|
12
|
-
slideGaps: string;
|
|
13
|
-
disableDrag: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare const Carousel: import("svelte").Component<Props, {}, "">;
|
|
16
|
-
type Carousel = ReturnType<typeof Carousel>;
|
|
17
|
-
export default Carousel;
|