@immich/ui 0.4.0 → 0.6.0
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/common/context.svelte.d.ts +4 -0
- package/dist/common/context.svelte.js +6 -0
- package/dist/common/use-child.svelte.d.ts +5 -0
- package/dist/common/{use-context.svelte.js → use-child.svelte.js} +1 -1
- package/dist/components/Card/Card.svelte +6 -6
- package/dist/components/Card/CardBody.svelte +3 -3
- package/dist/components/Card/CardFooter.svelte +2 -2
- package/dist/components/Card/CardHeader.svelte +2 -2
- package/dist/components/CloseButton/CloseButton.svelte +9 -0
- package/dist/components/CloseButton/CloseButton.svelte.d.ts +3 -0
- package/dist/components/Form/Field.svelte +29 -0
- package/dist/components/Form/Field.svelte.d.ts +6 -0
- package/dist/components/Form/HelperText.svelte +24 -0
- package/dist/components/Form/HelperText.svelte.d.ts +8 -0
- package/dist/components/Form/Input.svelte +101 -14
- package/dist/components/Form/Input.svelte.d.ts +8 -2
- package/dist/components/Heading/Heading.svelte +8 -7
- package/dist/components/Link/Link.svelte +17 -0
- package/dist/components/Link/Link.svelte.d.ts +8 -0
- package/dist/components/Stack/HStack.svelte +1 -1
- package/dist/components/Stack/HStack.svelte.d.ts +2 -1
- package/dist/components/Stack/Stack.svelte +0 -10
- package/dist/components/Stack/VStack.svelte +1 -1
- package/dist/components/Stack/VStack.svelte.d.ts +2 -1
- package/dist/components/SupporterBadge/SupporterBadge.svelte +94 -0
- package/dist/components/SupporterBadge/SupporterBadge.svelte.d.ts +9 -0
- package/dist/components/Text/Text.svelte +1 -1
- package/dist/components/Text/Text.svelte.d.ts +1 -1
- package/dist/constants.d.ts +3 -1
- package/dist/constants.js +9 -7
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/internal/Child.svelte +4 -4
- package/dist/internal/Child.svelte.d.ts +3 -3
- package/dist/types.d.ts +15 -4
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +2 -0
- package/package.json +1 -1
- package/dist/common/use-context.svelte.d.ts +0 -5
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { withPrefix } from '../utils.js';
|
|
2
|
+
import { getContext, hasContext, setContext } from 'svelte';
|
|
3
|
+
const fieldKey = Symbol(withPrefix('field'));
|
|
4
|
+
export const setFieldContext = (field) => setContext(fieldKey, field);
|
|
5
|
+
export const hasFieldContext = () => hasContext(fieldKey);
|
|
6
|
+
export const getFieldContext = () => (getContext(fieldKey) || {});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { withChildrenSnippets } from '../../common/use-
|
|
2
|
+
import { withChildrenSnippets } from '../../common/use-child.svelte.js';
|
|
3
3
|
import IconButton from '../IconButton/IconButton.svelte';
|
|
4
|
-
import {
|
|
4
|
+
import { ChildKey } from '../../constants.js';
|
|
5
5
|
import type { Color, Shape } from '../../types.js';
|
|
6
6
|
import { cleanClass } from '../../utils.js';
|
|
7
7
|
import { mdiChevronDown } from '@mdi/js';
|
|
@@ -104,10 +104,10 @@
|
|
|
104
104
|
expanded = !expanded;
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
const { getChildren: getChildSnippet } = withChildrenSnippets(
|
|
108
|
-
const headerChildren = $derived(getChildSnippet(
|
|
109
|
-
const bodyChildren = $derived(getChildSnippet(
|
|
110
|
-
const footerChildren = $derived(getChildSnippet(
|
|
107
|
+
const { getChildren: getChildSnippet } = withChildrenSnippets(ChildKey.Card);
|
|
108
|
+
const headerChildren = $derived(getChildSnippet(ChildKey.CardHeader));
|
|
109
|
+
const bodyChildren = $derived(getChildSnippet(ChildKey.CardBody));
|
|
110
|
+
const footerChildren = $derived(getChildSnippet(ChildKey.CardFooter));
|
|
111
111
|
|
|
112
112
|
const headerClasses = 'flex flex-col space-y-1.5';
|
|
113
113
|
const headerContainerClasses = $derived(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { ChildKey } from '../../constants.js';
|
|
3
3
|
import Child from '../../internal/Child.svelte';
|
|
4
4
|
import { cleanClass } from '../../utils.js';
|
|
5
5
|
import type { Snippet } from 'svelte';
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
let { class: className, children }: Props = $props();
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
|
-
<Child for={
|
|
17
|
-
<div class={twMerge(cleanClass('p-4', className))}>
|
|
16
|
+
<Child for={ChildKey.Card} as={ChildKey.CardBody}>
|
|
17
|
+
<div class={twMerge(cleanClass('w-full p-4', className))}>
|
|
18
18
|
{@render children?.()}
|
|
19
19
|
</div>
|
|
20
20
|
</Child>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { ChildKey } from '../../constants.js';
|
|
3
3
|
import Child from '../../internal/Child.svelte';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
let { children }: Props = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
|
-
<Child for={
|
|
13
|
+
<Child for={ChildKey.Card} as={ChildKey.CardFooter}>
|
|
14
14
|
{@render children?.()}
|
|
15
15
|
</Child>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { ChildKey } from '../../constants.js';
|
|
3
3
|
import Child from '../../internal/Child.svelte';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
let { children }: Props = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
|
-
<Child for={
|
|
13
|
+
<Child for={ChildKey.Card} as={ChildKey.CardHeader}>
|
|
14
14
|
{@render children?.()}
|
|
15
15
|
</Child>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import IconButton from '../IconButton/IconButton.svelte';
|
|
3
|
+
import type { CloseButtonProps } from '../../types.js';
|
|
4
|
+
import { mdiClose } from '@mdi/js';
|
|
5
|
+
|
|
6
|
+
const { size = 'medium', variant = 'ghost' }: CloseButtonProps = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<IconButton icon={mdiClose} color="secondary" shape="round" {variant} {size} />
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { setFieldContext } from '../../common/context.svelte.js';
|
|
3
|
+
import { withChildrenSnippets } from '../../common/use-child.svelte.js';
|
|
4
|
+
import { ChildKey } from '../../constants.js';
|
|
5
|
+
import type { FieldContext } from '../../types.js';
|
|
6
|
+
import { type Snippet } from 'svelte';
|
|
7
|
+
|
|
8
|
+
type Props = FieldContext & {
|
|
9
|
+
children: Snippet;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const { children, ...props }: Props = $props();
|
|
13
|
+
|
|
14
|
+
const state = $state(props);
|
|
15
|
+
|
|
16
|
+
setFieldContext(state);
|
|
17
|
+
|
|
18
|
+
const { getChildren: getChildSnippet } = withChildrenSnippets(ChildKey.Field);
|
|
19
|
+
const helperTextChildren = $derived(getChildSnippet(ChildKey.HelperText));
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<div>
|
|
23
|
+
{@render children()}
|
|
24
|
+
{#if helperTextChildren}
|
|
25
|
+
<div class="pt-1">
|
|
26
|
+
{@render helperTextChildren?.()}
|
|
27
|
+
</div>
|
|
28
|
+
{/if}
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Text from '../Text/Text.svelte';
|
|
3
|
+
import { ChildKey } from '../../constants.js';
|
|
4
|
+
import Child from '../../internal/Child.svelte';
|
|
5
|
+
import type { Color } from '../../types.js';
|
|
6
|
+
import { cleanClass } from '../../utils.js';
|
|
7
|
+
import type { Snippet } from 'svelte';
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
color?: Color;
|
|
11
|
+
class?: string;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
let { class: className, children, color }: Props = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<Child for={ChildKey.Field} as={ChildKey.HelperText}>
|
|
19
|
+
<div class={cleanClass(className)}>
|
|
20
|
+
<Text {color} size="small">
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</Text>
|
|
23
|
+
</div>
|
|
24
|
+
</Child>
|
|
@@ -1,22 +1,109 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { getFieldContext } from '../../common/context.svelte.js';
|
|
3
|
+
import type { Shape, Size } from '../../types.js';
|
|
4
|
+
import { cleanClass, generateId } from '../../utils.js';
|
|
2
5
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
-
import
|
|
4
|
-
|
|
6
|
+
import { tv } from 'tailwind-variants';
|
|
7
|
+
|
|
8
|
+
type Props = {
|
|
9
|
+
class?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
size?: Size;
|
|
12
|
+
shape?: Shape;
|
|
13
|
+
inputSize?: HTMLInputAttributes['size'];
|
|
14
|
+
} & Omit<HTMLInputAttributes, 'size'>;
|
|
5
15
|
|
|
6
16
|
let {
|
|
7
|
-
|
|
8
|
-
|
|
17
|
+
shape = 'semi-round',
|
|
18
|
+
size = 'medium',
|
|
9
19
|
class: className,
|
|
20
|
+
value = $bindable<string>(),
|
|
10
21
|
...restProps
|
|
11
|
-
}:
|
|
22
|
+
}: Props = $props();
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
label,
|
|
26
|
+
readOnly = false,
|
|
27
|
+
required = false,
|
|
28
|
+
invalid = false,
|
|
29
|
+
disabled = false,
|
|
30
|
+
} = $derived(getFieldContext());
|
|
31
|
+
|
|
32
|
+
const labelStyles = tv({
|
|
33
|
+
base: '',
|
|
34
|
+
variants: {
|
|
35
|
+
size: {
|
|
36
|
+
tiny: 'text-xs',
|
|
37
|
+
small: 'text-sm',
|
|
38
|
+
medium: 'text-md',
|
|
39
|
+
large: 'text-lg',
|
|
40
|
+
giant: 'text-xl',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const inputStyles = tv({
|
|
46
|
+
base: 'outline-none disabled:cursor-not-allowed bg-gray-200 dark:bg-gray-600 disabled:bg-gray-300 disabled:text-gray-200 dark:disabled:bg-gray-800 aria-readonly:text-dark/50 dark:aria-readonly:text-dark/75',
|
|
47
|
+
variants: {
|
|
48
|
+
shape: {
|
|
49
|
+
rectangle: 'rounded-none',
|
|
50
|
+
'semi-round': '',
|
|
51
|
+
round: 'rounded-full',
|
|
52
|
+
},
|
|
53
|
+
padding: {
|
|
54
|
+
base: 'px-3 py-2',
|
|
55
|
+
round: 'px-4 py-2',
|
|
56
|
+
},
|
|
57
|
+
roundedSize: {
|
|
58
|
+
tiny: 'rounded-xl',
|
|
59
|
+
small: 'rounded-xl',
|
|
60
|
+
medium: 'rounded-2xl',
|
|
61
|
+
large: 'rounded-2xl',
|
|
62
|
+
giant: 'rounded-2xl',
|
|
63
|
+
},
|
|
64
|
+
textSize: {
|
|
65
|
+
tiny: 'text-xs',
|
|
66
|
+
small: 'text-sm',
|
|
67
|
+
medium: 'text-md',
|
|
68
|
+
large: 'text-lg',
|
|
69
|
+
giant: 'text-xl',
|
|
70
|
+
},
|
|
71
|
+
invalid: {
|
|
72
|
+
true: 'border border-danger/80',
|
|
73
|
+
false: '',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const id = generateId();
|
|
79
|
+
const inputId = `input-${id}`;
|
|
80
|
+
const labelId = `label-${id}`;
|
|
12
81
|
</script>
|
|
13
82
|
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
83
|
+
<div class="flex flex-col gap-1">
|
|
84
|
+
{#if label}
|
|
85
|
+
<label id={labelId} for={inputId} class={labelStyles({ size })}>{label}</label>
|
|
86
|
+
{/if}
|
|
87
|
+
<input
|
|
88
|
+
id={label && inputId}
|
|
89
|
+
aria-labelledby={label && labelId}
|
|
90
|
+
{required}
|
|
91
|
+
aria-required={required}
|
|
92
|
+
{disabled}
|
|
93
|
+
aria-disabled={disabled}
|
|
94
|
+
readonly={readOnly}
|
|
95
|
+
aria-readonly={readOnly}
|
|
96
|
+
class={cleanClass(
|
|
97
|
+
inputStyles({
|
|
98
|
+
shape,
|
|
99
|
+
textSize: size,
|
|
100
|
+
padding: shape === 'round' ? 'round' : 'base',
|
|
101
|
+
roundedSize: shape === 'semi-round' ? size : undefined,
|
|
102
|
+
invalid,
|
|
103
|
+
}),
|
|
104
|
+
className,
|
|
105
|
+
)}
|
|
106
|
+
bind:value
|
|
107
|
+
{...restProps}
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import type { Shape, Size } from '../../types.js';
|
|
1
2
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
declare const Input: import("svelte").Component<{
|
|
4
|
+
class?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
size?: Size;
|
|
7
|
+
shape?: Shape;
|
|
8
|
+
inputSize?: HTMLInputAttributes["size"];
|
|
9
|
+
} & Omit<HTMLInputAttributes, "size">, {}, "value">;
|
|
4
10
|
export default Input;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
size: HeadingSize;
|
|
9
9
|
color?: Color;
|
|
10
10
|
class?: string;
|
|
11
|
+
|
|
11
12
|
children: Snippet;
|
|
12
13
|
};
|
|
13
14
|
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
const styles = tv({
|
|
26
|
-
base: 'leading-none tracking-tight',
|
|
27
|
+
base: 'font-bold leading-none tracking-tight',
|
|
27
28
|
variants: {
|
|
28
29
|
color: {
|
|
29
30
|
primary: 'text-primary',
|
|
@@ -34,12 +35,12 @@
|
|
|
34
35
|
info: 'text-info',
|
|
35
36
|
},
|
|
36
37
|
size: {
|
|
37
|
-
tiny: 'text-lg
|
|
38
|
-
small: 'text-xl
|
|
39
|
-
medium: 'text-2xl
|
|
40
|
-
large: 'text-3xl
|
|
41
|
-
giant: 'text-4xl
|
|
42
|
-
title: 'text-5xl
|
|
38
|
+
tiny: 'text-lg',
|
|
39
|
+
small: 'text-xl',
|
|
40
|
+
medium: 'text-2xl',
|
|
41
|
+
large: 'text-3xl',
|
|
42
|
+
giant: 'text-4xl',
|
|
43
|
+
title: 'text-5xl',
|
|
43
44
|
},
|
|
44
45
|
},
|
|
45
46
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cleanClass } from '../../utils.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
class?: string;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
href: string;
|
|
10
|
+
} & HTMLAnchorAttributes;
|
|
11
|
+
|
|
12
|
+
const { href, class: className, children, ...restProps }: Props = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<a {href} class={cleanClass('underline', className)} {...restProps}>
|
|
16
|
+
{@render children()}
|
|
17
|
+
</a>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
3
|
+
declare const Link: import("svelte").Component<{
|
|
4
|
+
class?: string;
|
|
5
|
+
children: Snippet;
|
|
6
|
+
href: string;
|
|
7
|
+
} & HTMLAnchorAttributes, {}, "">;
|
|
8
|
+
export default Link;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
declare const HStack: import("svelte").Component<{
|
|
2
2
|
class?: string;
|
|
3
3
|
children: import("svelte").Snippet;
|
|
4
|
-
align?: "start" | "center" | "end";
|
|
5
4
|
gap?: import("../../types.js").Gap;
|
|
6
5
|
wrap?: boolean;
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
fullHeight?: boolean;
|
|
7
8
|
}, {}, "">;
|
|
8
9
|
export default HStack;
|
|
@@ -24,14 +24,6 @@
|
|
|
24
24
|
center: 'items-center',
|
|
25
25
|
end: 'items-end',
|
|
26
26
|
},
|
|
27
|
-
fullWidth: {
|
|
28
|
-
true: 'w-full',
|
|
29
|
-
false: '',
|
|
30
|
-
},
|
|
31
|
-
fullHeight: {
|
|
32
|
-
true: 'h-full',
|
|
33
|
-
false: '',
|
|
34
|
-
},
|
|
35
27
|
gap: {
|
|
36
28
|
0: 'gap-0',
|
|
37
29
|
1: 'gap-1',
|
|
@@ -58,8 +50,6 @@
|
|
|
58
50
|
direction,
|
|
59
51
|
gap,
|
|
60
52
|
wrap,
|
|
61
|
-
fullWidth: direction === 'row',
|
|
62
|
-
fullHeight: direction === 'column',
|
|
63
53
|
}),
|
|
64
54
|
className,
|
|
65
55
|
)}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
declare const VStack: import("svelte").Component<{
|
|
2
2
|
class?: string;
|
|
3
3
|
children: import("svelte").Snippet;
|
|
4
|
-
align?: "start" | "center" | "end";
|
|
5
4
|
gap?: import("../../types.js").Gap;
|
|
6
5
|
wrap?: boolean;
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
fullHeight?: boolean;
|
|
7
8
|
}, {}, "">;
|
|
8
9
|
export default VStack;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Logo from '../Logo/Logo.svelte';
|
|
3
|
+
import Text from '../Text/Text.svelte';
|
|
4
|
+
import type { Size } from '../../types.js';
|
|
5
|
+
import { cleanClass } from '../../utils.js';
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
import { tv } from 'tailwind-variants';
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
effect?: 'hover' | 'always';
|
|
11
|
+
text?: string;
|
|
12
|
+
size?: Size;
|
|
13
|
+
children?: Snippet;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const { effect = 'hover', text = 'Supporter', size = 'medium', children }: Props = $props();
|
|
17
|
+
|
|
18
|
+
const iconSize: Record<Size, Size> = {
|
|
19
|
+
tiny: 'tiny',
|
|
20
|
+
small: 'tiny',
|
|
21
|
+
medium: 'small',
|
|
22
|
+
large: 'medium',
|
|
23
|
+
giant: 'medium',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const containerStyles = tv({
|
|
27
|
+
base: 'bg-secondary flex place-items-center gap-2 overflow-hidden rounded-lg transition-all',
|
|
28
|
+
variants: {
|
|
29
|
+
size: {
|
|
30
|
+
tiny: 'px-2 py-1',
|
|
31
|
+
small: 'px-2 py-1',
|
|
32
|
+
medium: 'px-3 py-2',
|
|
33
|
+
large: 'px-3 py-2',
|
|
34
|
+
giant: 'px-3 py-2',
|
|
35
|
+
},
|
|
36
|
+
effect: {
|
|
37
|
+
hover: 'border border-dark/25 supporter-effect-hover',
|
|
38
|
+
always: 'shadow supporter-effect',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<div class={cleanClass(containerStyles({ effect, size }))}>
|
|
45
|
+
{#if children}
|
|
46
|
+
{@render children()}
|
|
47
|
+
{:else}
|
|
48
|
+
<Logo size={iconSize[size]} variant="icon" />
|
|
49
|
+
<Text fontWeight="normal" color="secondary" {size}>{text}</Text>
|
|
50
|
+
{/if}
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
.supporter-effect,
|
|
55
|
+
.supporter-effect-hover:hover {
|
|
56
|
+
position: relative;
|
|
57
|
+
background-clip: padding-box;
|
|
58
|
+
animation: gradient 10s ease infinite;
|
|
59
|
+
z-index: 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.supporter-effect:after,
|
|
63
|
+
.supporter-effect-hover:hover:after {
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: 0px;
|
|
66
|
+
bottom: 0px;
|
|
67
|
+
left: 0px;
|
|
68
|
+
right: 0px;
|
|
69
|
+
background: linear-gradient(
|
|
70
|
+
to right,
|
|
71
|
+
rgba(16, 132, 254, 0.15),
|
|
72
|
+
rgba(229, 125, 175, 0.15),
|
|
73
|
+
rgba(254, 36, 29, 0.15),
|
|
74
|
+
rgba(255, 183, 0, 0.15),
|
|
75
|
+
rgba(22, 193, 68, 0.15)
|
|
76
|
+
);
|
|
77
|
+
content: '';
|
|
78
|
+
animation: gradient 10s ease infinite;
|
|
79
|
+
background-size: 400% 400%;
|
|
80
|
+
z-index: -1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@keyframes gradient {
|
|
84
|
+
0% {
|
|
85
|
+
background-position: 0% 50%;
|
|
86
|
+
}
|
|
87
|
+
50% {
|
|
88
|
+
background-position: 100% 50%;
|
|
89
|
+
}
|
|
90
|
+
100% {
|
|
91
|
+
background-position: 0% 50%;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Size } from '../../types.js';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
declare const SupporterBadge: import("svelte").Component<{
|
|
4
|
+
effect?: "hover" | "always";
|
|
5
|
+
text?: string;
|
|
6
|
+
size?: Size;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
}, {}, "">;
|
|
9
|
+
export default SupporterBadge;
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
8
8
|
color?: Color;
|
|
9
|
+
class?: string;
|
|
9
10
|
size?: Size;
|
|
10
11
|
children: Snippet;
|
|
11
12
|
variant?: 'italic';
|
|
12
13
|
fontWeight?: 'light' | 'normal' | 'semi-bold' | 'bold';
|
|
13
|
-
class?: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const { color, size, fontWeight = 'normal', children, class: className }: Props = $props();
|
|
@@ -2,10 +2,10 @@ import type { Color, Size } from '../../types.js';
|
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
declare const Text: import("svelte").Component<{
|
|
4
4
|
color?: Color;
|
|
5
|
+
class?: string;
|
|
5
6
|
size?: Size;
|
|
6
7
|
children: Snippet;
|
|
7
8
|
variant?: "italic";
|
|
8
9
|
fontWeight?: "light" | "normal" | "semi-bold" | "bold";
|
|
9
|
-
class?: string;
|
|
10
10
|
}, {}, "">;
|
|
11
11
|
export default Text;
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export var ChildKey;
|
|
2
|
+
(function (ChildKey) {
|
|
3
|
+
ChildKey["Field"] = "field";
|
|
4
|
+
ChildKey["HelperText"] = "helped-text";
|
|
5
|
+
ChildKey["Card"] = "card";
|
|
6
|
+
ChildKey["CardHeader"] = "card-header";
|
|
7
|
+
ChildKey["CardBody"] = "card-body";
|
|
8
|
+
ChildKey["CardFooter"] = "card-footer";
|
|
9
|
+
})(ChildKey || (ChildKey = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -6,15 +6,20 @@ export { default as CardDescription } from './components/Card/CardDescription.sv
|
|
|
6
6
|
export { default as CardFooter } from './components/Card/CardFooter.svelte';
|
|
7
7
|
export { default as CardHeader } from './components/Card/CardHeader.svelte';
|
|
8
8
|
export { default as CardTitle } from './components/Card/CardTitle.svelte';
|
|
9
|
+
export { default as CloseButton } from './components/CloseButton/CloseButton.svelte';
|
|
9
10
|
export { default as Checkbox } from './components/Form/Checkbox.svelte';
|
|
11
|
+
export { default as Field } from './components/Form/Field.svelte';
|
|
12
|
+
export { default as HelperText } from './components/Form/HelperText.svelte';
|
|
10
13
|
export { default as Input } from './components/Form/Input.svelte';
|
|
11
14
|
export { default as Label } from './components/Form/Label.svelte';
|
|
12
15
|
export { default as Heading } from './components/Heading/Heading.svelte';
|
|
13
16
|
export { default as Icon } from './components/Icon/Icon.svelte';
|
|
14
17
|
export { default as IconButton } from './components/IconButton/IconButton.svelte';
|
|
18
|
+
export { default as Link } from './components/Link/Link.svelte';
|
|
15
19
|
export { default as Logo } from './components/Logo/Logo.svelte';
|
|
16
20
|
export { default as HStack } from './components/Stack/HStack.svelte';
|
|
17
21
|
export { default as Stack } from './components/Stack/Stack.svelte';
|
|
18
22
|
export { default as VStack } from './components/Stack/VStack.svelte';
|
|
23
|
+
export { default as SupporterBadge } from './components/SupporterBadge/SupporterBadge.svelte';
|
|
19
24
|
export { default as Text } from './components/Text/Text.svelte';
|
|
20
25
|
export * from './types.js';
|
package/dist/index.js
CHANGED
|
@@ -6,15 +6,20 @@ export { default as CardDescription } from './components/Card/CardDescription.sv
|
|
|
6
6
|
export { default as CardFooter } from './components/Card/CardFooter.svelte';
|
|
7
7
|
export { default as CardHeader } from './components/Card/CardHeader.svelte';
|
|
8
8
|
export { default as CardTitle } from './components/Card/CardTitle.svelte';
|
|
9
|
+
export { default as CloseButton } from './components/CloseButton/CloseButton.svelte';
|
|
9
10
|
export { default as Checkbox } from './components/Form/Checkbox.svelte';
|
|
11
|
+
export { default as Field } from './components/Form/Field.svelte';
|
|
12
|
+
export { default as HelperText } from './components/Form/HelperText.svelte';
|
|
10
13
|
export { default as Input } from './components/Form/Input.svelte';
|
|
11
14
|
export { default as Label } from './components/Form/Label.svelte';
|
|
12
15
|
export { default as Heading } from './components/Heading/Heading.svelte';
|
|
13
16
|
export { default as Icon } from './components/Icon/Icon.svelte';
|
|
14
17
|
export { default as IconButton } from './components/IconButton/IconButton.svelte';
|
|
18
|
+
export { default as Link } from './components/Link/Link.svelte';
|
|
15
19
|
export { default as Logo } from './components/Logo/Logo.svelte';
|
|
16
20
|
export { default as HStack } from './components/Stack/HStack.svelte';
|
|
17
21
|
export { default as Stack } from './components/Stack/Stack.svelte';
|
|
18
22
|
export { default as VStack } from './components/Stack/VStack.svelte';
|
|
23
|
+
export { default as SupporterBadge } from './components/SupporterBadge/SupporterBadge.svelte';
|
|
19
24
|
export { default as Text } from './components/Text/Text.svelte';
|
|
20
25
|
export * from './types.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { ChildKey } from '../constants.js';
|
|
3
3
|
import { withPrefix } from '../utils.js';
|
|
4
4
|
import { getContext, type Snippet } from 'svelte';
|
|
5
5
|
|
|
6
|
-
type ContextType = { register: (key:
|
|
6
|
+
type ContextType = { register: (key: ChildKey, snippet: Snippet) => void };
|
|
7
7
|
type Props = {
|
|
8
|
-
for:
|
|
9
|
-
as:
|
|
8
|
+
for: ChildKey;
|
|
9
|
+
as: ChildKey;
|
|
10
10
|
children: Snippet;
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChildKey } from '../constants.js';
|
|
2
2
|
import { type Snippet } from 'svelte';
|
|
3
3
|
declare const Child: import("svelte").Component<{
|
|
4
|
-
for:
|
|
5
|
-
as:
|
|
4
|
+
for: ChildKey;
|
|
5
|
+
as: ChildKey;
|
|
6
6
|
children: Snippet;
|
|
7
7
|
}, {}, "">;
|
|
8
8
|
export default Child;
|
package/dist/types.d.ts
CHANGED
|
@@ -11,12 +11,14 @@ type ButtonOrAnchor = ({
|
|
|
11
11
|
} & HTMLButtonAttributes) | ({
|
|
12
12
|
href: string;
|
|
13
13
|
} & HTMLAnchorAttributes);
|
|
14
|
-
type
|
|
14
|
+
export type CloseButtonProps = {
|
|
15
|
+
size?: Size;
|
|
16
|
+
variant?: Variants;
|
|
17
|
+
};
|
|
18
|
+
type ButtonBaseProps = CloseButtonProps & {
|
|
15
19
|
class?: string;
|
|
16
20
|
color?: Color;
|
|
17
|
-
size?: Size;
|
|
18
21
|
shape?: Shape;
|
|
19
|
-
variant?: Variants;
|
|
20
22
|
} & ButtonOrAnchor;
|
|
21
23
|
export type IconProps = {
|
|
22
24
|
icon: string;
|
|
@@ -39,13 +41,22 @@ export type ButtonProps = ButtonBaseProps & {
|
|
|
39
41
|
type StackBaseProps = {
|
|
40
42
|
class?: string;
|
|
41
43
|
children: Snippet;
|
|
42
|
-
align?: 'start' | 'center' | 'end';
|
|
43
44
|
gap?: Gap;
|
|
44
45
|
wrap?: boolean;
|
|
46
|
+
fullWidth?: boolean;
|
|
47
|
+
fullHeight?: boolean;
|
|
45
48
|
};
|
|
46
49
|
export type StackProps = StackBaseProps & {
|
|
50
|
+
align?: 'start' | 'center' | 'end';
|
|
47
51
|
direction?: 'row' | 'column';
|
|
48
52
|
};
|
|
49
53
|
export type HStackProps = StackBaseProps;
|
|
50
54
|
export type VStackProps = StackBaseProps;
|
|
55
|
+
export type FieldContext = {
|
|
56
|
+
label?: string;
|
|
57
|
+
invalid?: boolean;
|
|
58
|
+
disabled?: boolean;
|
|
59
|
+
required?: boolean;
|
|
60
|
+
readOnly?: boolean;
|
|
61
|
+
};
|
|
51
62
|
export {};
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ContextKey } from './constants.js';
|
|
2
1
|
export declare const cleanClass: (...classNames: unknown[]) => string;
|
|
3
|
-
export declare const withPrefix: (key:
|
|
2
|
+
export declare const withPrefix: (key: string) => string;
|
|
3
|
+
export declare const generateId: () => string;
|
package/dist/utils.js
CHANGED
package/package.json
CHANGED