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