@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.
- package/README.md +9 -17
- package/dist/actions/shortcut.js +1 -1
- package/dist/components/Alert/Alert.svelte +92 -94
- package/dist/components/AppShell/AppShell.svelte +26 -26
- package/dist/components/AppShell/AppShellHeader.svelte +8 -8
- package/dist/components/AppShell/AppShellSidebar.svelte +20 -20
- package/dist/components/AppShell/PageLayout.svelte +29 -35
- package/dist/components/Avatar/Avatar.svelte +45 -55
- package/dist/components/Button/Button.svelte +3 -3
- package/dist/components/Card/Card.svelte +131 -135
- package/dist/components/Card/CardBody.svelte +9 -9
- package/dist/components/Card/CardDescription.svelte +9 -9
- package/dist/components/Card/CardFooter.svelte +9 -9
- package/dist/components/Card/CardHeader.svelte +9 -9
- package/dist/components/Card/CardTitle.svelte +14 -14
- package/dist/components/Checkbox/Checkbox.svelte +109 -110
- package/dist/components/CloseButton/CloseButton.svelte +12 -17
- package/dist/components/Code/Code.svelte +58 -65
- package/dist/components/CommandPalette/CommandPalette.svelte +126 -131
- package/dist/components/CommandPalette/CommandPaletteItem.svelte +61 -61
- package/dist/components/ConfirmModal/ConfirmModal.svelte +48 -48
- package/dist/components/Container/Container.svelte +25 -25
- package/dist/components/Field/Field.svelte +21 -21
- package/dist/components/FormatBytes/FormatBytes.svelte +9 -9
- package/dist/components/Heading/Heading.svelte +41 -47
- package/dist/components/HelperText/HelperText.svelte +17 -17
- package/dist/components/Icon/Icon.svelte +37 -42
- package/dist/components/IconButton/IconButton.svelte +6 -13
- package/dist/components/Input/Input.svelte +149 -152
- package/dist/components/Kbd/Kbd.svelte +25 -25
- package/dist/components/Label/Label.svelte +6 -6
- package/dist/components/Link/Link.svelte +18 -25
- package/dist/components/LoadingSpinner/LoadingSpinner.svelte +46 -46
- package/dist/components/Logo/Logo.svelte +53 -53
- package/dist/components/Modal/Modal.svelte +110 -114
- package/dist/components/Modal/ModalBody.svelte +8 -8
- package/dist/components/Modal/ModalFooter.svelte +8 -8
- package/dist/components/Modal/ModalHeader.svelte +8 -8
- package/dist/components/MultiSelect/MultiSelect.svelte +7 -7
- package/dist/components/Navbar/NavbarGroup.svelte +5 -5
- package/dist/components/Navbar/NavbarItem.svelte +59 -61
- package/dist/components/PasswordInput/PasswordInput.svelte +29 -31
- package/dist/components/Scrollable/Scrollable.svelte +49 -49
- package/dist/components/Select/Select.svelte +9 -9
- package/dist/components/Stack/HStack.svelte +4 -4
- package/dist/components/Stack/Stack.svelte +62 -62
- package/dist/components/Stack/VStack.svelte +4 -4
- package/dist/components/SupporterBadge/SupporterBadge.svelte +80 -80
- package/dist/components/Switch/Switch.svelte +95 -96
- package/dist/components/Text/Text.svelte +27 -34
- package/dist/components/Textarea/Textarea.svelte +103 -104
- package/dist/components/ThemeSwitcher/ThemeSwitcher.svelte +30 -43
- package/dist/internal/Button.svelte +177 -177
- package/dist/internal/Child.svelte +21 -21
- package/dist/internal/Select.svelte +151 -158
- package/dist/internal/Text.svelte +42 -50
- package/dist/site/SiteFooter.svelte +60 -76
- package/dist/site/SiteFooterLink.svelte +14 -14
- package/dist/theme/default.css +40 -40
- package/dist/utilities/byte-units.js +2 -13
- package/package.json +77 -77
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
2
|
+
import { getBytesWithUnit } from '../../utilities/byte-units.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
type Props = {
|
|
5
|
+
bytes: number;
|
|
6
|
+
precision?: number;
|
|
7
|
+
variant?: 'short' | 'narrow';
|
|
8
|
+
};
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const { bytes, precision, variant = 'short' }: Props = $props();
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const [value, unit] = $derived(getBytesWithUnit(bytes, precision));
|
|
13
|
+
const separator = $derived(variant === 'narrow' ? '' : ' ');
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<span>{value}{separator}{unit}</span>
|
|
@@ -1,57 +1,51 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from '../../types.js';
|
|
9
|
-
import { cleanClass } from '../../utils.js';
|
|
10
|
-
import Text from '../../internal/Text.svelte';
|
|
11
|
-
import type { Snippet } from 'svelte';
|
|
12
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
13
|
-
import { tv } from 'tailwind-variants';
|
|
2
|
+
import type { FontWeight, HeadingColor, HeadingSize, HeadingTag, TextVariant } from '../../types.js';
|
|
3
|
+
import { cleanClass } from '../../utils.js';
|
|
4
|
+
import Text from '../../internal/Text.svelte';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
7
|
+
import { tv } from 'tailwind-variants';
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
type Props = {
|
|
10
|
+
/**
|
|
11
|
+
* The HTML element type.
|
|
12
|
+
*/
|
|
13
|
+
tag?: HeadingTag;
|
|
14
|
+
size?: HeadingSize;
|
|
15
|
+
color?: HeadingColor;
|
|
16
|
+
fontWeight?: FontWeight;
|
|
17
|
+
variant?: TextVariant;
|
|
18
|
+
class?: string;
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
children: Snippet;
|
|
21
|
+
} & HTMLAttributes<HTMLElement>;
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
const {
|
|
24
|
+
tag = 'p',
|
|
25
|
+
size = 'medium',
|
|
26
|
+
fontWeight = 'semi-bold',
|
|
27
|
+
class: className,
|
|
28
|
+
children,
|
|
29
|
+
...restProps
|
|
30
|
+
}: Props = $props();
|
|
37
31
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
32
|
+
const styles = tv({
|
|
33
|
+
base: 'leading-none tracking-tight',
|
|
34
|
+
variants: {
|
|
35
|
+
size: {
|
|
36
|
+
tiny: 'text-lg',
|
|
37
|
+
small: 'text-xl',
|
|
38
|
+
medium: 'text-2xl',
|
|
39
|
+
large: 'text-3xl',
|
|
40
|
+
giant: 'text-4xl',
|
|
41
|
+
title: 'text-5xl',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
});
|
|
51
45
|
|
|
52
|
-
|
|
46
|
+
const classList = $derived(cleanClass(styles({ size }), className));
|
|
53
47
|
</script>
|
|
54
48
|
|
|
55
49
|
<Text {tag} {fontWeight} class={classList} {...restProps}>
|
|
56
|
-
|
|
50
|
+
{@render children()}
|
|
57
51
|
</Text>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import Text from '../Text/Text.svelte';
|
|
3
|
+
import { ChildKey } from '../../constants.js';
|
|
4
|
+
import Child from '../../internal/Child.svelte';
|
|
5
|
+
import type { TextColor } from '../../types.js';
|
|
6
|
+
import { cleanClass } from '../../utils.js';
|
|
7
|
+
import type { Snippet } from 'svelte';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
type Props = {
|
|
10
|
+
color?: TextColor;
|
|
11
|
+
class?: string;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
};
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
let { class: className, children, color = 'muted' }: Props = $props();
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<Child for={ChildKey.Field} as={ChildKey.HelperText}>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
<div class={cleanClass(className)}>
|
|
20
|
+
<Text {color} size="small">
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</Text>
|
|
23
|
+
</div>
|
|
24
24
|
</Child>
|
|
@@ -1,52 +1,47 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { IconProps } from '../../types.js';
|
|
3
|
+
import { cleanClass } from '../../utils.js';
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
const {
|
|
7
|
+
size = '1em',
|
|
8
|
+
viewBox = '0 0 24 24',
|
|
9
|
+
class: className = '',
|
|
10
|
+
flipped = false,
|
|
11
|
+
flopped = false,
|
|
12
|
+
spin = false,
|
|
13
|
+
strokeColor = 'transparent',
|
|
14
|
+
strokeWidth = 2,
|
|
15
|
+
role = 'img',
|
|
16
|
+
title,
|
|
17
|
+
icon,
|
|
18
|
+
color = 'currentColor',
|
|
19
|
+
description,
|
|
20
|
+
...restProps
|
|
21
|
+
}: IconProps & HTMLAttributes<EventTarget> = $props();
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
24
|
<svg
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)}
|
|
34
|
-
stroke={strokeColor}
|
|
35
|
-
stroke-width={strokeWidth}
|
|
36
|
-
{role}
|
|
37
|
-
{...restProps}
|
|
25
|
+
width={size}
|
|
26
|
+
height={size}
|
|
27
|
+
{viewBox}
|
|
28
|
+
class={cleanClass(className, flipped && '-scale-x-100', flopped && 'rotate-180', spin && 'animate-spin')}
|
|
29
|
+
stroke={strokeColor}
|
|
30
|
+
stroke-width={strokeWidth}
|
|
31
|
+
{role}
|
|
32
|
+
{...restProps}
|
|
38
33
|
>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
{#if title}
|
|
35
|
+
<title>{title}</title>
|
|
36
|
+
{/if}
|
|
37
|
+
{#if description}
|
|
38
|
+
<desc>{description}</desc>
|
|
39
|
+
{/if}
|
|
40
|
+
<path d={typeof icon === 'string' ? icon : icon.path} fill={color} />
|
|
46
41
|
</svg>
|
|
47
42
|
|
|
48
43
|
<style>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
svg {
|
|
45
|
+
transition: transform 0.2s ease;
|
|
46
|
+
}
|
|
52
47
|
</style>
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import Button from '../../internal/Button.svelte';
|
|
3
|
+
import Icon from '../Icon/Icon.svelte';
|
|
4
|
+
import type { IconButtonProps } from '../../types.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
icon,
|
|
8
|
-
flipped,
|
|
9
|
-
flopped,
|
|
10
|
-
title,
|
|
11
|
-
'aria-label': ariaLabel,
|
|
12
|
-
...buttonProps
|
|
13
|
-
}: IconButtonProps = $props();
|
|
6
|
+
const { icon, flipped, flopped, title, 'aria-label': ariaLabel, ...buttonProps }: IconButtonProps = $props();
|
|
14
7
|
|
|
15
|
-
|
|
8
|
+
const buttonTitle = $derived(title || ariaLabel);
|
|
16
9
|
</script>
|
|
17
10
|
|
|
18
11
|
<Button icon {...buttonProps} title={buttonTitle} aria-label={ariaLabel}>
|
|
19
|
-
|
|
12
|
+
<Icon {icon} {flipped} {flopped} size="60%" aria-hidden />
|
|
20
13
|
</Button>
|
|
@@ -1,171 +1,168 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { getFieldContext } from '../../common/context.svelte.js';
|
|
3
|
+
import Icon from '../Icon/Icon.svelte';
|
|
4
|
+
import Label from '../Label/Label.svelte';
|
|
5
|
+
import Text from '../Text/Text.svelte';
|
|
6
|
+
import type { InputProps } from '../../types.js';
|
|
7
|
+
import { cleanClass, generateId, isIconLike } from '../../utils.js';
|
|
8
|
+
import { tv } from 'tailwind-variants';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
let {
|
|
11
|
+
ref = $bindable(null),
|
|
12
|
+
containerRef = $bindable(null),
|
|
13
|
+
shape = 'semi-round',
|
|
14
|
+
size = 'medium',
|
|
15
|
+
class: className,
|
|
16
|
+
value = $bindable<string>(),
|
|
17
|
+
leadingIcon,
|
|
18
|
+
trailingIcon,
|
|
19
|
+
trailingText,
|
|
20
|
+
inputSize,
|
|
21
|
+
...restProps
|
|
22
|
+
}: InputProps = $props();
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
$derived(getFieldContext());
|
|
24
|
+
const { label, description, readOnly, required, invalid, disabled, ...labelProps } = $derived(getFieldContext());
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
const iconStyles = tv({
|
|
27
|
+
base: 'flex flex-shrink-0 items-center justify-center',
|
|
28
|
+
variants: {
|
|
29
|
+
size: {
|
|
30
|
+
tiny: 'w-6',
|
|
31
|
+
small: 'w-8',
|
|
32
|
+
medium: 'w-10',
|
|
33
|
+
large: 'w-12',
|
|
34
|
+
giant: 'w-14',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
39
|
+
const containerStyles = tv({
|
|
40
|
+
base: 'flex w-full items-center bg-gray-200 outline-none disabled:cursor-not-allowed disabled:bg-gray-300 disabled:text-gray-400 dark:bg-gray-600 dark:disabled:bg-gray-800 dark:disabled:text-gray-200',
|
|
41
|
+
variants: {
|
|
42
|
+
shape: {
|
|
43
|
+
rectangle: 'rounded-none',
|
|
44
|
+
'semi-round': '',
|
|
45
|
+
round: 'rounded-full',
|
|
46
|
+
},
|
|
47
|
+
roundedSize: {
|
|
48
|
+
tiny: 'rounded-xl',
|
|
49
|
+
small: 'rounded-xl',
|
|
50
|
+
medium: 'rounded-2xl',
|
|
51
|
+
large: 'rounded-2xl',
|
|
52
|
+
giant: 'rounded-2xl',
|
|
53
|
+
},
|
|
54
|
+
invalid: {
|
|
55
|
+
true: 'border-danger/80 border',
|
|
56
|
+
false: '',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
});
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
61
|
+
const inputStyles = tv({
|
|
62
|
+
base: 'flex-1 bg-transparent py-3 outline-none disabled:cursor-not-allowed',
|
|
63
|
+
variants: {
|
|
64
|
+
textSize: {
|
|
65
|
+
tiny: 'text-xs',
|
|
66
|
+
small: 'text-sm',
|
|
67
|
+
medium: 'text-base',
|
|
68
|
+
large: 'text-lg',
|
|
69
|
+
giant: 'text-xl',
|
|
70
|
+
},
|
|
71
|
+
leadingPadding: {
|
|
72
|
+
base: 'pl-4',
|
|
73
|
+
icon: 'pl-0',
|
|
74
|
+
},
|
|
75
|
+
trailingPadding: {
|
|
76
|
+
base: 'pr-4',
|
|
77
|
+
icon: 'pr-0',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
});
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
82
|
+
const trailingTextStyles = tv({
|
|
83
|
+
variants: {
|
|
84
|
+
padding: {
|
|
85
|
+
base: 'px-4',
|
|
86
|
+
icon: 'pl-4',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
});
|
|
91
90
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
const id = generateId();
|
|
92
|
+
const inputId = `input-${id}`;
|
|
93
|
+
const labelId = `label-${id}`;
|
|
94
|
+
const descriptionId = $derived(description ? `description-${id}` : undefined);
|
|
96
95
|
</script>
|
|
97
96
|
|
|
98
97
|
<div class="flex w-full flex-col gap-1" bind:this={containerRef}>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
{#if label}
|
|
99
|
+
<Label id={labelId} for={inputId} {label} {...labelProps} />
|
|
100
|
+
{/if}
|
|
102
101
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
{#if description}
|
|
103
|
+
<Text color="secondary" size="small" id={descriptionId}>{description}</Text>
|
|
104
|
+
{/if}
|
|
106
105
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
106
|
+
<div
|
|
107
|
+
class={cleanClass(
|
|
108
|
+
containerStyles({
|
|
109
|
+
shape,
|
|
110
|
+
roundedSize: shape === 'semi-round' ? size : undefined,
|
|
111
|
+
invalid,
|
|
112
|
+
}),
|
|
113
|
+
className,
|
|
114
|
+
)}
|
|
115
|
+
>
|
|
116
|
+
{#if leadingIcon}
|
|
117
|
+
<div tabindex="-1" class={iconStyles({ size })}>
|
|
118
|
+
{#if isIconLike(leadingIcon)}
|
|
119
|
+
<Icon size="60%" icon={leadingIcon} />
|
|
120
|
+
{:else}
|
|
121
|
+
{@render leadingIcon()}
|
|
122
|
+
{/if}
|
|
123
|
+
</div>
|
|
124
|
+
{/if}
|
|
126
125
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
>
|
|
153
|
-
{/if}
|
|
126
|
+
<input
|
|
127
|
+
id={inputId}
|
|
128
|
+
aria-labelledby={label && labelId}
|
|
129
|
+
{required}
|
|
130
|
+
aria-required={required}
|
|
131
|
+
{disabled}
|
|
132
|
+
aria-disabled={disabled}
|
|
133
|
+
aria-describedby={descriptionId}
|
|
134
|
+
readonly={readOnly}
|
|
135
|
+
size={inputSize}
|
|
136
|
+
aria-readonly={readOnly}
|
|
137
|
+
class={inputStyles({
|
|
138
|
+
textSize: size,
|
|
139
|
+
leadingPadding: leadingIcon ? 'icon' : 'base',
|
|
140
|
+
trailingPadding: trailingIcon || trailingText ? 'icon' : 'base',
|
|
141
|
+
})}
|
|
142
|
+
bind:this={ref}
|
|
143
|
+
bind:value
|
|
144
|
+
{...restProps}
|
|
145
|
+
/>
|
|
146
|
+
{#if trailingText}
|
|
147
|
+
<Text {size} color="muted" class={trailingTextStyles({ padding: trailingIcon ? 'icon' : 'base' })}
|
|
148
|
+
>{trailingText}</Text
|
|
149
|
+
>
|
|
150
|
+
{/if}
|
|
154
151
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
152
|
+
{#if trailingIcon}
|
|
153
|
+
<div tabindex="-1" class={iconStyles({ size })}>
|
|
154
|
+
{#if isIconLike(trailingIcon)}
|
|
155
|
+
<Icon size="60%" icon={trailingIcon} />
|
|
156
|
+
{:else}
|
|
157
|
+
{@render trailingIcon()}
|
|
158
|
+
{/if}
|
|
159
|
+
</div>
|
|
160
|
+
{/if}
|
|
161
|
+
</div>
|
|
165
162
|
</div>
|
|
166
163
|
|
|
167
164
|
<style>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
input::-ms-reveal {
|
|
166
|
+
display: none;
|
|
167
|
+
}
|
|
171
168
|
</style>
|