@immich/ui 0.14.2 → 0.16.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/common/context.svelte.d.ts +8 -1
- package/dist/common/context.svelte.js +4 -1
- package/dist/components/Alert/Alert.svelte +5 -3
- package/dist/components/Alert/Alert.svelte.d.ts +4 -2
- package/dist/components/AppShell/AppShell.svelte.d.ts +4 -2
- package/dist/components/AppShell/AppShellHeader.svelte.d.ts +4 -2
- package/dist/components/AppShell/AppShellSidebar.svelte +1 -0
- package/dist/components/AppShell/AppShellSidebar.svelte.d.ts +4 -2
- package/dist/components/AppShell/PageLayout.svelte.d.ts +4 -2
- package/dist/components/Avatar/Avatar.svelte.d.ts +5 -3
- package/dist/components/Button/Button.svelte.d.ts +1 -0
- package/dist/components/Card/Card.svelte +3 -11
- package/dist/components/Card/Card.svelte.d.ts +5 -3
- package/dist/components/Card/CardBody.svelte.d.ts +4 -2
- package/dist/components/Card/CardDescription.svelte.d.ts +4 -2
- package/dist/components/Card/CardFooter.svelte.d.ts +4 -2
- package/dist/components/Card/CardHeader.svelte.d.ts +4 -2
- package/dist/components/Card/CardTitle.svelte.d.ts +4 -2
- package/dist/components/CloseButton/CloseButton.svelte +1 -1
- package/dist/components/CloseButton/CloseButton.svelte.d.ts +1 -0
- package/dist/components/Code/Code.svelte.d.ts +5 -3
- package/dist/components/Container/Container.svelte +33 -0
- package/dist/components/Container/Container.svelte.d.ts +11 -0
- package/dist/components/Form/Checkbox.svelte +4 -21
- package/dist/components/Form/Checkbox.svelte.d.ts +5 -3
- package/dist/components/Form/Field.svelte +3 -2
- package/dist/components/Form/Field.svelte.d.ts +5 -2
- package/dist/components/Form/HelperText.svelte.d.ts +4 -2
- package/dist/components/Form/Input.svelte +14 -23
- package/dist/components/Form/Input.svelte.d.ts +1 -0
- package/dist/components/Form/PasswordInput.svelte +6 -3
- package/dist/components/Form/PasswordInput.svelte.d.ts +1 -0
- package/dist/components/FormatBytes/FormatBytes.svelte.d.ts +5 -3
- package/dist/components/Heading/Heading.svelte.d.ts +4 -2
- package/dist/components/Icon/Icon.svelte.d.ts +3 -1
- package/dist/components/IconButton/IconButton.svelte +12 -3
- package/dist/components/IconButton/IconButton.svelte.d.ts +1 -0
- package/dist/components/Kbd/Kbd.svelte.d.ts +4 -2
- package/dist/components/Label/Label.svelte +12 -0
- package/dist/components/Label/Label.svelte.d.ts +4 -0
- package/dist/components/Link/Link.svelte.d.ts +4 -2
- package/dist/components/LoadingSpinner/LoadingSpinner.svelte.d.ts +4 -2
- package/dist/components/Logo/Logo.svelte.d.ts +6 -4
- package/dist/components/Modal/Modal.svelte +10 -9
- package/dist/components/Modal/Modal.svelte.d.ts +4 -7
- package/dist/components/Modal/ModalBody.svelte.d.ts +4 -2
- package/dist/components/Modal/ModalFooter.svelte.d.ts +4 -2
- package/dist/components/Modal/ModalHeader.svelte.d.ts +4 -2
- package/dist/components/MultiSelect/MultiSelect.svelte.d.ts +1 -0
- package/dist/components/Navbar/NavbarGroup.svelte.d.ts +4 -2
- package/dist/components/Navbar/NavbarItem.svelte +2 -2
- package/dist/components/Navbar/NavbarItem.svelte.d.ts +6 -4
- package/dist/components/Scrollable/Scrollable.svelte.d.ts +4 -2
- package/dist/components/Select/Select.svelte.d.ts +1 -0
- package/dist/components/Stack/HStack.svelte.d.ts +1 -0
- package/dist/components/Stack/Stack.svelte.d.ts +1 -0
- package/dist/components/Stack/VStack.svelte.d.ts +1 -0
- package/dist/components/SupporterBadge/SupporterBadge.svelte.d.ts +5 -3
- package/dist/components/Switch/Switch.svelte +20 -12
- package/dist/components/Switch/Switch.svelte.d.ts +5 -2
- package/dist/components/Text/Text.svelte.d.ts +6 -4
- package/dist/components/ThemeSwitcher/ThemeSwitcher.svelte +13 -1
- package/dist/components/ThemeSwitcher/ThemeSwitcher.svelte.d.ts +6 -3
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/internal/Button.svelte +35 -10
- package/dist/internal/Button.svelte.d.ts +4 -2
- package/dist/internal/Child.svelte.d.ts +4 -2
- package/dist/internal/Select.svelte +5 -22
- package/dist/internal/Select.svelte.d.ts +8 -5
- package/dist/services/translation.svelte.d.ts +1 -0
- package/dist/services/translation.svelte.js +1 -0
- package/dist/styles.d.ts +122 -0
- package/dist/styles.js +24 -0
- package/dist/types.d.ts +13 -2
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/components/Form/Label.svelte +0 -19
- package/dist/components/Form/Label.svelte.d.ts +0 -3
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
import Input from '../components/Form/Input.svelte';
|
|
5
5
|
import Icon from '../components/Icon/Icon.svelte';
|
|
6
6
|
import IconButton from '../components/IconButton/IconButton.svelte';
|
|
7
|
+
import Label from '../components/Label/Label.svelte';
|
|
7
8
|
import type { SelectCommonProps, SelectItem } from '../types.js';
|
|
8
9
|
import { cleanClass, generateId } from '../utils.js';
|
|
9
10
|
import { mdiArrowDown, mdiArrowUp, mdiCheck, mdiUnfoldMoreHorizontal } from '@mdi/js';
|
|
10
11
|
import { Select } from 'bits-ui';
|
|
11
|
-
import { tv } from 'tailwind-variants';
|
|
12
12
|
|
|
13
13
|
type T = SelectItem;
|
|
14
14
|
|
|
@@ -45,26 +45,8 @@
|
|
|
45
45
|
|
|
46
46
|
const options = $derived(asOptions(data));
|
|
47
47
|
|
|
48
|
-
const {
|
|
49
|
-
|
|
50
|
-
readOnly = false,
|
|
51
|
-
required = false,
|
|
52
|
-
invalid = false,
|
|
53
|
-
disabled = false,
|
|
54
|
-
} = $derived(getFieldContext());
|
|
55
|
-
|
|
56
|
-
const labelStyles = tv({
|
|
57
|
-
base: '',
|
|
58
|
-
variants: {
|
|
59
|
-
size: {
|
|
60
|
-
tiny: 'text-xs',
|
|
61
|
-
small: 'text-sm',
|
|
62
|
-
medium: 'text-md',
|
|
63
|
-
large: 'text-lg',
|
|
64
|
-
giant: 'text-xl',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
});
|
|
48
|
+
const { readOnly, required, invalid, disabled, label, ...labelProps } =
|
|
49
|
+
$derived(getFieldContext());
|
|
68
50
|
|
|
69
51
|
const id = generateId();
|
|
70
52
|
const inputId = `input-${id}`;
|
|
@@ -95,7 +77,7 @@
|
|
|
95
77
|
|
|
96
78
|
<div class={cleanClass('flex flex-col gap-1', className)} bind:this={ref}>
|
|
97
79
|
{#if label}
|
|
98
|
-
<
|
|
80
|
+
<Label id={labelId} for={inputId} {label} {...labelProps} />
|
|
99
81
|
{/if}
|
|
100
82
|
|
|
101
83
|
<Select.Root type={multiple ? 'multiple' : 'single'} {onValueChange}>
|
|
@@ -125,6 +107,7 @@
|
|
|
125
107
|
class="m-1"
|
|
126
108
|
icon={mdiUnfoldMoreHorizontal}
|
|
127
109
|
{disabled}
|
|
110
|
+
aria-label="Expand"
|
|
128
111
|
/>
|
|
129
112
|
{/snippet}
|
|
130
113
|
</Input>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { SelectCommonProps, SelectItem } from '../types.js';
|
|
2
2
|
import { Select } from 'bits-ui';
|
|
3
|
-
|
|
3
|
+
type T = SelectItem;
|
|
4
|
+
type Props = {
|
|
4
5
|
multiple?: boolean;
|
|
5
|
-
values?:
|
|
6
|
-
asLabel?: (items:
|
|
7
|
-
onChange?: (values:
|
|
8
|
-
} & SelectCommonProps<
|
|
6
|
+
values?: T[];
|
|
7
|
+
asLabel?: (items: T[]) => string;
|
|
8
|
+
onChange?: (values: T[]) => void;
|
|
9
|
+
} & SelectCommonProps<T>;
|
|
10
|
+
declare const Select: import("svelte").Component<Props, {}, "values">;
|
|
11
|
+
type Select = ReturnType<typeof Select>;
|
|
9
12
|
export default Select;
|
|
@@ -3,6 +3,7 @@ declare const defaultTranslations: {
|
|
|
3
3
|
close: string;
|
|
4
4
|
showPassword: string;
|
|
5
5
|
hidePassword: string;
|
|
6
|
+
darkTheme: string;
|
|
6
7
|
};
|
|
7
8
|
export type Translations = typeof defaultTranslations;
|
|
8
9
|
export declare const translate: <T extends keyof Translations>(key: T, overrides?: TranslationProps<T>) => string;
|
|
@@ -2,6 +2,7 @@ const defaultTranslations = {
|
|
|
2
2
|
close: 'Close',
|
|
3
3
|
showPassword: 'Show password',
|
|
4
4
|
hidePassword: 'Hide password',
|
|
5
|
+
darkTheme: 'Toggle dark theme',
|
|
5
6
|
};
|
|
6
7
|
let translations = $state(defaultTranslations);
|
|
7
8
|
export const translate = (key, overrides) => overrides?.[key] ?? translations[key];
|
package/dist/styles.d.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
label: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
size: {
|
|
4
|
+
tiny: string;
|
|
5
|
+
small: string;
|
|
6
|
+
medium: string;
|
|
7
|
+
large: string;
|
|
8
|
+
giant: string;
|
|
9
|
+
};
|
|
10
|
+
color: {
|
|
11
|
+
muted: string;
|
|
12
|
+
primary: string;
|
|
13
|
+
secondary: string;
|
|
14
|
+
success: string;
|
|
15
|
+
danger: string;
|
|
16
|
+
warning: string;
|
|
17
|
+
info: string;
|
|
18
|
+
};
|
|
19
|
+
}, undefined, "", import("tailwind-variants/dist/config").TVConfig<{
|
|
20
|
+
size: {
|
|
21
|
+
tiny: string;
|
|
22
|
+
small: string;
|
|
23
|
+
medium: string;
|
|
24
|
+
large: string;
|
|
25
|
+
giant: string;
|
|
26
|
+
};
|
|
27
|
+
color: {
|
|
28
|
+
muted: string;
|
|
29
|
+
primary: string;
|
|
30
|
+
secondary: string;
|
|
31
|
+
success: string;
|
|
32
|
+
danger: string;
|
|
33
|
+
warning: string;
|
|
34
|
+
info: string;
|
|
35
|
+
};
|
|
36
|
+
}, {
|
|
37
|
+
size: {
|
|
38
|
+
tiny: string;
|
|
39
|
+
small: string;
|
|
40
|
+
medium: string;
|
|
41
|
+
large: string;
|
|
42
|
+
giant: string;
|
|
43
|
+
};
|
|
44
|
+
color: {
|
|
45
|
+
muted: string;
|
|
46
|
+
primary: string;
|
|
47
|
+
secondary: string;
|
|
48
|
+
success: string;
|
|
49
|
+
danger: string;
|
|
50
|
+
warning: string;
|
|
51
|
+
info: string;
|
|
52
|
+
};
|
|
53
|
+
}>, {
|
|
54
|
+
size: {
|
|
55
|
+
tiny: string;
|
|
56
|
+
small: string;
|
|
57
|
+
medium: string;
|
|
58
|
+
large: string;
|
|
59
|
+
giant: string;
|
|
60
|
+
};
|
|
61
|
+
color: {
|
|
62
|
+
muted: string;
|
|
63
|
+
primary: string;
|
|
64
|
+
secondary: string;
|
|
65
|
+
success: string;
|
|
66
|
+
danger: string;
|
|
67
|
+
warning: string;
|
|
68
|
+
info: string;
|
|
69
|
+
};
|
|
70
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
71
|
+
size: {
|
|
72
|
+
tiny: string;
|
|
73
|
+
small: string;
|
|
74
|
+
medium: string;
|
|
75
|
+
large: string;
|
|
76
|
+
giant: string;
|
|
77
|
+
};
|
|
78
|
+
color: {
|
|
79
|
+
muted: string;
|
|
80
|
+
primary: string;
|
|
81
|
+
secondary: string;
|
|
82
|
+
success: string;
|
|
83
|
+
danger: string;
|
|
84
|
+
warning: string;
|
|
85
|
+
info: string;
|
|
86
|
+
};
|
|
87
|
+
}, undefined, "", import("tailwind-variants/dist/config").TVConfig<{
|
|
88
|
+
size: {
|
|
89
|
+
tiny: string;
|
|
90
|
+
small: string;
|
|
91
|
+
medium: string;
|
|
92
|
+
large: string;
|
|
93
|
+
giant: string;
|
|
94
|
+
};
|
|
95
|
+
color: {
|
|
96
|
+
muted: string;
|
|
97
|
+
primary: string;
|
|
98
|
+
secondary: string;
|
|
99
|
+
success: string;
|
|
100
|
+
danger: string;
|
|
101
|
+
warning: string;
|
|
102
|
+
info: string;
|
|
103
|
+
};
|
|
104
|
+
}, {
|
|
105
|
+
size: {
|
|
106
|
+
tiny: string;
|
|
107
|
+
small: string;
|
|
108
|
+
medium: string;
|
|
109
|
+
large: string;
|
|
110
|
+
giant: string;
|
|
111
|
+
};
|
|
112
|
+
color: {
|
|
113
|
+
muted: string;
|
|
114
|
+
primary: string;
|
|
115
|
+
secondary: string;
|
|
116
|
+
success: string;
|
|
117
|
+
danger: string;
|
|
118
|
+
warning: string;
|
|
119
|
+
info: string;
|
|
120
|
+
};
|
|
121
|
+
}>, unknown, unknown, undefined>>;
|
|
122
|
+
};
|
package/dist/styles.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
export const styles = {
|
|
3
|
+
label: tv({
|
|
4
|
+
base: '',
|
|
5
|
+
variants: {
|
|
6
|
+
size: {
|
|
7
|
+
tiny: 'text-xs',
|
|
8
|
+
small: 'text-sm',
|
|
9
|
+
medium: 'text-md',
|
|
10
|
+
large: 'text-lg',
|
|
11
|
+
giant: 'text-xl',
|
|
12
|
+
},
|
|
13
|
+
color: {
|
|
14
|
+
muted: 'text-gray-600 dark:text-gray-400',
|
|
15
|
+
primary: 'text-primary',
|
|
16
|
+
secondary: 'text-dark',
|
|
17
|
+
success: 'text-success',
|
|
18
|
+
danger: 'text-danger',
|
|
19
|
+
warning: 'text-warning',
|
|
20
|
+
info: 'text-info',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Translations } from './services/translation.svelte.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { HTMLAnchorAttributes, HTMLButtonAttributes, HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes, HTMLInputAttributes, HTMLLabelAttributes } from 'svelte/elements';
|
|
4
4
|
export type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
5
5
|
export type TextColor = Color | 'muted';
|
|
6
6
|
export type HeadingColor = TextColor;
|
|
7
7
|
export type Size = 'tiny' | 'small' | 'medium' | 'large' | 'giant';
|
|
8
8
|
export type ModalSize = Size | 'full';
|
|
9
|
+
export type ContainerSize = ModalSize;
|
|
9
10
|
export type HeadingSize = Size | 'title';
|
|
10
11
|
export type Shape = 'rectangle' | 'semi-round' | 'round';
|
|
11
12
|
export type Variants = 'filled' | 'outline' | 'ghost';
|
|
@@ -46,6 +47,8 @@ type ButtonBase = {
|
|
|
46
47
|
export type ButtonProps = ButtonBase & {
|
|
47
48
|
fullWidth?: boolean;
|
|
48
49
|
loading?: boolean;
|
|
50
|
+
leadingIcon?: string;
|
|
51
|
+
trailingIcon?: string;
|
|
49
52
|
} & ButtonOrAnchor;
|
|
50
53
|
export type CloseButtonProps = {
|
|
51
54
|
size?: Size;
|
|
@@ -57,6 +60,7 @@ export type IconButtonProps = ButtonBase & {
|
|
|
57
60
|
icon: string;
|
|
58
61
|
flipped?: boolean;
|
|
59
62
|
flopped?: boolean;
|
|
63
|
+
'aria-label': string;
|
|
60
64
|
} & ButtonOrAnchor;
|
|
61
65
|
type StackBaseProps = {
|
|
62
66
|
class?: string;
|
|
@@ -76,13 +80,20 @@ export type StackProps = StackBaseProps & {
|
|
|
76
80
|
};
|
|
77
81
|
export type HStackProps = StackBaseProps;
|
|
78
82
|
export type VStackProps = StackBaseProps;
|
|
83
|
+
export type LabelProps = {
|
|
84
|
+
label?: string;
|
|
85
|
+
class?: string;
|
|
86
|
+
size?: Size;
|
|
87
|
+
color?: TextColor;
|
|
88
|
+
children?: Snippet;
|
|
89
|
+
} & HTMLLabelAttributes;
|
|
79
90
|
export type FieldContext = {
|
|
80
91
|
label?: string;
|
|
81
92
|
invalid?: boolean;
|
|
82
93
|
disabled?: boolean;
|
|
83
94
|
required?: boolean;
|
|
84
95
|
readOnly?: boolean;
|
|
85
|
-
};
|
|
96
|
+
} & LabelProps;
|
|
86
97
|
type BaseInputProps = {
|
|
87
98
|
class?: string;
|
|
88
99
|
value?: string;
|
package/dist/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cleanClass } from '../../utils.js';
|
|
3
|
-
import { Label as LabelPrimitive } from 'bits-ui';
|
|
4
|
-
|
|
5
|
-
let {
|
|
6
|
-
ref = $bindable(null),
|
|
7
|
-
class: className,
|
|
8
|
-
...restProps
|
|
9
|
-
}: LabelPrimitive.RootProps = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<LabelPrimitive.Root
|
|
13
|
-
bind:ref
|
|
14
|
-
class={cleanClass(
|
|
15
|
-
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
|
|
16
|
-
className,
|
|
17
|
-
)}
|
|
18
|
-
{...restProps}
|
|
19
|
-
/>
|