@immich/ui 0.29.0 → 0.30.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/README.md +9 -17
- package/dist/actions/shortcut.js +1 -1
- package/dist/components/Alert/Alert.svelte +92 -94
- package/dist/components/AppShell/AppShell.svelte +26 -26
- package/dist/components/AppShell/AppShellHeader.svelte +8 -8
- package/dist/components/AppShell/AppShellSidebar.svelte +20 -20
- package/dist/components/AppShell/PageLayout.svelte +29 -35
- package/dist/components/Avatar/Avatar.svelte +45 -55
- package/dist/components/Button/Button.svelte +3 -3
- package/dist/components/Card/Card.svelte +131 -135
- package/dist/components/Card/CardBody.svelte +9 -9
- package/dist/components/Card/CardDescription.svelte +9 -9
- package/dist/components/Card/CardFooter.svelte +9 -9
- package/dist/components/Card/CardHeader.svelte +9 -9
- package/dist/components/Card/CardTitle.svelte +14 -14
- package/dist/components/Checkbox/Checkbox.svelte +109 -110
- package/dist/components/CloseButton/CloseButton.svelte +12 -17
- package/dist/components/Code/Code.svelte +58 -65
- package/dist/components/CommandPalette/CommandPalette.svelte +126 -131
- package/dist/components/CommandPalette/CommandPaletteItem.svelte +61 -61
- package/dist/components/ConfirmModal/ConfirmModal.svelte +48 -48
- package/dist/components/Container/Container.svelte +25 -25
- package/dist/components/Field/Field.svelte +21 -21
- package/dist/components/FormatBytes/FormatBytes.svelte +9 -9
- package/dist/components/Heading/Heading.svelte +41 -47
- package/dist/components/HelperText/HelperText.svelte +17 -17
- package/dist/components/Icon/Icon.svelte +37 -42
- package/dist/components/IconButton/IconButton.svelte +6 -13
- package/dist/components/Input/Input.svelte +153 -144
- package/dist/components/Kbd/Kbd.svelte +25 -25
- package/dist/components/Label/Label.svelte +6 -6
- package/dist/components/Link/Link.svelte +18 -25
- package/dist/components/LoadingSpinner/LoadingSpinner.svelte +46 -46
- package/dist/components/Logo/Logo.svelte +53 -53
- package/dist/components/Modal/Modal.svelte +110 -114
- package/dist/components/Modal/ModalBody.svelte +8 -8
- package/dist/components/Modal/ModalFooter.svelte +8 -8
- package/dist/components/Modal/ModalHeader.svelte +8 -8
- package/dist/components/MultiSelect/MultiSelect.svelte +7 -7
- package/dist/components/Navbar/NavbarGroup.svelte +5 -5
- package/dist/components/Navbar/NavbarItem.svelte +59 -61
- package/dist/components/PasswordInput/PasswordInput.svelte +29 -31
- package/dist/components/Scrollable/Scrollable.svelte +49 -49
- package/dist/components/Select/Select.svelte +9 -9
- package/dist/components/Stack/HStack.svelte +4 -4
- package/dist/components/Stack/Stack.svelte +62 -62
- package/dist/components/Stack/VStack.svelte +4 -4
- package/dist/components/SupporterBadge/SupporterBadge.svelte +80 -80
- package/dist/components/Switch/Switch.svelte +95 -96
- package/dist/components/Text/Text.svelte +27 -34
- package/dist/components/Textarea/Textarea.svelte +103 -104
- package/dist/components/ThemeSwitcher/ThemeSwitcher.svelte +30 -43
- package/dist/internal/Button.svelte +177 -177
- package/dist/internal/Child.svelte +21 -21
- package/dist/internal/Select.svelte +151 -158
- package/dist/internal/Text.svelte +42 -50
- package/dist/site/SiteFooter.svelte +60 -76
- package/dist/site/SiteFooterLink.svelte +14 -14
- package/dist/theme/default.css +40 -40
- package/dist/types.d.ts +1 -0
- package/dist/utilities/byte-units.js +2 -13
- package/package.json +77 -77
|
@@ -1,154 +1,150 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { withChildrenSnippets } from '../../common/use-child.svelte.js';
|
|
3
|
+
import IconButton from '../IconButton/IconButton.svelte';
|
|
4
|
+
import Scrollable from '../Scrollable/Scrollable.svelte';
|
|
5
|
+
import { ChildKey } from '../../constants.js';
|
|
6
|
+
import type { Color } from '../../types.js';
|
|
7
|
+
import { cleanClass } from '../../utils.js';
|
|
8
|
+
import { mdiChevronDown } from '@mdi/js';
|
|
9
|
+
import { type Snippet } from 'svelte';
|
|
10
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
11
|
+
import { twMerge } from 'tailwind-merge';
|
|
12
|
+
import { tv } from 'tailwind-variants';
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
type Props = HTMLAttributes<HTMLDivElement> & {
|
|
15
|
+
ref?: HTMLElement | null;
|
|
16
|
+
color?: Color;
|
|
17
|
+
shape?: 'round' | 'rectangle';
|
|
18
|
+
expanded?: boolean;
|
|
19
|
+
expandable?: boolean;
|
|
20
|
+
children: Snippet;
|
|
21
|
+
};
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
let {
|
|
24
|
+
ref = $bindable(null),
|
|
25
|
+
color,
|
|
26
|
+
class: className,
|
|
27
|
+
shape = 'round',
|
|
28
|
+
expanded = $bindable(true),
|
|
29
|
+
expandable = false,
|
|
30
|
+
children,
|
|
31
|
+
...restProps
|
|
32
|
+
}: Props = $props();
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
const containerStyles = tv({
|
|
35
|
+
base: 'w-full overflow-hidden shadow-sm',
|
|
36
|
+
variants: {
|
|
37
|
+
shape: {
|
|
38
|
+
rectangle: '',
|
|
39
|
+
round: 'rounded-2xl',
|
|
40
|
+
},
|
|
41
|
+
border: {
|
|
42
|
+
true: 'border',
|
|
43
|
+
false: '',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
const cardStyles = tv({
|
|
49
|
+
base: 'flex h-full w-full flex-col',
|
|
50
|
+
variants: {
|
|
51
|
+
color: {
|
|
52
|
+
primary: 'bg-primary/25 dark:bg-primary/25',
|
|
53
|
+
secondary: 'text-dark bg-gray-50 dark:bg-neutral-900 dark:text-white',
|
|
54
|
+
success: 'bg-success/15 dark:bg-success/30',
|
|
55
|
+
danger: 'bg-danger/15 dark:bg-danger/50',
|
|
56
|
+
warning: 'bg-warning/25 dark:bg-warning/50',
|
|
57
|
+
info: 'bg-info/25 dark:bg-info/50',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
const headerContainerStyles = tv({
|
|
63
|
+
base: 'p-4',
|
|
64
|
+
variants: {
|
|
65
|
+
padding: {
|
|
66
|
+
true: '',
|
|
67
|
+
false: 'pb-0',
|
|
68
|
+
},
|
|
69
|
+
border: {
|
|
70
|
+
true: 'border-b',
|
|
71
|
+
false: '',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
const onToggle = () => {
|
|
77
|
+
expanded = !expanded;
|
|
78
|
+
};
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
const { getChildren: getChildSnippet } = withChildrenSnippets(ChildKey.Card);
|
|
81
|
+
const headerChild = $derived(getChildSnippet(ChildKey.CardHeader));
|
|
82
|
+
const bodyChild = $derived(getChildSnippet(ChildKey.CardBody));
|
|
83
|
+
const footerChild = $derived(getChildSnippet(ChildKey.CardFooter));
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const headerBorder = $derived(!color);
|
|
86
|
+
const headerPadding = $derived(headerBorder || !expanded);
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
const headerContainerClasses = $derived(
|
|
89
|
+
twMerge(
|
|
90
|
+
cleanClass(
|
|
91
|
+
headerContainerStyles({
|
|
92
|
+
padding: headerPadding,
|
|
93
|
+
border: headerBorder,
|
|
94
|
+
}),
|
|
95
|
+
headerChild?.class,
|
|
96
|
+
),
|
|
97
|
+
),
|
|
98
|
+
);
|
|
99
99
|
</script>
|
|
100
100
|
|
|
101
101
|
{#snippet header()}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
102
|
+
{#if expandable}
|
|
103
|
+
<button
|
|
104
|
+
type="button"
|
|
105
|
+
onclick={onToggle}
|
|
106
|
+
class={cleanClass('flex w-full items-center justify-between px-4', headerContainerClasses)}
|
|
107
|
+
>
|
|
108
|
+
<div class="flex flex-col">
|
|
109
|
+
{@render headerChild?.snippet()}
|
|
110
|
+
</div>
|
|
111
|
+
<div>
|
|
112
|
+
<IconButton
|
|
113
|
+
color="secondary"
|
|
114
|
+
icon={mdiChevronDown}
|
|
115
|
+
flopped={expanded}
|
|
116
|
+
variant="ghost"
|
|
117
|
+
shape="round"
|
|
118
|
+
size="large"
|
|
119
|
+
aria-label="Expand"
|
|
120
|
+
/>
|
|
121
|
+
</div>
|
|
122
|
+
</button>
|
|
123
|
+
{:else}
|
|
124
|
+
<div class={cleanClass('flex flex-col', headerContainerClasses)}>
|
|
125
|
+
{@render headerChild?.snippet()}
|
|
126
|
+
</div>
|
|
127
|
+
{/if}
|
|
128
128
|
{/snippet}
|
|
129
129
|
|
|
130
|
-
<div
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
<div class={cleanClass(cardStyles({ color }))}>
|
|
136
|
-
{#if headerChild}
|
|
137
|
-
{@render header()}
|
|
138
|
-
{/if}
|
|
130
|
+
<div bind:this={ref} class={cleanClass(containerStyles({ shape, border: !color }), className)} {...restProps}>
|
|
131
|
+
<div class={cleanClass(cardStyles({ color }))}>
|
|
132
|
+
{#if headerChild}
|
|
133
|
+
{@render header()}
|
|
134
|
+
{/if}
|
|
139
135
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
136
|
+
{#if bodyChild && expanded}
|
|
137
|
+
<Scrollable class={twMerge(cleanClass('p-4', bodyChild?.class))}>
|
|
138
|
+
{@render bodyChild?.snippet()}
|
|
139
|
+
</Scrollable>
|
|
140
|
+
{/if}
|
|
145
141
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
142
|
+
{#if footerChild}
|
|
143
|
+
<div class={twMerge(cleanClass('flex items-center border-t p-4', footerChild.class))}>
|
|
144
|
+
{@render footerChild.snippet()}
|
|
145
|
+
</div>
|
|
146
|
+
{/if}
|
|
151
147
|
|
|
152
|
-
|
|
153
|
-
|
|
148
|
+
{@render children()}
|
|
149
|
+
</div>
|
|
154
150
|
</div>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ChildKey } from '../../constants.js';
|
|
3
|
+
import Child from '../../internal/Child.svelte';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type Props = {
|
|
7
|
+
class?: string;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
};
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
let { class: className, children }: Props = $props();
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<Child for={ChildKey.Card} as={ChildKey.CardBody} class={className}>
|
|
15
|
-
|
|
15
|
+
{@render children?.()}
|
|
16
16
|
</Child>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import Text from '../Text/Text.svelte';
|
|
3
|
+
import { cleanClass } from '../../utils.js';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type Props = {
|
|
7
|
+
class?: string;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
};
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
let { children, class: className }: Props = $props();
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<Text size="small" class={cleanClass('text-dark/75', className)}>
|
|
15
|
-
|
|
15
|
+
{@render children?.()}
|
|
16
16
|
</Text>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ChildKey } from '../../constants.js';
|
|
3
|
+
import Child from '../../internal/Child.svelte';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type Props = {
|
|
7
|
+
class?: string;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
};
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
let { class: className, children }: Props = $props();
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<Child for={ChildKey.Card} as={ChildKey.CardFooter} class={className}>
|
|
15
|
-
|
|
15
|
+
{@render children?.()}
|
|
16
16
|
</Child>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ChildKey } from '../../constants.js';
|
|
3
|
+
import Child from '../../internal/Child.svelte';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type Props = {
|
|
7
|
+
class?: string;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
};
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
let { class: className, children }: Props = $props();
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<Child for={ChildKey.Card} as={ChildKey.CardHeader} class={className}>
|
|
15
|
-
|
|
15
|
+
{@render children?.()}
|
|
16
16
|
</Child>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import Heading from '../Heading/Heading.svelte';
|
|
3
|
+
import type { HeadingSize, HeadingTag } from '../../types.js';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
type Props = {
|
|
7
|
+
/**
|
|
8
|
+
* The HTML element type.
|
|
9
|
+
*/
|
|
10
|
+
tag?: HeadingTag;
|
|
11
|
+
class?: string;
|
|
12
|
+
size?: HeadingSize;
|
|
13
|
+
children: Snippet;
|
|
14
|
+
};
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const { size = 'small', tag, class: className, children }: Props = $props();
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<Heading {tag} {size} class={className}>
|
|
20
|
-
|
|
20
|
+
{@render children?.()}
|
|
21
21
|
</Heading>
|