This repository consists of two projects:
cps-ui-kit- shared components library itselfcomposition- application for previewing compositions of components consumed from the library
This library's components and the composition app are tested for WCAG 2.2 AA compliance both with automated tooling (axe-core, via a Playwright test suite and pa11y-ci) and manual accessibility review. See Run accessibility tests for how to run the automated checks yourself.
- Autocomplete
- Button
- Button toggles
- Checkbox
- Chip
- Datepicker
- Dialog
- Divider
- Expansion panel
- File upload
- Icon
- Info circle
- Input
- Loader
- Menu
- Notifications
- Paginator
- Progress circular (indeterminate)
- Progress linear (indeterminate)
- Radio
- Scheduler
- Select
- Sidebar menu
- Switch
- Table
- Tabs
- Tag
- Textarea
- Timepicker
- Tooltip directive
- Tree autocomplete
- Tree select
- Tree table
Run ng build cps-ui-kit --watch and ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.
- go to
projects/cps-ui-kit/src/lib/componentsdirectory - run:
ng g c cps-componentname --standalone --prefix - modify
projects/cps-ui-kit/src/public-api.tsto export the component from the library - update available components list in
projects/cps-ui-kit/README.md(keep alphabetical order!)
Make sure ng build cps-ui-kit --watch is running, so the library will be rebuilt on each change of its contents due to --watch flag
- go to
projects/composition/src/app/pagesdirectory - run:
ng g c componentname-page --standalone - there is no need to test composition pages, so manually delete
componentname-page.component.cy.tsfile (can't be done automatically with Angular CLI flag, since cypress is used) - provide
host: { class: 'composition-page' }into page@Component - import the components for the composition page from
cps-ui-kit, provide them to imports array of@Component - include
ComponentDocsViewerComponentinto@Componentimportsarray in case of a new component page, includeServiceDocsViewerComponentinto@Componentimportsarray in case of a new service page - import
ComponentData or ServiceDatafrom '../../api-data/cps-componentname.json' once it is generated - wrap page html template contents into
<app-component-docs-viewer [componentData]="componentData">...</app-component-docs-viewer>in case of a new component page, wrap page html template contents into<app-service-docs-viewer [serviceData]="serviceData">...</app-service-docs-viewer>in case of a new service page - go to
projects/composition/src/app/components/navigation-sidebar.component.tsfile and extend_componentsarray (keep alphabetical order!) - go to
projects/composition/src/app/app-routing.module.tsand add a new route for a new page - update available components list in
/README.md(keep alphabetical order!)
Execute npm run generate-json-api to generate documentation for any changes in the components' API.
npm run test
npm run test:playwright (headless run)
npm run test:playwright:headed to run tests in headed mode (browser visible)
npm run test:playwright:interactive to open Playwright UI mode
See playwright/README.md for full details.
Versioning and the changelog are driven by Conventional Commits. Because PRs are squash-merged, the PR title becomes the single commit on master, so the PR title is what must follow the convention (enforced by the Check PR Title workflow):
<type>(<scope>): <subject>
Type determines the version bump and changelog section:
| Type | Bump | Changelog |
|---|---|---|
feat |
minor | Features |
fix |
patch | Bug Fixes |
perf |
patch | Performance Improvements |
feat! / fix! / BREAKING CHANGE: footer |
major | Breaking section |
docs, style, refactor, test, build, ci, chore |
none | hidden |
Scope (optional) is the component the change targets, written as the component name without the cps- prefix. It only affects how the entry is grouped/labelled in the changelog (this is a single package, so the scope does not change versioning). Use the component name from the list above:
feat(chip): add dismissible variant
fix(scheduler): correct keyboard navigation in month view
fix(tree-table): resolve a11y issue with row focus
Omit the scope for cross-cutting changes that don't map to a single component (theming, shared utilities, build, repo-wide a11y sweeps):
chore: bump X package to v1.2.3
There is intentionally no fixed list of allowed scopes: scope is free-form so new components don't require a CI change. Keep names consistent with the component directory (minus
cps-).
Publishing is fully automated by Release Please. You never edit the version in package.json by hand.
- Merge feature/fix PRs to
masteras usual (squash merge, conventional title). - Release Please keeps an open "release" PR up to date, accumulating the next version bump and the generated
CHANGELOG.mdfrom the merged commits. - When you're ready to ship, merge the release PR. That tags the release and triggers the publish job, which builds and publishes to NPM via trusted publishing (OIDC), with no NPM token required.
The current released version is tracked in .release-please-manifest.json; Release Please updates both it and projects/cps-ui-kit/package.json inside the release PR.
Accessibility is covered by two complementary tools, run separately and by different CI jobs:
Playwright + axe-core — scans individual cps-ui-kit components (in isolation) and the full composition app (pages, shell, interactive states) against WCAG 2.0/2.1/2.2 A/AA + best-practice rules.
npm run test:playwright:accessibility # everything (cps-ui-kit + composition)
npm run test:playwright:cps-ui-kit:accessibility # cps-ui-kit components only
npm run test:playwright:composition:accessibility # composition app onlyThese run as part of the playwright CI job. See playwright/README.md for full details, including how component/page entries are structured.
pa11y-ci — scans all 33 composition demo pages (one per component) against WCAG 2.0 AA, using axe-core as its underlying test engine. This is a separate, independent check from the Playwright one above and runs as its own pa11y CI job.
To run it manually:
-
Start the development server:
npm run start
-
In a separate terminal, run the accessibility tests:
npm run test:pa11y
Alternatively, use the combined script that starts the server and shows a colorful summary with statistics:
npm run test:pa11y:localnpm run test:pa11y:summary produces that same summary, but assumes the server is already running.
npm run test:pa11y:ci is the CI equivalent of test:pa11y:local — it starts the server and runs the plain test:pa11y reporter (full per-URL violation output) instead of the summary. This is what the pa11y CI job runs.
The summary variants display:
- Total URLs tested with pass/fail ratio
- Total accessibility errors found
- Accessibility standard (WCAG 2.0 AA)
- Test engine (axe-core via pa11y-ci)
- Top 10 components with the most issues
Both test:pa11y and test:pa11y:ci fail (non-zero exit code) if any accessibility error is found on any page.