@functionalcms/svelte-components 3.5.20 → 4.0.0-pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/functional.css +1 -1
- package/css/functional.css.map +1 -1
- package/dist/auth/authenticationHandle.js +0 -4
- package/dist/auth/redisSessionProvider.js +1 -2
- package/dist/auth/sessionIdGenerator.d.ts +1 -1
- package/dist/components/form/Button.svelte +379 -0
- package/dist/components/form/Button.svelte.d.ts +27 -0
- package/dist/components/form/Input.d.ts +21 -0
- package/dist/components/form/Input.js +23 -0
- package/dist/components/form/Input.svelte +142 -177
- package/dist/components/form/Input.svelte.d.ts +24 -46
- package/dist/components/{Banner.svelte → layouts/Banner.svelte} +5 -5
- package/dist/components/layouts/DefaultLayout.svelte +5 -5
- package/dist/components/layouts/DefaultLayout.svelte.d.ts +4 -4
- package/dist/components/layouts/SimpleFooter.svelte +4 -4
- package/dist/components/layouts/SimpleFooter.svelte.d.ts +3 -3
- package/dist/components/layouts/Well.svelte +46 -0
- package/dist/components/layouts/Well.svelte.d.ts +12 -0
- package/dist/components/menu/CollapsibleMenu.svelte +2 -2
- package/dist/components/menu/CollapsibleMenu.svelte.d.ts +3 -16
- package/dist/components/menu/DynamicMenu.svelte +25 -13
- package/dist/components/menu/DynamicMenu.svelte.d.ts +10 -28
- package/dist/components/menu/HamburgerMenu.svelte +29 -21
- package/dist/components/menu/HamburgerMenu.svelte.d.ts +11 -24
- package/dist/components/menu/ListMenu.svelte +53 -0
- package/dist/components/menu/ListMenu.svelte.d.ts +17 -0
- package/dist/components/menu/{Menu.d.ts → types.d.ts} +2 -0
- package/dist/components/menu/{Menu.js → types.js} +5 -0
- package/dist/components/presentation/Card.svelte +77 -92
- package/dist/components/presentation/Card.svelte.d.ts +10 -13
- package/dist/components/presentation/{Carusele.d.ts → Carousel.d.ts} +1 -1
- package/dist/components/presentation/Carousel.svelte +98 -1
- package/dist/components/presentation/Carousel.svelte.d.ts +14 -15
- package/dist/components/presentation/Drawer.svelte +131 -0
- package/dist/components/presentation/Drawer.svelte.d.ts +13 -0
- package/dist/components/presentation/Gallery.svelte +7 -7
- package/dist/components/presentation/Gallery.svelte.d.ts +3 -3
- package/dist/components/presentation/ImageCompare.svelte +39 -46
- package/dist/components/presentation/ImageCompare.svelte.d.ts +8 -26
- package/dist/components/presentation/Link.svelte +362 -0
- package/dist/components/presentation/Link.svelte.d.ts +27 -0
- package/dist/components/presentation/Logo.svelte +36 -0
- package/dist/components/presentation/Logo.svelte.d.ts +8 -0
- package/dist/components/presentation/ShowItem.d.ts +7 -7
- package/dist/components/presentation/ShowItem.js +1 -8
- package/dist/index-server.d.ts +0 -1
- package/dist/index-server.js +0 -3
- package/dist/index.d.ts +16 -22
- package/dist/index.js +39 -57
- package/dist/server-side/getServices.d.ts +1 -1
- package/dist/server-side/types.d.ts +1 -2
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +54 -0
- package/package.json +27 -24
- package/dist/components/CssHelper.d.ts +0 -1
- package/dist/components/CssHelper.js +0 -3
- package/dist/components/Link.svelte +0 -349
- package/dist/components/Link.svelte.d.ts +0 -48
- package/dist/components/Logo.svelte +0 -38
- package/dist/components/Logo.svelte.d.ts +0 -28
- package/dist/components/Spacer.svelte +0 -22
- package/dist/components/Spacer.svelte.d.ts +0 -6
- package/dist/components/Well.svelte +0 -40
- package/dist/components/Well.svelte.d.ts +0 -12
- package/dist/components/agnostic/Button/Button.svelte +0 -371
- package/dist/components/agnostic/Button/Button.svelte.d.ts +0 -52
- package/dist/components/agnostic/Button/ButtonGroup.svelte +0 -21
- package/dist/components/agnostic/Button/ButtonGroup.svelte.d.ts +0 -32
- package/dist/components/agnostic/Button/button-base.css +0 -12
- package/dist/components/agnostic/Button/button-core.css +0 -237
- package/dist/components/agnostic/Button/button-empty.css +0 -31
- package/dist/components/agnostic/Button/button-group.css +0 -8
- package/dist/components/agnostic/Close/Close.svelte +0 -124
- package/dist/components/agnostic/Close/Close.svelte.d.ts +0 -25
- package/dist/components/agnostic/Close/api.d.ts +0 -1
- package/dist/components/agnostic/Disclose/Disclose.svelte +0 -116
- package/dist/components/agnostic/Disclose/Disclose.svelte.d.ts +0 -11
- package/dist/components/agnostic/Divider/Divider.svelte +0 -141
- package/dist/components/agnostic/Divider/Divider.svelte.d.ts +0 -24
- package/dist/components/agnostic/Divider/api.d.ts +0 -3
- package/dist/components/agnostic/Divider/api.js +0 -1
- package/dist/components/agnostic/Loader/Loader.svelte +0 -116
- package/dist/components/agnostic/Loader/Loader.svelte.d.ts +0 -22
- package/dist/components/agnostic/animation.css +0 -37
- package/dist/components/blog/BlogDescription.svelte +0 -9
- package/dist/components/blog/BlogDescription.svelte.d.ts +0 -23
- package/dist/components/blog/BlogPost.d.ts +0 -13
- package/dist/components/blog/BlogPost.js +0 -1
- package/dist/components/blog/BlogTitle.svelte +0 -19
- package/dist/components/blog/BlogTitle.svelte.d.ts +0 -23
- package/dist/components/blog/blog.d.ts +0 -8
- package/dist/components/blog/blog.js +0 -29
- package/dist/components/converters/ShowItemToNavigationItems.d.ts +0 -3
- package/dist/components/converters/ShowItemToNavigationItems.js +0 -10
- package/dist/components/form/DateTimePicker.svelte +0 -59
- package/dist/components/form/DateTimePicker.svelte.d.ts +0 -18
- package/dist/components/form/InputAddonItem.svelte +0 -42
- package/dist/components/form/InputAddonItem.svelte.d.ts +0 -31
- package/dist/components/form/InputTypes.d.ts +0 -9
- package/dist/components/form/InputTypes.js +0 -10
- package/dist/components/form/Select.svelte +0 -157
- package/dist/components/form/Select.svelte.d.ts +0 -34
- package/dist/components/form/Switch.svelte +0 -275
- package/dist/components/form/Switch.svelte.d.ts +0 -30
- package/dist/components/menu/Menu.svelte +0 -526
- package/dist/components/menu/Menu.svelte.d.ts +0 -33
- package/dist/components/menu/MenuItem.svelte +0 -121
- package/dist/components/menu/MenuItem.svelte.d.ts +0 -39
- package/dist/components/menu/NavigationItems.svelte +0 -44
- package/dist/components/menu/NavigationItems.svelte.d.ts +0 -32
- package/dist/components/menu/authentication.d.ts +0 -1
- package/dist/components/menu/authentication.js +0 -6
- package/dist/components/presentation/Carousel/carousel-content.svelte +0 -35
- package/dist/components/presentation/Carousel/carousel-content.svelte.d.ts +0 -28
- package/dist/components/presentation/Carousel/carousel-item.svelte +0 -25
- package/dist/components/presentation/Carousel/carousel-item.svelte.d.ts +0 -28
- package/dist/components/presentation/Carousel/carousel-next.svelte +0 -39
- package/dist/components/presentation/Carousel/carousel-next.svelte.d.ts +0 -18
- package/dist/components/presentation/Carousel/carousel-previous.svelte +0 -40
- package/dist/components/presentation/Carousel/carousel-previous.svelte.d.ts +0 -18
- package/dist/components/presentation/Carousel/carousel.svelte +0 -99
- package/dist/components/presentation/Carousel/carousel.svelte.d.ts +0 -31
- package/dist/components/presentation/Carousel/context.d.ts +0 -32
- package/dist/components/presentation/Carousel/context.js +0 -12
- package/dist/components/presentation/Carusele.js +0 -5
- /package/dist/components/{Markdown.svelte → content/Markdown.svelte} +0 -0
- /package/dist/components/{Markdown.svelte.d.ts → content/Markdown.svelte.d.ts} +0 -0
- /package/dist/components/{Banner.svelte.d.ts → layouts/Banner.svelte.d.ts} +0 -0
- /package/dist/components/{agnostic/Close/api.js → presentation/Carousel.js} +0 -0
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../../utils.js';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
|
-
import { Orientation } from '../Styling';
|
|
5
4
|
|
|
6
5
|
interface Props {
|
|
7
6
|
children: Snippet;
|
|
8
|
-
isAnimated
|
|
9
|
-
isSkinned
|
|
10
|
-
isStacked
|
|
11
|
-
isShadow
|
|
12
|
-
isBorder
|
|
7
|
+
isAnimated: boolean;
|
|
8
|
+
isSkinned: boolean;
|
|
9
|
+
isStacked: boolean;
|
|
10
|
+
isShadow: boolean;
|
|
11
|
+
isBorder: boolean;
|
|
13
12
|
isRounded?: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
css?: string;
|
|
13
|
+
isWrapped: boolean;
|
|
14
|
+
type: string;
|
|
15
|
+
css: string;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
let {
|
|
21
19
|
children,
|
|
22
20
|
isAnimated = false,
|
|
23
21
|
isSkinned = true,
|
|
@@ -25,39 +23,31 @@
|
|
|
25
23
|
isShadow = false,
|
|
26
24
|
isBorder = false,
|
|
27
25
|
isRounded = false,
|
|
28
|
-
|
|
29
|
-
orientation = Orientation.Column,
|
|
26
|
+
isWrapped = true,
|
|
30
27
|
type = '',
|
|
31
|
-
css = ''
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
css ? `${css}` : ''
|
|
45
|
-
);
|
|
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}` : '');
|
|
46
42
|
</script>
|
|
47
43
|
|
|
48
|
-
<div class={klasses}>
|
|
49
|
-
{@render children()}
|
|
44
|
+
<div class={klasses} {...restProps}>
|
|
45
|
+
{@render children?.()}
|
|
50
46
|
</div>
|
|
51
47
|
|
|
52
48
|
<style>
|
|
53
|
-
/**
|
|
54
|
-
* Cards
|
|
55
|
-
*
|
|
56
|
-
* I drew some inspiration from the article on media-query less cards:
|
|
57
|
-
* https://css-tricks.com/how-to-make-a-media-query-less-card-component/
|
|
58
|
-
*/
|
|
59
49
|
.card,
|
|
60
|
-
.
|
|
50
|
+
.base {
|
|
61
51
|
display: flex;
|
|
62
52
|
align-items: center;
|
|
63
53
|
position: relative;
|
|
@@ -65,98 +55,93 @@
|
|
|
65
55
|
width: 100%;
|
|
66
56
|
}
|
|
67
57
|
|
|
68
|
-
.
|
|
58
|
+
.wrapped {
|
|
69
59
|
flex-wrap: wrap;
|
|
70
60
|
}
|
|
71
61
|
|
|
72
|
-
.
|
|
73
|
-
border: 1px solid var(--
|
|
62
|
+
.border {
|
|
63
|
+
border: 1px solid var(--border-color);
|
|
74
64
|
}
|
|
75
65
|
|
|
76
|
-
.
|
|
77
|
-
border-radius: var(--
|
|
66
|
+
.rounded {
|
|
67
|
+
border-radius: var(--radius, 0.25rem);
|
|
78
68
|
}
|
|
79
69
|
|
|
80
|
-
.
|
|
70
|
+
.shadow {
|
|
81
71
|
box-shadow:
|
|
82
|
-
var(--
|
|
83
|
-
var(--
|
|
84
|
-
var(--
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var(--
|
|
88
|
-
|
|
89
|
-
border-radius: var(--functional-card-border-radius, var(--functional-radius, 0.25rem));
|
|
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);
|
|
90
79
|
overflow: hidden;
|
|
91
80
|
}
|
|
92
81
|
|
|
93
|
-
.
|
|
82
|
+
.shadow:hover {
|
|
94
83
|
box-shadow:
|
|
95
|
-
var(--
|
|
96
|
-
var(--
|
|
97
|
-
var(--
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var(--
|
|
101
|
-
var(--functional-card-boxshadow2-color, rgb(3 3 3 / 10%));
|
|
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%));
|
|
102
90
|
}
|
|
103
91
|
|
|
104
|
-
|
|
105
|
-
* Animates the y position and box shadow on hover
|
|
106
|
-
*/
|
|
107
|
-
.card-animated {
|
|
92
|
+
.animated {
|
|
108
93
|
transition:
|
|
109
94
|
box-shadow ease-out 5s,
|
|
110
|
-
transform var(--
|
|
95
|
+
transform var(--timing-fast)
|
|
111
96
|
cubic-bezier(
|
|
112
|
-
var(--
|
|
113
|
-
var(--
|
|
114
|
-
var(--
|
|
115
|
-
var(--
|
|
97
|
+
var(--cubic-1,),
|
|
98
|
+
var(--cubic-2,),
|
|
99
|
+
var(--cubic-3,),
|
|
100
|
+
var(--cubic-4,)
|
|
116
101
|
);
|
|
117
102
|
}
|
|
118
103
|
|
|
119
|
-
.
|
|
120
|
-
transform: translateY(var(--
|
|
104
|
+
.animated:hover {
|
|
105
|
+
transform: translateY(var(--translate-y-hover, -3px));
|
|
121
106
|
transition:
|
|
122
|
-
box-shadow ease-out var(--
|
|
123
|
-
transform var(--
|
|
107
|
+
box-shadow ease-out var(--timing-fast),
|
|
108
|
+
transform var(--timing-slow)
|
|
124
109
|
cubic-bezier(
|
|
125
|
-
var(--
|
|
126
|
-
var(--
|
|
127
|
-
var(--
|
|
128
|
-
var(--
|
|
110
|
+
var(--cubic-1,),
|
|
111
|
+
var(--cubic-2,),
|
|
112
|
+
var(--cubic-3,),
|
|
113
|
+
var(--cubic-4,)
|
|
129
114
|
);
|
|
130
115
|
}
|
|
131
116
|
|
|
132
117
|
@media (prefers-reduced-motion), (update: slow) {
|
|
133
|
-
.
|
|
134
|
-
.
|
|
118
|
+
.animated,
|
|
119
|
+
.animated:hover {
|
|
135
120
|
transition-duration: 0.001ms !important;
|
|
136
121
|
}
|
|
137
122
|
}
|
|
138
123
|
|
|
139
|
-
.
|
|
124
|
+
.stacked {
|
|
140
125
|
flex-direction: column;
|
|
141
126
|
}
|
|
142
127
|
|
|
143
|
-
.
|
|
144
|
-
background: var(--
|
|
145
|
-
color: var(--
|
|
128
|
+
.success {
|
|
129
|
+
background: var(--action-light);
|
|
130
|
+
color: var(--action-dark);
|
|
146
131
|
}
|
|
147
132
|
|
|
148
|
-
.
|
|
149
|
-
background: var(--
|
|
150
|
-
color: var(--
|
|
133
|
+
.info {
|
|
134
|
+
background: var(--primary-light);
|
|
135
|
+
color: var(--primary-dark);
|
|
151
136
|
}
|
|
152
137
|
|
|
153
|
-
.
|
|
154
|
-
background: var(--
|
|
155
|
-
color: var(--
|
|
138
|
+
.error {
|
|
139
|
+
background: var(--error-light);
|
|
140
|
+
color: var(--error-dark);
|
|
156
141
|
}
|
|
157
142
|
|
|
158
|
-
.
|
|
159
|
-
background: var(--
|
|
160
|
-
color: var(--
|
|
143
|
+
.warning {
|
|
144
|
+
background: var(--warning-light);
|
|
145
|
+
color: var(--warning-dark);
|
|
161
146
|
}
|
|
162
147
|
</style>
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
|
|
3
|
-
interface Props {
|
|
2
|
+
declare const Card: import("svelte").Component<Partial<{
|
|
4
3
|
children: Snippet;
|
|
5
|
-
isAnimated
|
|
6
|
-
isSkinned
|
|
7
|
-
isStacked
|
|
8
|
-
isShadow
|
|
9
|
-
isBorder
|
|
4
|
+
isAnimated: boolean;
|
|
5
|
+
isSkinned: boolean;
|
|
6
|
+
isStacked: boolean;
|
|
7
|
+
isShadow: boolean;
|
|
8
|
+
isBorder: boolean;
|
|
10
9
|
isRounded?: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
declare const Card: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
isWrapped: boolean;
|
|
11
|
+
type: string;
|
|
12
|
+
css: string;
|
|
13
|
+
}>, {}, "">;
|
|
17
14
|
type Card = ReturnType<typeof Card>;
|
|
18
15
|
export default Card;
|
|
@@ -1,4 +1,101 @@
|
|
|
1
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 type { CarouselItem } from './Carousel.ts';
|
|
6
|
+
import { cn } from '../../utils.js';
|
|
7
|
+
import Button from '../form/Button.svelte';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
child: Snippet<[CarouselItem]>;
|
|
11
|
+
items: Array<CarouselItem>;
|
|
12
|
+
next?: Snippet;
|
|
13
|
+
prev?: Snippet;
|
|
14
|
+
css?: { slide: string; container: string };
|
|
15
|
+
perPage?: number;
|
|
16
|
+
slideGaps: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let { child, next, prev, items, perPage = 1, slideGaps = '20px;' }: Props = $props();
|
|
20
|
+
|
|
21
|
+
let options: EmblaOptionsType = { loop: false };
|
|
22
|
+
let slideStyle = $derived('flex: 0 0 ' + 100 / perPage + '%;');
|
|
23
|
+
let containerCss = cn('flex', 'fw');
|
|
24
|
+
|
|
25
|
+
let embla = {
|
|
26
|
+
scrollPrev: () => console.log('prev'),
|
|
27
|
+
scrollNext: () => console.log('next')
|
|
28
|
+
};
|
|
29
|
+
let viewportNode: HTMLElement | undefined = undefined;
|
|
30
|
+
|
|
31
|
+
onMount(() => {
|
|
32
|
+
if (viewportNode != undefined) {
|
|
33
|
+
embla = EmblaCarousel(viewportNode, options);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
2
36
|
</script>
|
|
3
37
|
|
|
4
|
-
<
|
|
38
|
+
<div class="carousel flex flex-row" use:emblaCarouselSvelte>
|
|
39
|
+
<div class="carousel__viewport" bind:this={viewportNode}>
|
|
40
|
+
<div class={containerCss}>
|
|
41
|
+
{#each items as item}
|
|
42
|
+
<div class="carousel__slide" style={slideStyle}>
|
|
43
|
+
{@render child(item)}
|
|
44
|
+
</div>
|
|
45
|
+
{/each}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<Button
|
|
49
|
+
type="link"
|
|
50
|
+
css="carousel__prev"
|
|
51
|
+
style="order: -1 !important;width: 50px;height: 100%;background: none;border: none !important;align-self: center;"
|
|
52
|
+
onclick={() => embla.scrollPrev()}
|
|
53
|
+
>
|
|
54
|
+
{#if prev}
|
|
55
|
+
{@render prev()}
|
|
56
|
+
{:else}
|
|
57
|
+
<svg
|
|
58
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
59
|
+
width="24"
|
|
60
|
+
height="24"
|
|
61
|
+
viewBox="0 0 24 24"
|
|
62
|
+
fill="none"
|
|
63
|
+
stroke="currentColor"
|
|
64
|
+
stroke-width="2"
|
|
65
|
+
stroke-linecap="round"
|
|
66
|
+
stroke-linejoin="round"
|
|
67
|
+
class="lucide lucide-arrow-left"><path d="m12 19-7-7 7-7" /><path d="M19 12H5" /></svg
|
|
68
|
+
>
|
|
69
|
+
{/if}
|
|
70
|
+
</Button>
|
|
71
|
+
<Button
|
|
72
|
+
type="link"
|
|
73
|
+
css="carousel__next"
|
|
74
|
+
style="order: 1000 !important;width: 50px;height: 100%;background: none; border: none !important;align-self: center;"
|
|
75
|
+
onclick={() => embla.scrollNext()}
|
|
76
|
+
>
|
|
77
|
+
{#if next}
|
|
78
|
+
{@render next()}
|
|
79
|
+
{:else}
|
|
80
|
+
<svg
|
|
81
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
82
|
+
width="24"
|
|
83
|
+
height="24"
|
|
84
|
+
viewBox="0 0 24 24"
|
|
85
|
+
fill="none"
|
|
86
|
+
stroke="currentColor"
|
|
87
|
+
stroke-width="2"
|
|
88
|
+
stroke-linecap="round"
|
|
89
|
+
stroke-linejoin="round"
|
|
90
|
+
class="lucide lucide-arrow-right"><path d="M5 12h14" /><path d="m12 5 7 7-7 7" /></svg
|
|
91
|
+
>
|
|
92
|
+
{/if}
|
|
93
|
+
</Button>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<style>.carousel .carousel__viewport {
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
}
|
|
99
|
+
.carousel .carousel__slide {
|
|
100
|
+
min-width: 0;
|
|
101
|
+
}</style>
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
|
+
import type { CarouselItem } from './Carousel.ts';
|
|
3
|
+
interface Props {
|
|
4
|
+
child: Snippet<[CarouselItem]>;
|
|
5
|
+
items: Array<CarouselItem>;
|
|
6
|
+
next?: Snippet;
|
|
7
|
+
prev?: Snippet;
|
|
8
|
+
css?: {
|
|
9
|
+
slide: string;
|
|
10
|
+
container: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
perPage?: number;
|
|
13
|
+
slideGaps: string;
|
|
13
14
|
}
|
|
14
|
-
declare const Carousel:
|
|
15
|
-
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type Carousel = InstanceType<typeof Carousel>;
|
|
15
|
+
declare const Carousel: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type Carousel = ReturnType<typeof Carousel>;
|
|
18
17
|
export default Carousel;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount, type Snippet } from 'svelte';
|
|
3
|
+
import { Placement } from '../Styling.js';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
open?: boolean;
|
|
7
|
+
duration?: number;
|
|
8
|
+
placement?: Placement;
|
|
9
|
+
size?: number;
|
|
10
|
+
clickAway: () => void;
|
|
11
|
+
children: Snippet
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
open = false,
|
|
16
|
+
duration = 0.2,
|
|
17
|
+
placement = Placement.Start,
|
|
18
|
+
size = undefined,
|
|
19
|
+
clickAway,
|
|
20
|
+
children,
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
|
|
23
|
+
let mounted = $state(false);
|
|
24
|
+
|
|
25
|
+
let style = $derived('--duration: ' + duration + 's; --size: ' + size + ';');
|
|
26
|
+
|
|
27
|
+
function scrollLock(open: boolean) {
|
|
28
|
+
if (mounted) {
|
|
29
|
+
const body = document.querySelector('body');
|
|
30
|
+
if (body != null) {
|
|
31
|
+
body.style.overflow = open ? 'hidden' : 'auto';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function handleClickAway() {
|
|
37
|
+
clickAway();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
onMount(() => {
|
|
41
|
+
mounted = true;
|
|
42
|
+
scrollLock(open);
|
|
43
|
+
});
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<aside class="drawer" class:open {style}>
|
|
47
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
48
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
49
|
+
<div class="overlay" onclick={handleClickAway}></div>
|
|
50
|
+
|
|
51
|
+
<div class="panel {placement}" class:size>
|
|
52
|
+
{@render children()}
|
|
53
|
+
</div>
|
|
54
|
+
</aside>
|
|
55
|
+
|
|
56
|
+
<style>
|
|
57
|
+
.drawer {
|
|
58
|
+
position: fixed;
|
|
59
|
+
top: 0;
|
|
60
|
+
left: 0;
|
|
61
|
+
height: 100%;
|
|
62
|
+
width: 100%;
|
|
63
|
+
z-index: -1;
|
|
64
|
+
transition: z-index var(--duration) step-end;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.drawer.open {
|
|
68
|
+
z-index: 99;
|
|
69
|
+
transition: z-index var(--duration) step-start;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.overlay {
|
|
73
|
+
position: fixed;
|
|
74
|
+
top: 0;
|
|
75
|
+
left: 0;
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 100%;
|
|
78
|
+
background: rgba(100, 100, 100, 0.5);
|
|
79
|
+
opacity: 0;
|
|
80
|
+
z-index: 2;
|
|
81
|
+
transition: opacity var(--duration) ease;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.drawer.open .overlay {
|
|
85
|
+
opacity: 1;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.panel {
|
|
89
|
+
position: fixed;
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
background: white;
|
|
93
|
+
z-index: 3;
|
|
94
|
+
transition: transform var(--duration) ease;
|
|
95
|
+
overflow: auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.panel.left {
|
|
99
|
+
left: 0;
|
|
100
|
+
transform: translate(-100%, 0);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.panel.right {
|
|
104
|
+
right: 0;
|
|
105
|
+
transform: translate(100%, 0);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.panel.top {
|
|
109
|
+
top: 0;
|
|
110
|
+
transform: translate(0, -100%);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.panel.bottom {
|
|
114
|
+
bottom: 0;
|
|
115
|
+
transform: translate(0, 100%);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.panel.left.size,
|
|
119
|
+
.panel.right.size {
|
|
120
|
+
max-width: var(--size);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.panel.top.size,
|
|
124
|
+
.panel.bottom.size {
|
|
125
|
+
max-height: var(--size);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.drawer.open .panel {
|
|
129
|
+
transform: translate(0, 0);
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
|
+
import { Placement } from '../Styling.js';
|
|
3
|
+
interface Props {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
duration?: number;
|
|
6
|
+
placement?: Placement;
|
|
7
|
+
size?: number;
|
|
8
|
+
clickAway: () => void;
|
|
9
|
+
children: Snippet;
|
|
10
|
+
}
|
|
11
|
+
declare const Drawer: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type Drawer = ReturnType<typeof Drawer>;
|
|
13
|
+
export default Drawer;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Card from './Card.svelte';
|
|
3
|
-
import type { ShowItem } from './ShowItem.
|
|
3
|
+
import type { ShowItem } from './ShowItem.ts';
|
|
4
4
|
import { AlignItmes, Justify, Orientation } from '../Styling.js';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../../utils.js';
|
|
6
6
|
import type { Snippet } from 'svelte';
|
|
7
|
-
|
|
8
|
-
interface
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
9
|
items: Array<ShowItem>;
|
|
10
10
|
renderItem: Snippet<[ShowItem]>;
|
|
11
11
|
justify: Justify;
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
alignItems = AlignItmes.Center,
|
|
24
24
|
orientation = Orientation.DynamicRow,
|
|
25
25
|
...restProps
|
|
26
|
-
}:
|
|
26
|
+
}: Props = $props();
|
|
27
27
|
|
|
28
|
-
let
|
|
28
|
+
let classes = cn('flex', css, `${orientation}`, `${justify}`, `${alignItems}`);
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
|
-
<Card css={
|
|
31
|
+
<Card css={classes} {...restProps}>
|
|
32
32
|
{#each items as entry}
|
|
33
33
|
{@render renderItem(entry)}
|
|
34
34
|
{/each}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ShowItem } from './ShowItem.
|
|
1
|
+
import type { ShowItem } from './ShowItem.ts';
|
|
2
2
|
import { AlignItmes, Justify, Orientation } from '../Styling.js';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
|
-
interface
|
|
4
|
+
interface Props {
|
|
5
5
|
items: Array<ShowItem>;
|
|
6
6
|
renderItem: Snippet<[ShowItem]>;
|
|
7
7
|
justify: Justify;
|
|
@@ -10,6 +10,6 @@ interface GaleryProps {
|
|
|
10
10
|
restProps: any;
|
|
11
11
|
css: string;
|
|
12
12
|
}
|
|
13
|
-
declare const Gallery: import("svelte").Component<
|
|
13
|
+
declare const Gallery: import("svelte").Component<Props, {}, "">;
|
|
14
14
|
type Gallery = ReturnType<typeof Gallery>;
|
|
15
15
|
export default Gallery;
|