@shiva004/surveys 0.1.7 → 0.3.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
@@ -2,7 +2,35 @@
2
2
 
3
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.
4
4
 
5
- ## Run
5
+ ## Use as a package
6
+
7
+ ```bash
8
+ npm install @shiva004/surveys
9
+ ```
10
+
11
+ ```tsx
12
+ import { SurveyApp, JourneyApp, npsOf } from '@shiva004/surveys';
13
+ import '@shiva004/surveys/style.css';
14
+
15
+ export default function Page() {
16
+ return <SurveyApp />;
17
+ }
18
+ ```
19
+
20
+ ### User Journey docs page (new in 0.3.0)
21
+
22
+ ```tsx
23
+ import { UserJourneyDocs } from '@shiva004/surveys';
24
+ import '@shiva004/surveys/style.css';
25
+
26
+ <UserJourneyDocs githubUrl="https://github.com/your-org/your-repo" defaultTheme="dark" />
27
+ ```
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.
32
+
33
+ ## Run the demo
6
34
 
7
35
  ```bash
8
36
  npm install
package/dist/App.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const App: React.FC;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import './docs.css';
3
+ type Theme = 'light' | 'dark';
4
+ export interface UserJourneyDocsProps {
5
+ /** Initial theme. Defaults to the saved choice, then 'light'. */
6
+ defaultTheme?: Theme;
7
+ /** Optional link for the "View on GitHub" buttons. */
8
+ githubUrl?: string;
9
+ className?: string;
10
+ }
11
+ export declare const UserJourneyDocs: React.FC<UserJourneyDocsProps>;
12
+ export default UserJourneyDocs;
@@ -0,0 +1,22 @@
1
+ export type DocPage = {
2
+ id: string;
3
+ title: string;
4
+ route: string;
5
+ nav: string;
6
+ icon: string;
7
+ lead: string;
8
+ explain: string[];
9
+ questions: string[];
10
+ header: string;
11
+ stats: [string, string, string][];
12
+ controls: string[];
13
+ columns: [string, string, string][] | null;
14
+ states: string[];
15
+ colors: string[];
16
+ extraTitle: string | null;
17
+ extra: string[] | null;
18
+ api: [string, string, string][];
19
+ types: [string, string][];
20
+ hooks: string;
21
+ };
22
+ export declare const DOC_PAGES: DocPage[];
@@ -0,0 +1,10 @@
1
+ export type Rows = string[][];
2
+ export declare const OVERVIEW_ROWS: Rows;
3
+ export declare const COMPONENT_ROWS: Rows;
4
+ export declare const THEME_TOKEN_ROWS: Rows;
5
+ export declare const CARD_TOKEN_ROWS: Rows;
6
+ export declare const COLOR_ROWS: Rows;
7
+ export declare const TYPO_ROWS: Rows;
8
+ export declare const FAQ_ROWS: Rows;
9
+ export declare const GLOSSARY_ROWS: Rows;
10
+ export declare const TREE = "userjourney/\n\u251C\u2500 pages/\n\u2502 \u251C\u2500 Journeymaps/ Journey Maps\n\u2502 \u251C\u2500 Navigationanalysis/ Navigation Analysis\n\u2502 \u251C\u2500 Path/ Paths\n\u2502 \u2514\u2500 Userflows/ User Flows\n\u251C\u2500 Hooks/ useJourneys, useTableConfig, useTableData\n\u251C\u2500 services/api/ journeys.api.ts, TableConfigDto.ts\n\u251C\u2500 types/ journeys.types.ts\n\u251C\u2500 cells/ UserjourneyCells.tsx, FlowCells.tsx\n\u251C\u2500 Components/ CreateJourneyModal.tsx\n\u251C\u2500 nav.ts \u00B7 routes.ts";
@@ -0,0 +1,11 @@
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';