@immich/ui 0.50.0 → 0.51.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/Alert/Alert.svelte +1 -1
- package/dist/components/Avatar/Avatar.svelte +10 -10
- package/dist/components/Badge/Badge.svelte +17 -17
- package/dist/components/Card/Card.svelte +2 -2
- package/dist/components/CommandPalette/CommandPaletteItem.svelte +7 -5
- package/dist/components/ConfirmModal/ConfirmModal.svelte +2 -2
- package/dist/components/ConfirmModal/ConfirmModal.svelte.d.ts +2 -2
- package/dist/components/FormModal/FormModal.svelte +2 -2
- package/dist/components/FormModal/FormModal.svelte.d.ts +2 -2
- package/dist/components/IconButton/IconButton.svelte +2 -2
- package/dist/components/Modal/Modal.svelte +30 -27
- package/dist/components/Textarea/Textarea.svelte +1 -1
- package/dist/components/Toast/ToastContent.svelte +7 -7
- package/dist/components/Tooltip/Tooltip.svelte +38 -0
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +11 -0
- package/dist/components/Tooltip/TooltipProvider.svelte +15 -0
- package/dist/components/Tooltip/TooltipProvider.svelte.d.ts +8 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/internal/Button.svelte +34 -26
- package/dist/internal/Select.svelte +1 -1
- package/dist/theme/default.css +4 -4
- package/dist/utilities/common.js +8 -1
- package/package.json +2 -2
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
{#if open}
|
|
84
84
|
<Card {color} class={cleanClass(className)}>
|
|
85
85
|
<CardBody>
|
|
86
|
-
<div class=
|
|
86
|
+
<div class={cleanClass((closable || onClose) && 'flex items-center justify-between')}>
|
|
87
87
|
<div class={cleanClass('flex gap-2')}>
|
|
88
88
|
{#if icon}
|
|
89
89
|
<div>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
const { color = 'primary', size = 'medium', name }: Props = $props();
|
|
12
12
|
|
|
13
13
|
const styles = tv({
|
|
14
|
-
base: 'flex h-full w-full items-center justify-center font-medium select-none',
|
|
14
|
+
base: 'flex h-full w-full 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',
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
},
|
|
23
23
|
color: {
|
|
24
24
|
primary: 'bg-primary text-light',
|
|
25
|
-
pink: '
|
|
26
|
-
red: '
|
|
27
|
-
yellow: '
|
|
28
|
-
purple: '
|
|
29
|
-
orange: '
|
|
30
|
-
gray: '
|
|
31
|
-
amber: '
|
|
32
|
-
blue: '
|
|
33
|
-
green: '
|
|
25
|
+
pink: 'bg-pink-400',
|
|
26
|
+
red: 'bg-red-500',
|
|
27
|
+
yellow: 'bg-yellow-500',
|
|
28
|
+
purple: 'bg-purple-600',
|
|
29
|
+
orange: 'bg-orange-600',
|
|
30
|
+
gray: 'bg-gray-600',
|
|
31
|
+
amber: 'bg-amber-600',
|
|
32
|
+
blue: 'bg-blue-500',
|
|
33
|
+
green: 'bg-green-600',
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
});
|
|
@@ -24,31 +24,31 @@
|
|
|
24
24
|
}: Props = $props();
|
|
25
25
|
|
|
26
26
|
const styles = tv({
|
|
27
|
-
base: '
|
|
27
|
+
base: 'text-light inline-flex items-center font-medium antialiased',
|
|
28
28
|
variants: {
|
|
29
29
|
shape: styleVariants.shape,
|
|
30
30
|
color: {
|
|
31
|
-
primary: '
|
|
32
|
-
secondary: '
|
|
33
|
-
success: '
|
|
34
|
-
info: '
|
|
35
|
-
warning: '
|
|
36
|
-
danger: '
|
|
31
|
+
primary: 'bg-primary',
|
|
32
|
+
secondary: 'bg-dark',
|
|
33
|
+
success: 'bg-success',
|
|
34
|
+
info: 'bg-info',
|
|
35
|
+
warning: 'bg-warning',
|
|
36
|
+
danger: 'bg-danger text-danger-50',
|
|
37
37
|
},
|
|
38
38
|
textSize: styleVariants.textSize,
|
|
39
39
|
paddingSize: {
|
|
40
|
-
tiny: 'px-
|
|
41
|
-
small: 'px-
|
|
42
|
-
medium: 'px-
|
|
43
|
-
large: 'px-
|
|
44
|
-
giant: 'px-
|
|
40
|
+
tiny: 'px-3 py-1',
|
|
41
|
+
small: 'px-3.25 py-1.25',
|
|
42
|
+
medium: 'px-3.75 py-1.5',
|
|
43
|
+
large: 'px-4 py-1.75',
|
|
44
|
+
giant: 'px-4.25 py-2',
|
|
45
45
|
},
|
|
46
46
|
roundedSize: {
|
|
47
|
-
tiny: 'rounded-
|
|
48
|
-
small: 'rounded-
|
|
49
|
-
medium: 'rounded-
|
|
50
|
-
large: 'rounded-
|
|
51
|
-
giant: 'rounded-
|
|
47
|
+
tiny: 'rounded-lg',
|
|
48
|
+
small: 'rounded-lg',
|
|
49
|
+
medium: 'rounded-lg',
|
|
50
|
+
large: 'rounded-xl',
|
|
51
|
+
giant: 'rounded-xl',
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
});
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
primary: 'bg-primary-50 dark:bg-primary-100',
|
|
53
53
|
secondary: 'text-dark bg-light-50 dark:bg-light-100 dark:text-white',
|
|
54
54
|
success: 'bg-success-50 dark:bg-success-100',
|
|
55
|
-
danger: 'bg-danger-
|
|
56
|
-
warning: 'bg-warning-
|
|
55
|
+
danger: 'bg-danger-100',
|
|
56
|
+
warning: 'bg-warning-100',
|
|
57
57
|
info: 'bg-info-50 dark:bg-info-100',
|
|
58
58
|
},
|
|
59
59
|
},
|
|
@@ -43,11 +43,13 @@
|
|
|
43
43
|
fullWidth
|
|
44
44
|
variant={selected ? 'outline' : 'ghost'}
|
|
45
45
|
color="secondary"
|
|
46
|
-
class="flex justify-between gap-3 border text-start {selected
|
|
46
|
+
class="hover:bg-primary-50 flex justify-between gap-3 border py-4 text-start {selected
|
|
47
|
+
? 'border-primary/50 bg-primary-50'
|
|
48
|
+
: 'border-light-200 dark:border-light-300'}"
|
|
47
49
|
>
|
|
48
50
|
<div class="flex flex-col">
|
|
49
|
-
<div class="flex items-center gap-
|
|
50
|
-
<Text fontWeight="bold">{item.title}</Text>
|
|
51
|
+
<div class="flex place-items-center gap-2">
|
|
52
|
+
<Text fontWeight="semi-bold">{item.title}</Text>
|
|
51
53
|
<Icon icon={item.icon} size="1.25rem" class={item.iconClass} />
|
|
52
54
|
</div>
|
|
53
55
|
{#if item.description}
|
|
@@ -58,9 +60,9 @@
|
|
|
58
60
|
>
|
|
59
61
|
{/if}
|
|
60
62
|
<div class="mt-2">
|
|
61
|
-
<Badge
|
|
63
|
+
<Badge color="primary" size="small" shape="round">{item.type}</Badge>
|
|
62
64
|
{#if item.isGlobal}
|
|
63
|
-
<Badge
|
|
65
|
+
<Badge color="warning" size="small" shape="round">Global</Badge>
|
|
64
66
|
{/if}
|
|
65
67
|
</div>
|
|
66
68
|
</div>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import ModalBody from '../Modal/ModalBody.svelte';
|
|
5
5
|
import ModalFooter from '../Modal/ModalFooter.svelte';
|
|
6
6
|
import HStack from '../Stack/HStack.svelte';
|
|
7
|
-
import type { Color } from '../../types.js';
|
|
8
7
|
import { t } from '../../services/translation.svelte.js';
|
|
8
|
+
import type { Color, ModalSize } from '../../types.js';
|
|
9
9
|
import type { Snippet } from 'svelte';
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
confirmText?: string;
|
|
16
16
|
confirmColor?: Color;
|
|
17
17
|
disabled?: boolean;
|
|
18
|
-
size?:
|
|
18
|
+
size?: ModalSize;
|
|
19
19
|
onClose: (confirmed: boolean) => void;
|
|
20
20
|
promptSnippet?: Snippet;
|
|
21
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Color } from '../../types.js';
|
|
1
|
+
import type { Color, ModalSize } from '../../types.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
interface Props {
|
|
4
4
|
title?: string;
|
|
@@ -7,7 +7,7 @@ interface Props {
|
|
|
7
7
|
confirmText?: string;
|
|
8
8
|
confirmColor?: Color;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
-
size?:
|
|
10
|
+
size?: ModalSize;
|
|
11
11
|
onClose: (confirmed: boolean) => void;
|
|
12
12
|
promptSnippet?: Snippet;
|
|
13
13
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import ModalFooter from '../Modal/ModalFooter.svelte';
|
|
6
6
|
import HStack from '../Stack/HStack.svelte';
|
|
7
7
|
import { t } from '../../services/translation.svelte.js';
|
|
8
|
-
import type { Color } from '../../types.js';
|
|
8
|
+
import type { Color, ModalSize } from '../../types.js';
|
|
9
9
|
import { generateId } from '../../utilities/internal.js';
|
|
10
10
|
import type { Snippet } from 'svelte';
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
submitText?: string;
|
|
16
16
|
submitColor?: Color;
|
|
17
17
|
disabled?: boolean;
|
|
18
|
-
size?:
|
|
18
|
+
size?: ModalSize;
|
|
19
19
|
preventDefault?: boolean;
|
|
20
20
|
onClose: () => void;
|
|
21
21
|
onSubmit: (event: SubmitEvent) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Color } from '../../types.js';
|
|
1
|
+
import type { Color, ModalSize } from '../../types.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
type Props = {
|
|
4
4
|
title: string;
|
|
@@ -6,7 +6,7 @@ type Props = {
|
|
|
6
6
|
submitText?: string;
|
|
7
7
|
submitColor?: Color;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
-
size?:
|
|
9
|
+
size?: ModalSize;
|
|
10
10
|
preventDefault?: boolean;
|
|
11
11
|
onClose: () => void;
|
|
12
12
|
onSubmit: (event: SubmitEvent) => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Button from '../../internal/Button.svelte';
|
|
3
2
|
import Icon from '../Icon/Icon.svelte';
|
|
3
|
+
import Button from '../../internal/Button.svelte';
|
|
4
4
|
import type { IconButtonProps } from '../../types.js';
|
|
5
5
|
|
|
6
6
|
const { icon, flipped, flopped, title, 'aria-label': ariaLabel, ...buttonProps }: IconButtonProps = $props();
|
|
7
7
|
|
|
8
|
-
const buttonTitle = $derived(title
|
|
8
|
+
const buttonTitle = $derived(title ?? ariaLabel);
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<Button icon {...buttonProps} title={buttonTitle} aria-label={ariaLabel}>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import CloseButton from '../CloseButton/CloseButton.svelte';
|
|
9
9
|
import Icon from '../Icon/Icon.svelte';
|
|
10
10
|
import Logo from '../Logo/Logo.svelte';
|
|
11
|
+
import TooltipProvider from '../Tooltip/TooltipProvider.svelte';
|
|
11
12
|
import { ChildKey, zIndex } from '../../constants.js';
|
|
12
13
|
import { commandPaletteManager } from '../../services/command-palette-manager.svelte.js';
|
|
13
14
|
import type { ModalSize } from '../../types.js';
|
|
@@ -99,35 +100,37 @@
|
|
|
99
100
|
{interactOutsideBehavior}
|
|
100
101
|
class={cleanClass(modalContentStyles({ size }))}
|
|
101
102
|
>
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
103
|
+
<TooltipProvider>
|
|
104
|
+
<div class={cleanClass('flex w-full grow flex-col justify-center')}>
|
|
105
|
+
<Card bind:ref={cardRef} class={cleanClass(modalStyles({ size }), className)}>
|
|
106
|
+
<CardHeader class="border-b border-gray-200 px-5 py-3 dark:border-white/10">
|
|
107
|
+
{#if headerChildren}
|
|
108
|
+
{@render headerChildren.snippet()}
|
|
109
|
+
{:else if title}
|
|
110
|
+
<div class="flex items-center justify-between gap-2">
|
|
111
|
+
{#if typeof icon === 'string'}
|
|
112
|
+
<Icon {icon} size="1.5rem" aria-hidden />
|
|
113
|
+
{:else if icon}
|
|
114
|
+
<Logo variant="icon" size="tiny" />
|
|
115
|
+
{/if}
|
|
116
|
+
<CardTitle tag="p" class="text-dark/90 grow text-lg font-semibold">{title}</CardTitle>
|
|
117
|
+
<CloseButton class="-me-2" onclick={() => handleClose()} />
|
|
118
|
+
</div>
|
|
119
|
+
{/if}
|
|
120
|
+
</CardHeader>
|
|
119
121
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
<CardBody class="grow px-5">
|
|
123
|
+
{@render bodyChildren?.snippet()}
|
|
124
|
+
</CardBody>
|
|
123
125
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
{#if footerChildren}
|
|
127
|
+
<CardFooter class="border-t border-gray-200 dark:border-white/10">
|
|
128
|
+
{@render footerChildren.snippet()}
|
|
129
|
+
</CardFooter>
|
|
130
|
+
{/if}
|
|
131
|
+
</Card>
|
|
132
|
+
</div>
|
|
133
|
+
</TooltipProvider>
|
|
131
134
|
</Dialog.Content>
|
|
132
135
|
</Dialog.Portal>
|
|
133
136
|
</Dialog.Root>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
const { label, description, readOnly, required, invalid, disabled, ...labelProps } = $derived(getFieldContext());
|
|
23
23
|
|
|
24
24
|
const styles = tv({
|
|
25
|
-
base: 'w-full bg-gray-200 outline-none disabled:cursor-not-allowed disabled:bg-gray-300 disabled:text-gray-400 dark:bg-gray-
|
|
25
|
+
base: 'focus-within:ring-primary dark:focus-within:ring-primary w-full bg-gray-100 ring-1 ring-gray-200 outline-none focus-within:ring-1 disabled:cursor-not-allowed disabled:bg-gray-300 disabled:text-gray-400 dark:bg-gray-800 dark:ring-black dark:disabled:bg-gray-800 dark:disabled:text-gray-200',
|
|
26
26
|
variants: {
|
|
27
27
|
shape: styleVariants.shape,
|
|
28
28
|
padding: {
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
const iconStyles = tv({
|
|
30
|
-
base: 'h-8 w-8 shrink-0 rounded-xl py-1.75',
|
|
30
|
+
base: 'h-8 w-8 shrink-0 rounded-xl py-1.75 text-white',
|
|
31
31
|
variants: {
|
|
32
32
|
color: {
|
|
33
|
-
primary: 'bg-primary
|
|
34
|
-
secondary: 'bg-
|
|
35
|
-
success: 'bg-success
|
|
36
|
-
info: 'bg-info
|
|
37
|
-
warning: 'bg-warning
|
|
38
|
-
danger: 'bg-danger
|
|
33
|
+
primary: 'bg-primary dark:bg-primary-200',
|
|
34
|
+
secondary: 'bg-dark dark:bg-light-300',
|
|
35
|
+
success: 'bg-success dark:bg-success-200',
|
|
36
|
+
info: 'bg-info dark:text-info-50',
|
|
37
|
+
warning: 'bg-warning dark:text-warning-50',
|
|
38
|
+
danger: 'bg-danger dark:text-danger-50',
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { zIndex } from '../../constants.js';
|
|
3
|
+
import { Tooltip } from 'bits-ui';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
import { fly } from 'svelte/transition';
|
|
6
|
+
|
|
7
|
+
type Props = Tooltip.RootProps & {
|
|
8
|
+
text?: string | null;
|
|
9
|
+
child: Snippet<[{ props: Record<string, unknown> }]>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
let { open = $bindable(false), child, text, ...restProps }: Props = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#if text}
|
|
16
|
+
<Tooltip.Root bind:open {...restProps}>
|
|
17
|
+
<Tooltip.Trigger {child} />
|
|
18
|
+
<Tooltip.Portal>
|
|
19
|
+
<Tooltip.Content
|
|
20
|
+
sideOffset={8}
|
|
21
|
+
forceMount
|
|
22
|
+
class="bg-light-800 text-light {zIndex.Tooltip} rounded-lg px-3.5 py-2 text-xs shadow-lg"
|
|
23
|
+
>
|
|
24
|
+
{#snippet child({ wrapperProps, props, open })}
|
|
25
|
+
{#if open}
|
|
26
|
+
<div {...wrapperProps}>
|
|
27
|
+
<div {...props} transition:fly={{ y: 4, duration: 150 }}>
|
|
28
|
+
{text}
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
{/if}
|
|
32
|
+
{/snippet}
|
|
33
|
+
</Tooltip.Content>
|
|
34
|
+
</Tooltip.Portal>
|
|
35
|
+
</Tooltip.Root>
|
|
36
|
+
{:else}
|
|
37
|
+
{@render child({ props: {} })}
|
|
38
|
+
{/if}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Tooltip } from 'bits-ui';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type Props = Tooltip.RootProps & {
|
|
4
|
+
text?: string | null;
|
|
5
|
+
child: Snippet<[{
|
|
6
|
+
props: Record<string, unknown>;
|
|
7
|
+
}]>;
|
|
8
|
+
};
|
|
9
|
+
declare const Tooltip: import("svelte").Component<Props, {}, "open">;
|
|
10
|
+
type Tooltip = ReturnType<typeof Tooltip>;
|
|
11
|
+
export default Tooltip;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Tooltip } from 'bits-ui';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
delayDuration?: number;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const { children, delayDuration }: Props = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Tooltip.Provider disableCloseOnTriggerClick ignoreNonKeyboardFocus {delayDuration}>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</Tooltip.Provider>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type Props = {
|
|
3
|
+
delayDuration?: number;
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const TooltipProvider: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type TooltipProvider = ReturnType<typeof TooltipProvider>;
|
|
8
|
+
export default TooltipProvider;
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ export { default as Toast } from './components/Toast/Toast.svelte';
|
|
|
73
73
|
export { default as ToastContainer } from './components/Toast/ToastContainer.svelte';
|
|
74
74
|
export { default as ToastContent } from './components/Toast/ToastContent.svelte';
|
|
75
75
|
export { default as ToastPanel } from './components/Toast/ToastPanel.svelte';
|
|
76
|
+
export { default as Tooltip } from './components/Tooltip/Tooltip.svelte';
|
|
77
|
+
export { default as TooltipProvider } from './components/Tooltip/TooltipProvider.svelte';
|
|
76
78
|
export * from './services/command-palette-manager.svelte.js';
|
|
77
79
|
export * from './services/menu-manager.svelte.js';
|
|
78
80
|
export * from './services/modal-manager.svelte.js';
|
package/dist/index.js
CHANGED
|
@@ -75,6 +75,8 @@ export { default as Toast } from './components/Toast/Toast.svelte';
|
|
|
75
75
|
export { default as ToastContainer } from './components/Toast/ToastContainer.svelte';
|
|
76
76
|
export { default as ToastContent } from './components/Toast/ToastContent.svelte';
|
|
77
77
|
export { default as ToastPanel } from './components/Toast/ToastPanel.svelte';
|
|
78
|
+
export { default as Tooltip } from './components/Tooltip/Tooltip.svelte';
|
|
79
|
+
export { default as TooltipProvider } from './components/Tooltip/TooltipProvider.svelte';
|
|
78
80
|
// helpers
|
|
79
81
|
export * from './services/command-palette-manager.svelte.js';
|
|
80
82
|
export * from './services/menu-manager.svelte.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Icon from '../components/Icon/Icon.svelte';
|
|
3
3
|
import LoadingSpinner from '../components/LoadingSpinner/LoadingSpinner.svelte';
|
|
4
|
+
import Tooltip from '../components/Tooltip/Tooltip.svelte';
|
|
4
5
|
import { styleVariants } from '../styles.js';
|
|
5
6
|
import type { ButtonProps, Size } from '../types.js';
|
|
6
7
|
import { isExternalLink, resolveUrl } from '../utilities/common.js';
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
leadingIcon,
|
|
28
29
|
trailingIcon,
|
|
29
30
|
icon = false,
|
|
31
|
+
title,
|
|
30
32
|
class: className = '',
|
|
31
33
|
children,
|
|
32
34
|
...restProps
|
|
@@ -149,29 +151,35 @@
|
|
|
149
151
|
{/if}
|
|
150
152
|
{/snippet}
|
|
151
153
|
|
|
152
|
-
{
|
|
153
|
-
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
{
|
|
154
|
+
<Tooltip text={title}>
|
|
155
|
+
{#snippet child({ props })}
|
|
156
|
+
{#if href}
|
|
157
|
+
{@const resolved = resolveUrl(href)}
|
|
158
|
+
{@const external = isExternalLink(resolved)}
|
|
159
|
+
<a
|
|
160
|
+
bind:this={ref}
|
|
161
|
+
{...props}
|
|
162
|
+
href={resolved}
|
|
163
|
+
class={classList}
|
|
164
|
+
aria-disabled={disabled}
|
|
165
|
+
target={external ? '_blank' : undefined}
|
|
166
|
+
rel={external ? 'noopener noreferrer' : undefined}
|
|
167
|
+
{...restProps as HTMLAnchorAttributes}
|
|
168
|
+
>
|
|
169
|
+
{@render wrapper()}
|
|
170
|
+
</a>
|
|
171
|
+
{:else}
|
|
172
|
+
<ButtonPrimitive.Root
|
|
173
|
+
bind:ref
|
|
174
|
+
{...props}
|
|
175
|
+
class={classList}
|
|
176
|
+
type={type as HTMLButtonAttributes['type']}
|
|
177
|
+
{...restProps as HTMLButtonAttributes}
|
|
178
|
+
{disabled}
|
|
179
|
+
aria-disabled={disabled}
|
|
180
|
+
>
|
|
181
|
+
{@render wrapper()}
|
|
182
|
+
</ButtonPrimitive.Root>
|
|
183
|
+
{/if}
|
|
184
|
+
{/snippet}
|
|
185
|
+
</Tooltip>
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
>
|
|
137
137
|
{#snippet children({ selected })}
|
|
138
138
|
<div
|
|
139
|
-
class="flex
|
|
139
|
+
class="flex items-center justify-center gap-2 text-sm font-medium whitespace-nowrap transition-colors"
|
|
140
140
|
>
|
|
141
141
|
<span>{label}</span>
|
|
142
142
|
</div>
|
package/dist/theme/default.css
CHANGED
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
--immich-ui-primary-900: oklch(0.211 0.068 273.01);
|
|
120
120
|
--immich-ui-primary-950: oklch(0.15 0.05 273.01);
|
|
121
121
|
|
|
122
|
-
--immich-ui-success-50: oklch(0.
|
|
122
|
+
--immich-ui-success-50: oklch(0.983 0.0115 162.06);
|
|
123
123
|
--immich-ui-success-100: oklch(0.937 0.109 148.66);
|
|
124
124
|
--immich-ui-success-200: oklch(0.863 0.249 147.5);
|
|
125
125
|
--immich-ui-success-300: oklch(0.813 0.234 147.54);
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
--immich-ui-success-900: oklch(0.252 0.073 147.47);
|
|
132
132
|
--immich-ui-success-950: oklch(0.194 0.056 147.87);
|
|
133
133
|
|
|
134
|
-
--immich-ui-danger-50: oklch(0.
|
|
134
|
+
--immich-ui-danger-50: oklch(0.9747 0.0109 24.32);
|
|
135
135
|
--immich-ui-danger-100: oklch(0.926 0.034 17.84);
|
|
136
136
|
--immich-ui-danger-200: oklch(0.853 0.074 19.77);
|
|
137
137
|
--immich-ui-danger-300: oklch(0.774 0.125 21.53);
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
--immich-ui-danger-900: oklch(0.245 0.094 29.51);
|
|
144
144
|
--immich-ui-danger-950: oklch(0.186 0.07 29.56);
|
|
145
145
|
|
|
146
|
-
--immich-ui-warning: oklch(0.
|
|
146
|
+
--immich-ui-warning: oklch(0.9887 0.0126 86.83);
|
|
147
147
|
--immich-ui-warning-50: oklch(0.983 0.01 58.27);
|
|
148
148
|
--immich-ui-warning-100: oklch(0.959 0.027 63.96);
|
|
149
149
|
--immich-ui-warning-200: oklch(0.925 0.051 64.24);
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
--immich-ui-warning-900: oklch(0.27 0.057 76.33);
|
|
157
157
|
--immich-ui-warning-950: oklch(0.209 0.044 77.51);
|
|
158
158
|
|
|
159
|
-
--immich-ui-info-50: oklch(0.
|
|
159
|
+
--immich-ui-info-50: oklch(0.9801 0.0096 252.81);
|
|
160
160
|
--immich-ui-info-100: oklch(0.922 0.036 268.3);
|
|
161
161
|
--immich-ui-info-200: oklch(0.845 0.073 265.19);
|
|
162
162
|
--immich-ui-info-300: oklch(0.769 0.114 261.53);
|
package/dist/utilities/common.js
CHANGED
|
@@ -24,7 +24,14 @@ export const resolveUrl = (url, currentHostname) => {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
export const isExternalLink = (href) => {
|
|
27
|
-
|
|
27
|
+
try {
|
|
28
|
+
const current = new URL(globalThis.location.href);
|
|
29
|
+
const target = new URL(href, current);
|
|
30
|
+
return target.origin !== current.origin;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
28
35
|
};
|
|
29
36
|
export const isMenuItemType = (item) => {
|
|
30
37
|
return item === MenuItemType.Divider;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@immich/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"license": "GNU Affero General Public License version 3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@mdi/js": "^7.4.47",
|
|
52
52
|
"bits-ui": "^2.9.8",
|
|
53
53
|
"luxon": "^3.7.2",
|
|
54
|
-
"simple-icons": "^
|
|
54
|
+
"simple-icons": "^16.0.0",
|
|
55
55
|
"svelte-highlight": "^7.8.4",
|
|
56
56
|
"tailwind-merge": "^3.0.0",
|
|
57
57
|
"tailwind-variants": "^3.0.0",
|