@viveksinghind/narrative-form-angular 0.0.2 → 1.0.4
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 +34 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @viveksinghind/narrative-form-angular
|
|
2
2
|
|
|
3
|
-
Angular
|
|
3
|
+
Angular integration for Narrative Form, a dynamic typewriter-style sign-up flow.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -8,38 +8,52 @@ Angular components for Narrative Form — a beautiful, typewriter-style signup f
|
|
|
8
8
|
npm install @viveksinghind/narrative-form-angular @viveksinghind/narrative-form-core
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
- 💅 Beautiful, animated typewriter UI out of the box
|
|
14
|
-
- ⚡️ Built on top of a robust core state machine
|
|
15
|
-
- 🎨 Fully customizable and themeable (using standard CSS variables)
|
|
16
|
-
- 📱 Responsive and accessible
|
|
17
|
-
- 🅰️ Native Angular components and services
|
|
18
|
-
|
|
19
|
-
## Basic Usage
|
|
20
|
-
|
|
21
|
-
Import `NarrativeFormModule` in your module (or standalone component):
|
|
11
|
+
## Usage
|
|
22
12
|
|
|
23
13
|
```typescript
|
|
14
|
+
import { Component } from '@angular/core';
|
|
24
15
|
import { NarrativeFormComponent } from '@viveksinghind/narrative-form-angular';
|
|
25
16
|
|
|
26
17
|
@Component({
|
|
27
18
|
selector: 'app-root',
|
|
28
19
|
standalone: true,
|
|
29
20
|
imports: [NarrativeFormComponent],
|
|
30
|
-
template:
|
|
21
|
+
template: `
|
|
22
|
+
<narrative-form
|
|
23
|
+
[config]="myFormConfig"
|
|
24
|
+
(complete)="onComplete($event)">
|
|
25
|
+
</narrative-form>
|
|
26
|
+
`
|
|
31
27
|
})
|
|
32
28
|
export class AppComponent {
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
myFormConfig = {
|
|
30
|
+
form: { id: "test", name: "Test Form", version: 1 },
|
|
31
|
+
welcome: {
|
|
32
|
+
heading: "Welcome to the future",
|
|
33
|
+
subtext: "Let's get started",
|
|
34
|
+
ctaLabel: "Begin"
|
|
35
|
+
},
|
|
36
|
+
fields: [
|
|
37
|
+
{
|
|
38
|
+
key: "name",
|
|
39
|
+
type: "text",
|
|
40
|
+
prefix: "Hi, my name is",
|
|
41
|
+
validation: { required: true }
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
done: {
|
|
45
|
+
message: "All done! Thank you.",
|
|
46
|
+
}
|
|
35
47
|
};
|
|
36
48
|
|
|
37
|
-
onComplete(
|
|
38
|
-
console.log('Form
|
|
49
|
+
onComplete(values: any) {
|
|
50
|
+
console.log('Form Complete!', values);
|
|
39
51
|
}
|
|
40
52
|
}
|
|
41
53
|
```
|
|
42
54
|
|
|
43
|
-
##
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
## Features
|
|
56
|
+
- First-class Angular standalone components
|
|
57
|
+
- Smooth CSS animations
|
|
58
|
+
- Accessible form elements
|
|
59
|
+
- Themeable via config
|
package/package.json
CHANGED