@viveksinghind/narrative-form-react 1.0.1 → 1.0.2

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -17
  3. package/package.json +79 -77
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vivek Singh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @viveksinghind/narrative-form-react
2
2
 
3
- React components for Narrative Form a beautiful, typewriter-style signup flow.
3
+ React integration for Narrative Form, a dynamic typewriter-style sign-up flow.
4
4
 
5
5
  ## Installation
6
6
 
@@ -8,30 +8,44 @@ React components for Narrative Form — a beautiful, typewriter-style signup flo
8
8
  npm install @viveksinghind/narrative-form-react @viveksinghind/narrative-form-core
9
9
  ```
10
10
 
11
- ## Features
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
16
- - 📱 Responsive and accessible
17
-
18
- ## Basic Usage
11
+ ## Usage
19
12
 
20
13
  ```tsx
14
+ import React from 'react';
21
15
  import { NarrativeForm } from '@viveksinghind/narrative-form-react';
22
- import '@viveksinghind/narrative-form-react/dist/index.css';
23
16
 
24
- const formConfig = {
25
- // your form configuration
17
+ const myFormConfig = {
18
+ form: { id: "test", name: "Test Form", version: 1 },
19
+ welcome: {
20
+ heading: "Welcome to the future",
21
+ subtext: "Let's get started",
22
+ ctaLabel: "Begin"
23
+ },
24
+ fields: [
25
+ {
26
+ key: "name",
27
+ type: "text",
28
+ prefix: "Hi, my name is",
29
+ validation: { required: true }
30
+ }
31
+ ],
32
+ done: {
33
+ message: "All done! Thank you.",
34
+ }
26
35
  };
27
36
 
28
- function App() {
37
+ export default function App() {
29
38
  return (
30
- <NarrativeForm config={formConfig} onComplete={(data) => console.log(data)} />
39
+ <NarrativeForm
40
+ config={myFormConfig}
41
+ onComplete={(values) => console.log('Form Complete!', values)}
42
+ />
31
43
  );
32
44
  }
33
45
  ```
34
46
 
35
- ## License
36
-
37
- MIT
47
+ ## Features
48
+ - Fully typed React components
49
+ - Smooth CSS animations for the typewriter effect
50
+ - Accessible form elements
51
+ - Themeable via config
package/package.json CHANGED
@@ -1,77 +1,79 @@
1
- {
2
- "name": "@viveksinghind/narrative-form-react",
3
- "version": "1.0.1",
4
- "description": "React components for narrative-form — typewriter-style sign-up flow",
5
- "author": "Vivek Singh <vivekSinghInd>",
6
- "license": "MIT",
7
- "main": "dist/index.cjs",
8
- "module": "dist/index.mjs",
9
- "types": "dist/index.d.ts",
10
- "sideEffects": false,
11
- "files": ["dist"],
12
- "exports": {
13
- ".": {
14
- "types": "./dist/index.d.ts",
15
- "import": "./dist/index.mjs",
16
- "require": "./dist/index.cjs"
17
- },
18
- "./style.css": "./dist/index.css",
19
- "./dist/index.css": "./dist/index.css"
20
- },
21
- "scripts": {
22
- "build": "tsup",
23
- "dev": "tsup --watch",
24
- "typecheck": "tsc --noEmit",
25
- "test": "jest",
26
- "clean": "rimraf dist",
27
- "storybook": "storybook dev -p 6006",
28
- "build-storybook": "storybook build"
29
- },
30
- "dependencies": {
31
- "@viveksinghind/narrative-form-core": "workspace:*"
32
- },
33
- "peerDependencies": {
34
- "react": ">=17.0.0",
35
- "react-dom": ">=17.0.0"
36
- },
37
- "devDependencies": {
38
- "@testing-library/jest-dom": "^6.4.2",
39
- "@testing-library/react": "^15.0.6",
40
- "@testing-library/user-event": "^14.5.2",
41
- "@types/react": "^18.3.1",
42
- "@types/react-dom": "^18.3.0",
43
- "jest": "^29.7.0",
44
- "jest-environment-jsdom": "^29.7.0",
45
- "react": "^18.3.1",
46
- "react-dom": "^18.3.1",
47
- "rimraf": "^5.0.5",
48
- "storybook": "^8.1.11",
49
- "@storybook/react": "^8.1.11",
50
- "@storybook/react-vite": "^8.1.11",
51
- "@storybook/addon-essentials": "^8.1.11",
52
- "@storybook/addon-links": "^8.1.11",
53
- "@storybook/addon-interactions": "^8.1.11",
54
- "@storybook/blocks": "^8.1.11",
55
- "vite": "^5.3.1",
56
- "tsup": "^8.0.2",
57
- "typescript": "^5.4.5"
58
- },
59
- "keywords": [
60
- "react",
61
- "narrative-form",
62
- "typewriter",
63
- "form",
64
- "onboarding",
65
- "signup",
66
- "typescript"
67
- ],
68
- "repository": {
69
- "type": "git",
70
- "url": "https://github.com/vivekSinghInd/narrative-form.git",
71
- "directory": "packages/react"
72
- },
73
- "homepage": "https://github.com/vivekSinghInd/narrative-form#readme",
74
- "bugs": {
75
- "url": "https://github.com/vivekSinghInd/narrative-form/issues"
76
- }
77
- }
1
+ {
2
+ "name": "@viveksinghind/narrative-form-react",
3
+ "version": "1.0.2",
4
+ "description": "React components for narrative-form — typewriter-style sign-up flow",
5
+ "author": "Vivek Singh <vivekSinghInd>",
6
+ "license": "MIT",
7
+ "main": "dist/index.cjs",
8
+ "module": "dist/index.mjs",
9
+ "types": "dist/index.d.ts",
10
+ "sideEffects": false,
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.mjs",
18
+ "require": "./dist/index.cjs"
19
+ },
20
+ "./style.css": "./dist/index.css",
21
+ "./dist/index.css": "./dist/index.css"
22
+ },
23
+ "dependencies": {
24
+ "@viveksinghind/narrative-form-core": "1.0.2"
25
+ },
26
+ "peerDependencies": {
27
+ "react": ">=17.0.0",
28
+ "react-dom": ">=17.0.0"
29
+ },
30
+ "devDependencies": {
31
+ "@testing-library/jest-dom": "^6.4.2",
32
+ "@testing-library/react": "^15.0.6",
33
+ "@testing-library/user-event": "^14.5.2",
34
+ "@types/react": "^18.3.1",
35
+ "@types/react-dom": "^18.3.0",
36
+ "jest": "^29.7.0",
37
+ "jest-environment-jsdom": "^29.7.0",
38
+ "react": "^18.3.1",
39
+ "react-dom": "^18.3.1",
40
+ "rimraf": "^5.0.5",
41
+ "storybook": "^8.1.11",
42
+ "@storybook/react": "^8.1.11",
43
+ "@storybook/react-vite": "^8.1.11",
44
+ "@storybook/addon-essentials": "^8.1.11",
45
+ "@storybook/addon-links": "^8.1.11",
46
+ "@storybook/addon-interactions": "^8.1.11",
47
+ "@storybook/blocks": "^8.1.11",
48
+ "vite": "^5.3.1",
49
+ "tsup": "^8.0.2",
50
+ "typescript": "^5.4.5"
51
+ },
52
+ "keywords": [
53
+ "react",
54
+ "narrative-form",
55
+ "typewriter",
56
+ "form",
57
+ "onboarding",
58
+ "signup",
59
+ "typescript"
60
+ ],
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "https://github.com/vivekSinghInd/narrative-form.git",
64
+ "directory": "packages/react"
65
+ },
66
+ "homepage": "https://github.com/vivekSinghInd/narrative-form#readme",
67
+ "bugs": {
68
+ "url": "https://github.com/vivekSinghInd/narrative-form/issues"
69
+ },
70
+ "scripts": {
71
+ "build": "tsup",
72
+ "dev": "tsup --watch",
73
+ "typecheck": "tsc --noEmit",
74
+ "test": "jest",
75
+ "clean": "rimraf dist",
76
+ "storybook": "storybook dev -p 6006",
77
+ "build-storybook": "storybook build"
78
+ }
79
+ }