@immich/ui 0.3.0 → 0.5.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/use-context.svelte.d.ts +5 -0
- package/dist/common/use-context.svelte.js +19 -0
- package/dist/components/Alert/Alert.svelte +50 -0
- package/dist/components/Alert/Alert.svelte.d.ts +9 -0
- package/dist/components/Button/Button.svelte +8 -0
- package/dist/components/Button/Button.svelte.d.ts +4 -0
- package/dist/components/Card/Card.svelte +187 -0
- package/dist/components/Card/Card.svelte.d.ts +11 -0
- package/dist/components/Card/CardBody.svelte +20 -0
- package/dist/components/Card/CardBody.svelte.d.ts +6 -0
- package/dist/components/Card/CardDescription.svelte +16 -0
- package/dist/components/Card/CardDescription.svelte.d.ts +6 -0
- package/dist/components/Card/CardFooter.svelte +15 -0
- package/dist/components/Card/CardFooter.svelte.d.ts +5 -0
- package/dist/components/Card/CardHeader.svelte +15 -0
- package/dist/components/Card/CardHeader.svelte.d.ts +5 -0
- package/dist/components/Card/CardTitle.svelte +17 -0
- package/dist/components/Card/CardTitle.svelte.d.ts +8 -0
- package/dist/components/CloseButton/CloseButton.svelte +9 -0
- package/dist/components/CloseButton/CloseButton.svelte.d.ts +3 -0
- package/dist/components/{Checkbox.svelte → Form/Checkbox.svelte} +20 -30
- package/dist/components/{Checkbox.svelte.d.ts → Form/Checkbox.svelte.d.ts} +1 -1
- package/dist/components/{Input.svelte → Form/Input.svelte} +1 -1
- package/dist/components/{Label.svelte → Form/Label.svelte} +1 -1
- package/dist/components/Heading/Heading.svelte +54 -0
- package/dist/components/Heading/Heading.svelte.d.ts +9 -0
- package/dist/components/Icon/Icon.svelte +52 -0
- package/dist/components/Icon/Icon.svelte.d.ts +4 -0
- package/dist/components/IconButton/IconButton.svelte +11 -0
- package/dist/components/IconButton/IconButton.svelte.d.ts +3 -0
- package/dist/components/Link/Link.svelte +17 -0
- package/dist/components/Link/Link.svelte.d.ts +8 -0
- package/dist/components/{Logo.svelte → Logo/Logo.svelte} +11 -10
- package/dist/components/{Logo.svelte.d.ts → Logo/Logo.svelte.d.ts} +1 -1
- package/dist/components/Stack/HStack.svelte +10 -0
- package/dist/components/Stack/HStack.svelte.d.ts +8 -0
- package/dist/components/Stack/Stack.svelte +68 -0
- package/dist/components/Stack/Stack.svelte.d.ts +3 -0
- package/dist/components/Stack/VStack.svelte +10 -0
- package/dist/components/Stack/VStack.svelte.d.ts +8 -0
- package/dist/components/SupporterBadge/SupporterBadge.svelte +94 -0
- package/dist/components/SupporterBadge/SupporterBadge.svelte.d.ts +9 -0
- package/dist/components/Text/Text.svelte +49 -0
- package/dist/components/Text/Text.svelte.d.ts +11 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.js +7 -0
- package/dist/index.d.ts +22 -1
- package/dist/index.js +22 -1
- package/dist/{components → internal}/Button.svelte +79 -71
- package/dist/internal/Button.svelte.d.ts +6 -0
- package/dist/internal/Child.svelte +21 -0
- package/dist/internal/Child.svelte.d.ts +8 -0
- package/dist/types.d.ts +50 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +1 -0
- package/package.json +2 -1
- package/dist/components/Button.svelte.d.ts +0 -15
- package/dist/components/Card.svelte +0 -20
- package/dist/components/Card.svelte.d.ts +0 -4
- package/dist/components/CardBody.svelte +0 -16
- package/dist/components/CardBody.svelte.d.ts +0 -4
- package/dist/components/CardDescription.svelte +0 -16
- package/dist/components/CardDescription.svelte.d.ts +0 -4
- package/dist/components/CardFooter.svelte +0 -16
- package/dist/components/CardFooter.svelte.d.ts +0 -4
- package/dist/components/CardHeader.svelte +0 -17
- package/dist/components/CardHeader.svelte.d.ts +0 -4
- package/dist/components/CardTitle.svelte +0 -25
- package/dist/components/CardTitle.svelte.d.ts +0 -7
- package/dist/components/Icon.svelte +0 -62
- package/dist/components/Icon.svelte.d.ts +0 -20
- package/dist/components/index.d.ts +0 -12
- package/dist/components/index.js +0 -12
- /package/dist/components/{Input.svelte.d.ts → Form/Input.svelte.d.ts} +0 -0
- /package/dist/components/{Label.svelte.d.ts → Form/Label.svelte.d.ts} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ContextKey } from '../constants.js';
|
|
3
|
+
import { withPrefix } from '../utils.js';
|
|
4
|
+
import { getContext, type Snippet } from 'svelte';
|
|
5
|
+
|
|
6
|
+
type ContextType = { register: (key: ContextKey, snippet: Snippet) => void };
|
|
7
|
+
type Props = {
|
|
8
|
+
for: ContextKey;
|
|
9
|
+
as: ContextKey;
|
|
10
|
+
children: Snippet;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const { for: key, as, children }: Props = $props();
|
|
14
|
+
|
|
15
|
+
const context = getContext<ContextType>(withPrefix(key));
|
|
16
|
+
if (context) {
|
|
17
|
+
context.register(as, children);
|
|
18
|
+
} else {
|
|
19
|
+
console.log('Unable to find context for key:', key);
|
|
20
|
+
}
|
|
21
|
+
</script>
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
1
3
|
export type Color = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
|
|
2
4
|
export type Size = 'tiny' | 'small' | 'medium' | 'large' | 'giant';
|
|
5
|
+
export type HeadingSize = Size | 'title';
|
|
3
6
|
export type Shape = 'rectangle' | 'semi-round' | 'round';
|
|
7
|
+
export type Variants = 'filled' | 'outline' | 'ghost' | 'hero';
|
|
8
|
+
export type Gap = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
9
|
+
type ButtonOrAnchor = ({
|
|
10
|
+
href?: never;
|
|
11
|
+
} & HTMLButtonAttributes) | ({
|
|
12
|
+
href: string;
|
|
13
|
+
} & HTMLAnchorAttributes);
|
|
14
|
+
export type CloseButtonProps = {
|
|
15
|
+
size?: Size;
|
|
16
|
+
variant?: Variants;
|
|
17
|
+
};
|
|
18
|
+
type ButtonBaseProps = CloseButtonProps & {
|
|
19
|
+
class?: string;
|
|
20
|
+
color?: Color;
|
|
21
|
+
shape?: Shape;
|
|
22
|
+
} & ButtonOrAnchor;
|
|
23
|
+
export type IconProps = {
|
|
24
|
+
icon: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
size?: string;
|
|
28
|
+
color?: Color | 'currentColor' | string;
|
|
29
|
+
flipped?: boolean;
|
|
30
|
+
flopped?: boolean;
|
|
31
|
+
spin?: boolean;
|
|
32
|
+
class?: string;
|
|
33
|
+
viewBox?: string;
|
|
34
|
+
strokeWidth?: number;
|
|
35
|
+
strokeColor?: string;
|
|
36
|
+
};
|
|
37
|
+
export type IconButtonProps = ButtonBaseProps & IconProps;
|
|
38
|
+
export type ButtonProps = ButtonBaseProps & {
|
|
39
|
+
fullWidth?: boolean;
|
|
40
|
+
};
|
|
41
|
+
type StackBaseProps = {
|
|
42
|
+
class?: string;
|
|
43
|
+
children: Snippet;
|
|
44
|
+
align?: 'start' | 'center' | 'end';
|
|
45
|
+
gap?: Gap;
|
|
46
|
+
wrap?: boolean;
|
|
47
|
+
};
|
|
48
|
+
export type StackProps = StackBaseProps & {
|
|
49
|
+
direction?: 'row' | 'column';
|
|
50
|
+
};
|
|
51
|
+
export type HStackProps = StackBaseProps;
|
|
52
|
+
export type VStackProps = StackBaseProps;
|
|
53
|
+
export {};
|
package/dist/utils.d.ts
CHANGED
package/dist/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@immich/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "GNU Affero General Public License version 3",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "npm run start:dev",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@mdi/js": "^7.4.47",
|
|
66
66
|
"bits-ui": "^1.0.0-next.46",
|
|
67
|
+
"tailwind-merge": "^2.5.4",
|
|
67
68
|
"tailwind-variants": "^0.3.0"
|
|
68
69
|
}
|
|
69
70
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Color, Shape, Size } from '../types.js';
|
|
2
|
-
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
-
declare const Button: import("svelte").Component<{
|
|
4
|
-
class?: string;
|
|
5
|
-
color?: Color;
|
|
6
|
-
size?: Size;
|
|
7
|
-
shape?: Shape;
|
|
8
|
-
variant?: "filled" | "outline" | "ghost" | "hero";
|
|
9
|
-
fullWidth?: boolean;
|
|
10
|
-
} & (({
|
|
11
|
-
href?: never;
|
|
12
|
-
} & HTMLButtonAttributes) | ({
|
|
13
|
-
href: string;
|
|
14
|
-
} & HTMLAnchorAttributes)), {}, "">;
|
|
15
|
-
export default Button;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cleanClass } from '../utils.js';
|
|
3
|
-
import type { WithElementRef } from 'bits-ui';
|
|
4
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
-
|
|
6
|
-
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>>;
|
|
7
|
-
|
|
8
|
-
let { ref = $bindable(null), class: className, children, ...restProps }: Props = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<div
|
|
12
|
-
bind:this={ref}
|
|
13
|
-
class={cleanClass(
|
|
14
|
-
'rounded-lg border border-gray-300 bg-light text-dark shadow-lg dark:border-gray-600',
|
|
15
|
-
className,
|
|
16
|
-
)}
|
|
17
|
-
{...restProps}
|
|
18
|
-
>
|
|
19
|
-
{@render children?.()}
|
|
20
|
-
</div>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cleanClass } from '../utils.js';
|
|
3
|
-
import type { WithElementRef } from 'bits-ui';
|
|
4
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
children,
|
|
10
|
-
...restProps
|
|
11
|
-
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<div bind:this={ref} class={cleanClass('p-6', className)} {...restProps}>
|
|
15
|
-
{@render children?.()}
|
|
16
|
-
</div>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { WithElementRef } from 'bits-ui';
|
|
3
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
-
import { cleanClass } from '../utils.js';
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
children,
|
|
10
|
-
...restProps
|
|
11
|
-
}: WithElementRef<HTMLAttributes<HTMLParagraphElement>> = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<p bind:this={ref} class={cleanClass('text-muted-foreground text-sm', className)} {...restProps}>
|
|
15
|
-
{@render children?.()}
|
|
16
|
-
</p>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cleanClass } from '../utils.js';
|
|
3
|
-
import type { WithElementRef } from 'bits-ui';
|
|
4
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
children,
|
|
10
|
-
...restProps
|
|
11
|
-
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<div bind:this={ref} class={cleanClass('flex items-center p-6 pt-0', className)} {...restProps}>
|
|
15
|
-
{@render children?.()}
|
|
16
|
-
</div>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cleanClass } from '../utils.js';
|
|
3
|
-
import type { WithElementRef } from 'bits-ui';
|
|
4
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
-
|
|
6
|
-
type Props = WithElementRef<HTMLAttributes<HTMLDivElement>>;
|
|
7
|
-
|
|
8
|
-
let { ref = $bindable(null), class: className, children, ...restProps }: Props = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<div
|
|
12
|
-
bind:this={ref}
|
|
13
|
-
class={cleanClass('flex flex-col space-y-1.5 rounded-t-lg p-6 pb-0', className)}
|
|
14
|
-
{...restProps}
|
|
15
|
-
>
|
|
16
|
-
{@render children?.()}
|
|
17
|
-
</div>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { WithElementRef } from 'bits-ui';
|
|
3
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
-
import { cleanClass } from '../utils.js';
|
|
5
|
-
|
|
6
|
-
let {
|
|
7
|
-
ref = $bindable(null),
|
|
8
|
-
class: className,
|
|
9
|
-
level = 3,
|
|
10
|
-
children,
|
|
11
|
-
...restProps
|
|
12
|
-
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
13
|
-
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
14
|
-
} = $props();
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div
|
|
18
|
-
role="heading"
|
|
19
|
-
aria-level={level}
|
|
20
|
-
bind:this={ref}
|
|
21
|
-
class={cleanClass('text-lg font-semibold leading-none tracking-tight', className)}
|
|
22
|
-
{...restProps}
|
|
23
|
-
>
|
|
24
|
-
{@render children?.()}
|
|
25
|
-
</div>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
declare const CardTitle: import("svelte").Component<HTMLAttributes<HTMLDivElement> & {
|
|
3
|
-
ref?: HTMLElement | null | undefined;
|
|
4
|
-
} & {
|
|
5
|
-
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
-
}, {}, "ref">;
|
|
7
|
-
export default CardTitle;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Color } from '../types.js';
|
|
3
|
-
import { cleanClass } from '../utils.js';
|
|
4
|
-
import type { AriaRole } from 'svelte/elements';
|
|
5
|
-
|
|
6
|
-
type IconProps = {
|
|
7
|
-
path: string;
|
|
8
|
-
size?: string;
|
|
9
|
-
color?: Color | 'currentColor' | string;
|
|
10
|
-
flipped?: boolean;
|
|
11
|
-
class?: string;
|
|
12
|
-
viewBox?: string;
|
|
13
|
-
role?: AriaRole;
|
|
14
|
-
title?: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
ariaHidden?: boolean;
|
|
17
|
-
ariaLabel?: string;
|
|
18
|
-
ariaLabelledby?: string;
|
|
19
|
-
strokeWidth?: number;
|
|
20
|
-
strokeColor?: string;
|
|
21
|
-
spin?: false;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const {
|
|
25
|
-
size = '1em',
|
|
26
|
-
viewBox = '0 0 24 24',
|
|
27
|
-
class: className = '',
|
|
28
|
-
flipped = false,
|
|
29
|
-
spin = false,
|
|
30
|
-
role = 'img',
|
|
31
|
-
ariaLabelledby,
|
|
32
|
-
strokeColor = 'transparent',
|
|
33
|
-
strokeWidth = 2,
|
|
34
|
-
ariaLabel = '',
|
|
35
|
-
ariaHidden = false,
|
|
36
|
-
title,
|
|
37
|
-
path,
|
|
38
|
-
color = 'currentColor',
|
|
39
|
-
description,
|
|
40
|
-
}: IconProps = $props();
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<svg
|
|
44
|
-
width={size}
|
|
45
|
-
height={size}
|
|
46
|
-
{viewBox}
|
|
47
|
-
class={cleanClass(className, flipped && '-scale-x-100', spin && 'animate-spin')}
|
|
48
|
-
{role}
|
|
49
|
-
stroke={strokeColor}
|
|
50
|
-
stroke-width={strokeWidth}
|
|
51
|
-
aria-label={ariaLabel}
|
|
52
|
-
aria-hidden={ariaHidden}
|
|
53
|
-
aria-labelledby={ariaLabelledby}
|
|
54
|
-
>
|
|
55
|
-
{#if title}
|
|
56
|
-
<title>{title}</title>
|
|
57
|
-
{/if}
|
|
58
|
-
{#if description}
|
|
59
|
-
<desc>{description}</desc>
|
|
60
|
-
{/if}
|
|
61
|
-
<path d={path} fill={color} />
|
|
62
|
-
</svg>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Color } from '../types.js';
|
|
2
|
-
import type { AriaRole } from 'svelte/elements';
|
|
3
|
-
declare const Icon: import("svelte").Component<{
|
|
4
|
-
path: string;
|
|
5
|
-
size?: string;
|
|
6
|
-
color?: Color | "currentColor" | string;
|
|
7
|
-
flipped?: boolean;
|
|
8
|
-
class?: string;
|
|
9
|
-
viewBox?: string;
|
|
10
|
-
role?: AriaRole;
|
|
11
|
-
title?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
ariaHidden?: boolean;
|
|
14
|
-
ariaLabel?: string;
|
|
15
|
-
ariaLabelledby?: string;
|
|
16
|
-
strokeWidth?: number;
|
|
17
|
-
strokeColor?: string;
|
|
18
|
-
spin?: false;
|
|
19
|
-
}, {}, "">;
|
|
20
|
-
export default Icon;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { default as Button } from './Button.svelte';
|
|
2
|
-
export { default as Card } from './Card.svelte';
|
|
3
|
-
export { default as CardBody } from './CardBody.svelte';
|
|
4
|
-
export { default as CardDescription } from './CardDescription.svelte';
|
|
5
|
-
export { default as CardFooter } from './CardFooter.svelte';
|
|
6
|
-
export { default as CardHeader } from './CardHeader.svelte';
|
|
7
|
-
export { default as CardTitle } from './CardTitle.svelte';
|
|
8
|
-
export { default as Checkbox } from './Checkbox.svelte';
|
|
9
|
-
export { default as Icon } from './Icon.svelte';
|
|
10
|
-
export { default as Input } from './Input.svelte';
|
|
11
|
-
export { default as Label } from './Label.svelte';
|
|
12
|
-
export { default as Logo } from './Logo.svelte';
|
package/dist/components/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { default as Button } from './Button.svelte';
|
|
2
|
-
export { default as Card } from './Card.svelte';
|
|
3
|
-
export { default as CardBody } from './CardBody.svelte';
|
|
4
|
-
export { default as CardDescription } from './CardDescription.svelte';
|
|
5
|
-
export { default as CardFooter } from './CardFooter.svelte';
|
|
6
|
-
export { default as CardHeader } from './CardHeader.svelte';
|
|
7
|
-
export { default as CardTitle } from './CardTitle.svelte';
|
|
8
|
-
export { default as Checkbox } from './Checkbox.svelte';
|
|
9
|
-
export { default as Icon } from './Icon.svelte';
|
|
10
|
-
export { default as Input } from './Input.svelte';
|
|
11
|
-
export { default as Label } from './Label.svelte';
|
|
12
|
-
export { default as Logo } from './Logo.svelte';
|
|
File without changes
|
|
File without changes
|