@immich/ui 0.11.0 → 0.12.1
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/Card/Card.svelte +1 -1
- package/dist/components/Code/Code.svelte +24 -10
- package/dist/components/Code/Code.svelte.d.ts +3 -1
- package/dist/components/Form/Field.svelte +1 -1
- package/dist/components/Form/Input.svelte +4 -4
- package/dist/components/Heading/Heading.svelte +4 -3
- package/dist/components/Heading/Heading.svelte.d.ts +2 -1
- package/dist/components/IconButton/IconButton.svelte +1 -1
- package/dist/components/ThemeSwitcher/ThemeSwitcher.svelte +10 -3
- package/dist/components/ThemeSwitcher/ThemeSwitcher.svelte.d.ts +2 -1
- package/dist/internal/Button.svelte +5 -5
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
variants: {
|
|
49
49
|
color: {
|
|
50
50
|
primary: 'bg-primary/25 dark:bg-primary/25',
|
|
51
|
-
secondary: 'bg-
|
|
51
|
+
secondary: 'bg-gray-50 text-dark dark:bg-neutral-900 dark:text-white',
|
|
52
52
|
success: 'bg-success/15 dark:bg-success/30',
|
|
53
53
|
danger: 'bg-danger/15 dark:bg-danger/50',
|
|
54
54
|
warning: 'bg-warning/25 dark:bg-warning/50',
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Size, TextColor } from '../../types.js';
|
|
3
|
+
import { cleanClass } from '../../utils.js';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
5
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
6
|
import { tv } from 'tailwind-variants';
|
|
5
7
|
|
|
6
8
|
type Props = {
|
|
7
9
|
color?: TextColor;
|
|
8
10
|
size?: Size;
|
|
9
11
|
variant?: 'filled';
|
|
12
|
+
class?: string;
|
|
10
13
|
children: Snippet;
|
|
11
|
-
}
|
|
14
|
+
} & HTMLAttributes<HTMLElement>;
|
|
12
15
|
|
|
13
|
-
const {
|
|
16
|
+
const {
|
|
17
|
+
class: className,
|
|
18
|
+
size = 'medium',
|
|
19
|
+
variant,
|
|
20
|
+
color = 'secondary',
|
|
21
|
+
children,
|
|
22
|
+
...restProps
|
|
23
|
+
}: Props = $props();
|
|
14
24
|
|
|
15
25
|
const styles = tv({
|
|
16
26
|
base: 'font-monospace',
|
|
@@ -33,8 +43,8 @@
|
|
|
33
43
|
filledColor: {
|
|
34
44
|
false: '',
|
|
35
45
|
muted: 'bg-gray-600 text-light dark:bg-gray-800',
|
|
36
|
-
primary: 'bg-
|
|
37
|
-
secondary: 'bg-
|
|
46
|
+
primary: 'bg-gray-200 text-primary dark:bg-gray-700',
|
|
47
|
+
secondary: 'bg-gray-700 text-light dark:bg-gray-200',
|
|
38
48
|
success: 'bg-success text-light',
|
|
39
49
|
danger: 'bg-danger text-light',
|
|
40
50
|
warning: 'bg-warning text-light',
|
|
@@ -53,10 +63,14 @@
|
|
|
53
63
|
</script>
|
|
54
64
|
|
|
55
65
|
<code
|
|
56
|
-
class={
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
class={cleanClass(
|
|
67
|
+
styles({
|
|
68
|
+
filled: variant === 'filled',
|
|
69
|
+
filledColor: variant === 'filled' && color,
|
|
70
|
+
textColor: color,
|
|
71
|
+
size,
|
|
72
|
+
}),
|
|
73
|
+
className,
|
|
74
|
+
)}
|
|
75
|
+
{...restProps}>{@render children()}</code
|
|
62
76
|
>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Size, TextColor } from '../../types.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
4
|
declare const Code: import("svelte").Component<{
|
|
4
5
|
color?: TextColor;
|
|
5
6
|
size?: Size;
|
|
6
7
|
variant?: "filled";
|
|
8
|
+
class?: string;
|
|
7
9
|
children: Snippet;
|
|
8
|
-
}
|
|
10
|
+
} & HTMLAttributes<HTMLElement>, {}, "">;
|
|
9
11
|
export default Code;
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
round: 'rounded-full',
|
|
45
45
|
},
|
|
46
46
|
padding: {
|
|
47
|
-
base: 'px-
|
|
48
|
-
round: 'px-
|
|
47
|
+
base: 'px-4 py-3',
|
|
48
|
+
round: 'px-5 py-3',
|
|
49
49
|
},
|
|
50
50
|
roundedSize: {
|
|
51
51
|
tiny: 'rounded-xl',
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
const labelId = `label-${id}`;
|
|
74
74
|
</script>
|
|
75
75
|
|
|
76
|
-
<div class="flex flex-col gap-1" bind:this={containerRef}>
|
|
76
|
+
<div class="flex w-full flex-col gap-1" bind:this={containerRef}>
|
|
77
77
|
{#if label}
|
|
78
78
|
<label id={labelId} for={inputId} class={labelStyles({ size })}>{label}</label>
|
|
79
79
|
{/if}
|
|
80
80
|
|
|
81
|
-
<div class="relative">
|
|
81
|
+
<div class="relative mt-1.5 w-full">
|
|
82
82
|
<input
|
|
83
83
|
id={label && inputId}
|
|
84
84
|
aria-labelledby={label && labelId}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { HeadingColor, HeadingSize } from '../../types.js';
|
|
3
3
|
import { cleanClass } from '../../utils.js';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
6
|
import { tv } from 'tailwind-variants';
|
|
6
7
|
|
|
7
8
|
type Props = {
|
|
@@ -10,9 +11,9 @@
|
|
|
10
11
|
class?: string;
|
|
11
12
|
|
|
12
13
|
children: Snippet;
|
|
13
|
-
}
|
|
14
|
+
} & HTMLAttributes<HTMLHeadingElement>;
|
|
14
15
|
|
|
15
|
-
const { color, size = 'medium', class: className, children }: Props = $props();
|
|
16
|
+
const { color, size = 'medium', class: className, children, ...restProps }: Props = $props();
|
|
16
17
|
|
|
17
18
|
const sizes = {
|
|
18
19
|
title: 'h1',
|
|
@@ -50,6 +51,6 @@
|
|
|
50
51
|
const classList = $derived(cleanClass(styles({ color, size }), className));
|
|
51
52
|
</script>
|
|
52
53
|
|
|
53
|
-
<svelte:element this={tag} class={classList} role="heading">
|
|
54
|
+
<svelte:element this={tag} class={classList} role="heading" {...restProps}>
|
|
54
55
|
{@render children()}
|
|
55
56
|
</svelte:element>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { HeadingColor, HeadingSize } from '../../types.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
4
|
declare const Heading: import("svelte").Component<{
|
|
4
5
|
size: HeadingSize;
|
|
5
6
|
color?: HeadingColor;
|
|
6
7
|
class?: string;
|
|
7
8
|
children: Snippet;
|
|
8
|
-
}
|
|
9
|
+
} & HTMLAttributes<HTMLHeadingElement>, {}, "">;
|
|
9
10
|
export default Heading;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import IconButton from '../IconButton/IconButton.svelte';
|
|
3
3
|
import { theme } from '../../services/theme.svelte.js';
|
|
4
|
-
import { Theme, type Size, type Variants } from '../../types.js';
|
|
4
|
+
import { Theme, type Color, type Size, type Variants } from '../../types.js';
|
|
5
5
|
import { cleanClass } from '../../utils.js';
|
|
6
6
|
import { mdiWeatherNight, mdiWeatherSunny } from '@mdi/js';
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
9
9
|
size?: Size;
|
|
10
10
|
class?: string;
|
|
11
|
+
color?: Color;
|
|
11
12
|
variant?: Variants;
|
|
12
13
|
onChange?: (theme: Theme) => void;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
const {
|
|
16
|
+
const {
|
|
17
|
+
color = 'primary',
|
|
18
|
+
variant = 'ghost',
|
|
19
|
+
size,
|
|
20
|
+
class: className,
|
|
21
|
+
onChange,
|
|
22
|
+
}: Props = $props();
|
|
16
23
|
|
|
17
24
|
const handleToggleTheme = () => {
|
|
18
25
|
theme.value = theme.value === Theme.Dark ? Theme.Light : Theme.Dark;
|
|
@@ -24,7 +31,7 @@
|
|
|
24
31
|
|
|
25
32
|
<IconButton
|
|
26
33
|
shape="round"
|
|
27
|
-
color
|
|
34
|
+
{color}
|
|
28
35
|
{size}
|
|
29
36
|
{variant}
|
|
30
37
|
icon={themeIcon}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Theme, type Size, type Variants } from '../../types.js';
|
|
1
|
+
import { Theme, type Color, type Size, type Variants } from '../../types.js';
|
|
2
2
|
declare const ThemeSwitcher: import("svelte").Component<{
|
|
3
3
|
size?: Size;
|
|
4
4
|
class?: string;
|
|
5
|
+
color?: Color;
|
|
5
6
|
variant?: Variants;
|
|
6
7
|
onChange?: (theme: Theme) => void;
|
|
7
8
|
}, {}, "">;
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
true: 'w-full',
|
|
42
42
|
},
|
|
43
43
|
textPadding: {
|
|
44
|
-
tiny: 'px-
|
|
45
|
-
small: 'px-
|
|
46
|
-
medium: 'px-
|
|
47
|
-
large: 'px-
|
|
48
|
-
giant: 'px-
|
|
44
|
+
tiny: 'px-3 py-1',
|
|
45
|
+
small: 'px-4 py-1.5',
|
|
46
|
+
medium: 'px-5 py-2',
|
|
47
|
+
large: 'px-8 py-2.5',
|
|
48
|
+
giant: 'px-10 py-3',
|
|
49
49
|
},
|
|
50
50
|
textSize: {
|
|
51
51
|
tiny: 'text-xs',
|