[AAE-15295] added design tokens to PeopleCloudComponent (#9162)

This commit is contained in:
Wojciech Duda
2023-12-18 14:47:15 +01:00
committed by GitHub
parent 269dcf1cf1
commit 0191860950
4 changed files with 67 additions and 52 deletions

View File

@@ -4,45 +4,48 @@
@mixin adf-components-variables($theme) { @mixin adf-components-variables($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$accent: map-get($theme, accent); $accent: map-get($theme, accent);
$warn: map-get($theme, warn);
$foreground: map-get($theme, foreground);
$background: map-get($theme, background);
$defaults: ( $defaults: (
--adf-card-view-background: $adf-ref-card-background, --adf-card-view-background: mat.get-color-from-palette($background, card),
--adf-card-view-border: $adf-ref-card-border, --adf-card-view-border: $adf-ref-card-border,
--adf-card-view-border-color: $adf-ref-card-border-color, --adf-card-view-border-color: mat.get-color-from-palette($foreground, divider),
--adf-card-view-border-radius: $adf-ref-card-border-radius-slim, --adf-card-view-border-radius: $adf-ref-card-border-radius-slim,
--adf-card-view-array-item-background: $adf-ref-card-background, --adf-card-view-array-item-background: mat.get-color-from-palette($background, card),
--adf-card-view-array-item-border: $adf-ref-card-border, --adf-card-view-array-item-border: $adf-ref-card-border,
--adf-card-view-array-item-border-color: $adf-ref-card-border-color, --adf-card-view-array-item-border-color: mat.get-color-from-palette($foreground, divider),
--adf-card-view-array-item-border-radius: $adf-ref-card-border-radius-slim, --adf-card-view-array-item-border-radius: $adf-ref-card-border-radius-slim,
--adf-edit-task-and-service-filter-header-title-color: $adf-ref-title-color, --adf-edit-task-and-service-filter-header-title-color: mat.get-color-from-palette($foreground, text),
--adf-edit-task-and-service-filter-header-description-color: $adf-ref-description-color, --adf-edit-task-and-service-filter-header-description-color: mat.get-color-from-palette($foreground, secondary-text),
--adf-edit-task-and-service-filter-content-text-label-color: $adf-ref-text-field-label-color, --adf-edit-task-and-service-filter-content-text-label-color: mat.get-color-from-palette($foreground, secondary-text),
--adf-edit-task-and-service-filter-content-select-label-color: $adf-ref-select-field-label-color, --adf-edit-task-and-service-filter-content-select-label-color: mat.get-color-from-palette($foreground, secondary-text),
--adf-edit-task-and-service-filter-header-height: $adf-ref-height-48, --adf-edit-task-and-service-filter-header-height: $adf-ref-height-48,
--adf-about-panel-header-height: $adf-ref-height-48, --adf-about-panel-header-height: $adf-ref-height-48,
--adf-about-panel-header-title-color: $adf-ref-title-color, --adf-about-panel-header-title-color: mat.get-color-from-palette($foreground, text),
--adf-edit-process-filter-header-height: $adf-ref-height-48, --adf-edit-process-filter-header-height: $adf-ref-height-48,
--adf-edit-process-filter-header-title-color: $adf-ref-title-color, --adf-edit-process-filter-header-title-color: mat.get-color-from-palette($foreground, text),
--adf-edit-process-filter-header-description-color: $adf-ref-description-color, --adf-edit-process-filter-header-description-color: mat.get-color-from-palette($foreground, secondary-text),
--adf-edit-process-filter-content-text-label-color: $adf-ref-text-field-label-color, --adf-edit-process-filter-content-text-label-color: mat.get-color-from-palette($foreground, secondary-text),
--adf-edit-process-filter-content-select-label-color: $adf-ref-select-field-label-color, --adf-edit-process-filter-content-select-label-color: mat.get-color-from-palette($foreground, secondary-text),
--adf-about-server-settings-background: $adf-ref-card-background, --adf-about-server-settings-background: mat.get-color-from-palette($background, card),
--adf-about-server-settings-color: $adf-ref-card-color, --adf-about-server-settings-color: mat.get-color-from-palette($foreground, text),
--adf-about-server-settings-border-radius: $adf-ref-card-border-radius-normal, --adf-about-server-settings-border-radius: $adf-ref-card-border-radius-normal,
--adf-about-server-settings-padding: $adf-ref-card-padding, --adf-about-server-settings-padding: $adf-ref-card-padding,
--adf-package-list-table-background: $adf-ref-table-background, --adf-package-list-table-background: mat.get-color-from-palette($background, card),
--adf-package-list-table-header-border-bottom-color: $adf-ref-table-header-border-bottom-color, --adf-package-list-table-header-border-bottom-color: mat.get-color-from-palette($foreground, divider),
--adf-package-list-table-header-border-style: $adf-ref-table-header-border-style, --adf-package-list-table-header-border-style: $adf-ref-table-header-border-style,
--adf-package-list-table-header-border-bottom-width: $adf-ref-table-header-border-bottom-width, --adf-package-list-table-header-border-bottom-width: $adf-ref-table-header-border-bottom-width,
--adf-package-list-table-header-border-width: $adf-ref-table-header-border-width, --adf-package-list-table-header-border-width: $adf-ref-table-header-border-width,
--adf-package-list-table-header-min-height: $adf-ref-table-header-min-height, --adf-package-list-table-header-min-height: $adf-ref-table-header-min-height,
--adf-package-list-table-header-cell-color: $adf-ref-table-header-cell-color, --adf-package-list-table-header-cell-color: mat.get-color-from-palette($foreground, secondary-text),
--adf-package-list-table-row-border-bottom-color: $adf-ref-table-row-border-bottom-color, --adf-package-list-table-row-border-bottom-color: mat.get-color-from-palette($foreground, dividers),
--adf-package-list-table-row-border-style: $adf-ref-table-row-border-style, --adf-package-list-table-row-border-style: $adf-ref-table-row-border-style,
--adf-package-list-table-row-border-bottom-width: $adf-ref-table-row-border-bottom-width, --adf-package-list-table-row-border-bottom-width: $adf-ref-table-row-border-bottom-width,
--adf-package-list-table-row-border-width: $adf-ref-table-row-border-width, --adf-package-list-table-row-border-width: $adf-ref-table-row-border-width,
--adf-package-list-table-row-min-height: $adf-ref-table-row-min-height, --adf-package-list-table-row-min-height: $adf-ref-table-row-min-height,
--adf-package-list-table-row-cell-color: $adf-ref-table-row-cell-color, --adf-package-list-table-row-cell-color: mat.get-color-from-palette($foreground, text),
--adf-identity-user-info-background: var(--adf-theme-primary-300), --adf-identity-user-info-background: var(--adf-theme-primary-300),
--adf-identity-user-info-height: $adf-ref-height, --adf-identity-user-info-height: $adf-ref-height,
--adf-identity-user-info-width: $adf-ref-width, --adf-identity-user-info-width: $adf-ref-width,
@@ -51,17 +54,24 @@
--adf-user-info-container-margin-right: $adf-ref-margin-right, --adf-user-info-container-margin-right: $adf-ref-margin-right,
--adf-info-drawer-tab-default-color: mat.get-color-from-palette($accent), --adf-info-drawer-tab-default-color: mat.get-color-from-palette($accent),
--adf-info-drawer-tab-default-background:unset, --adf-info-drawer-tab-default-background: mat.get-color-from-palette($background, card),
--adf-info-drawer-tab-default-bottom-line:unset, --adf-info-drawer-tab-default-bottom-line:$adf-ref-tab-bottom-line-default,
--adf-info-drawer-tab-hover-color:mat.get-color-from-palette($accent), --adf-info-drawer-tab-hover-color:mat.get-color-from-palette($accent),
--adf-info-drawer-tab-hover-background:unset, --adf-info-drawer-tab-hover-background: mat.get-color-from-palette($background, card),
--adf-info-drawer-tab-hover-bottom-line:unset, --adf-info-drawer-tab-hover-bottom-line:$adf-ref-tab-bottom-line-default,
--adf-info-drawer-tab-active-unfocused-color: mat.get-color-from-palette($primary), --adf-info-drawer-tab-active-unfocused-color: mat.get-color-from-palette($primary),
--adf-info-drawer-tab-active-unfocused-background:unset, --adf-info-drawer-tab-active-unfocused-background: mat.get-color-from-palette($background, card),
--adf-info-drawer-tab-active-unfocused-bottom-line:unset, --adf-info-drawer-tab-active-unfocused-bottom-line: $adf-ref-tab-bottom-line-default,
--adf-info-drawer-tab-active-focused-color: mat.get-color-from-palette($foreground, text),
--adf-info-drawer-tab-active-focused-background: mat.get-color-from-palette($primary), --adf-info-drawer-tab-active-focused-background: mat.get-color-from-palette($primary),
--adf-info-drawer-tab-active-focused-color:unset, --adf-info-drawer-tab-active-focused-bottom-line: $adf-ref-tab-bottom-line-active,
--adf-info-drawer-tab-active-focused-bottom-line:unset,
--adf-people-cloud-input-label-default-color: mat.get-color-from-palette($foreground, secondary-text),
--adf-people-cloud-input-label-focus-color: mat.get-color-from-palette($primary),
--adf-people-cloud-autosuggest-result-active-color: mat.get-color-from-palette($foreground, text),
--adf-people-cloud-autosuggest-result-disabled-color: mat.get-color-from-palette($foreground, secondary-text),
--adf-people-cloud-input-caption-error-color: mat.get-color-from-palette($warn)
); );
// propagates SCSS variables into the CSS variables scope // propagates SCSS variables into the CSS variables scope

View File

@@ -1,29 +1,19 @@
$adf-ref-card-background: white;
$adf-ref-card-border: unset; $adf-ref-card-border: unset;
$adf-ref-card-border-color: unset;
$adf-ref-card-border-radius-slim: 0; $adf-ref-card-border-radius-slim: 0;
$adf-ref-height-48: 48px; $adf-ref-height-48: 48px;
$adf-ref-title-color: rgba(0, 0, 0, 0.87);
$adf-ref-description-color: rgba(0, 0, 0, 0.54);
$adf-ref-text-field-label-color: rgba(0, 0, 0, 0.54);
$adf-ref-select-field-label-color: rgba(0, 0, 0, 0.54);
$adf-ref-card-color: rgba(0, 0, 0, 0.87);
$adf-ref-card-padding: 16px; $adf-ref-card-padding: 16px;
$adf-ref-card-border-radius-normal: 4px; $adf-ref-card-border-radius-normal: 4px;
$adf-ref-table-background: white;
$adf-ref-table-header-border-bottom-color: rgba(0, 0, 0, 0.12);
$adf-ref-table-header-border-style: solid; $adf-ref-table-header-border-style: solid;
$adf-ref-table-header-border-bottom-width: 1px; $adf-ref-table-header-border-bottom-width: 1px;
$adf-ref-table-header-border-width: 0; $adf-ref-table-header-border-width: 0;
$adf-ref-table-header-min-height: 56px; $adf-ref-table-header-min-height: 56px;
$adf-ref-table-header-cell-color: rgba(0, 0, 0, 0.54);
$adf-ref-table-row-border-bottom-color: rgba(0, 0, 0, 0.12);
$adf-ref-table-row-border-style: solid; $adf-ref-table-row-border-style: solid;
$adf-ref-table-row-border-bottom-width: 1px; $adf-ref-table-row-border-bottom-width: 1px;
$adf-ref-table-row-border-width: 0; $adf-ref-table-row-border-width: 0;
$adf-ref-table-row-min-height: 48px; $adf-ref-table-row-min-height: 48px;
$adf-ref-table-row-cell-color: rgba(0, 0, 0, 0.87);
$adf-ref-height: 40px; $adf-ref-height: 40px;
$adf-ref-width: 40px; $adf-ref-width: 40px;
$adf-ref-line-height: 40px; $adf-ref-line-height: 40px;
$adf-ref-margin-right: 8px; $adf-ref-margin-right: 8px;
$adf-ref-tab-bottom-line-default: unset;
$adf-ref-tab-bottom-line-active: unset;

View File

@@ -1,6 +1,7 @@
<form> <form>
<mat-form-field [floatLabel]="'auto'" class="adf-people-cloud" [class.adf-invalid]="hasError() && isDirty()"> <mat-form-field floatLabel="auto" class="adf-people-cloud" [class.adf-invalid]="hasError() && isDirty()">
<mat-label *ngIf="!isReadonly()" id="adf-people-cloud-title-id">{{ title | translate }}</mat-label> <mat-label *ngIf="!isReadonly()" id="adf-people-cloud-title-id" class="adf-people-cloud-title"
[ngClass]="{'adf-people-cloud-title--focus': isFocused}">{{ title | translate }}</mat-label>
<mat-chip-list #userMultipleChipList [disabled]="isReadonly() || isValidationLoading()" data-automation-id="adf-cloud-people-chip-list"> <mat-chip-list #userMultipleChipList [disabled]="isReadonly() || isValidationLoading()" data-automation-id="adf-cloud-people-chip-list">
<mat-chip <mat-chip
*ngFor="let user of selectedUsers" *ngFor="let user of selectedUsers"
@@ -17,6 +18,7 @@
</mat-icon> </mat-icon>
</mat-chip> </mat-chip>
<input *ngIf="!isReadonly()" matInput <input *ngIf="!isReadonly()" matInput
#chipInput
[formControl]="searchUserCtrl" [formControl]="searchUserCtrl"
[matAutocomplete]="auto" [matAutocomplete]="auto"
[matChipInputFor]="userMultipleChipList" [matChipInputFor]="userMultipleChipList"
@@ -32,7 +34,8 @@
(optionSelected)="onSelect($event.option.value)" (optionSelected)="onSelect($event.option.value)"
[displayWith]="getDisplayName"> [displayWith]="getDisplayName">
<ng-container *ngIf="(searchUsers$ | async)?.length else noResults" > <ng-container *ngIf="(searchUsers$ | async)?.length else noResults" >
<mat-option *ngFor="let user of searchUsers$ | async; let i = index" [value]="user"> <mat-option *ngFor="let user of searchUsers$ | async; let i = index" [value]="user"
class="adf-people-cloud-option-active">
<div class="adf-people-cloud-row" id="adf-people-cloud-user-{{user.username}}" <div class="adf-people-cloud-row" id="adf-people-cloud-user-{{user.username}}"
data-automation-id="adf-people-cloud-row"> data-automation-id="adf-people-cloud-row">
<div [outerHTML]="user | usernameInitials:'adf-people-cloud-pic'"></div> <div [outerHTML]="user | usernameInitials:'adf-people-cloud-pic'"></div>

View File

@@ -5,6 +5,14 @@
&-option-not-active { &-option-not-active {
background: inherit !important; background: inherit !important;
} }
&-title {
color: var(--adf-people-cloud-input-label-default-color);
&--focus {
color: var(--adf-people-cloud-input-label-focus-color);
}
}
} }
&-people-cloud-list { &-people-cloud-list {
@@ -12,6 +20,14 @@
padding: 10px 0; padding: 10px 0;
} }
&-people-cloud-option-active:not(&:disabled) {
color: var(--adf-people-cloud-autosuggest-result-active-color);
}
&-people-cloud-option-not-active:not(&:active) {
color: var(--adf-people-cloud-autosuggest-result-disabled-color);
}
&-people-cloud-row { &-people-cloud-row {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -26,9 +42,6 @@
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 100px; border-radius: 100px;
color: var(--adf-theme-foreground-text-color);
font-weight: bolder;
font-size: var(--theme-adf-picture-1-font-size);
text-transform: uppercase; text-transform: uppercase;
} }
@@ -40,15 +53,14 @@
&-message { &-message {
padding-right: 8px; padding-right: 8px;
height: 16px; height: 16px;
font-size: var(--theme-caption-font-size);
line-height: 1.33; line-height: 1.33;
color: var(--theme-warn-color);
width: auto; width: auto;
} }
}
&-icon { &-error,
font-size: var(--theme-adf-icon-1-font-size); &-error-text,
color: var(--theme-warn-color); &-error-icon {
} color: var(--adf-people-cloud-input-caption-error-color);
} }
} }