ngblock 0.0.2 → 0.0.3

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 (2) hide show
  1. package/README.md +61 -46
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,46 +1,61 @@
1
- # ngblock
2
-
3
- An Angular library packaged in Angular Package Format for use in Angular applications.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install ngblock
9
- ```
10
-
11
- ## Use
12
-
13
- Import the standalone button component where you need it:
14
-
15
- ```ts
16
- import { Component } from '@angular/core';
17
- import { ButtonComponent } from 'ngblock';
18
-
19
- @Component({
20
- imports: [ButtonComponent],
21
- template: `
22
- <ngb-button (click)="save()">Save</ngb-button>
23
- <ngb-button type="submit" [disabled]="isSaving">Submit</ngb-button>
24
- `,
25
- })
26
- export class ExampleComponent {
27
- isSaving = false;
28
-
29
- save(): void {
30
- // Handle the action.
31
- }
32
- }
33
- ```
34
-
35
- `ngb-button` projects its content into a native button. It supports the native
36
- button types through `type` (`button`, `submit`, or `reset`) and a `disabled`
37
- input. The default type is `button`.
38
-
39
- ## Develop
40
-
41
- From the Nx workspace root:
42
-
43
- ```bash
44
- npx nx build ngblock
45
- npx nx test ngblock
46
- ```
1
+ # ngblock
2
+
3
+ `ngblock` is an Angular UI library. The current release includes a standalone
4
+ button control.
5
+
6
+ ## Requirements
7
+
8
+ - Angular `^22.2.0`
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install ngblock
14
+ ```
15
+
16
+ ## Button control
17
+
18
+ Import `ButtonComponent` into the standalone component that uses it:
19
+
20
+ ```ts
21
+ import { Component } from '@angular/core';
22
+ import { ButtonComponent } from 'ngblock';
23
+
24
+ @Component({
25
+ selector: 'app-example',
26
+ imports: [ButtonComponent],
27
+ template: `
28
+ <ngb-button (click)="save()">Save</ngb-button>
29
+ <ngb-button type="submit" [disabled]="isSaving">Submit</ngb-button>
30
+ `,
31
+ })
32
+ export class ExampleComponent {
33
+ isSaving = false;
34
+
35
+ save(): void {
36
+ // Perform the save action.
37
+ }
38
+ }
39
+ ```
40
+
41
+ `ButtonComponent` renders a native `<button>` and projects its content as the
42
+ button label. Its selector is `ngb-button`.
43
+
44
+ | Input | Type | Default | Description |
45
+ | --- | --- | --- | --- |
46
+ | `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | Native button type. |
47
+ | `disabled` | `boolean` | `false` | Disables the native button. |
48
+
49
+ The control inherits its font and text color from its context, with basic
50
+ padding, border, focus-visible, and disabled styles. Use the native `click`
51
+ event to handle activation.
52
+
53
+ ## Develop
54
+
55
+ From the Nx workspace root:
56
+
57
+ ```bash
58
+ npx nx build ngblock
59
+ npx nx test ngblock
60
+ npx nx lint ngblock
61
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngblock",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "An Angular library for ngblock.",
5
5
  "license": "MIT",
6
6
  "peerDependencies": {