Skip to content
Open
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
64 changes: 51 additions & 13 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion projects/composition/src/app/app.component.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TerranceKhumalo-absa in projects/composition/src/app/app.component.spec.ts could we import ThemeToggleComponent in the test module? ng test logs app-theme-toggle is not a known element, which masks template errors.

Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<div class="top-toolbar">
<img src="assets/ui_logo.svg" />
<img src="assets/ui_logo.svg" alt="CPS UI Kit logo" />
<span>Consumer Products UI Kit</span>
@if (version) {
<span
><b>v{{ version }}</b></span
>
}
<app-theme-toggle />
</div>
<div class="composition-container">
<app-navigation-sidebar
Expand Down
36 changes: 28 additions & 8 deletions projects/composition/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,38 @@

.top-toolbar {
height: vars.$top-tbar-height;
background-color: white;
background-color: var(--cps-surface-body);
display: flex;
padding-left: 20px;
padding: 0 14px;
align-items: center;
border-bottom: 1px solid lightgrey;
border-bottom: 1px solid var(--cps-border-color);
gap: 8px;
img {
width: 42px;
height: 42px;
}

span {
margin-left: 16px;
font-size: 18px;
color: vars.$color-calm;
font-size: 13px;
color: var(--cps-text-secondary);
line-height: 1;

&:first-of-type {
flex: 1;
color: var(--cps-text-primary);
font-weight: 600;
letter-spacing: 0.01em;
}

b {
color: var(--cps-accent-primary);
font-weight: 700;
font-size: 15px;
}
}

app-theme-toggle {
margin-left: auto;
}
}
.composition-container {
Expand All @@ -29,11 +48,12 @@
background-color: vars.$composition-background;
.composition-body-toolbar {
height: vars.$inner-tbar-height;
background: vars.$color-calm;
background: var(--cps-surface-elevated);
border-bottom: 1px solid var(--cps-border-color);
display: flex;
align-items: center;
justify-content: space-between;
color: white;
color: var(--cps-text-primary);
font-size: 20px;
.composition-body-toolbar-title {
margin: 0 auto;
Expand Down
10 changes: 6 additions & 4 deletions projects/composition/src/app/app.module.ts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TerranceKhumalo-absa I'm not sure was it intended or not, so I'll just gather the list suspicious props in files:
projects/composition/src/app/pages/menu-page/menu-page.component.scss:12 color: red;
projects/composition/src/app/pages/table-page/table-page.component.scss:4 color: red;

Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
// provideClientHydration
} from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TitleStrategy } from '@angular/router';

Check warning on line 7 in projects/composition/src/app/app.module.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
import { CpsIconComponent } from 'cps-ui-kit';

Check warning on line 8 in projects/composition/src/app/app.module.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NavigationSidebarComponent } from './components/navigation-sidebar/navigation-sidebar.component';
import { TitleStrategy } from '@angular/router';
import { AppPrefixTitleStrategy } from './app.prefix-title-strategy';
import { CpsIconComponent } from 'cps-ui-kit';
import { NavigationSidebarComponent } from './components/navigation-sidebar/navigation-sidebar.component';

Check warning on line 12 in projects/composition/src/app/app.module.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
import { ThemeToggleComponent } from './components/theme-toggle/theme-toggle.component';

Check warning on line 13 in projects/composition/src/app/app.module.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

