Skip to content

Commit

Permalink
Aura - Rating | fix focus outline
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Apr 4, 2024
1 parent 2efa214 commit 419d42c
Show file tree
Hide file tree
Showing 72 changed files with 298 additions and 92 deletions.
2 changes: 2 additions & 0 deletions src/app/components/rating/rating.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@layer primeng {
.p-rating {
display: inline-flex;
position: relative;
align-items: center;
}

.p-rating-icon {
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/rating/rating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const RATING_VALUE_ACCESSOR: any = {
template: `
<div class="p-rating" [ngClass]="{ 'p-readonly': readonly, 'p-disabled': disabled }" [attr.data-pc-name]="'rating'" [attr.data-pc-section]="'root'">
<ng-container *ngIf="!isCustomIcon; else customTemplate">
<div *ngIf="cancel" [attr.data-pc-section]="'cancelItem'" (click)="onOptionClick($event, 0)" [ngClass]="{ 'p-focus': focusedOptionIndex() === 0 && isFocusVisible }" class="p-rating-item p-rating-cancel-item">
<div *ngIf="cancel" [attr.data-pc-section]="'cancelItem'" (click)="onOptionClick($event, 0)" [ngClass]="{ 'p-focus': focusedOptionIndex() === 0 }" class="p-rating-item p-rating-cancel-item">
<span class="p-hidden-accessible" [attr.data-p-hidden-accessible]="true">
<input
type="radio"
Expand All @@ -43,7 +43,7 @@ export const RATING_VALUE_ACCESSOR: any = {
<BanIcon *ngIf="!iconCancelClass" [styleClass]="'p-rating-icon p-rating-cancel'" [ngStyle]="iconCancelStyle" [attr.data-pc-section]="'cancelIcon'" />
</div>
<ng-template ngFor [ngForOf]="starsArray" let-star let-i="index">
<div class="p-rating-item" [ngClass]="{ 'p-rating-item-active': star + 1 <= value, 'p-focus': star + 1 === focusedOptionIndex() && isFocusVisible }" (click)="onOptionClick($event, star + 1)">
<div class="p-rating-item" [ngClass]="{ 'p-rating-item-active': star + 1 <= value, 'p-focus': star + 1 === focusedOptionIndex() }" (click)="onOptionClick($event, star + 1)">
<span class="p-hidden-accessible" [attr.data-p-hidden-accessible]="true">
<input
type="radio"
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/doc/togglebutton/basicdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Code } from '../../domain/code';
<p>Two-way binding to a boolean property is defined using the standard <i>ngModel</i> directive.</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<p-toggleButton [(ngModel)]="checked" onLabel="Yes" offLabel="No"></p-toggleButton>
<p-toggleButton [(ngModel)]="checked" onLabel="Yes" offLabel="No" styleClass="w-6rem"></p-toggleButton>
</div>
<app-code [code]="code" selector="toggle-button-basic-demo"></app-code>
`
Expand Down
2 changes: 1 addition & 1 deletion src/app/showcase/service/appconfigservice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isPlatformBrowser } from '@angular/common';
})
export class AppConfigService {
_config: AppConfig = {
theme: 'aura-light-blue',
theme: 'aura-light-green',
darkMode: false,
inputStyle: 'outlined',
ripple: true,
Expand Down
5 changes: 4 additions & 1 deletion src/assets/components/themes/arya-blue/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: rgba(255, 255, 255, 0.87);
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
Expand All @@ -1709,7 +1713,6 @@
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 1px #93cbf9;
border-color: #64B5F6;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #64B5F6;
Expand Down
5 changes: 4 additions & 1 deletion src/assets/components/themes/arya-green/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: rgba(255, 255, 255, 0.87);
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
Expand All @@ -1709,7 +1713,6 @@
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 1px #a7d8a9;
border-color: #81C784;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #81C784;
Expand Down
5 changes: 4 additions & 1 deletion src/assets/components/themes/arya-orange/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: rgba(255, 255, 255, 0.87);
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
Expand All @@ -1709,7 +1713,6 @@
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 1px #ffe284;
border-color: #FFD54F;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #FFD54F;
Expand Down
5 changes: 4 additions & 1 deletion src/assets/components/themes/arya-purple/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: rgba(255, 255, 255, 0.87);
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
Expand All @@ -1709,7 +1713,6 @@
outline: 0 none;
outline-offset: 0;
box-shadow: 0 0 0 1px #cf95d9;
border-color: #BA68C8;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #BA68C8;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-dark-amber/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #a1a1aa;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1724,9 +1728,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #52525b;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #fbbf24;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-dark-blue/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #a1a1aa;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1724,9 +1728,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #52525b;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #60a5fa;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-dark-cyan/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #a1a1aa;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1724,9 +1728,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #52525b;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #22d3ee;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-dark-green/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #a1a1aa;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1724,9 +1728,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #52525b;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #34d399;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-dark-indigo/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #a1a1aa;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1724,9 +1728,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #52525b;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #818cf8;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-dark-lime/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #a1a1aa;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1724,9 +1728,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #52525b;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #a3e635;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-dark-noir/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #a1a1aa;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1724,9 +1728,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #52525b;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #fafafa;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-dark-pink/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #a1a1aa;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1724,9 +1728,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #52525b;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #f472b6;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-dark-purple/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #a1a1aa;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1724,9 +1728,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #52525b;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #a78bfa;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-dark-teal/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #a1a1aa;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1724,9 +1728,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #52525b;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #2dd4bf;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-light-amber/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #64748b;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1726,9 +1730,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #94a3b8;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #f59e0b;
Expand Down
7 changes: 5 additions & 2 deletions src/assets/components/themes/aura-light-blue/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,10 @@
.p-rating {
gap: 0.5rem;
}
.p-rating .p-rating-item {
border-radius: 50%;
outline-color: transparent;
}
.p-rating .p-rating-item .p-rating-icon {
color: #64748b;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s;
Expand All @@ -1726,9 +1730,8 @@
}
.p-rating .p-rating-item.p-focus {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: -1px;
outline-offset: 2px;
box-shadow: none;
border-color: #94a3b8;
}
.p-rating .p-rating-item.p-rating-item-active .p-rating-icon {
color: #3B82F6;
Expand Down
Loading

0 comments on commit 419d42c

Please sign in to comment.