Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): immich-ui components #14263

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 185 additions & 3 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.8.0",
"@faker-js/faker": "^9.0.0",
"@immich/ui": "^0.7.0",
"@socket.io/component-emitter": "^3.1.0",
"@sveltejs/adapter-static": "^3.0.5",
"@sveltejs/enhanced-img": "^0.3.9",
Expand Down
22 changes: 22 additions & 0 deletions web/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@
--immich-dark-success: 56 142 60;
--immich-dark-warning: 245 124 0;
}

:root {
/* light */
--immich-ui-primary: 66 80 175;
--immich-ui-dark: 0 0 0;
--immich-ui-light: 255 255 255;
--immich-ui-success: 34 197 94;
--immich-ui-danger: 180 0 0;
--immich-ui-warning: 255 170 0;
--immich-ui-info: 14 165 233;
}

.dark {
/* dark */
--immich-ui-primary: 172 203 250;
--immich-ui-light: 0 0 0;
--immich-ui-dark: 229 231 235;
/* --immich-success: 56 142 60; */
--immich-ui-danger: 239 68 68;
--immich-ui-warning: 255 170 0;
--immich-ui-info: 14 165 233;
}
}

@font-face {
Expand Down
37 changes: 16 additions & 21 deletions web/src/lib/components/forms/admin-registration-form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
import { goto } from '$app/navigation';
import { AppRoute } from '$lib/constants';
import { signUpAdmin } from '@immich/sdk';
import { Alert, Button, Field, Input, PasswordInput } from '@immich/ui';
import { handleError } from '../../utils/handle-error';
import Button from '../elements/buttons/button.svelte';
import PasswordField from '../shared-components/password-field.svelte';
import { t } from 'svelte-i18n';
import { retrieveServerConfig } from '$lib/stores/server-config.store';

Expand Down Expand Up @@ -47,32 +46,28 @@
};
</script>

<form {onsubmit} method="post" class="mt-5 flex flex-col gap-5">
<div class="flex flex-col gap-2">
<label class="immich-form-label" for="email">{$t('admin_email')}</label>
<input class="immich-form-input" id="email" bind:value={email} type="email" autocomplete="email" required />
</div>
<form {onsubmit} method="post" class="mt-5 flex flex-col gap-5 text-dark">
<Field label={$t('admin_email')} required>
<Input bind:value={email} type="email" autocomplete="email" />
</Field>

<div class="flex flex-col gap-2">
<label class="immich-form-label" for="password">{$t('admin_password')}</label>
<PasswordField id="password" bind:password autocomplete="new-password" />
</div>
<Field label={$t('admin_password')} required>
<PasswordInput bind:value={password} autocomplete="new-password" />
</Field>

<div class="flex flex-col gap-2">
<label class="immich-form-label" for="confirmPassword">{$t('confirm_admin_password')}</label>
<PasswordField id="confirmPassword" bind:password={confirmPassword} autocomplete="new-password" />
</div>
<Field label={$t('confirm_admin_password')} required>
<PasswordInput bind:value={confirmPassword} autocomplete="new-password" />
</Field>

<div class="flex flex-col gap-2">
<label class="immich-form-label" for="name">{$t('name')}</label>
<input class="immich-form-input" id="name" bind:value={name} type="text" autocomplete="name" required />
</div>
<Field label={$t('name')} required>
<Input bind:value={name} type="text" autocomplete="name" />
</Field>

{#if errorMessage}
<p class="text-red-400">{errorMessage}</p>
<Alert color="danger" title={errorMessage} />
{/if}

<div class="my-5 flex w-full">
<Button type="submit" size="lg" fullwidth>{$t('sign_up')}</Button>
<Button type="submit" size="large" fullWidth>{$t('sign_up')}</Button>
</div>
</form>
Loading
Loading