This repository consists of two projects:
cps-ui-kit
- shared components library itselfcomposition
- application for previewing compositions of components consumed from the library
- 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/components
directory - run:
ng g c cps-componentname --standalone --prefix
- modify
projects/cps-ui-kit/src/public-api.ts
to 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/pages
directory - run:
ng g c componentname-page --standalone
- there is no need to test composition pages, so manually delete
componentname-page.component.cy.ts
file (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
ComponentDocsViewerComponent
into@Component
imports
array in case of a new component page, includeServiceDocsViewerComponent
into@Component
imports
array in case of a new service page - import
ComponentData or ServiceData
from '../../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.ts
file and extend_components
array (keep alphabetical order!) - go to
projects/composition/src/app/app-routing.module.ts
and 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