@immich/ui 0.57.3 → 0.58.0
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/Avatar/Avatar.svelte +2 -2
- package/dist/components/Button/Button.svelte +2 -2
- package/dist/components/IconButton/IconButton.svelte +10 -2
- package/dist/components/ListButton/ListButton.svelte +51 -0
- package/dist/components/ListButton/ListButton.svelte.d.ts +11 -0
- package/dist/components/Text/Text.svelte +3 -2
- package/dist/components/Text/Text.svelte.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/Button.svelte +1 -1
- package/dist/internal/Text.svelte +1 -1
- package/dist/internal/Text.svelte.d.ts +1 -1
- package/dist/styles.d.ts +4 -0
- package/dist/styles.js +4 -0
- package/dist/types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
const { color = 'primary', size = 'medium', name }: Props = $props();
|
|
12
12
|
|
|
13
13
|
const styles = tv({
|
|
14
|
-
base: 'flex
|
|
14
|
+
base: 'flex items-center justify-center font-medium text-white select-none',
|
|
15
15
|
variants: {
|
|
16
16
|
size: {
|
|
17
17
|
tiny: 'h-5 w-5 text-xs',
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
const wrapper = tv({
|
|
39
|
-
base: 'overflow-hidden rounded-full shadow-md',
|
|
39
|
+
base: 'block w-full overflow-hidden rounded-full shadow-md',
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
const getInitials = (name: string) => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import Button from '../../internal/Button.svelte';
|
|
3
3
|
import type { ButtonProps } from '../../types.js';
|
|
4
4
|
|
|
5
|
-
let { ref = $bindable(null), ...props }: ButtonProps = $props();
|
|
5
|
+
let { ref = $bindable(null), color = 'primary', ...props }: ButtonProps = $props();
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
|
-
<Button bind:ref {...props} />
|
|
8
|
+
<Button bind:ref {color} {...props} />
|
|
@@ -3,11 +3,19 @@
|
|
|
3
3
|
import Button from '../../internal/Button.svelte';
|
|
4
4
|
import type { IconButtonProps } from '../../types.js';
|
|
5
5
|
|
|
6
|
-
const {
|
|
6
|
+
const {
|
|
7
|
+
icon,
|
|
8
|
+
flipped,
|
|
9
|
+
flopped,
|
|
10
|
+
title,
|
|
11
|
+
'aria-label': ariaLabel,
|
|
12
|
+
color = 'primary',
|
|
13
|
+
...buttonProps
|
|
14
|
+
}: IconButtonProps = $props();
|
|
7
15
|
|
|
8
16
|
const buttonTitle = $derived(title ?? ariaLabel);
|
|
9
17
|
</script>
|
|
10
18
|
|
|
11
|
-
<Button icon {...buttonProps} title={buttonTitle} aria-label={ariaLabel}>
|
|
19
|
+
<Button icon {color} {...buttonProps} title={buttonTitle} aria-label={ariaLabel}>
|
|
12
20
|
<Icon {icon} {flipped} {flopped} size="60%" aria-hidden />
|
|
13
21
|
</Button>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Icon from '../Icon/Icon.svelte';
|
|
3
|
+
import HStack from '../Stack/HStack.svelte';
|
|
4
|
+
import Button from '../../internal/Button.svelte';
|
|
5
|
+
import type { ButtonProps, IconLike } from '../../types.js';
|
|
6
|
+
import { cleanClass, isIconLike } from '../../utilities/internal.js';
|
|
7
|
+
import { mdiCheck } from '@mdi/js';
|
|
8
|
+
import type { Snippet } from 'svelte';
|
|
9
|
+
import { tv } from 'tailwind-variants';
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
ref = $bindable(null),
|
|
13
|
+
selected = false,
|
|
14
|
+
class: className,
|
|
15
|
+
selectedIcon = mdiCheck,
|
|
16
|
+
children,
|
|
17
|
+
...props
|
|
18
|
+
}: ButtonProps & {
|
|
19
|
+
color?: never;
|
|
20
|
+
selected?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
selectedIcon?: IconLike | Snippet | false;
|
|
23
|
+
} = $props();
|
|
24
|
+
|
|
25
|
+
const styles = tv({
|
|
26
|
+
base: 'hover:bg-light-200 dark:hover:bg-light-300 text-dark',
|
|
27
|
+
variants: {
|
|
28
|
+
selected: {
|
|
29
|
+
true: 'bg-light-200 dark:bg-light-300',
|
|
30
|
+
false: '',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<Button bind:ref fullWidth class={cleanClass(styles({ selected }), className)} {...props}>
|
|
37
|
+
{#if selectedIcon}
|
|
38
|
+
<HStack fullWidth class="justify-between">
|
|
39
|
+
{@render children?.()}
|
|
40
|
+
{#if selected}
|
|
41
|
+
{#if isIconLike(selectedIcon)}
|
|
42
|
+
<Icon icon={selectedIcon} />
|
|
43
|
+
{:else}
|
|
44
|
+
{@render selectedIcon()}
|
|
45
|
+
{/if}
|
|
46
|
+
{/if}
|
|
47
|
+
</HStack>
|
|
48
|
+
{:else}
|
|
49
|
+
{@render children?.()}
|
|
50
|
+
{/if}
|
|
51
|
+
</Button>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ButtonProps, IconLike } from '../../types.js';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = ButtonProps & {
|
|
4
|
+
color?: never;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
selectedIcon?: IconLike | Snippet | false;
|
|
8
|
+
};
|
|
9
|
+
declare const ListButton: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
10
|
+
type ListButton = ReturnType<typeof ListButton>;
|
|
11
|
+
export default ListButton;
|
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
color?: TextColor;
|
|
13
13
|
fontWeight?: FontWeight;
|
|
14
14
|
variant?: TextVariant;
|
|
15
|
+
inline?: boolean;
|
|
15
16
|
class?: string;
|
|
16
17
|
children: Snippet;
|
|
17
18
|
} & HTMLAttributes<HTMLElement>;
|
|
18
19
|
|
|
19
|
-
const { color, size, fontWeight = 'normal', children, class: className, ...restProps }: Props = $props();
|
|
20
|
+
const { color, inline, size, fontWeight = 'normal', children, class: className, ...restProps }: Props = $props();
|
|
20
21
|
|
|
21
22
|
const styles = tv({
|
|
22
23
|
variants: {
|
|
@@ -25,6 +26,6 @@
|
|
|
25
26
|
});
|
|
26
27
|
</script>
|
|
27
28
|
|
|
28
|
-
<Text tag=
|
|
29
|
+
<Text tag={inline ? 'span' : 'p'} {color} {fontWeight} class={cleanClass(styles({ size }), className)} {...restProps}>
|
|
29
30
|
{@render children()}
|
|
30
31
|
</Text>
|
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export { default as Input } from './components/Input/Input.svelte';
|
|
|
48
48
|
export { default as Kbd } from './components/Kbd/Kbd.svelte';
|
|
49
49
|
export { default as Label } from './components/Label/Label.svelte';
|
|
50
50
|
export { default as Link } from './components/Link/Link.svelte';
|
|
51
|
+
export { default as ListButton } from './components/ListButton/ListButton.svelte';
|
|
51
52
|
export { default as LoadingSpinner } from './components/LoadingSpinner/LoadingSpinner.svelte';
|
|
52
53
|
export { default as Logo } from './components/Logo/Logo.svelte';
|
|
53
54
|
export { Markdown } from './components/Markdown/index.js';
|
package/dist/index.js
CHANGED
|
@@ -50,6 +50,7 @@ export { default as Input } from './components/Input/Input.svelte';
|
|
|
50
50
|
export { default as Kbd } from './components/Kbd/Kbd.svelte';
|
|
51
51
|
export { default as Label } from './components/Label/Label.svelte';
|
|
52
52
|
export { default as Link } from './components/Link/Link.svelte';
|
|
53
|
+
export { default as ListButton } from './components/ListButton/ListButton.svelte';
|
|
53
54
|
export { default as LoadingSpinner } from './components/LoadingSpinner/LoadingSpinner.svelte';
|
|
54
55
|
export { default as Logo } from './components/Logo/Logo.svelte';
|
|
55
56
|
export { Markdown } from './components/Markdown/index.js';
|
package/dist/styles.d.ts
CHANGED
|
@@ -74,11 +74,15 @@ export declare const styleVariants: {
|
|
|
74
74
|
giant: string;
|
|
75
75
|
};
|
|
76
76
|
fontWeight: {
|
|
77
|
+
thin: string;
|
|
78
|
+
'extra-light': string;
|
|
77
79
|
light: string;
|
|
78
80
|
normal: string;
|
|
81
|
+
medium: string;
|
|
79
82
|
'semi-bold': string;
|
|
80
83
|
bold: string;
|
|
81
84
|
'extra-bold': string;
|
|
85
|
+
black: string;
|
|
82
86
|
};
|
|
83
87
|
tableSpacing: {
|
|
84
88
|
tiny: string;
|
package/dist/styles.js
CHANGED
|
@@ -70,11 +70,15 @@ export const styleVariants = {
|
|
|
70
70
|
giant: 'text-xl',
|
|
71
71
|
},
|
|
72
72
|
fontWeight: {
|
|
73
|
+
thin: 'font-thin',
|
|
74
|
+
'extra-light': 'font-extralight',
|
|
73
75
|
light: 'font-light',
|
|
74
76
|
normal: 'font-normal',
|
|
77
|
+
medium: 'font-medium',
|
|
75
78
|
'semi-bold': 'font-semibold',
|
|
76
79
|
bold: 'font-bold',
|
|
77
80
|
'extra-bold': 'font-extrabold',
|
|
81
|
+
black: 'font-black',
|
|
78
82
|
},
|
|
79
83
|
tableSpacing: {
|
|
80
84
|
tiny: '',
|
package/dist/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { HTMLAnchorAttributes, HTMLAttributes, HTMLButtonAttributes, HTMLIn
|
|
|
6
6
|
export type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
7
7
|
export type TextColor = Color | 'muted';
|
|
8
8
|
export type TextVariant = 'italic';
|
|
9
|
-
export type FontWeight = 'light' | 'normal' | 'semi-bold' | 'bold' | 'extra-bold';
|
|
9
|
+
export type FontWeight = 'thin' | 'extra-light' | 'light' | 'normal' | 'medium' | 'semi-bold' | 'bold' | 'extra-bold' | 'black';
|
|
10
10
|
export type HeadingColor = TextColor;
|
|
11
11
|
export type Size = 'tiny' | 'small' | 'medium' | 'large' | 'giant';
|
|
12
12
|
export type ModalSize = Size | 'full';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@immich/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"license": "GNU Affero General Public License version 3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@tailwindcss/vite": "^4.1.7",
|
|
38
38
|
"@types/luxon": "^3.7.1",
|
|
39
39
|
"autoprefixer": "^10.4.20",
|
|
40
|
-
"globals": "^
|
|
40
|
+
"globals": "^17.0.0",
|
|
41
41
|
"publint": "^0.3.0",
|
|
42
42
|
"svelte": "^5.37.0",
|
|
43
43
|
"svelte-check": "^4.0.0",
|