@immich/ui 0.30.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 +149 -152
- 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/utilities/byte-units.js +2 -13
- package/package.json +77 -77
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
type Props = {
|
|
10
|
+
effect?: 'hover' | 'always';
|
|
11
|
+
text?: string;
|
|
12
|
+
size?: Size;
|
|
13
|
+
children?: Snippet;
|
|
14
|
+
};
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const { effect = 'hover', text = 'Supporter', size = 'medium', children }: Props = $props();
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const iconSize: Record<Size, Size> = {
|
|
19
|
+
tiny: 'tiny',
|
|
20
|
+
small: 'tiny',
|
|
21
|
+
medium: 'small',
|
|
22
|
+
large: 'medium',
|
|
23
|
+
giant: 'medium',
|
|
24
|
+
};
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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: 'supporter-effect-hover border-dark/25 border',
|
|
38
|
+
always: 'supporter-effect shadow',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
44
|
<div class={cleanClass(containerStyles({ effect, size }))}>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
51
|
</div>
|
|
52
52
|
|
|
53
53
|
<style>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
94
|
</style>
|
|
@@ -1,110 +1,109 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { getFieldContext } from '../../common/context.svelte.js';
|
|
3
|
+
import Label from '../Label/Label.svelte';
|
|
4
|
+
import Text from '../Text/Text.svelte';
|
|
5
|
+
import type { Color } from '../../types.js';
|
|
6
|
+
import { cleanClass, generateId } from '../../utils.js';
|
|
7
|
+
import { Switch, type WithoutChildrenOrChild } from 'bits-ui';
|
|
8
|
+
import { tv } from 'tailwind-variants';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
type Props = {
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
color?: Color;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
class?: string;
|
|
15
|
+
} & WithoutChildrenOrChild<Switch.RootProps>;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
let {
|
|
18
|
+
id = generateId(),
|
|
19
|
+
checked = $bindable(false),
|
|
20
|
+
ref = $bindable(null),
|
|
21
|
+
color = 'primary',
|
|
22
|
+
class: className,
|
|
23
|
+
...restProps
|
|
24
|
+
}: Props = $props();
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
$derived(getFieldContext());
|
|
26
|
+
const { readOnly, required, disabled, label, description, ...labelProps } = $derived(getFieldContext());
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
const enabled = $derived(checked && !disabled);
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
const wrapper = tv({
|
|
31
|
+
base: 'relative flex flex-col justify-center',
|
|
32
|
+
variants: {
|
|
33
|
+
disabled: {
|
|
34
|
+
true: 'cursor-not-allowed opacity-38',
|
|
35
|
+
false: 'cursor-pointer',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
40
|
+
const bar = tv({
|
|
41
|
+
base: 'h-8 w-13 rounded-full border border-2',
|
|
42
|
+
variants: {
|
|
43
|
+
fillColor: {
|
|
44
|
+
default: 'border-gray-400 bg-gray-300 dark:border-gray-500 dark:bg-gray-400',
|
|
45
|
+
primary: 'bg-primary/50 dark:bg-primary border-transparent',
|
|
46
|
+
secondary: 'bg-dark/50 border-transparent',
|
|
47
|
+
success: 'bg-success/50 border-transparent',
|
|
48
|
+
danger: 'bg-danger/50 border-transparent',
|
|
49
|
+
warning: 'bg-warning/50 border-transparent',
|
|
50
|
+
info: 'bg-info/50 border-transparent',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
55
|
+
const dot = tv({
|
|
56
|
+
base: 'absolute h-4 w-4 origin-center rounded-full transition-transform duration-100',
|
|
57
|
+
variants: {
|
|
58
|
+
checked: {
|
|
59
|
+
true: 'translate-x-7 scale-150 rtl:-translate-x-7',
|
|
60
|
+
false: 'translate-x-2 rtl:-translate-x-2',
|
|
61
|
+
},
|
|
62
|
+
fillColor: {
|
|
63
|
+
default: 'bg-gray-400 dark:bg-gray-500',
|
|
64
|
+
primary: 'bg-[#4250af]',
|
|
65
|
+
secondary: 'bg-dark',
|
|
66
|
+
success: 'bg-success',
|
|
67
|
+
danger: 'bg-danger',
|
|
68
|
+
warning: 'bg-warning',
|
|
69
|
+
info: 'bg-info',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
});
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
const inputId = `input-${id}`;
|
|
75
|
+
const labelId = `label-${id}`;
|
|
76
|
+
const descriptionId = $derived(description ? `description-${id}` : undefined);
|
|
78
77
|
</script>
|
|
79
78
|
|
|
80
79
|
<Switch.Root
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
80
|
+
bind:checked
|
|
81
|
+
bind:ref
|
|
82
|
+
id={inputId}
|
|
83
|
+
disabled={disabled || readOnly}
|
|
84
|
+
{required}
|
|
85
|
+
class={cleanClass(label && 'w-full', className)}
|
|
86
|
+
aria-readonly={readOnly}
|
|
87
|
+
aria-labelledby={labelId}
|
|
88
|
+
aria-describedby={descriptionId}
|
|
89
|
+
{...restProps}
|
|
91
90
|
>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
91
|
+
<Switch.Thumb>
|
|
92
|
+
{#snippet child()}
|
|
93
|
+
<div class={cleanClass(label && 'flex items-center justify-between gap-1')}>
|
|
94
|
+
{#if label}
|
|
95
|
+
<div class="text-start">
|
|
96
|
+
<Label id={labelId} for={inputId} {label} {...labelProps} />
|
|
97
|
+
{#if description}
|
|
98
|
+
<Text color="secondary" size="small" id={descriptionId}>{description}</Text>
|
|
99
|
+
{/if}
|
|
100
|
+
</div>
|
|
101
|
+
{/if}
|
|
102
|
+
<span class={wrapper({ disabled })}>
|
|
103
|
+
<span class={bar({ fillColor: enabled ? color : 'default' })}> </span>
|
|
104
|
+
<span class={dot({ checked: enabled, fillColor: enabled ? color : 'default' })}></span>
|
|
105
|
+
</span>
|
|
106
|
+
</div>
|
|
107
|
+
{/snippet}
|
|
108
|
+
</Switch.Thumb>
|
|
110
109
|
</Switch.Root>
|
|
@@ -1,42 +1,35 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import Text from '../../internal/Text.svelte';
|
|
3
|
+
import type { FontWeight, Size, TextColor, TextVariant } from '../../types.js';
|
|
4
|
+
import { cleanClass } from '../../utils.js';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
7
|
+
import { tv } from 'tailwind-variants';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
type Props = {
|
|
10
|
+
size?: Size;
|
|
11
|
+
color?: TextColor;
|
|
12
|
+
fontWeight?: FontWeight;
|
|
13
|
+
variant?: TextVariant;
|
|
14
|
+
class?: string;
|
|
15
|
+
children: Snippet;
|
|
16
|
+
} & HTMLAttributes<HTMLElement>;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
color,
|
|
20
|
-
size,
|
|
21
|
-
fontWeight = 'normal',
|
|
22
|
-
children,
|
|
23
|
-
class: className,
|
|
24
|
-
...restProps
|
|
25
|
-
}: Props = $props();
|
|
18
|
+
const { color, size, fontWeight = 'normal', children, class: className, ...restProps }: Props = $props();
|
|
26
19
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
const styles = tv({
|
|
21
|
+
variants: {
|
|
22
|
+
size: {
|
|
23
|
+
tiny: 'text-xs',
|
|
24
|
+
small: 'text-sm',
|
|
25
|
+
medium: 'text-base',
|
|
26
|
+
large: 'text-lg',
|
|
27
|
+
giant: 'text-xl',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
38
31
|
</script>
|
|
39
32
|
|
|
40
33
|
<Text tag="p" {color} {fontWeight} class={cleanClass(styles({ size }), className)} {...restProps}>
|
|
41
|
-
|
|
34
|
+
{@render children()}
|
|
42
35
|
</Text>
|