@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.
Files changed (62) hide show
  1. package/README.md +9 -17
  2. package/dist/actions/shortcut.js +1 -1
  3. package/dist/components/Alert/Alert.svelte +92 -94
  4. package/dist/components/AppShell/AppShell.svelte +26 -26
  5. package/dist/components/AppShell/AppShellHeader.svelte +8 -8
  6. package/dist/components/AppShell/AppShellSidebar.svelte +20 -20
  7. package/dist/components/AppShell/PageLayout.svelte +29 -35
  8. package/dist/components/Avatar/Avatar.svelte +45 -55
  9. package/dist/components/Button/Button.svelte +3 -3
  10. package/dist/components/Card/Card.svelte +131 -135
  11. package/dist/components/Card/CardBody.svelte +9 -9
  12. package/dist/components/Card/CardDescription.svelte +9 -9
  13. package/dist/components/Card/CardFooter.svelte +9 -9
  14. package/dist/components/Card/CardHeader.svelte +9 -9
  15. package/dist/components/Card/CardTitle.svelte +14 -14
  16. package/dist/components/Checkbox/Checkbox.svelte +109 -110
  17. package/dist/components/CloseButton/CloseButton.svelte +12 -17
  18. package/dist/components/Code/Code.svelte +58 -65
  19. package/dist/components/CommandPalette/CommandPalette.svelte +126 -131
  20. package/dist/components/CommandPalette/CommandPaletteItem.svelte +61 -61
  21. package/dist/components/ConfirmModal/ConfirmModal.svelte +48 -48
  22. package/dist/components/Container/Container.svelte +25 -25
  23. package/dist/components/Field/Field.svelte +21 -21
  24. package/dist/components/FormatBytes/FormatBytes.svelte +9 -9
  25. package/dist/components/Heading/Heading.svelte +41 -47
  26. package/dist/components/HelperText/HelperText.svelte +17 -17
  27. package/dist/components/Icon/Icon.svelte +37 -42
  28. package/dist/components/IconButton/IconButton.svelte +6 -13
  29. package/dist/components/Input/Input.svelte +153 -144
  30. package/dist/components/Kbd/Kbd.svelte +25 -25
  31. package/dist/components/Label/Label.svelte +6 -6
  32. package/dist/components/Link/Link.svelte +18 -25
  33. package/dist/components/LoadingSpinner/LoadingSpinner.svelte +46 -46
  34. package/dist/components/Logo/Logo.svelte +53 -53
  35. package/dist/components/Modal/Modal.svelte +110 -114
  36. package/dist/components/Modal/ModalBody.svelte +8 -8
  37. package/dist/components/Modal/ModalFooter.svelte +8 -8
  38. package/dist/components/Modal/ModalHeader.svelte +8 -8
  39. package/dist/components/MultiSelect/MultiSelect.svelte +7 -7
  40. package/dist/components/Navbar/NavbarGroup.svelte +5 -5
  41. package/dist/components/Navbar/NavbarItem.svelte +59 -61
  42. package/dist/components/PasswordInput/PasswordInput.svelte +29 -31
  43. package/dist/components/Scrollable/Scrollable.svelte +49 -49
  44. package/dist/components/Select/Select.svelte +9 -9
  45. package/dist/components/Stack/HStack.svelte +4 -4
  46. package/dist/components/Stack/Stack.svelte +62 -62
  47. package/dist/components/Stack/VStack.svelte +4 -4
  48. package/dist/components/SupporterBadge/SupporterBadge.svelte +80 -80
  49. package/dist/components/Switch/Switch.svelte +95 -96
  50. package/dist/components/Text/Text.svelte +27 -34
  51. package/dist/components/Textarea/Textarea.svelte +103 -104
  52. package/dist/components/ThemeSwitcher/ThemeSwitcher.svelte +30 -43
  53. package/dist/internal/Button.svelte +177 -177
  54. package/dist/internal/Child.svelte +21 -21
  55. package/dist/internal/Select.svelte +151 -158
  56. package/dist/internal/Text.svelte +42 -50
  57. package/dist/site/SiteFooter.svelte +60 -76
  58. package/dist/site/SiteFooterLink.svelte +14 -14
  59. package/dist/theme/default.css +40 -40
  60. package/dist/types.d.ts +1 -0
  61. package/dist/utilities/byte-units.js +2 -13
  62. package/package.json +77 -77
@@ -1,154 +1,150 @@
1
1
  <script lang="ts">
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';
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
- 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
- };
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
- 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();
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
- 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
- });
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
- 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
- });
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
- 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
- });
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
- const onToggle = () => {
77
- expanded = !expanded;
78
- };
76
+ const onToggle = () => {
77
+ expanded = !expanded;
78
+ };
79
79
 
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));
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
- const headerBorder = $derived(!color);
86
- const headerPadding = $derived(headerBorder || !expanded);
85
+ const headerBorder = $derived(!color);
86
+ const headerPadding = $derived(headerBorder || !expanded);
87
87
 
