ngxsmk-tel-input 1.6.8 → 1.6.9

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.
Files changed (38) hide show
  1. package/README.md +43 -8
  2. package/fesm2022/ngxsmk-tel-input.mjs +2425 -313
  3. package/fesm2022/ngxsmk-tel-input.mjs.map +1 -1
  4. package/lib/integrations/aws-sns.service.d.ts +30 -0
  5. package/lib/integrations/aws-sns.service.d.ts.map +1 -0
  6. package/lib/integrations/twilio.service.d.ts +31 -0
  7. package/lib/integrations/twilio.service.d.ts.map +1 -0
  8. package/lib/integrations/verification.service.d.ts +30 -0
  9. package/lib/integrations/verification.service.d.ts.map +1 -0
  10. package/lib/integrations/vonage.service.d.ts +30 -0
  11. package/lib/integrations/vonage.service.d.ts.map +1 -0
  12. package/lib/ngxsmk-tel-input.component.d.ts +233 -12
  13. package/lib/ngxsmk-tel-input.component.d.ts.map +1 -1
  14. package/lib/ngxsmk-tel-input.service.d.ts +94 -14
  15. package/lib/ngxsmk-tel-input.service.d.ts.map +1 -1
  16. package/lib/phone-input.utils.d.ts +125 -13
  17. package/lib/phone-input.utils.d.ts.map +1 -1
  18. package/lib/phone-intelligence.service.d.ts +47 -0
  19. package/lib/phone-intelligence.service.d.ts.map +1 -0
  20. package/lib/signals.d.ts +50 -0
  21. package/lib/signals.d.ts.map +1 -0
  22. package/lib/testing/e2e-helpers.d.ts +116 -0
  23. package/lib/testing/e2e-helpers.d.ts.map +1 -0
  24. package/lib/testing/mock-phone-service.d.ts +39 -0
  25. package/lib/testing/mock-phone-service.d.ts.map +1 -0
  26. package/lib/testing/test-fixtures.d.ts +120 -0
  27. package/lib/testing/test-fixtures.d.ts.map +1 -0
  28. package/lib/testing/testing.module.d.ts +11 -0
  29. package/lib/testing/testing.module.d.ts.map +1 -0
  30. package/lib/themes/material.theme.d.ts +24 -0
  31. package/lib/themes/material.theme.d.ts.map +1 -0
  32. package/lib/themes/primeng.theme.d.ts +22 -0
  33. package/lib/themes/primeng.theme.d.ts.map +1 -0
  34. package/lib/types-enhanced.d.ts +135 -0
  35. package/lib/types-enhanced.d.ts.map +1 -0
  36. package/package.json +4 -4
  37. package/public-api.d.ts +23 -0
  38. package/public-api.d.ts.map +1 -1
