@immich/ui 0.4.0 → 0.5.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/components/CloseButton/CloseButton.svelte +9 -0
- package/dist/components/CloseButton/CloseButton.svelte.d.ts +3 -0
- 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/SupporterBadge/SupporterBadge.svelte +94 -0
- package/dist/components/SupporterBadge/SupporterBadge.svelte.d.ts +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/types.d.ts +5 -3
- package/package.json +1 -1
|
@@ -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} />
|
|
@@ -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;
|
|
@@ -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;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,12 +6,15 @@ 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';
|
|
10
11
|
export { default as Input } from './components/Form/Input.svelte';
|
|
11
12
|
export { default as Label } from './components/Form/Label.svelte';
|
|
12
13
|
export { default as Heading } from './components/Heading/Heading.svelte';
|
|
13
14
|
export { default as Icon } from './components/Icon/Icon.svelte';
|
|
14
15
|
export { default as IconButton } from './components/IconButton/IconButton.svelte';
|
|
16
|
+
export { default as Link } from './components/Link/Link.svelte';
|
|
17
|
+
export { default as SupporterBadge } from './components/SupporterBadge/SupporterBadge.svelte';
|
|
15
18
|
export { default as Logo } from './components/Logo/Logo.svelte';
|
|
16
19
|
export { default as HStack } from './components/Stack/HStack.svelte';
|
|
17
20
|
export { default as Stack } from './components/Stack/Stack.svelte';
|
package/dist/index.js
CHANGED
|
@@ -6,12 +6,15 @@ 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';
|
|
10
11
|
export { default as Input } from './components/Form/Input.svelte';
|
|
11
12
|
export { default as Label } from './components/Form/Label.svelte';
|
|
12
13
|
export { default as Heading } from './components/Heading/Heading.svelte';
|
|
13
14
|
export { default as Icon } from './components/Icon/Icon.svelte';
|
|
14
15
|
export { default as IconButton } from './components/IconButton/IconButton.svelte';
|
|
16
|
+
export { default as Link } from './components/Link/Link.svelte';
|
|
17
|
+
export { default as SupporterBadge } from './components/SupporterBadge/SupporterBadge.svelte';
|
|
15
18
|
export { default as Logo } from './components/Logo/Logo.svelte';
|
|
16
19
|
export { default as HStack } from './components/Stack/HStack.svelte';
|
|
17
20
|
export { default as Stack } from './components/Stack/Stack.svelte';
|
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;
|