@assistanz/carbideui 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-present Assistanz Networks Pvt Ltd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,53 +1,220 @@
1
- # Ngcc — Angular Carbon Components
2
- **Maintained by:** [Assistanz Networks Pvt Ltd](https://assistanz.com/)
1
+ # @assistanz/carbideui
2
+
3
+ An independent, community-driven Angular component library inspired by the [Carbon Design System](https://carbondesignsystem.com/).
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@assistanz/carbideui.svg?style=flat-square)](https://www.npmjs.com/package/@assistanz/carbideui)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://github.com/assistanz/carbideui/blob/main/LICENSE)
7
+ [![Angular](https://img.shields.io/badge/Angular-20%2B-DD0031.svg?style=flat-square)](https://angular.dev)
8
+ [![WCAG 2.1 AA](https://img.shields.io/badge/WCAG-2.1%20AA-brightgreen.svg?style=flat-square)](https://www.w3.org/WAI/WCAG21/quickref/)
9
+
10
+ > **Disclaimer:** This project is NOT affiliated with, endorsed by, or sponsored by IBM or the Carbon Design System team. "Carbon" is a trademark of IBM Corporation.
3
11
 
4
12
  ---
5
13
 
6
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.1.4.
14
+ ## Table of Contents
15
+
16
+ - [Installation](#installation)
17
+ - [Setup](#setup)
18
+ - [Quick Start](#quick-start)
19
+ - [Components](#components)
20
+ - [Forms](#forms)
21
+ - [Button](#button)
22
+ - [Data — Table & Pagination](#data--table--pagination)
23
+ - [Feedback — Notification & Toast](#feedback--notification--toast)
24
+ - [Modal](#modal)
25
+ - [Tooltip & Skeleton](#tooltip--skeleton)
26
+ - [Navigation — Tabs & Accordion](#navigation--tabs--accordion)
27
+ - [Charts](#charts)
28
+ - [Theming](#theming)
29
+ - [Reactive Forms](#reactive-forms)
30
+ - [Accessibility](#accessibility)
31
+ - [Troubleshooting](#troubleshooting)
32
+ - [Compatibility](#compatibility)
33
+ - [Resources](#resources)
7
34
 
8
- ## Code scaffolding
35
+ ---
9
36
 
10
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
37
+ ## Installation
11
38
 
12
39
  ```bash
13
- ng generate component component-name
40
+ npm install @assistanz/carbideui @carbon/styles @carbon/charts
14
41
  ```
42
+ ---
15
43
 
16
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
44
+ ## Setup
17
45
 
18
- ```bash
19
- ng generate --help
46
+ ### 1. Import styles
47
+
48
+ Add the following to your global stylesheet (`src/styles.scss`):
49
+
50
+ ```scss
51
+ @use '@carbon/styles/scss/config' with (
52
+ $use-flexbox-grid: true,
53
+ $font-path: '@ibm/plex'
54
+ );
55
+
56
+ @use '@carbon/styles';
57
+ @use '@assistanz/carbideui/styles';
20
58
  ```
21
59
 
22
- ## Building
60
+ > Without this, components will render unstyled.
23
61
 
24
- To build the library, run:
62
+ ---
25
63
 
26
- ```bash
27
- ng build ngcc
64
+ ## Quick Start
65
+
66
+ Import only the components you need — all are standalone and tree-shakeable.
67
+
68
+ ```typescript
69
+ import { NgccButton, NgccInput, NgccCheckbox } from '@assistanz/carbideui';
70
+
71
+ @Component({
72
+ selector: 'app-root',
73
+ standalone: true,
74
+ imports: [NgccButton, NgccInput, NgccCheckbox],
75
+ template: `
76
+ <ngcc-input label="Email" type="email" [(value)]="email" />
77
+ <ngcc-checkbox label="I agree to terms" [(checked)]="agreed" />
78
+ <ngcc-button label="Submit" variant="primary" (click)="submit()" />
79
+ `,
80
+ })
81
+ export class AppComponent {
82
+ email = '';
83
+ agreed = false;
84
+
85
+ submit() {}
86
+ }
28
87
  ```
29
88
 
30
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
89
+ ---
31
90
 
32
- ### Publishing the Library
91
+ ## Components
33
92
 
34
- Once the project is built, you can publish your library by following these steps:
93
+ ### Forms
35
94
 
36
- 1. Navigate to the `dist` directory:
37
- ```bash
38
- cd dist/ngcc
39
- ```
95
+ All form components implement `ControlValueAccessor` and support both template-driven (`[(ngModel)]`) and reactive forms.
40
96
 
41
- 2. Run the `npm publish` command to publish your library to the npm registry:
42
- ```bash
43
- npm publish
44
- ```
97
+ #### NgccInput
45
98
 
46
- ## Running unit tests
99
+ ```typescript
100
+ import { NgccInput } from '@assistanz/carbideui';
47
101
 
48
- To execute unit tests with the Vitest:
102
+ // template
103
+ <ngcc-input
104
+ label="Email"
105
+ type="email"
106
+ placeholder="user@example.com"
107
+ [(value)]="email"
108
+ [required]="true"
109
+ [invalid]="isEmailInvalid()"
110
+ errorMessage="Please enter a valid email"
111
+ helperText="We'll never share your email"
112
+ />
113
+ ```
114
+ ---
49
115
 
50
- ```bash
51
- npm run test
116
+ ## Reactive Forms
117
+
118
+ ```typescript
119
+ import { ReactiveFormsModule, FormGroup, FormControl } from '@angular/forms';
120
+ import { NgccInput, NgccCheckbox, NgccDropdown } from '@assistanz/carbideui';
121
+
122
+ @Component({
123
+ imports: [ReactiveFormsModule, NgccInput, NgccCheckbox, NgccDropdown],
124
+ template: `
125
+ <form [formGroup]="form">
126
+ <ngcc-input label="Email" formControlName="email" />
127
+ <ngcc-checkbox label="Subscribe" formControlName="subscribe" />
128
+ <ngcc-dropdown label="Country" formControlName="country" [items]="countries" />
129
+ </form>
130
+ `,
131
+ })
132
+ export class MyComponent {
133
+ form = new FormGroup({
134
+ email: new FormControl(''),
135
+ subscribe: new FormControl(false),
136
+ country: new FormControl(null),
137
+ });
138
+ }
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Accessibility
144
+
145
+ All components are built to **WCAG 2.1 AA** standard:
146
+
147
+ - ARIA labels via `ariaLabel` prop on every interactive component
148
+ - Keyboard navigation — Tab, arrow keys, Enter/Space
149
+ - Focus trap inside modals
150
+ - Screen reader support (tested with NVDA / JAWS)
151
+ - Automated axe-core testing on every component
152
+
153
+ Always provide a label or `ariaLabel` on interactive elements:
154
+
155
+ ```html
156
+ <ngcc-button ariaLabel="Submit registration form" variant="primary" />
52
157
  ```
53
158
 
159
+ ---
160
+
161
+ ## Troubleshooting
162
+
163
+ **Components render unstyled**
164
+ Ensure `@carbon/styles` is imported **before** any component usage in your global stylesheet.
165
+
166
+ ```scss
167
+ @use '@carbon/styles'; /* must be present */
168
+ ```
169
+
170
+ **Two-way binding `[(value)]` does not update**
171
+ Import `FormsModule` in your component:
172
+
173
+ ```typescript
174
+ import { FormsModule } from '@angular/forms';
175
+ @Component({ imports: [FormsModule, NgccInput] })
176
+ ```
177
+
178
+ **`NullInjectorError` for NotificationService / ToastService**
179
+ These services are `providedIn: 'root'`. Ensure you are bootstrapping with `bootstrapApplication()`:
180
+
181
+ ```typescript
182
+ bootstrapApplication(AppComponent);
183
+ ```
184
+
185
+ **Theme does not change**
186
+ Use the signal setter — direct assignment does not trigger reactivity:
187
+
188
+ ```typescript
189
+ this.themeService.baseTheme.set('g90'); // correct
190
+ this.themeService.baseTheme = 'g90'; // does not work
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Compatibility
196
+
197
+ | Dependency | Version |
198
+ | --------------- | ------------------ |
199
+ | Angular | ^20.0.0 |
200
+ | @carbon/styles | ^1.98.0 |
201
+ | @carbon/charts | ^1.27.0 |
202
+ | TypeScript | ~5.9 |
203
+ | Node.js | >=20 |
204
+
205
+ ---
206
+
207
+ ## Resources
208
+
209
+ - [GitHub Repository](https://github.com/assistanz/carbideui)
210
+ - [Storybook / Interactive Docs](https://assistanz.github.io/carbideui)
211
+ - [Component Usage Reference](https://github.com/assistanz/carbideui/blob/main/COMPONENT_USAGE_REFERENCE.md)
212
+ - [Changelog](https://github.com/assistanz/carbideui/blob/main/CHANGELOG.md)
213
+ - [Issue Tracker](https://github.com/assistanz/carbideui/issues)
214
+ - [Contributing Guide](https://github.com/assistanz/carbideui/blob/main/.github/CONTRIBUTING.md)
215
+
216
+ ---
217
+
218
+ ## License
219
+
220
+ [MIT](https://github.com/assistanz/carbideui/blob/main/LICENSE) — Maintained by [Assistanz Networks Pvt Ltd](https://assistanz.com/)