@functionalcms/svelte-components 4.2.12 → 4.2.14
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.
|
@@ -1,116 +1,120 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cn } from '../../utils.js';
|
|
3
|
-
import type { Snippet } from 'svelte';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
children: Snippet;
|
|
7
|
-
css: string;
|
|
8
|
-
style: string;
|
|
9
|
-
type?: 'submit' | 'reset' | 'button' | 'link';
|
|
10
|
-
href: string;
|
|
11
|
-
mode?: string;
|
|
12
|
-
size?: string;
|
|
13
|
-
isPrimary: boolean;
|
|
14
|
-
isBordered?: boolean;
|
|
15
|
-
isCapsule?: boolean;
|
|
16
|
-
isGrouped?: boolean;
|
|
17
|
-
isBlock?: boolean;
|
|
18
|
-
isLink?: boolean;
|
|
19
|
-
isBlank?: boolean;
|
|
20
|
-
isDisabled?: boolean;
|
|
21
|
-
role?: string;
|
|
22
|
-
isCircle?: boolean;
|
|
23
|
-
isRounded?: boolean;
|
|
24
|
-
isSkinned?: boolean;
|
|
25
|
-
ariaSelected?: boolean;
|
|
26
|
-
ariaControls?: string;
|
|
27
|
-
tabIndex?: number;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
{
|
|
111
|
-
|
|
112
|
-
{
|
|
113
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../../utils.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
children: Snippet;
|
|
7
|
+
css: string;
|
|
8
|
+
style: string;
|
|
9
|
+
type?: 'submit' | 'reset' | 'button' | 'link';
|
|
10
|
+
href: string;
|
|
11
|
+
mode?: string;
|
|
12
|
+
size?: string;
|
|
13
|
+
isPrimary: boolean;
|
|
14
|
+
isBordered?: boolean;
|
|
15
|
+
isCapsule?: boolean;
|
|
16
|
+
isGrouped?: boolean;
|
|
17
|
+
isBlock?: boolean;
|
|
18
|
+
isLink?: boolean;
|
|
19
|
+
isBlank?: boolean;
|
|
20
|
+
isDisabled?: boolean;
|
|
21
|
+
role?: string;
|
|
22
|
+
isCircle?: boolean;
|
|
23
|
+
isRounded?: boolean;
|
|
24
|
+
isSkinned?: boolean;
|
|
25
|
+
ariaSelected?: boolean;
|
|
26
|
+
ariaControls?: string;
|
|
27
|
+
tabIndex?: number;
|
|
28
|
+
ariaLabel: string;
|
|
29
|
+
click?: () => void;
|
|
30
|
+
keydown?: (e: KeyboardEvent) => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let {
|
|
34
|
+
children,
|
|
35
|
+
css = '',
|
|
36
|
+
style = '',
|
|
37
|
+
href = '',
|
|
38
|
+
mode = undefined,
|
|
39
|
+
size = undefined,
|
|
40
|
+
type = 'button',
|
|
41
|
+
isPrimary = false,
|
|
42
|
+
isBordered = false,
|
|
43
|
+
isCapsule = false,
|
|
44
|
+
isGrouped = false,
|
|
45
|
+
isBlock = false,
|
|
46
|
+
isLink = false,
|
|
47
|
+
isBlank = false,
|
|
48
|
+
isDisabled = false,
|
|
49
|
+
role = undefined,
|
|
50
|
+
isCircle = false,
|
|
51
|
+
isRounded = false,
|
|
52
|
+
isSkinned = true,
|
|
53
|
+
ariaSelected = undefined,
|
|
54
|
+
ariaControls = undefined,
|
|
55
|
+
tabIndex = 0,
|
|
56
|
+
click = undefined,
|
|
57
|
+
keydown = undefined,
|
|
58
|
+
ariaLabel = '',
|
|
59
|
+
...restProps
|
|
60
|
+
}: Partial<Props> = $props();
|
|
61
|
+
|
|
62
|
+
let klasses = $derived(
|
|
63
|
+
cn(
|
|
64
|
+
isSkinned ? 'btn' : 'btn-base',
|
|
65
|
+
mode ? `btn-${mode}` : '',
|
|
66
|
+
size ? `btn-${size}` : '',
|
|
67
|
+
isBordered ? 'btn-bordered' : '',
|
|
68
|
+
isCapsule ? 'btn-capsule ' : '',
|
|
69
|
+
isGrouped ? 'btn-grouped' : '',
|
|
70
|
+
isBlock ? 'btn-block' : '',
|
|
71
|
+
isCircle ? 'btn-circle' : '',
|
|
72
|
+
isRounded ? 'btn-rounded' : '',
|
|
73
|
+
isDisabled ? 'disabled' : '',
|
|
74
|
+
isBlank ? 'btn-blank' : '',
|
|
75
|
+
isLink ? 'btn-link' : '',
|
|
76
|
+
css ? `${css}` : ''
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
{#if type == 'link'}
|
|
83
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
84
|
+
<a
|
|
85
|
+
class={klasses}
|
|
86
|
+
{href}
|
|
87
|
+
{style}
|
|
88
|
+
{role}
|
|
89
|
+
aria-selected={ariaSelected}
|
|
90
|
+
aria-controls={ariaControls}
|
|
91
|
+
aria-label={ariaLabel}
|
|
92
|
+
tabindex={tabIndex}
|
|
93
|
+
onclick={onclick}
|
|
94
|
+
onkeydown={onkeydown}
|
|
95
|
+
{...restProps}
|
|
96
|
+
>
|
|
97
|
+
{@render children?.()}
|
|
98
|
+
</a>
|
|
99
|
+
{:else}
|
|
100
|
+
<button
|
|
101
|
+
{type}
|
|
102
|
+
class={klasses}
|
|
103
|
+
{style}
|
|
104
|
+
{role}
|
|
105
|
+
aria-selected={ariaSelected}
|
|
106
|
+
aria-controls={ariaControls}
|
|
107
|
+
aria-label={ariaLabel}
|
|
108
|
+
tabindex={tabIndex}
|
|
109
|
+
disabled={isDisabled}
|
|
110
|
+
onclick={onclick}
|
|
111
|
+
onkeydown={onkeydown}
|
|
112
|
+
{...restProps}
|
|
113
|
+
>
|
|
114
|
+
{@render children?.()}
|
|
115
|
+
</button>
|
|
116
|
+
{/if}
|
|
117
|
+
|
|
114
118
|
<style>.btn-base {
|
|
115
119
|
display: inline-flex;
|
|
116
120
|
align-items: center;
|
|
@@ -382,4 +386,4 @@ on the side padding. As such, these have a good bit less then regular buttons. *
|
|
|
382
386
|
|
|
383
387
|
.btn-link:hover {
|
|
384
388
|
cursor: pointer;
|
|
385
|
-
}</style>
|
|
389
|
+
}</style>
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
<Button
|
|
49
49
|
type="button"
|
|
50
50
|
css="carousel__prev"
|
|
51
|
+
ariaLabel="Previous item on Carousele"
|
|
51
52
|
style="order: -1 !important;width: 50px;height: 100%;background: none;border: none !important;align-self: center;"
|
|
52
53
|
onclick={() => embla.scrollPrev()}
|
|
53
54
|
>
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
<Button
|
|
72
73
|
type="button"
|
|
73
74
|
css="carousel__next"
|
|
75
|
+
ariaLabel="Next item on Carousele"
|
|
74
76
|
style="order: 1000 !important;width: 50px;height: 100%;background: none; border: none !important;align-self: center;"
|
|
75
77
|
onclick={() => embla.scrollNext()}
|
|
76
78
|
>
|