@immich/ui 0.57.3 → 0.58.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/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/MultiSelect/MultiSelect.svelte +2 -4
- package/dist/components/MultiSelect/MultiSelect.svelte.d.ts +24 -3
- package/dist/components/Select/Select.svelte +2 -4
- package/dist/components/Select/Select.svelte.d.ts +24 -3
- 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/Select.svelte +8 -12
- package/dist/internal/Select.svelte.d.ts +28 -9
- 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 +11 -11
- 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;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts" generics="T extends string">
|
|
2
2
|
import InternalSelect from '../../internal/Select.svelte';
|
|
3
3
|
import type { MultiSelectProps, SelectItem } from '../../types.js';
|
|
4
4
|
|
|
5
|
-
type T = SelectItem;
|
|
6
|
-
|
|
7
5
|
let { onChange, values = $bindable([]), ...restProps }: MultiSelectProps<T> = $props();
|
|
8
6
|
|
|
9
|
-
const handleChange = (items: T[]) => {
|
|
7
|
+
const handleChange = (items: SelectItem<T>[]) => {
|
|
10
8
|
onChange?.(items);
|
|
11
9
|
};
|
|
12
10
|
</script>
|
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
import type { MultiSelectProps
|
|
2
|
-
declare
|
|
3
|
-
|
|
1
|
+
import type { MultiSelectProps } from '../../types.js';
|
|
2
|
+
declare function $$render<T extends string>(): {
|
|
3
|
+
props: MultiSelectProps<T>;
|
|
4
|
+
exports: {};
|
|
5
|
+
bindings: "values";
|
|
6
|
+
slots: {};
|
|
7
|
+
events: {};
|
|
8
|
+
};
|
|
9
|
+
declare class __sveltets_Render<T extends string> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
13
|
+
bindings(): "values";
|
|
14
|
+
exports(): {};
|
|
15
|
+
}
|
|
16
|
+
interface $$IsomorphicComponent {
|
|
17
|
+
new <T extends string>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
+
<T extends string>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
22
|
+
}
|
|
23
|
+
declare const MultiSelect: $$IsomorphicComponent;
|
|
24
|
+
type MultiSelect<T extends string> = InstanceType<typeof MultiSelect<T>>;
|
|
4
25
|
export default MultiSelect;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts" generics="T extends string">
|
|
2
2
|
import InternalSelect from '../../internal/Select.svelte';
|
|
3
3
|
import type { SelectItem, SelectProps } from '../../types.js';
|
|
4
4
|
|
|
5
|
-
type T = SelectItem;
|
|
6
|
-
|
|
7
5
|
let { onChange, value = $bindable(), ...restProps }: SelectProps<T> = $props();
|
|
8
6
|
|
|
9
7
|
let values = $derived(value ? [value] : []);
|
|
10
8
|
|
|
11
|
-
const handleChange = (items: T[]) => {
|
|
9
|
+
const handleChange = (items: SelectItem<T>[]) => {
|
|
12
10
|
value = items[0];
|
|
13
11
|
onChange?.(value);
|
|
14
12
|
};
|
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare
|
|
3
|
-
|
|
1
|
+
import type { SelectProps } from '../../types.js';
|
|
2
|
+
declare function $$render<T extends string>(): {
|
|
3
|
+
props: SelectProps<T>;
|
|
4
|
+
exports: {};
|
|
5
|
+
bindings: "value";
|
|
6
|
+
slots: {};
|
|
7
|
+
events: {};
|
|
8
|
+
};
|
|
9
|
+
declare class __sveltets_Render<T extends string> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
13
|
+
bindings(): "value";
|
|
14
|
+
exports(): {};
|
|
15
|
+
}
|
|
16
|
+
interface $$IsomorphicComponent {
|
|
17
|
+
new <T extends string>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
+
<T extends string>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
22
|
+
}
|
|
23
|
+
declare const Select: $$IsomorphicComponent;
|
|
24
|
+
type Select<T extends string> = InstanceType<typeof Select<T>>;
|
|
4
25
|
export default Select;
|
|
@@ -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';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts" generics="T extends string">
|
|
2
2
|
import { getFieldContext } from '../common/context.svelte.js';
|
|
3
3
|
import Icon from '../components/Icon/Icon.svelte';
|
|
4
4
|
import IconButton from '../components/IconButton/IconButton.svelte';
|
|
@@ -10,13 +10,11 @@
|
|
|
10
10
|
import { Select } from 'bits-ui';
|
|
11
11
|
import { tv } from 'tailwind-variants';
|
|
12
12
|
|
|
13
|
-
type T = SelectItem;
|
|
14
|
-
|
|
15
13
|
type Props = {
|
|
16
14
|
multiple?: boolean;
|
|
17
|
-
values: T[];
|
|
18
|
-
asLabel?: (items: T[]) => string;
|
|
19
|
-
onChange?: (values: T[]) => void;
|
|
15
|
+
values: SelectItem<T>[];
|
|
16
|
+
asLabel?: (items: SelectItem<T>[]) => string;
|
|
17
|
+
onChange?: (values: SelectItem<T>[]) => void;
|
|
20
18
|
} & SelectCommonProps<T>;
|
|
21
19
|
|
|
22
20
|
let {
|
|
@@ -26,15 +24,15 @@
|
|
|
26
24
|
multiple = false,
|
|
27
25
|
values = $bindable([]),
|
|
28
26
|
onChange,
|
|
29
|
-
asLabel = (options: T[]) => options.map(({ label }) => label).join(', '),
|
|
27
|
+
asLabel = (options: SelectItem<T>[]) => options.map(({ label }) => label).join(', '),
|
|
30
28
|
placeholder,
|
|
31
29
|
class: className,
|
|
32
30
|
}: Props = $props();
|
|
33
31
|
|
|
34
|
-
const asOptions = (items: string[] | T[]) => {
|
|
32
|
+
const asOptions = (items: string[] | SelectItem<T>[]) => {
|
|
35
33
|
return items.map((item) => {
|
|
36
34
|
if (typeof item === 'string') {
|
|
37
|
-
return { value: item, label: item } as T
|
|
35
|
+
return { value: item, label: item } as SelectItem<T>;
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
const label = item.label ?? item.value;
|
|
@@ -73,9 +71,7 @@
|
|
|
73
71
|
const findOption = (value: string) => options.find((option) => option.value === value);
|
|
74
72
|
|
|
75
73
|
const onValueChange = (items: string[] | string) => {
|
|
76
|
-
values =
|
|
77
|
-
? ((items as string[]).map(findOption) as T[])
|
|
78
|
-
: [findOption(items as string) as T].filter(Boolean);
|
|
74
|
+
values = (Array.isArray(items) ? items : [items]).map(findOption).filter((item) => item !== undefined);
|
|
79
75
|
|
|
80
76
|
onChange?.(values);
|
|
81
77
|
};
|
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
import type { SelectCommonProps, SelectItem } from '../types.js';
|
|
2
2
|
import { Select } from 'bits-ui';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} & SelectCommonProps<T>;
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
declare function $$render<T extends string>(): {
|
|
4
|
+
props: {
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
values: SelectItem<T>[];
|
|
7
|
+
asLabel?: (items: SelectItem<T>[]) => string;
|
|
8
|
+
onChange?: (values: SelectItem<T>[]) => void;
|
|
9
|
+
} & SelectCommonProps<T>;
|
|
10
|
+
exports: {};
|
|
11
|
+
bindings: "values";
|
|
12
|
+
slots: {};
|
|
13
|
+
events: {};
|
|
14
|
+
};
|
|
15
|
+
declare class __sveltets_Render<T extends string> {
|
|
16
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
17
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
18
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
19
|
+
bindings(): "values";
|
|
20
|
+
exports(): {};
|
|
21
|
+
}
|
|
22
|
+
interface $$IsomorphicComponent {
|
|
23
|
+
new <T extends string>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
24
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
25
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
26
|
+
<T extends string>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
27
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
28
|
+
}
|
|
29
|
+
declare const Select: $$IsomorphicComponent;
|
|
30
|
+
type Select<T extends string> = InstanceType<typeof Select<T>>;
|
|
12
31
|
export default Select;
|
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';
|
|
@@ -152,25 +152,25 @@ export type TextareaProps = {
|
|
|
152
152
|
shape?: Shape;
|
|
153
153
|
grow?: boolean;
|
|
154
154
|
} & HTMLTextareaAttributes;
|
|
155
|
-
export type SelectItem = {
|
|
155
|
+
export type SelectItem<T extends string = string> = {
|
|
156
156
|
label?: string;
|
|
157
|
-
value:
|
|
157
|
+
value: T;
|
|
158
158
|
disabled?: boolean;
|
|
159
159
|
};
|
|
160
|
-
export type SelectCommonProps<T extends
|
|
161
|
-
data: string[] | T[];
|
|
160
|
+
export type SelectCommonProps<T extends string> = {
|
|
161
|
+
data: string[] | SelectItem<T>[];
|
|
162
162
|
size?: Size;
|
|
163
163
|
shape?: Shape;
|
|
164
164
|
placeholder?: string;
|
|
165
165
|
class?: string;
|
|
166
166
|
};
|
|
167
|
-
export type SelectProps<T extends
|
|
168
|
-
value?: T
|
|
169
|
-
onChange?: (value: T) => void;
|
|
167
|
+
export type SelectProps<T extends string> = SelectCommonProps<T> & {
|
|
168
|
+
value?: SelectItem<T>;
|
|
169
|
+
onChange?: (value: SelectItem<T>) => void;
|
|
170
170
|
};
|
|
171
|
-
export type MultiSelectProps<T extends
|
|
172
|
-
values?: T[];
|
|
173
|
-
onChange?: (values: T[]) => void;
|
|
171
|
+
export type MultiSelectProps<T extends string> = SelectCommonProps<T> & {
|
|
172
|
+
values?: SelectItem<T>[];
|
|
173
|
+
onChange?: (values: SelectItem<T>[]) => void;
|
|
174
174
|
};
|
|
175
175
|
export type ToastId = {
|
|
176
176
|
id: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@immich/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.1",
|
|
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",
|