ngx-cho-components
v1.0.0
Published
This library provides reusable Angular components for CHO applications with comprehensive Storybook documentation.
Readme
NgxChoComponents
This library provides reusable Angular components for CHO applications with comprehensive Storybook documentation.
Generated with Angular CLI version 17.3.0.
Overview
NgxChoComponents includes:
ChoAddressInfoComponent- Address display and editingChoDetailsCardComponent- Information card layoutChoEmailInfoComponent- Email display and validationChoPhoneInfoComponent- Phone number display and formattingChoRadioGroupComponent- Radio button group with validationChoReviewStatusAlertComponent- Status alert messages
Dependencies
This library depends on:
- ngx-cho-common (must be built first)
This library does not require Bootstrap, ng-bootstrap, Popper, or PrimeNG.
Installation
npm install ngx-cho-components ngx-cho-commonBreaking Changes
ChoModalComponent and the <cho-modal> selector have been removed. Applications should replace modal usage with an app-local dialog implementation, such as a native dialog or a PrimeNG dialog/drawer. This package no longer declares bootstrap or @ng-bootstrap/ng-bootstrap as peer dependencies.
Build
Important: Build ngx-cho-common first before building this library.
# Build dependencies first
ng build ngx-cho-common
# Then build this library
ng build ngx-cho-componentsBuild artifacts will be stored in the dist/ngx-cho-components directory.
Development
Code Scaffolding
ng generate component component-name --project ngx-cho-components
ng generate service service-name --project ngx-cho-componentsNote: Always include
--project ngx-cho-componentsor the component will be added to the default project.
Storybook Development
This library includes Storybook for component development and documentation:
# Start Storybook development server
ng run ngx-cho-components:storybook
# Build Storybook for deployment
ng run ngx-cho-components:build-storybookStorybook will be available at http://localhost:6006
Running Tests
ng test ngx-cho-componentsPublishing
- Update version in
projects/ngx-cho-components/package.json. Use a major version for the modal-component and peer-dependency removal. - Build dependencies and library:
ng build ngx-cho-common ng build ngx-cho-components --configuration production - Publish to npm:
cd dist/ngx-cho-components npm publish
Usage
Import the components module in your application:
import { NgxChoComponentsModule } from 'ngx-cho-components';
@NgModule({
imports: [NgxChoComponentsModule],
// ...
})
export class AppModule {}Use components in your templates:
<cho-address-info [address]="userAddress"></cho-address-info>
<cho-radio-group
[options]="radioOptions"
[(value)]="selectedValue">
</cho-radio-group>Styling
Components are framework-neutral and do not require Bootstrap. Applications should provide their own layout, dialog, and theme styling.
Documentation
View component documentation and examples in Storybook:
- Run
ng run ngx-cho-components:storybook - Navigate to
http://localhost:6006 - Browse component stories and interact with examples