@NgModule({
declarations: [AppComponent],
Expand All @@ -18,7 +19,8 @@
BrowserAnimationsModule,
AppRoutingModule,
NavigationSidebarComponent,
CpsIconComponent
CpsIconComponent,
ThemeToggleComponent
],
providers: [
{ provide: TitleStrategy, useClass: AppPrefixTitleStrategy }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<cps-tab-group
tabsBackground="bg-light"
tabsBackground="surface-elevated"
animationType="fade"
(afterTabChanged)="changeTab($event)"
[selectedIndex]="selectedTabIndex">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
@use '../../../variables.scss' as vars;

:host {
$item-hover-background: var(--cps-color-highlight-hover);
$item-active-background: var(--cps-color-highlight-active);
$item-border-color: var(--cps-color-line-light);
$item-hover-background: var(--cps-highlight-hover);
$item-active-background: var(--cps-highlight-active);
$item-border-color: var(--cps-color-line);

border-right: 1px solid $item-border-color;
background-color: var(--cps-color-bg-light);
background-color: var(--cps-surface-body);
.sidebar {
transition: width 0.2s;
background-color: white;
background-color: var(--cps-surface-body);
width: vars.$sidebar-width;
height: calc(100vh - vars.$top-tbar-height - 20px);
overflow: auto;
.list {
&-title {
margin: 0;
padding: 12px 0 12px 12px;
color: vars.$color-text;
color: var(--cps-text-primary);
}
&-item {
border-bottom: 1px solid $item-border-color;
Expand All @@ -26,7 +26,7 @@
align-items: center;
padding-left: 30px;
text-decoration: none;
color: vars.$color-text;
color: var(--cps-text-primary);
&:hover {
background: $item-hover-background;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<div class="theme-controls">
<button
class="theme-toggle-btn"
(click)="toggleMenu()"
[attr.aria-expanded]="menuOpen"
aria-label="Open appearance settings"
type="button">
Customize
<span class="theme-toggle-caret">▾</span>
</button>
@if (menuOpen) {
<div class="menu-backdrop" aria-hidden="true" (click)="closeMenu()"></div>
<div class="theme-menu" aria-label="Appearance settings">
<div class="theme-menu-header">
<div class="theme-menu-title">Appearance</div>
<div class="theme-menu-subtitle">Theme, radius and dark base</div>
</div>
<section class="theme-section theme-section-theme" aria-label="Theme">
<h4 class="theme-section-title">Theme</h4>
<div class="theme-options">
<button
type="button"
class="theme-option"
[class.selected]="colorTheme() === 'neutral'"
(click)="setColorTheme('neutral')">
<span class="option-dot"></span>
Neutral
</button>
<button
type="button"
class="theme-option"
[class.selected]="colorTheme() === 'calm'"
(click)="setColorTheme('calm')">
<span class="option-dot"></span>
Calm
</button>
<button
type="button"
class="theme-option"
[class.selected]="colorTheme() === 'energy'"
(click)="setColorTheme('energy')">
<span class="option-dot"></span>
Energy
</button>
<button
type="button"
class="theme-option"
[class.selected]="colorTheme() === 'passion'"
(click)="setColorTheme('passion')">
<span class="option-dot"></span>
Passion
</button>
Comment on lines +21 to +52
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Menu buttons should have role="menuitem" instead of using implicit button role within a role="menu" container. Additionally, each menu item button should have aria-checked attribute to indicate selected state for better screen reader support, not just a visual class.

Copilot uses AI. Check for mistakes.
</div>
</section>
<section class="theme-section" aria-label="Radius">
<h4 class="theme-section-title">Radius</h4>
<div class="theme-options">
<button
type="button"
class="theme-option"
[class.selected]="radiusTheme() === 'none'"
(click)="setRadiusTheme('none')">
None
</button>
<button
type="button"
class="theme-option"
[class.selected]="radiusTheme() === 'compact'"
(click)="setRadiusTheme('compact')">
Compact
</button>
<button
type="button"
class="theme-option"
[class.selected]="radiusTheme() === 'rounded'"
(click)="setRadiusTheme('rounded')">
Rounded
</button>
<button
type="button"
class="theme-option"
[class.selected]="radiusTheme() === 'pill'"
(click)="setRadiusTheme('pill')">
Pill
</button>
</div>
</section>
<section class="theme-section" aria-label="Base">
<h4 class="theme-section-title">Base</h4>
<p class="theme-section-hint">Base affects dark mode surfaces.</p>
<div class="theme-options">
<button
type="button"
class="theme-option"
[class.selected]="baseTheme() === 'default'"
(click)="setBaseTheme('default')">
Default
</button>
<button
type="button"
class="theme-option"
[class.selected]="baseTheme() === 'graphite'"
(click)="setBaseTheme('graphite')">
Graphite
</button>
<button
type="button"
class="theme-option"
[class.selected]="baseTheme() === 'midnight'"
(click)="setBaseTheme('midnight')">
Midnight
</button>
<button
type="button"
class="theme-option"
[class.selected]="baseTheme() === 'aubergine'"
(click)="setBaseTheme('aubergine')">
Aubergine
</button>
</div>
</section>
</div>
}
<button
class="theme-toggle-btn"
(click)="toggleTheme()"
[attr.aria-label]="
isDark() ? 'Switch to light mode' : 'Switch to dark mode'
"
type="button">
Comment on lines +124 to +130
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TerranceKhumalo-absa could we expose the toggle state with aria-pressed or role="switch" + aria-checked? Right now the icon button only has a label.

<cps-icon [icon]="isDark() ? 'sun' : 'moon'" [size]="20"> </cps-icon>
</button>
</div>
Loading
Loading