@functionalcms/svelte-components 4.2.14 → 4.2.16
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,120 +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
|
-
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
|
-
|
|
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
|
+
|
|
118
118
|
<style>.btn-base {
|
|
119
119
|
display: inline-flex;
|
|
120
120
|
align-items: center;
|
|
@@ -386,4 +386,4 @@ on the side padding. As such, these have a good bit less then regular buttons. *
|
|
|
386
386
|
|
|
387
387
|
.btn-link:hover {
|
|
388
388
|
cursor: pointer;
|
|
389
|
-
}</style>
|
|
389
|
+
}</style>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<a href="/" class={css}>
|
|
17
|
-
<img src={logoUrl} alt={companyName} loading="lazy"
|
|
17
|
+
<img src={logoUrl} alt={companyName} loading="lazy" />
|
|
18
18
|
</a>
|
|
19
19
|
|
|
20
20
|
<style>
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
a img {
|
|
27
27
|
width: 100%;
|
|
28
|
+
width: var(--logo-width, 200px);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
@media (min-width: 960px) {
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { default as Disclose } from './components/presentation/Disclose.svelte';
|
|
|
18
18
|
export { default as ListMenu } from './components/menu/ListMenu.svelte';
|
|
19
19
|
export { default as DynamicMenu } from './components/menu/DynamicMenu.svelte';
|
|
20
20
|
export { default as HamburgerMenu } from './components/menu/HamburgerMenu.svelte';
|
|
21
|
+
export { isAuthenticated } from './components/menu/types.js';
|
|
21
22
|
export { default as Button } from './components/form/Button.svelte';
|
|
22
23
|
export { default as Input } from './components/form/Input.svelte';
|
|
23
24
|
export { default as Switch } from './components/form/Switch.svelte';
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ export { default as Disclose } from './components/presentation/Disclose.svelte';
|
|
|
32
32
|
export { default as ListMenu } from './components/menu/ListMenu.svelte';
|
|
33
33
|
export { default as DynamicMenu } from './components/menu/DynamicMenu.svelte';
|
|
34
34
|
export { default as HamburgerMenu } from './components/menu/HamburgerMenu.svelte';
|
|
35
|
+
export { isAuthenticated } from './components/menu/types.js';
|
|
35
36
|
/*
|
|
36
37
|
* Form
|
|
37
38
|
*/
|