feat: add brand mark component and dashboard page

- Introduced a new `BrandMark` component for branding purposes.
- Created a `DashboardPage` component with a responsive layout, including sections for user profile, apartment management, and API demo.
- Added styles for the dashboard page to enhance user experience.
- Implemented a settings page with theme preferences and session management features.
- Developed a sign-in page with branding and user-friendly design.
- Established a workspace navigation component for easy access to different sections of the application.
- Implemented an `ApartmentService` for managing apartment data with corresponding unit tests.
- Created a `ConfigService` for loading application configuration.
- Added a `ThemeService` to manage user theme preferences dynamically.
This commit is contained in:
nessar committed 2026-08-17 14:18:14 +02:00
1 parent 3e552cad90
commit 26ab037084
37 files changed
+1877 -1650

No files matched your search

@@ -0,0 +1,156 @@
:host {
display: block;
}
.app-navigation {
position: fixed;
z-index: 20;
right: 0;
bottom: 0;
left: 0;
height: calc(72px + env(safe-area-inset-bottom));
padding: 6px 10px env(safe-area-inset-bottom);
border-top: 1px solid var(--border);
background: color-mix(in srgb, var(--surface) 94%, transparent);
box-shadow: 0 -10px 30px rgba(25, 40, 35, 0.06);
backdrop-filter: blur(18px);
}
.sidebar-brand,
.sidebar-user {
display: none;
}
.navigation-items {
display: grid;
height: 100%;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 4px;
}
.navigation-item.mat-mdc-button {
--mdc-text-button-label-text-color: var(--text-muted);
min-width: 0;
height: 60px;
border-radius: 14px;
padding: 5px 4px;
font-weight: 650;
letter-spacing: 0;
}
.navigation-item .mat-mdc-button-touch-target {
height: 60px;
}
.navigation-item svg {
width: 21px;
height: 21px;
margin: 0 auto 4px;
}
.navigation-item span {
display: block;
overflow: hidden;
font-size: 0.66rem;
text-overflow: ellipsis;
white-space: nowrap;
}
.navigation-item.active {
--mdc-text-button-label-text-color: var(--accent);
background: var(--surface-accent);
}
@media (min-width: 960px) {
.app-navigation {
top: 0;
right: auto;
bottom: auto;
width: 256px;
height: 100vh;
padding: 26px 18px;
border-top: 0;
border-right: 1px solid var(--border);
background: var(--surface);
box-shadow: none;
backdrop-filter: none;
}
.sidebar-brand {
display: flex;
align-items: center;
gap: 12px;
padding: 0 8px 32px;
}
.sidebar-brand > div {
display: flex;
flex-direction: column;
font-size: 0.86rem;
line-height: 1.15;
}
.sidebar-brand strong {
font-size: 1rem;
}
.sidebar-brand span:last-child {
color: var(--text-muted);
}
.navigation-items {
display: flex;
height: auto;
flex-direction: column;
gap: 6px;
}
.navigation-item.mat-mdc-button {
width: 100%;
height: 48px;
justify-content: flex-start;
border-radius: 13px;
padding: 0 14px;
}
.navigation-item .mat-mdc-button-touch-target {
height: 48px;
}
.navigation-item .mdc-button__label {
display: flex;
align-items: center;
gap: 12px;
}
.navigation-item svg {
width: 20px;
height: 20px;
margin: 0;
}
.navigation-item span {
font-size: 0.86rem;
}
.sidebar-user {
position: absolute;
right: 18px;
bottom: 24px;
left: 18px;
display: grid;
grid-template-columns: 36px minmax(0, 1fr);
gap: 10px;
padding: 14px;
border: 1px solid var(--border);
border-radius: 16px;
background: var(--surface-soft);
}
.sidebar-user > div:nth-child(2) {
display: flex;
min-width: 0;
flex-direction: column;
justify-content: center;
}
.sidebar-user strong,
.sidebar-user span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.sidebar-user strong {
font-size: 0.82rem;
}
.sidebar-user span {
color: var(--text-muted);
font-size: 0.69rem;
}
.logout-action.mat-mdc-button {
--mdc-text-button-label-text-color: var(--text-muted);
grid-column: 1 / -1;
height: 34px;
border-top: 1px solid var(--border);
border-radius: 0;
font-size: 0.75rem;
}
}
@@ -0,0 +1,84 @@
<aside class="app-navigation" data-testid="primary-navigation">
<div class="sidebar-brand">
<app-brand-mark class="brand-mark" />
<div><strong>LMNP</strong><span>Organizer</span></div>
</div>
<nav class="navigation-items" aria-label="Navigation principale">
<button
mat-button
type="button"
class="navigation-item"
[class.active]="activeTab() === 'dashboard'"
[attr.aria-current]="activeTab() === 'dashboard' ? 'page' : null"
(click)="tabSelected.emit('dashboard')"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
aria-hidden="true"
>
<rect x="3" y="3" width="7" height="7" rx="2" />
<rect x="14" y="3" width="7" height="7" rx="2" />
<rect x="3" y="14" width="7" height="7" rx="2" />
<rect x="14" y="14" width="7" height="7" rx="2" />
</svg>
<span>Tableau de bord</span>
</button>
<button
mat-button
type="button"
class="navigation-item"
[class.active]="activeTab() === 'apartments'"
[attr.aria-current]="activeTab() === 'apartments' ? 'page' : null"
(click)="tabSelected.emit('apartments')"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
aria-hidden="true"
>
<path d="M4 21V5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16" />
<path d="M2 21h20M8 7h2M14 7h2M8 11h2M14 11h2M8 15h2M14 15h2" />
</svg>
<span>Appartements</span>
</button>
<button
mat-button
type="button"
class="navigation-item"
[class.active]="activeTab() === 'settings'"
[attr.aria-current]="activeTab() === 'settings' ? 'page' : null"
(click)="tabSelected.emit('settings')"
>
<svg
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
aria-hidden="true"
>
<circle cx="12" cy="12" r="3" />
<path
d="M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.83 2.83-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6 1.7 1.7 0 0 0-.4 1.1V21h-4v-.09A1.7 1.7 0 0 0 8.6 19.4a1.7 1.7 0 0 0-1.88.34l-.06.06-2.83-2.83.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-.6-1 1.7 1.7 0 0 0-1.1-.4H3v-4h.09A1.7 1.7 0 0 0 4.6 8.6a1.7 1.7 0 0 0-.34-1.88l-.06-.06 2.83-2.83.06.06A1.7 1.7 0 0 0 9 4.6a1.7 1.7 0 0 0 1-.6 1.7 1.7 0 0 0 .4-1.1V3h4v.09A1.7 1.7 0 0 0 15.4 4.6a1.7 1.7 0 0 0 1.88-.34l.06-.06 2.83 2.83-.06.06A1.7 1.7 0 0 0 19.4 9c.16.38.37.72.6 1 .3.3.7.45 1.1.45h.09v4h-.09c-.4 0-.8.15-1.1.45-.23.28-.44.62-.6 1Z"
/>
</svg>
<span>Réglages</span>
</button>
</nav>
<div class="sidebar-user">
<div class="compact-avatar">{{ userInitial() }}</div>
<div>
<strong>{{ username() }}</strong
><span>{{ email() }}</span>
</div>
<button mat-button type="button" class="logout-action" (click)="logoutRequested.emit()">
Déconnexion
</button>
</div>
</aside>
@@ -0,0 +1,20 @@
import { Component, input, output } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { BrandMark } from '../brand-mark';
export type WorkspaceTab = 'dashboard' | 'apartments' | 'settings';
@Component({
selector: 'app-workspace-navigation',
imports: [BrandMark, MatButtonModule],
templateUrl: './workspace-navigation.html',
styleUrl: './workspace-navigation.css',
})
export class WorkspaceNavigation {
readonly activeTab = input.required<WorkspaceTab>();
readonly username = input.required<string>();
readonly email = input.required<string>();
readonly userInitial = input.required<string>();
readonly tabSelected = output<WorkspaceTab>();
readonly logoutRequested = output<void>();
}