88
- const headerContainerClasses = $derived(
89
- twMerge(
90
- cleanClass(
91
- headerContainerStyles({
92
- padding: headerPadding,
93
- border: headerBorder,
94
- }),
95
- headerChild?.class,
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
- {#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}
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
- bind:this={ref}
132
- class={cleanClass(containerStyles({ shape, border: !color }), className)}
133
- {...restProps}
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
- {#if bodyChild && expanded}
141
- <Scrollable class={twMerge(cleanClass('p-4', bodyChild?.class))}>
142
- {@render bodyChild?.snippet()}
143
- </Scrollable>
144
- {/if}
136
+ {#if bodyChild && expanded}
137
+ <Scrollable class={twMerge(cleanClass('p-4', bodyChild?.class))}>
138
+ {@render bodyChild?.snippet()}
139
+ </Scrollable>
140
+ {/if}
145
141
 
146
- {#if footerChild}
147
- <div class={twMerge(cleanClass('flex items-center border-t p-4', footerChild.class))}>
148
- {@render footerChild.snippet()}
149
- </div>
150
- {/if}
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
- {@render children()}
153
- </div>
148
+ {@render children()}
149
+ </div>
154
150
  </div>
@@ -1,16 +1,16 @@
1
1
  <script lang="ts">
2
- import { ChildKey } from '../../constants.js';
3
- import Child from '../../internal/Child.svelte';
4
- import type { Snippet } from 'svelte';
2
+ import { ChildKey } from '../../constants.js';
3
+ import Child from '../../internal/Child.svelte';
4
+ import type { Snippet } from 'svelte';
5
5
 
6
- type Props = {
7
- class?: string;
8
- children: Snippet;
9
- };
6
+ type Props = {
7
+ class?: string;
8
+ children: Snippet;
9
+ };
10
10
 
11
- let { class: className, children }: Props = $props();
11
+ let { class: className, children }: Props = $props();
12
12
  </script>
13
13
 
14
14
  <Child for={ChildKey.Card} as={ChildKey.CardBody} class={className}>
15
- {@render children?.()}
15
+ {@render children?.()}
16
16
  </Child>
@@ -1,16 +1,16 @@
1
1
  <script lang="ts">
2
- import Text from '../Text/Text.svelte';
3
- import { cleanClass } from '../../utils.js';
4
- import type { Snippet } from 'svelte';
2
+ import Text from '../Text/Text.svelte';
3
+ import { cleanClass } from '../../utils.js';
4
+ import type { Snippet } from 'svelte';
5
5
 
6
- type Props = {
7
- class?: string;
8
- children: Snippet;
9
- };
6
+ type Props = {
7
+ class?: string;
8
+ children: Snippet;
9
+ };
10
10
 
11
- let { children, class: className }: Props = $props();
11
+ let { children, class: className }: Props = $props();
12
12
  </script>
13
13
 
14
14
  <Text size="small" class={cleanClass('text-dark/75', className)}>
15
- {@render children?.()}
15
+ {@render children?.()}
16
16
  </Text>
@@ -1,16 +1,16 @@
1
1
  <script lang="ts">
2
- import { ChildKey } from '../../constants.js';
3
- import Child from '../../internal/Child.svelte';
4
- import type { Snippet } from 'svelte';
2
+ import { ChildKey } from '../../constants.js';
3
+ import Child from '../../internal/Child.svelte';
4
+ import type { Snippet } from 'svelte';
5
5
 
6
- type Props = {
7
- class?: string;
8
- children: Snippet;
9
- };
6
+ type Props = {
7
+ class?: string;
8
+ children: Snippet;
9
+ };
10
10
 
11
- let { class: className, children }: Props = $props();
11
+ let { class: className, children }: Props = $props();
12
12
  </script>
13
13
 
14
14
  <Child for={ChildKey.Card} as={ChildKey.CardFooter} class={className}>
15
- {@render children?.()}
15
+ {@render children?.()}
16
16
  </Child>
@@ -1,16 +1,16 @@
1
1
  <script lang="ts">
2
- import { ChildKey } from '../../constants.js';
3
- import Child from '../../internal/Child.svelte';
4
- import type { Snippet } from 'svelte';
2
+ import { ChildKey } from '../../constants.js';
3
+ import Child from '../../internal/Child.svelte';
4
+ import type { Snippet } from 'svelte';
5
5
 
6
- type Props = {
7
- class?: string;
8
- children: Snippet;
9
- };
6
+ type Props = {
7
+ class?: string;
8
+ children: Snippet;
9
+ };
10
10
 
11
- let { class: className, children }: Props = $props();
11
+ let { class: className, children }: Props = $props();
12
12
  </script>
13
13
 
14
14
  <Child for={ChildKey.Card} as={ChildKey.CardHeader} class={className}>
15
- {@render children?.()}
15
+ {@render children?.()}
16
16
  </Child>
@@ -1,21 +1,21 @@
1
1
  <script lang="ts">
2
- import Heading from '../Heading/Heading.svelte';
3
- import type { HeadingSize, HeadingTag } from '../../types.js';
4
- import type { Snippet } from 'svelte';
2
+ import Heading from '../Heading/Heading.svelte';
3
+ import type { HeadingSize, HeadingTag } from '../../types.js';
4
+ import type { Snippet } from 'svelte';
5
5
 
6
- type Props = {
7
- /**
8
- * The HTML element type.
9
- */
10
- tag?: HeadingTag;
11
- class?: string;
12
- size?: HeadingSize;
13
- children: Snippet;
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
- const { size = 'small', tag, class: className, children }: Props = $props();
16
+ const { size = 'small', tag, class: className, children }: Props = $props();
17
17
  </script>
18
18
 
19
19
  <Heading {tag} {size} class={className}>
20
- {@render children?.()}
20
+ {@render children?.()}
21
21
  </Heading>