package/README.md CHANGED
@@ -18,20 +18,23 @@ Wraps [`intl-tel-input`](https://github.com/jackocnr/intl-tel-input) for the UI
18
18
  * Reactive & template‑driven Forms support (CVA)
19
19
  * Built‑in validation using libphonenumber‑js
20
20
  * **Enhanced validation**: Detects invalid country codes (like "11", "99") and shows appropriate error states
21
+ * **Mobile responsive**: Optimized for touch devices with proper tap targets, prevents iOS zoom, and responsive dropdown
22
+ * **Dark & Light themes**: Comprehensive theme system with automatic system preference detection
23
+ * **Accessibility**: Full ARIA support, screen reader compatibility, keyboard navigation
21
24
  * SSR‑friendly (no `window` on the server)
22
25
  * Easy theming via CSS variables
23
26
  * Nice UX options: label/hint/error text, sizes, variants, clear button, autofocus, select-on-focus
24
- * New: Masking & caret-friendly as-you-type formatting (optional)
25
- * New: Format only when valid (formatWhenValid) and lock once valid (lockWhenValid) to prevent extra digits
27
+ * Masking & caret-friendly as-you-type formatting (optional)
28
+ * Format only when valid (formatWhenValid) and lock once valid (lockWhenValid) to prevent extra digits
26
29
 
27
30
  ---
28
31
 
29
32
  ## ✅ Requirements
30
33
 
31
- * Angular **17 19**
34
+ * Angular **17+** (17, 18, 19, 20, 21+)
32
35
  * Node **18** or **20**
33
36
 
34
- > Library `peerDependencies` target Angular `>=17 <20`. Your app can be 17, 18, or 19.
37
+ > Library `peerDependencies` target Angular `>=17`. Fully compatible with Angular 17, 18, 19, 20, 21, and future versions.
35
38
 
36
39
  ---
37
40
 
@@ -236,6 +239,7 @@ Arabic + RTL example
236
239
  | `customPlaceholder` | `(example: string, country: any) => string` | — | Transform the example placeholder. |
237
240
  | `clearAriaLabel` | `string` | `'Clear phone number'` | ARIA label for the clear button. |
238
241
  | `lockWhenValid` | `boolean` | `true` | Prevent appending extra digits once the number is valid (editing/replacing still allowed). |
242
+ | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Theme preference for the component. |
239
243
 
240
244
  > `CountryCode` is the ISO‑2 uppercase code from `libphonenumber-js` (e.g. `US`, `GB`).
241
245
 
@@ -266,7 +270,9 @@ For rare patterns not covered by libphonenumber-js, the control falls back to ra
266
270
 
267
271
  ---
268
272
 
269
- ## 🎨 Theming (CSS variables)
273
+ ## 🎨 Theming
274
+
275
+ ### CSS Variables
270
276
 
271
277
  Override on the element or a parent container:
272
278
 
@@ -285,7 +291,36 @@ Available tokens:
285
291
  * Input: `--tel-bg`, `--tel-fg`, `--tel-border`, `--tel-border-hover`, `--tel-ring`, `--tel-placeholder`, `--tel-error`, `--tel-radius`, `--tel-focus-shadow`
286
292
  * Dropdown: `--tel-dd-bg`, `--tel-dd-border`, `--tel-dd-shadow`, `--tel-dd-radius`, `--tel-dd-item-hover`, `--tel-dd-search-bg`, `--tel-dd-z`
287
293
 
288
- Dark mode: wrap in a `.dark` parent — tokens adapt automatically.
294
+ ### Theme Support
295
+
296
+ The component supports light, dark, and auto themes:
297
+
298
+ ```ts
299
+ import { NgxsmkTelInputComponent, ThemeService } from 'ngxsmk-tel-input';
300
+
301
+ // Component-level theme
302
+ <ngxsmk-tel-input [theme]="'dark'"></ngxsmk-tel-input>
303
+
304
+ // Global theme management
305
+ @Component({})
306
+ export class MyComponent {
307
+ private themeService = inject(ThemeService);
308
+
309
+ setDarkTheme() {
310
+ this.themeService.setTheme('dark');
311
+ }
312
+
313
+ // Subscribe to theme changes
314
+ theme$ = this.themeService.currentTheme$;
315
+ }
316
+ ```
317
+
318
+ Themes:
319
+ - `'light'`: Light theme
320
+ - `'dark'`: Dark theme
321
+ - `'auto'`: Automatically follows system preference (default)
322
+
323
+ Dark mode: wrap in a `.dark` parent or use `[theme]="'dark'"` — tokens adapt automatically.
289
324
 
290
325
  ---
291
326
 
@@ -365,7 +400,7 @@ Ensure the assets copy exists under `/assets/intl-tel-input/img` and add the CSS
365
400
  Build the library first so `dist/ngxsmk-tel-input` exists. If using workspace aliasing, add a `paths` entry to the root `tsconfig.base.json`.
366
401
 
367
402
  **Peer dependency conflict when installing**
368
- The lib peers are `@angular/* >=17 <20`. Upgrade your app or install a compatible version.
403
+ The lib peers are `@angular/* >=17`. Ensure your app uses Angular 17 or higher.
369
404
 
370
405
  **Vite/Angular “Failed to resolve import …”**
371
406
  Clear `.angular/cache`, rebuild the lib, and restart `ng serve`.
@@ -381,4 +416,4 @@ Clear `.angular/cache`, rebuild the lib, and restart `ng serve`.
381
416
  * UI powered by [`intl-tel-input`](https://github.com/jackocnr/intl-tel-input)
382
417
  * Parsing & validation by [`libphonenumber-js`](https://github.com/catamphetamine/libphonenumber-js)
383
418
 
384
- Last updated: 2025-08-29
419
+ Last updated: 2025-01-21