@awc-ui/angular 1.0.0-beta.9 → 1.0.1

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 CHANGED
@@ -1,43 +1,65 @@
1
1
  # Angular Web Components and Angular SSR — @awc-ui/angular
2
2
 
3
- Angular 17+ components for [AWC UI](https://www.npmjs.com/package/@awc-ui/core) — accessible Material Design 3 Web Components with directives that bridge Angular templates, `ngModel`, reactive forms, and Angular SSR.
3
+ Angular 20.3.31+ integration for AWC UI.
4
4
 
5
- ## Install
5
+ The wrapper is built with the patched Angular 20 compiler. Applications must use
6
+ Angular 20.3.31 or newer; upgrade Angular before updating this package from a
7
+ version that supported Angular 17–19.
8
+
9
+ `@awc-ui/angular` provides standalone component proxies and Angular form value
10
+ accessors. Imports register their custom elements automatically.
6
11
 
7
12
  ```bash
8
13
  npm install @awc-ui/angular @awc-ui/core
9
14
  ```
10
15
 
11
- Requires Angular 17+.
16
+ Load the theme once in your application entry:
17
+
18
+ ```ts
19
+ import '@awc-ui/core/css/tokens.css';
20
+ ```
12
21
 
13
- ## Usage
22
+ For a standalone component, import the controls and accessors into its template
23
+ scope, alongside Angular's forms module:
14
24
 
15
25
  ```ts
16
- // NgModule apps
17
- import { AwcUiModule } from "@awc-ui/angular";
26
+ import { Component } from '@angular/core';
27
+ import { FormsModule } from '@angular/forms';
28
+ import { MdButton, MdTextField, TextValueAccessor } from '@awc-ui/angular';
18
29
 
19
- @NgModule({
20
- imports: [AwcUiModule],
30
+ @Component({
31
+ selector: 'app-root',
32
+ standalone: true,
33
+ imports: [FormsModule, MdButton, MdTextField, TextValueAccessor],
34
+ template: `
35
+ <md-text-field label="Email" type="email" [(ngModel)]="email"></md-text-field>
36
+ <md-button variant="filled">Continue</md-button>
37
+ `,
21
38
  })
22
- export class AppModule {}
39
+ export class AppComponent {
40
+ email = '';
41
+ }
23
42
  ```
24
43
 
25
- ```ts
26
- // Standalone apps
27
- import { importProvidersFrom } from "@angular/core";
28
- import { AwcUiModule, provideAwcUi } from "@awc-ui/angular";
44
+ For convenience, `imports: [FormsModule, AwcUiModule]` supplies every component
45
+ and accessor. Use `ReactiveFormsModule` for `formControl` and `formControlName`.
46
+ NgModule applications also put `AwcUiModule` in `imports`.
29
47
 
30
- bootstrapApplication(AppComponent, {
31
- providers: [provideAwcUi(), importProvidersFrom(AwcUiModule)],
32
- });
33
- ```
48
+ `importProvidersFrom(AwcUiModule)` does not add directives to a standalone
49
+ component's template scope. `provideAwcUi()` is only needed for applications
50
+ using the lazy loader with raw tags; imported proxies already register themselves.
51
+
52
+ Radio controls bind the selected option's `value`, preserving each radio's
53
+ identity. Import both `MdRadio` and `RadioValueAccessor` for individual imports:
34
54
 
35
55
  ```html
36
- <md-button variant="filled">Click me</md-button>
56
+ <md-radio name="plan" value="basic" [(ngModel)]="plan">Basic</md-radio>
57
+ <md-radio name="plan" value="pro" [(ngModel)]="plan">Pro</md-radio>
37
58
  ```
38
59
 
39
- ## Documentation
60
+ Initialize `plan` to `'basic'` or `'pro'`; resetting the form to `null` clears the
61
+ selection. Multi-select accessors normalize a form reset to an empty array.
40
62
 
41
- [Angular and Angular SSR guide](https://awc-ui.dev/frameworks/angular/) · [All component docs](https://awc-ui.dev/components/)
63
+ ## Server rendering
42
64
 
43
- Component manuals and AI-readable documentation also ship with [`@awc-ui/core`](https://www.npmjs.com/package/@awc-ui/core).
65
+ See the [Angular SSR guide](https://awc-ui.dev/frameworks/angular/) for the shared hydration lifecycle and reference application.