@immich/ui 0.20.0 → 0.21.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 +1 -1
- package/dist/components/Navbar/NavbarItem.svelte +12 -5
- package/dist/components/Navbar/NavbarItem.svelte.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/theme/default.css +33 -0
- package/dist/theme/default.d.ts +13 -0
- package/dist/theme/default.js +16 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ export declare const setFieldContext: (field: FieldContext) => FieldContext;
|
|
|
3
3
|
export declare const hasFieldContext: () => boolean;
|
|
4
4
|
export declare const getFieldContext: () => {
|
|
5
5
|
label: string | undefined;
|
|
6
|
-
color: "primary" | "
|
|
6
|
+
color: "primary" | "success" | "danger" | "warning" | "info" | "secondary" | "muted";
|
|
7
7
|
invalid: boolean;
|
|
8
8
|
readOnly: boolean;
|
|
9
9
|
required: boolean;
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
href: string;
|
|
11
11
|
variant?: 'compact';
|
|
12
12
|
isActive?: () => boolean;
|
|
13
|
-
|
|
13
|
+
icon?: string | IconProps;
|
|
14
|
+
activeIcon?: string | IconProps;
|
|
15
|
+
};
|
|
14
16
|
|
|
15
17
|
const startsWithHref = () => page.url.pathname.startsWith(href);
|
|
16
18
|
|
|
@@ -20,12 +22,18 @@
|
|
|
20
22
|
title,
|
|
21
23
|
variant,
|
|
22
24
|
active: activeOverride,
|
|
23
|
-
|
|
25
|
+
icon,
|
|
26
|
+
activeIcon,
|
|
24
27
|
}: Props = $props();
|
|
25
28
|
|
|
26
29
|
const isActive = isActiveOverride ?? startsWithHref;
|
|
27
30
|
let active = $derived(activeOverride ?? isActive());
|
|
28
31
|
|
|
32
|
+
const iconProps = $derived(typeof icon === 'string' ? { icon } : icon);
|
|
33
|
+
const activeIconProps = $derived(
|
|
34
|
+
typeof activeIcon === 'string' ? { icon: activeIcon } : activeIcon,
|
|
35
|
+
);
|
|
36
|
+
|
|
29
37
|
const styles = tv({
|
|
30
38
|
base: 'flex w-full place-items-center gap-4 rounded-e-full px-5 transition-[padding] delay-100 duration-100 hover:bg-subtle hover:text-primary group-hover:sm:px-5',
|
|
31
39
|
variants: {
|
|
@@ -48,13 +56,12 @@
|
|
|
48
56
|
class={styles({ active, variant: variant ?? 'default' })}
|
|
49
57
|
>
|
|
50
58
|
<div class="flex w-full place-items-center gap-4 overflow-hidden truncate">
|
|
51
|
-
{#if iconProps
|
|
59
|
+
{#if iconProps}
|
|
52
60
|
<Icon
|
|
53
61
|
size="1.375em"
|
|
54
62
|
class="shrink-0"
|
|
55
63
|
aria-hidden={true}
|
|
56
|
-
{...iconProps}
|
|
57
|
-
icon={iconProps.icon}
|
|
64
|
+
{...active && activeIconProps ? activeIconProps : iconProps}
|
|
58
65
|
/>
|
|
59
66
|
{/if}
|
|
60
67
|
<span class="text-sm font-medium">{title}</span>
|
|
@@ -5,8 +5,8 @@ type Props = {
|
|
|
5
5
|
href: string;
|
|
6
6
|
variant?: 'compact';
|
|
7
7
|
isActive?: () => boolean;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
icon?: string | IconProps;
|
|
9
|
+
activeIcon?: string | IconProps;
|
|
10
10
|
};
|
|
11
11
|
declare const NavbarItem: import("svelte").Component<Props, {}, "">;
|
|
12
12
|
type NavbarItem = ReturnType<typeof NavbarItem>;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as immichLogoStackedLight } from './assets/immich-logo-stacked-
|
|
|
7
7
|
export { default as immichLogoJson } from './assets/immich-logo.json';
|
|
8
8
|
export { default as immichLogo } from './assets/immich-logo.svg';
|
|
9
9
|
export { default as playStoreBadge } from './assets/playstore-badge.png';
|
|
10
|
+
export * from './theme/default.js';
|
|
10
11
|
export { default as Alert } from './components/Alert/Alert.svelte';
|
|
11
12
|
export { default as AppShell } from './components/AppShell/AppShell.svelte';
|
|
12
13
|
export { default as AppShellHeader } from './components/AppShell/AppShellHeader.svelte';
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,8 @@ export { default as immichLogoStackedLight } from './assets/immich-logo-stacked-
|
|
|
8
8
|
export { default as immichLogoJson } from './assets/immich-logo.json';
|
|
9
9
|
export { default as immichLogo } from './assets/immich-logo.svg';
|
|
10
10
|
export { default as playStoreBadge } from './assets/playstore-badge.png';
|
|
11
|
+
// theme
|
|
12
|
+
export * from './theme/default.js';
|
|
11
13
|
// components
|
|
12
14
|
export { default as Alert } from './components/Alert/Alert.svelte';
|
|
13
15
|
export { default as AppShell } from './components/AppShell/AppShell.svelte';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
:root {
|
|
7
|
+
/* light */
|
|
8
|
+
--immich-ui-primary: 66 80 175;
|
|
9
|
+
--immich-ui-dark: 58 58 58;
|
|
10
|
+
--immich-ui-light: 255 255 255;
|
|
11
|
+
--immich-ui-success: 16 188 99;
|
|
12
|
+
--immich-ui-danger: 200 60 60;
|
|
13
|
+
--immich-ui-warning: 216 143 64;
|
|
14
|
+
--immich-ui-info: 8 111 230;
|
|
15
|
+
--immich-ui-gray: 246 246 246;
|
|
16
|
+
|
|
17
|
+
--immich-ui-default-border: 209 213 219;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.dark {
|
|
21
|
+
/* dark */
|
|
22
|
+
--immich-ui-primary: 172 203 250;
|
|
23
|
+
--immich-ui-light: 0 0 0;
|
|
24
|
+
--immich-ui-dark: 229 231 235;
|
|
25
|
+
--immich-ui-success: 72 237 152;
|
|
26
|
+
--immich-ui-danger: 246 125 125;
|
|
27
|
+
--immich-ui-warning: 254 197 132;
|
|
28
|
+
--immich-ui-info: 121 183 254;
|
|
29
|
+
--immich-ui-gray: 33 33 33;
|
|
30
|
+
|
|
31
|
+
--immich-ui-default-border: 55 65 81;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const tailwindConfig: () => {
|
|
2
|
+
colors: {
|
|
3
|
+
primary: string;
|
|
4
|
+
light: string;
|
|
5
|
+
dark: string;
|
|
6
|
+
success: string;
|
|
7
|
+
danger: string;
|
|
8
|
+
warning: string;
|
|
9
|
+
info: string;
|
|
10
|
+
subtle: string;
|
|
11
|
+
};
|
|
12
|
+
borderColor: ({ theme }: import("tailwindcss/types/config").PluginUtils) => any;
|
|
13
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const tailwindConfig = () => ({
|
|
2
|
+
colors: {
|
|
3
|
+
primary: 'rgb(var(--immich-ui-primary) / <alpha-value>)',
|
|
4
|
+
light: 'rgb(var(--immich-ui-light) / <alpha-value>)',
|
|
5
|
+
dark: 'rgb(var(--immich-ui-dark) / <alpha-value>)',
|
|
6
|
+
success: 'rgb(var(--immich-ui-success) / <alpha-value>)',
|
|
7
|
+
danger: 'rgb(var(--immich-ui-danger) / <alpha-value>)',
|
|
8
|
+
warning: 'rgb(var(--immich-ui-warning) / <alpha-value>)',
|
|
9
|
+
info: 'rgb(var(--immich-ui-info) / <alpha-value>)',
|
|
10
|
+
subtle: 'rgb(var(--immich-ui-gray) / <alpha-value>)',
|
|
11
|
+
},
|
|
12
|
+
borderColor: ({ theme }) => ({
|
|
13
|
+
...theme('colors'),
|
|
14
|
+
DEFAULT: 'rgb(var(--immich-ui-default-border) / <alpha-value>)',
|
|
15
|
+
}),
|
|
16
|
+
});
|