ngx-cho-components
v0.1.17
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 validationChoModalComponent- Modal dialog wrapperChoPhoneInfoComponent- 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)
- Bootstrap (for styling)
Installation
npm install ngx-cho-components ngx-cho-common bootstrapBuild
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 - 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-modal [isOpen]="showModal" (closeModal)="handleClose()">
<p>Modal content here</p>
</cho-modal>
<cho-radio-group
[options]="radioOptions"
[(value)]="selectedValue">
</cho-radio-group>Styling
Components are designed to work with Bootstrap. Include Bootstrap CSS in your application:
@import 'bootstrap/dist/css/bootstrap.min.css';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
