@shiva004/surveys 0.3.0 → 0.5.0

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,6 +1,6 @@
1
- # Survey + User Journey POC
1
+ # Logs + Feedback POC
2
2
 
3
- A standalone proof of concept for the Survey and User Journey modules. No backend, no auth: all data is mock and lives in memory, so a page reload resets it.
3
+ Standalone proof of concept with two modules: a **Log Viewer** (with a guided tour) and a **Feedback** popup (4-step star-rating survey preview). All data is mock and lives in memory.
4
4
 
5
5
  ## Use as a package
6
6
 
@@ -9,73 +9,34 @@ npm install @shiva004/surveys
9
9
  ```
10
10
 
11
11
  ```tsx
12
- import { SurveyApp, JourneyApp, npsOf } from '@shiva004/surveys';
12
+ import { LogsApp, FeedbackApp } from '@shiva004/surveys';
13
13
  import '@shiva004/surveys/style.css';
14
14
 
15
15
  export default function Page() {
16
- return <SurveyApp />;
16
+ return <LogsApp />; // or <FeedbackApp />
17
17
  }
18
18
  ```
19
19
 
20
- ### User Journey docs page (new in 0.3.0)
20
+ `LogsApp` accepts `autoStart` (default `true`) to open the tutorial once on first load.
21
+ `LogsFeedbackApp` renders both modules behind tabs.
21
22
 
22
- ```tsx
23
- import { UserJourneyDocs } from '@shiva004/surveys';
24
- import '@shiva004/surveys/style.css';
23
+ ### Walkthrough tour + analytics
25
24
 
26
- <UserJourneyDocs githubUrl="https://github.com/your-org/your-repo" defaultTheme="dark" />
25
+ ```tsx
26
+ import { JourneyProvider, useJourney, WalkthroughDemo } from '@shiva004/surveys';
27
27
  ```
28
28
 
29
- Self-contained (no Bootstrap needed): sidebar, "On this page" list with scroll-spy and a light/dark toggle. Props: `defaultTheme`, `githubUrl`, `className`.
30
-
31
- Requires React 18 or newer. Also exported: `SurveyJourneyApp` (both modules with tabs), the NPS helpers, the journey analytics functions and all types.
29
+ Unchanged from 0.4.0. Needs `react` and `react-dom` 18+.
32
30
 
33
31
  ## Run the demo
34
32
 
35
33
  ```bash
36
34
  npm install
37
35
  npm run dev # http://localhost:5173
38
- npm run build # type-check + production build
39
- ```
40
-
41
- ## What it proves
42
-
43
- **Survey**
44
- - Create a survey with a question builder (nps, rating, multiple choice, open text) and validation
45
- - Change status (draft / active / paused / closed); only active surveys accept answers
46
- - Take a survey; each submission becomes a response
47
- - Results page: NPS (promoters 9-10 minus detractors 0-6), category split, responses table
48
- - Delete a survey and its responses
49
-
50
- **User Journey**
51
- - A simulated page-view session stream (400 seeded sessions, "+ Simulate 50 sessions" adds more)
52
- - Navigation Analysis: views, share, bounce rate, exit rate per page
53
- - Paths: top 8 sequences (first 4 steps) with share reaching /signup
54
- - Userflows: where users go next from each page, as a percentage
55
- - Journey Maps: build stages with emotion and touchpoint pages; each stage's reach is computed from the same sessions
56
-
57
- The point of the Journey half: one event stream feeds all four views, so adding more traffic updates every tab.
58
-
59
- ## Layout
60
-
61
- ```
62
- src/
63
- types.ts shared types (mirror survey.types.ts / journeys.types.ts)
64
- ui.tsx Stat, Tabs, Bar, Page + seeded rng
65
- survey/
66
- nps.ts NPS maths (pure functions)
67
- data.ts seed surveys and responses
68
- SurveyApp.tsx list, create, take, results
69
- journey/
70
- analytics.ts simulator + navigation / path / flow / reach calculations
71
- JourneyApp.tsx four views + map builder
36
+ npm run build # production build + type declarations
72
37
  ```
73
38
 
74
- ## From POC to the real modules
39
+ ## What changed in 0.5.0
75
40
 
76
- | POC | Real module |
77
- | --- | --- |
78
- | `survey/nps.ts`, `journey/analytics.ts` | Move to the backend (or a shared util); the real UI only renders summaries |
79
- | In-memory state | `surveysApi` / `journeysApi` with react-query |
80
- | Plain tables and cards | shared `DataTable`, `Header`, `StatCard`, `Card` |
81
- | Simulated sessions | Real page-view events from tracking |
41
+ - Removed: Survey and User Journey modules (`SurveyApp`, `JourneyApp`, `SurveyJourneyApp`, NPS helpers, journey analytics, types, `UserJourneyDocs`).
42
+ - Added: `LogsApp`, `FeedbackApp`, `LogsFeedbackApp`.
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './feedback.css';
3
+ export declare const FeedbackApp: React.FC;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,5 @@
1
1
  import './styles.css';
2
- export { App as SurveyJourneyApp } from './App';
3
- export { SurveyApp } from './survey/SurveyApp';
4
- export { JourneyApp } from './journey/JourneyApp';
5
- export { UserJourneyDocs } from './docs/UserJourneyDocs';
6
- export type { UserJourneyDocsProps } from './docs/UserJourneyDocs';
7
- export { npsOf, npsCategory, npsScores } from './survey/nps';
8
- export type { NpsCategory } from './survey/nps';
9
- export { simulate, navigationStats, pathStats, flowStats, stageReach } from './journey/analytics';
10
- export type { NavRow, PathRow, FlowRow } from './journey/analytics';
11
- export type { Survey, Question, QType, SurveyStatus, Answer, SurveyResponse, Stage, JourneyMap } from './types';
2
+ export { App as LogsFeedbackApp } from './App';
3
+ export { LogsApp } from './logs/LogsApp';
4
+ export { FeedbackApp } from './feedback/FeedbackApp';
5
+ export * from './walkthrough';