valtech-components 2.0.653 → 2.0.655
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/README.md +217 -181
- package/esm2022/lib/components/molecules/phone-input/phone-input.component.mjs +39 -25
- package/fesm2022/valtech-components.mjs +37 -23
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/molecules/phone-input/phone-input.component.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,257 +1,293 @@
|
|
|
1
1
|
<img style="margin-bottom: 20px;" src="https://myvaltech.s3.us-east-2.amazonaws.com/logo-terminal-rounded.png" width="60px" />
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Valtech Components
|
|
4
4
|
|
|
5
|
-
[
|
|
5
|
+
[](https://www.npmjs.com/package/valtech-components)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
**[Documentation](https://ui.myvaltech.com)** | **[npm](https://www.npmjs.com/package/valtech-components)**
|
|
9
|
+
|
|
10
|
+
A comprehensive component library for building modern web and hybrid applications with Angular, Ionic, and Capacitor. Includes **134 UI components** and **23+ specialized services** for authentication, Firebase integration, internationalization, and more.
|
|
6
11
|
|
|
7
12
|
## Features
|
|
8
13
|
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
+
- **134 UI Components** — Atoms, molecules, organisms, and templates ready to use
|
|
15
|
+
- **Authentication System** — Complete auth with OAuth (Google, Apple), session management, and token handling
|
|
16
|
+
- **Firebase Integration** — Analytics, Firestore, Cloud Messaging, and Storage services
|
|
17
|
+
- **i18n with Signals** — Modern internationalization using Angular Signals for reactive translations
|
|
18
|
+
- **Remote App Configuration** — Feature flags and remote config management
|
|
19
|
+
- **Google Ad Manager** — Built-in ad slot integration
|
|
20
|
+
- **User Feedback System** — Collect and manage user feedback
|
|
21
|
+
- **Storybook Documentation** — Interactive component documentation
|
|
14
22
|
|
|
15
23
|
## Technologies
|
|
16
24
|
|
|
17
25
|
- Angular 18+
|
|
18
26
|
- Ionic 8+
|
|
19
27
|
- Capacitor 6+
|
|
20
|
-
-
|
|
28
|
+
- Firebase 10+
|
|
29
|
+
- RxJS 7.8+
|
|
21
30
|
|
|
22
31
|
## Installation
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```sh
|
|
33
|
+
```bash
|
|
27
34
|
npm install valtech-components
|
|
28
35
|
```
|
|
29
36
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## Development
|
|
33
|
-
|
|
34
|
-
### Prerequisites
|
|
35
|
-
|
|
36
|
-
- Node.js 18+
|
|
37
|
-
- npm 9+
|
|
38
|
-
|
|
39
|
-
### Setup
|
|
37
|
+
### Peer Dependencies
|
|
40
38
|
|
|
41
39
|
```bash
|
|
42
|
-
|
|
43
|
-
npm install
|
|
40
|
+
npm install @angular/core @angular/common @ionic/angular ionicons rxjs
|
|
44
41
|
```
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
| Command | Description |
|
|
49
|
-
|---------|-------------|
|
|
50
|
-
| `npm run build` | Build the library (production) |
|
|
51
|
-
| `npm run build:prod` | Build with production config |
|
|
52
|
-
| `npm run storybook` | Start Storybook dev server (port 6006) |
|
|
53
|
-
| `npm run build-storybook` | Build static Storybook |
|
|
54
|
-
| `npm run test` | Run unit tests |
|
|
55
|
-
| `npm run prettier` | Format source files |
|
|
56
|
-
|
|
57
|
-
### Storybook
|
|
58
|
-
|
|
59
|
-
Storybook is included for component development and documentation:
|
|
43
|
+
Optional peer dependencies for additional features:
|
|
60
44
|
|
|
61
45
|
```bash
|
|
62
|
-
#
|
|
63
|
-
npm
|
|
46
|
+
# Firebase services
|
|
47
|
+
npm install @angular/fire firebase
|
|
64
48
|
|
|
65
|
-
#
|
|
66
|
-
|
|
49
|
+
# QR code generation
|
|
50
|
+
npm install qr-code-styling
|
|
67
51
|
|
|
68
|
-
|
|
52
|
+
# Code highlighting
|
|
53
|
+
npm install prismjs
|
|
69
54
|
|
|
55
|
+
# Carousel support
|
|
56
|
+
npm install swiper
|
|
70
57
|
```
|
|
71
|
-
valtech-components/
|
|
72
|
-
├── .storybook/ # Storybook configuration
|
|
73
|
-
├── src/
|
|
74
|
-
│ ├── lib/
|
|
75
|
-
│ │ ├── components/ # UI components (atoms, molecules, organisms, templates)
|
|
76
|
-
│ │ ├── services/ # Angular services
|
|
77
|
-
│ │ ├── shared/ # Utilities, pipes, constants
|
|
78
|
-
│ │ └── assets/ # Fonts and static resources
|
|
79
|
-
│ ├── stories/ # Storybook documentation
|
|
80
|
-
│ └── public-api.ts # Library exports
|
|
81
|
-
├── styles/ # Global SCSS styles
|
|
82
|
-
├── angular.json # Angular CLI config
|
|
83
|
-
├── ng-package.json # ng-packagr config
|
|
84
|
-
└── package.json # Dependencies and scripts
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Building the Library
|
|
88
58
|
|
|
89
|
-
|
|
90
|
-
# Development build
|
|
91
|
-
npm run build
|
|
59
|
+
## Components
|
|
92
60
|
|
|
93
|
-
|
|
94
|
-
|
|
61
|
+
| Category | Count | Description |
|
|
62
|
+
|----------|-------|-------------|
|
|
63
|
+
| **Atoms** | 19 | Basic UI elements: avatar, button, icon, text, image, skeleton, progress-bar, qr-code, etc. |
|
|
64
|
+
| **Molecules** | 81 | Compound components: inputs (text, email, phone, pin, date), cards, searchbar, tabs, accordion, pagination, etc. |
|
|
65
|
+
| **Organisms** | 24 | Complex components: forms, data-table, menu, toolbar, login, comment-section, infinite-list, etc. |
|
|
66
|
+
| **Templates** | 10 | Page layouts: page-wrapper, page-content, docs-shell, auth-background, maintenance-page, etc. |
|
|
95
67
|
|
|
96
|
-
|
|
97
|
-
```
|
|
68
|
+
> **[View full component catalog](https://ui.myvaltech.com)**
|
|
98
69
|
|
|
99
|
-
|
|
70
|
+
## Services
|
|
100
71
|
|
|
101
|
-
|
|
72
|
+
### Basic Services
|
|
73
|
+
| Service | Description |
|
|
74
|
+
|---------|-------------|
|
|
75
|
+
| `ThemeService` | Theme management (light/dark mode) |
|
|
76
|
+
| `ToastService` | Toast notifications |
|
|
77
|
+
| `NavigationService` | Routing utilities |
|
|
78
|
+
| `DownloadService` | File download helpers |
|
|
79
|
+
| `IconsService` | Ionicons management |
|
|
80
|
+
| `LocaleService` | Simple locale management with localStorage |
|
|
81
|
+
| `LocalStorageService` | localStorage abstraction |
|
|
82
|
+
| `LinkProcessorService` | Automatic URL and markdown link processing |
|
|
83
|
+
| `InAppBrowserService` | Capacitor in-app browser |
|
|
84
|
+
|
|
85
|
+
### Authentication Services
|
|
86
|
+
| Service | Description |
|
|
87
|
+
|---------|-------------|
|
|
88
|
+
| `AuthService` | Main authentication service |
|
|
89
|
+
| `OAuthService` | OAuth providers (Google, Apple) |
|
|
90
|
+
| `SessionService` | Session management |
|
|
91
|
+
| `TokenService` | JWT token handling |
|
|
92
|
+
| `AuthStateService` | Authentication state management |
|
|
93
|
+
| `DeviceService` | Device information |
|
|
94
|
+
|
|
95
|
+
### Firebase Services
|
|
96
|
+
| Service | Description |
|
|
97
|
+
|---------|-------------|
|
|
98
|
+
| `FirebaseService` | Firebase initialization |
|
|
99
|
+
| `AnalyticsService` | Firebase Analytics with custom events |
|
|
100
|
+
| `FirestoreService` | Firestore database operations |
|
|
101
|
+
| `MessagingService` | Cloud Messaging (push notifications) |
|
|
102
|
+
| `NotificationsService` | Notification management |
|
|
103
|
+
| `FirebaseStorageService` | Firebase Storage operations |
|
|
104
|
+
|
|
105
|
+
### Other Services
|
|
106
|
+
| Service | Description |
|
|
107
|
+
|---------|-------------|
|
|
108
|
+
| `I18nService` | Internationalization with Angular Signals |
|
|
109
|
+
| `AppConfigService` | Remote configuration and feature flags |
|
|
110
|
+
| `FeedbackService` | User feedback collection |
|
|
111
|
+
| `ModalService` | Modal dialog management |
|
|
112
|
+
| `ConfirmationDialogService` | Confirmation dialogs |
|
|
113
|
+
| `QrGeneratorService` | QR code generation |
|
|
114
|
+
| `PresetService` | Reusable configuration presets |
|
|
115
|
+
| `PaginationService` | Pagination state management |
|
|
116
|
+
| `SkeletonService` | Skeleton loading states |
|
|
102
117
|
|
|
103
|
-
##
|
|
118
|
+
## Quick Start
|
|
104
119
|
|
|
105
|
-
|
|
120
|
+
### Basic Component Usage
|
|
106
121
|
|
|
107
122
|
```typescript
|
|
108
|
-
import {
|
|
109
|
-
import { TextComponent, ButtonComponent } from 'valtech-components';
|
|
123
|
+
import { Component } from '@angular/core';
|
|
124
|
+
import { TextComponent, ButtonComponent, CardComponent } from 'valtech-components';
|
|
110
125
|
|
|
111
126
|
@Component({
|
|
112
|
-
selector: '
|
|
127
|
+
selector: 'app-example',
|
|
113
128
|
standalone: true,
|
|
114
|
-
imports: [
|
|
115
|
-
TextComponent,
|
|
116
|
-
ButtonComponent
|
|
117
|
-
],
|
|
129
|
+
imports: [TextComponent, ButtonComponent, CardComponent],
|
|
118
130
|
template: `
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}"
|
|
127
|
-
/>
|
|
128
|
-
|
|
129
|
-
<!-- Button -->
|
|
130
|
-
<val-button
|
|
131
|
-
[props]="{
|
|
132
|
-
text: 'Cancel',
|
|
133
|
-
color: 'secondary',
|
|
134
|
-
type: 'button'
|
|
135
|
-
}"
|
|
136
|
-
(onClick)="handleCancel()"
|
|
137
|
-
/>
|
|
131
|
+
<val-card [props]="{ title: 'Welcome' }">
|
|
132
|
+
<val-text [props]="{ content: 'Hello, World!', size: 'medium' }" />
|
|
133
|
+
<val-button
|
|
134
|
+
[props]="{ text: 'Get Started', color: 'primary' }"
|
|
135
|
+
(onClick)="handleClick()"
|
|
136
|
+
/>
|
|
137
|
+
</val-card>
|
|
138
138
|
`
|
|
139
139
|
})
|
|
140
|
-
export class
|
|
141
|
-
|
|
142
|
-
console.log('
|
|
140
|
+
export class ExampleComponent {
|
|
141
|
+
handleClick() {
|
|
142
|
+
console.log('Button clicked');
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
The library includes a simple locale management service using localStorage:
|
|
147
|
+
### i18n with Signals
|
|
150
148
|
|
|
151
149
|
```typescript
|
|
152
|
-
import { inject } from '@angular/core';
|
|
153
|
-
import {
|
|
150
|
+
import { Component, inject, computed } from '@angular/core';
|
|
151
|
+
import { I18nService, TextComponent } from 'valtech-components';
|
|
154
152
|
|
|
155
153
|
@Component({
|
|
154
|
+
selector: 'app-i18n-example',
|
|
155
|
+
standalone: true,
|
|
156
|
+
imports: [TextComponent],
|
|
156
157
|
template: `
|
|
157
|
-
<val-
|
|
158
|
-
[props]="{ showFlags: true, showLabel: true }"
|
|
159
|
-
(languageChange)="onLanguageChange($event)"
|
|
160
|
-
></val-language-selector>
|
|
158
|
+
<val-text [props]="{ content: welcomeText() }" />
|
|
161
159
|
`
|
|
162
160
|
})
|
|
163
|
-
export class
|
|
164
|
-
|
|
161
|
+
export class I18nExampleComponent {
|
|
162
|
+
private i18n = inject(I18nService);
|
|
165
163
|
|
|
166
|
-
//
|
|
167
|
-
|
|
164
|
+
// Use computed() for reactive translations
|
|
165
|
+
welcomeText = computed(() => this.i18n.t('home.welcome'));
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Authentication
|
|
168
170
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
```typescript
|
|
172
|
+
import { Component, inject } from '@angular/core';
|
|
173
|
+
import { AuthService } from 'valtech-components';
|
|
174
|
+
|
|
175
|
+
@Component({
|
|
176
|
+
selector: 'app-auth-example',
|
|
177
|
+
template: `...`
|
|
178
|
+
})
|
|
179
|
+
export class AuthExampleComponent {
|
|
180
|
+
private auth = inject(AuthService);
|
|
181
|
+
|
|
182
|
+
async loginWithGoogle() {
|
|
183
|
+
await this.auth.loginWithGoogle();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
async logout() {
|
|
187
|
+
await this.auth.logout();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
get isAuthenticated() {
|
|
191
|
+
return this.auth.isAuthenticated();
|
|
172
192
|
}
|
|
173
193
|
}
|
|
174
194
|
```
|
|
175
195
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
The library now includes automatic link detection and processing capabilities. Convert URLs and internal routes in text content into clickable links automatically:
|
|
196
|
+
### Firebase Analytics
|
|
179
197
|
|
|
180
198
|
```typescript
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
processMarkdownLinks: true,
|
|
197
|
-
openExternalInNewTab: true
|
|
199
|
+
import { Component, inject } from '@angular/core';
|
|
200
|
+
import { AnalyticsService } from 'valtech-components';
|
|
201
|
+
|
|
202
|
+
@Component({
|
|
203
|
+
selector: 'app-analytics-example',
|
|
204
|
+
template: `...`
|
|
205
|
+
})
|
|
206
|
+
export class AnalyticsExampleComponent {
|
|
207
|
+
private analytics = inject(AnalyticsService);
|
|
208
|
+
|
|
209
|
+
trackEvent() {
|
|
210
|
+
this.analytics.logEvent('button_click', {
|
|
211
|
+
button_name: 'signup',
|
|
212
|
+
page: 'home'
|
|
213
|
+
});
|
|
198
214
|
}
|
|
199
|
-
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Development
|
|
219
|
+
|
|
220
|
+
### Prerequisites
|
|
221
|
+
|
|
222
|
+
- Node.js 18+
|
|
223
|
+
- npm 9+
|
|
224
|
+
|
|
225
|
+
### Setup
|
|
200
226
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
227
|
+
```bash
|
|
228
|
+
# Install dependencies
|
|
229
|
+
npm install
|
|
230
|
+
|
|
231
|
+
# Start Storybook
|
|
232
|
+
npm run storybook
|
|
233
|
+
# Open http://localhost:6006
|
|
206
234
|
```
|
|
207
235
|
|
|
208
|
-
###
|
|
236
|
+
### Available Scripts
|
|
209
237
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
238
|
+
| Command | Description |
|
|
239
|
+
|---------|-------------|
|
|
240
|
+
| `npm run build` | Build the library |
|
|
241
|
+
| `npm run build:prod` | Production build (optimized) |
|
|
242
|
+
| `npm run storybook` | Start Storybook dev server (port 6006) |
|
|
243
|
+
| `npm run build-storybook` | Build static Storybook |
|
|
244
|
+
| `npm run test` | Run unit tests |
|
|
245
|
+
| `npm run prettier` | Format source files |
|
|
246
|
+
| `npm run publish:patch` | Build and publish patch version to npm |
|
|
247
|
+
| `npm run update-apps` | Update dependent apps |
|
|
216
248
|
|
|
217
|
-
###
|
|
249
|
+
### Publishing
|
|
218
250
|
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
constructor(private linkProcessor: LinkProcessorService) {}
|
|
223
|
-
|
|
224
|
-
processText(text: string) {
|
|
225
|
-
// Convert links automatically
|
|
226
|
-
const processed = this.linkProcessor.processLinks(text);
|
|
227
|
-
|
|
228
|
-
// Check if text contains links
|
|
229
|
-
const hasLinks = this.linkProcessor.hasLinks(text);
|
|
230
|
-
|
|
231
|
-
// Extract all links with their types and text
|
|
232
|
-
const links = this.linkProcessor.extractLinks(text);
|
|
233
|
-
// Returns: [{ url: '...', type: 'external|internal', text: '...' }]
|
|
234
|
-
}
|
|
251
|
+
```bash
|
|
252
|
+
# Publish a new patch version (e.g., 2.0.654 → 2.0.655)
|
|
253
|
+
npm run publish:patch
|
|
235
254
|
```
|
|
236
255
|
|
|
237
256
|
## Project Structure
|
|
238
257
|
|
|
239
|
-
|
|
240
|
-
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
258
|
+
```
|
|
259
|
+
valtech-components/
|
|
260
|
+
├── .storybook/ # Storybook configuration
|
|
261
|
+
├── src/
|
|
262
|
+
│ ├── lib/
|
|
263
|
+
│ │ ├── components/ # UI components
|
|
264
|
+
│ │ │ ├── atoms/ # Basic elements (19)
|
|
265
|
+
│ │ │ ├── molecules/ # Compound components (81)
|
|
266
|
+
│ │ │ ├── organisms/ # Complex components (24)
|
|
267
|
+
│ │ │ └── templates/ # Page layouts (10)
|
|
268
|
+
│ │ ├── services/ # Angular services (23+)
|
|
269
|
+
│ │ │ ├── auth/ # Authentication
|
|
270
|
+
│ │ │ ├── firebase/ # Firebase integration
|
|
271
|
+
│ │ │ ├── i18n/ # Internationalization
|
|
272
|
+
│ │ │ ├── feedback/ # User feedback
|
|
273
|
+
│ │ │ ├── app-config/ # Remote configuration
|
|
274
|
+
│ │ │ └── ...
|
|
275
|
+
│ │ ├── shared/ # Utilities, pipes, constants
|
|
276
|
+
│ │ └── config/ # Shared configuration
|
|
277
|
+
│ ├── stories/ # Storybook stories
|
|
278
|
+
│ └── public-api.ts # Library exports
|
|
279
|
+
├── styles/ # Global SCSS styles
|
|
280
|
+
├── angular.json # Angular CLI config
|
|
281
|
+
├── ng-package.json # ng-packagr config
|
|
282
|
+
└── package.json # Dependencies and scripts
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## Documentation
|
|
286
|
+
|
|
287
|
+
For complete documentation, examples, and API reference, visit:
|
|
288
|
+
|
|
289
|
+
**[https://ui.myvaltech.com](https://ui.myvaltech.com)**
|
|
254
290
|
|
|
255
291
|
## License
|
|
256
292
|
|
|
257
|
-
[MIT](https://opensource.org/
|
|
293
|
+
[MIT](https://opensource.org/licenses/MIT)
|