@harshshahcg/survey-render 1.0.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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +195 -0
  3. package/dist/components/ExitConfirmationDialog.d.ts +8 -0
  4. package/dist/components/QuestionListCarousel.d.ts +13 -0
  5. package/dist/components/QuestionMapper.d.ts +13 -0
  6. package/dist/components/QuestionOverviewPanel.d.ts +12 -0
  7. package/dist/components/QuestionRenderer.d.ts +16 -0
  8. package/dist/components/SubmissionLoadingOverlay.d.ts +4 -0
  9. package/dist/components/SurveyContainer.d.ts +11 -0
  10. package/dist/components/SurveyRenderer.d.ts +15 -0
  11. package/dist/components/ValidationDialog.d.ts +9 -0
  12. package/dist/components/custom/DatePicker.d.ts +10 -0
  13. package/dist/components/custom/Dropdown.d.ts +17 -0
  14. package/dist/components/custom/ImageResponse.d.ts +12 -0
  15. package/dist/components/custom/MCQSelect.d.ts +13 -0
  16. package/dist/components/custom/MediaUpload.d.ts +12 -0
  17. package/dist/components/custom/TabularInput.d.ts +38 -0
  18. package/dist/components/custom/TextResponse.d.ts +11 -0
  19. package/dist/components/custom/VideoResponse.d.ts +12 -0
  20. package/dist/components/custom/VoiceResponse.d.ts +12 -0
  21. package/dist/components/ui/alert.d.ts +9 -0
  22. package/dist/components/ui/badge.d.ts +9 -0
  23. package/dist/components/ui/button-variants.d.ts +4 -0
  24. package/dist/components/ui/button.d.ts +13 -0
  25. package/dist/components/ui/card.d.ts +9 -0
  26. package/dist/components/ui/dialog.d.ts +15 -0
  27. package/dist/components/ui/input.d.ts +3 -0
  28. package/dist/components/ui/label.d.ts +6 -0
  29. package/dist/components/ui/pagination.d.ts +13 -0
  30. package/dist/components/ui/popover.d.ts +7 -0
  31. package/dist/components/ui/progress.d.ts +4 -0
  32. package/dist/components/ui/select.d.ts +15 -0
  33. package/dist/components/ui/tabs.d.ts +7 -0
  34. package/dist/components/ui/textarea.d.ts +3 -0
  35. package/dist/helpers/constants.d.ts +7 -0
  36. package/dist/index.d.ts +33 -0
  37. package/dist/lib/utils.d.ts +2 -0
  38. package/dist/surveyRender.js +7458 -0
  39. package/dist/surveyRender.js.map +1 -0
  40. package/dist/surveyRender.umd.cjs +100 -0
  41. package/dist/surveyRender.umd.cjs.map +1 -0
  42. package/dist/types/survey.types.d.ts +80 -0
  43. package/dist/utils/conditionalLogic.d.ts +25 -0
  44. package/dist/utils/fileUtils.d.ts +34 -0
  45. package/dist/utils/questionStatus.d.ts +11 -0
  46. package/dist/utils/responseFormatter.d.ts +12 -0
  47. package/dist/utils/validation.d.ts +20 -0
  48. package/package.json +67 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
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 ADDED
@@ -0,0 +1,195 @@
1
+ # survey-render
2
+
3
+ A reusable **React + TypeScript** survey rendering library. Renders surveys from a JSON config with conditional logic, validation, and file uploads. Returns responses in a structured array format. No offline sync or built-in storage—you own submission and persistence.
4
+
5
+ ## Features
6
+
7
+ - **JSON-driven** — Define surveys via `SurveyConfig`; no hard-coded forms
8
+ - **Multiple question types** — Single/multi select, dropdown, text, date, tabular inputs, image/video/voice uploads
9
+ - **Conditional logic** — Show/hide questions based on parent answers (`childrenQuestions` / `sourceQuestion`)
10
+ - **Validation** — Mandatory checks, character limits, numeric input, file type/size, tabular completeness
11
+ - **Media uploads** — Image, video, and voice responses with configurable allowed types and max size (base64 in payload)
12
+ - **Step-based UI** — Carousel navigation, overview panel, previous/next/submit, optional exit with save
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install survey-render
18
+ ```
19
+
20
+ **Peer dependencies:** React and React DOM (≥18).
21
+
22
+ ```bash
23
+ npm install react react-dom
24
+ ```
25
+
26
+ ## Quick start
27
+
28
+ ```tsx
29
+ import { SurveyRenderer } from "survey-render";
30
+ import type { SurveyConfig, SurveySubmitPayload } from "survey-render";
31
+
32
+ const surveyConfig: SurveyConfig = {
33
+ surveyId: "my-survey",
34
+ medium: "EN",
35
+ questionList: [
36
+ {
37
+ surveyId: "my-survey",
38
+ questionId: "Q1",
39
+ description: "Your name?",
40
+ descriptionEN: "Your name?",
41
+ type: "text-response",
42
+ isMandatory: true,
43
+ outcomeDescription: "",
44
+ questionDescriptionOptional: "",
45
+ sourceQuestion: "",
46
+ },
47
+ // ... more questions
48
+ ],
49
+ };
50
+
51
+ function App() {
52
+ const handleSubmit = (payload: SurveySubmitPayload) => {
53
+ console.log("Submit:", payload);
54
+ // payload.responses is SurveyResponseArray
55
+ };
56
+
57
+ return (
58
+ <SurveyRenderer
59
+ data={surveyConfig}
60
+ onSubmit={handleSubmit}
61
+ onSave={(payload) => console.log("Save draft:", payload)}
62
+ onExit={() => console.log("Exit")}
63
+ isSubmitting={false}
64
+ showHeader={true}
65
+ className=""
66
+ />
67
+ );
68
+ }
69
+ ```
70
+
71
+ ## Survey config shape
72
+
73
+ - **`SurveyConfig`**
74
+ - `surveyId`, `medium`, `questionList` (required)
75
+ - Optional: `surveyCode`, `surveyName`, `type`, `config` (media validation)
76
+
77
+ - **`SurveyQuestion`**
78
+ - `surveyId`, `questionId`, `description`, `descriptionEN`, `type`, `isMandatory`, `outcomeDescription`, `questionDescriptionOptional`, `sourceQuestion`
79
+ - Optional: `options` / `optionsEN`, `textInputType`, `textLimitCharacter`, `minValue` / `maxValue`, `childrenQuestions`, `tableHeaderValue`, `tableQuestionValue`, `userAnswer` (prefill), etc.
80
+
81
+ - **Media config** (`data.config`)
82
+ - Keys: e.g. `"image-response"`, `"video-response"`, `"voice-response"`
83
+ - Values: `supportedType` (or legacy `suppotedType`) and `supportedSize` (MB). Used for allowed MIME types and max file size.
84
+
85
+ ## Supported question types
86
+
87
+ | Type | Description |
88
+ |-----------------------|--------------------------------|
89
+ | `single-select` | One option from a list |
90
+ | `multi-select` | Multiple options |
91
+ | `drop-down` / `dropdown` | Dropdown single select |
92
+ | `text-response` | Free text (optional limit) |
93
+ | `calendar` | Date picker |
94
+ | `image-response` | Image upload (base64) |
95
+ | `video-response` | Video upload (base64) |
96
+ | `voice-response` | Audio upload (base64) |
97
+ | `tabular-text-input` | Rows with text fields |
98
+ | `tabular-drop-down` | Rows with dropdowns |
99
+ | `tabular-check-box` | Rows with checkboxes |
100
+
101
+ Use `SUPPORTED_QUESTION_TYPES` and `isSupportedQuestionType()` from the package when validating config.
102
+
103
+ ## Conditional logic
104
+
105
+ - **Root questions** — No `sourceQuestion` or not listed in any `childrenQuestions`; always visible.
106
+ - **Child questions** — Listed in another question’s `childrenQuestions`. Shown when the parent’s answer matches the key (e.g. `"Other": ["Q5.1"]` → show Q5.1 when parent answer is `"Other"`).
107
+ - Visibility is recalculated as responses change; hidden questions’ answers are cleared when they become hidden.
108
+
109
+ Helpers (exported): `calculateVisibility`, `clearHiddenResponses`, and type `VisibilityResult`.
110
+
111
+ ## Validation
112
+
113
+ - Mandatory, text character limit, numeric-only text, file required, and tabular row completeness.
114
+ - On submit, invalid or missing answers produce a list of `{ questionId, message }` and the built-in validation dialog opens; `onSubmit` is only called when valid.
115
+ - Helpers: `validateResponses`, `canSubmit`, and type `ValidationErrorItem`.
116
+
117
+ ## Response format
118
+
119
+ - **`SurveySubmitPayload`** — Passed to `onSubmit` and `onSave`: `surveyId`, optional `surveyCode` / `surveyName` / `type`, and `responses: SurveyResponseArray`.
120
+ - **`SurveyResponseArray`** — Array of `{ questionId, userAnswer }`. `userAnswer` is string, number, boolean, string[], `RowAnswer[]` (tabular), or `FileObject` (fileName, fileType, binary base64).
121
+ - Dates are formatted as `YYYY-MM-DD` in the payload.
122
+
123
+ Use `formatResponses` if you need to convert internal state to this format yourself.
124
+
125
+ ## API summary
126
+
127
+ ### Main component
128
+
129
+ - **`SurveyRenderer`** — Full survey UI: header, question carousel, current question, nav, validation/exit dialogs, loading overlay. Props: `data`, `onSubmit`, optional `onSave`, `onExit`, `isSubmitting`, `className`, `showHeader`.
130
+
131
+ ### Other components (for custom layouts)
132
+
133
+ - `SurveyContainer` — Same behavior as `SurveyRenderer`, use when you need a different wrapper.
134
+ - `QuestionRenderer` — Renders one question given `question`, `value`, `onChange`, and optional validation/media config.
135
+ - `QuestionListCarousel`, `QuestionOverviewPanel`, `ValidationDialog`, `ExitConfirmationDialog`, `SubmissionLoadingOverlay`.
136
+
137
+ ### Types
138
+
139
+ Exported from the package: `SurveyConfig`, `SurveyQuestion`, `SurveyResponseArray`, `SurveyResponseItem`, `SurveySubmitPayload`, `RowAnswer`, `FileObject`, `SupportedQuestionType`, and the various component prop types.
140
+
141
+ ### Utils
142
+
143
+ - **Conditional logic:** `calculateVisibility`, `clearHiddenResponses`
144
+ - **Validation:** `validateResponses`, `canSubmit`
145
+ - **Formatting:** `formatResponses`
146
+ - **Question status:** `getQuestionStatusMap`
147
+ - **Files:** `validateFile`, `validateFileType`, `validateFileSize`, `fileToFileObject`, `getEffectiveMediaConfig`, `MEDIA_ALLOWED_TYPES`, `MEDIA_MAX_SIZE_MB`
148
+ - **Defaults:** `DEFAULT_MEDIA_ALLOWED_TYPES`, `DEFAULT_MEDIA_MAX_SIZE_MB`
149
+ - **Types:** `getDefaultValue`, `SUPPORTED_QUESTION_TYPES`, `isSupportedQuestionType` (and related types)
150
+
151
+ ## Styling
152
+
153
+ The library uses **Tailwind CSS** and ships a `theme.css` (import it in your app so class names resolve). Ensure your app’s Tailwind (or build) includes the library’s styles/classes if you rely on the default look.
154
+
155
+ ## Build and dev
156
+
157
+ - **Build library:** `npm run build` or `npm run build:lib` — produces ESM and UMD in `dist/` plus TypeScript declarations.
158
+ - **Dev app:** `npm run dev` — runs the Vite dev server (e.g. `dev/main.tsx` with sample config).
159
+
160
+ ## Publishing to npm
161
+
162
+ 1. **Create an npm account** at [npmjs.com](https://www.npmjs.com/signup) if you don’t have one.
163
+
164
+ 2. **Log in** from the project directory:
165
+ ```bash
166
+ npm login
167
+ ```
168
+
169
+ 3. **Check package name availability:** The name `survey-render` may already be taken. Search on [npmjs.com](https://www.npmjs.com/search?q=survey-render). If taken, use a scoped name in `package.json`:
170
+ ```json
171
+ "name": "@your-username/survey-render"
172
+ ```
173
+ Then consumers install with `npm install @your-username/survey-render`.
174
+
175
+ 4. **Build and publish:**
176
+ ```bash
177
+ npm run build
178
+ npm publish
179
+ ```
180
+ The `prepublishOnly` script runs `npm run build` automatically before `npm publish`, so `dist/` is built even if you didn’t run `build` yourself.
181
+
182
+ 5. **Scoped package (e.g. `@username/survey-render`):** Publish with public access so it’s installable without a paid plan:
183
+ ```bash
184
+ npm publish --access public
185
+ ```
186
+
187
+ 6. **Later versions:** Bump version, then publish again:
188
+ ```bash
189
+ npm version patch # 1.0.0 → 1.0.1
190
+ npm publish
191
+ ```
192
+
193
+ ## License
194
+
195
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,8 @@
1
+ export interface ExitConfirmationDialogProps {
2
+ open: boolean;
3
+ onOpenChange: (open: boolean) => void;
4
+ onConfirm: () => void;
5
+ onCancel: () => void;
6
+ readOnly?: boolean;
7
+ }
8
+ export declare function ExitConfirmationDialog({ open, onOpenChange, onConfirm, onCancel, readOnly, }: ExitConfirmationDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export type QuestionStatus = "completed" | "unanswered" | "required" | "error";
2
+ export interface QuestionListCarouselProps {
3
+ /** Ordered list of visible question IDs (e.g. Q1, Q2, Q6.1) */
4
+ questions: string[];
5
+ /** Currently active question ID (controlled by parent) */
6
+ activeQuestionId: string | undefined;
7
+ /** Called when user selects a question (click card or arrow) */
8
+ onQuestionSelect: (questionId: string) => void;
9
+ /** Optional map of questionId -> status for styling */
10
+ questionStatusMap?: Record<string, QuestionStatus>;
11
+ className?: string;
12
+ }
13
+ export declare function QuestionListCarousel({ questions, activeQuestionId, onQuestionSelect, questionStatusMap, className, }: QuestionListCarouselProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ import type { SurveyQuestion } from "../types/survey.types";
2
+ import type { EffectiveMediaConfig } from "../utils/fileUtils";
3
+ export interface QuestionMapperProps {
4
+ question: SurveyQuestion;
5
+ value: unknown;
6
+ onChange: (value: unknown) => void;
7
+ error?: string;
8
+ touched?: boolean;
9
+ disabled?: boolean;
10
+ mediaConfig?: EffectiveMediaConfig | null;
11
+ className?: string;
12
+ }
13
+ export default function QuestionMapper({ question, value, onChange, error, touched, disabled, mediaConfig, className, }: QuestionMapperProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { SurveyQuestion } from "../types/survey.types";
2
+ export interface QuestionOverviewPanelProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ questions: SurveyQuestion[];
6
+ visibleQuestionIds: string[];
7
+ responses: Record<string, unknown>;
8
+ currentQuestionIndex: number;
9
+ onGoToQuestion: (index: number) => void;
10
+ readOnly?: boolean;
11
+ }
12
+ export declare function QuestionOverviewPanel({ isOpen, onClose, questions, visibleQuestionIds, responses, currentQuestionIndex, onGoToQuestion, readOnly, }: QuestionOverviewPanelProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import type { SurveyQuestion } from "../types/survey.types";
2
+ import type { EffectiveMediaConfig } from "../utils/fileUtils";
3
+ export interface QuestionRendererProps {
4
+ question: SurveyQuestion;
5
+ value: unknown;
6
+ onChange: (value: unknown) => void;
7
+ disabled?: boolean;
8
+ error?: string;
9
+ validationErrors?: Array<{
10
+ questionId: string;
11
+ message: string;
12
+ }>;
13
+ mediaConfig?: EffectiveMediaConfig | null;
14
+ className?: string;
15
+ }
16
+ export declare function QuestionRenderer({ question, value, onChange, disabled, error, validationErrors, mediaConfig, className, }: QuestionRendererProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export interface SubmissionLoadingOverlayProps {
2
+ show: boolean;
3
+ }
4
+ export declare function SubmissionLoadingOverlay({ show }: SubmissionLoadingOverlayProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import type { SurveyConfig, SurveySubmitPayload } from "../types/survey.types";
2
+ export interface SurveyContainerProps {
3
+ data: SurveyConfig;
4
+ onSubmit: (payload: SurveySubmitPayload) => void;
5
+ onSave?: (payload: SurveySubmitPayload) => void;
6
+ onExit?: () => void;
7
+ isSubmitting?: boolean;
8
+ className?: string;
9
+ showHeader?: boolean;
10
+ }
11
+ export declare function SurveyContainer({ data, onSubmit, onSave, onExit, isSubmitting, className, showHeader, }: SurveyContainerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { SurveyConfig, SurveySubmitPayload } from "../types/survey.types";
2
+ export interface SurveyRendererProps {
3
+ data: SurveyConfig;
4
+ onSubmit: (payload: SurveySubmitPayload) => void;
5
+ onSave?: (payload: SurveySubmitPayload) => void;
6
+ onExit?: () => void;
7
+ isSubmitting?: boolean;
8
+ className?: string;
9
+ showHeader?: boolean;
10
+ }
11
+ /**
12
+ * Main entry: renders a survey from JSON config.
13
+ * Handles conditional questions, validation, and returns responses in required format.
14
+ */
15
+ export declare function SurveyRenderer({ data, onSubmit, onSave, onExit, isSubmitting, className, showHeader, }: SurveyRendererProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { ValidationErrorItem } from "../utils/validation";
2
+ export interface ValidationDialogProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ missingQuestionIds: string[];
6
+ errors?: ValidationErrorItem[];
7
+ onOk: () => void;
8
+ }
9
+ export declare function ValidationDialog({ open, onOpenChange, missingQuestionIds, errors, onOk, }: ValidationDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ export interface DatePickerProps {
2
+ selectedDate?: Date;
3
+ onDateSelect: (date: Date | undefined) => void;
4
+ placeholder?: string;
5
+ className?: string;
6
+ disabled?: boolean;
7
+ minDate?: Date;
8
+ maxDate?: Date;
9
+ }
10
+ export default function DatePicker({ selectedDate, onDateSelect, placeholder, className, disabled, minDate, maxDate, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ export interface DropdownOption {
2
+ value: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ }
6
+ export interface DropdownProps {
7
+ options: DropdownOption[];
8
+ value?: string;
9
+ onChange: (value: string) => void;
10
+ placeholder?: string;
11
+ disabled?: boolean;
12
+ error?: string;
13
+ required?: boolean;
14
+ className?: string;
15
+ dropdownClassName?: string;
16
+ }
17
+ export default function Dropdown({ options, value, onChange, placeholder, disabled, error, required, className, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { SurveyQuestion, FileObject } from "../../types/survey.types";
2
+ import type { EffectiveMediaConfig } from "../../utils/fileUtils";
3
+ export interface ImageResponseProps {
4
+ question: SurveyQuestion;
5
+ value: FileObject | null;
6
+ onChange: (value: FileObject | null) => void;
7
+ error?: string;
8
+ disabled?: boolean;
9
+ mediaConfig?: EffectiveMediaConfig | null;
10
+ className?: string;
11
+ }
12
+ export declare function ImageResponse({ question: _question, value, onChange, error, disabled, mediaConfig, className, }: ImageResponseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export interface MCQOption {
2
+ id: string;
3
+ text: string;
4
+ }
5
+ export interface MCQSelectProps {
6
+ options: MCQOption[];
7
+ selectionMode: "single" | "multiple";
8
+ selectedOptions?: string | string[];
9
+ onOptionSelect: (optionId: string | string[]) => void;
10
+ className?: string;
11
+ disabled?: boolean;
12
+ }
13
+ export default function MCQSelect({ options, selectionMode, selectedOptions, onOptionSelect, className, disabled, }: MCQSelectProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { FileObject } from "../../types/survey.types";
2
+ import type { EffectiveMediaConfig } from "../../utils/fileUtils";
3
+ export type MediaType = "image" | "video" | "audio";
4
+ export interface MediaUploadProps {
5
+ mediaType: MediaType;
6
+ value: FileObject | null;
7
+ onChange: (value: FileObject | null) => void;
8
+ className?: string;
9
+ disabled?: boolean;
10
+ mediaConfig?: EffectiveMediaConfig | null;
11
+ }
12
+ export default function MediaUpload({ mediaType, value, onChange, className, disabled, mediaConfig, }: MediaUploadProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ export interface TabularInputOption {
2
+ id: string;
3
+ text: string;
4
+ }
5
+ export interface TabularInputRow {
6
+ id: string;
7
+ label: string;
8
+ }
9
+ export interface TabularInputColumn {
10
+ id: string;
11
+ title: string;
12
+ width?: string;
13
+ }
14
+ export interface TabularInputValue {
15
+ rowId: string;
16
+ value: string | boolean;
17
+ }
18
+ export interface TabularInputConfig {
19
+ type: "dropdown" | "text" | "number" | "checkbox";
20
+ options?: TabularInputOption[];
21
+ placeholder?: string;
22
+ min?: number;
23
+ max?: number;
24
+ step?: number;
25
+ required?: boolean;
26
+ maxLength?: number;
27
+ inputType?: string;
28
+ checkboxLabel?: string;
29
+ }
30
+ export interface TabularInputProps {
31
+ columns: TabularInputColumn[];
32
+ rows: TabularInputRow[];
33
+ inputConfig: TabularInputConfig;
34
+ values: TabularInputValue[];
35
+ onValueChange: (rowId: string, value: string | boolean) => void;
36
+ className?: string;
37
+ }
38
+ export default function TabularInput({ columns, rows, inputConfig, values, onValueChange, className, }: TabularInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ export interface TextResponseProps {
2
+ value?: string;
3
+ onChange: (value: string) => void;
4
+ placeholder?: string;
5
+ className?: string;
6
+ disabled?: boolean;
7
+ minRows?: number;
8
+ maxRows?: number;
9
+ characterLimit?: number;
10
+ }
11
+ export default function TextResponse({ value, onChange, placeholder, className, disabled, minRows, maxRows, characterLimit, }: TextResponseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { SurveyQuestion, FileObject } from "../../types/survey.types";
2
+ import type { EffectiveMediaConfig } from "../../utils/fileUtils";
3
+ export interface VideoResponseProps {
4
+ question: SurveyQuestion;
5
+ value: FileObject | null;
6
+ onChange: (value: FileObject | null) => void;
7
+ error?: string;
8
+ disabled?: boolean;
9
+ mediaConfig?: EffectiveMediaConfig | null;
10
+ className?: string;
11
+ }
12
+ export declare function VideoResponse({ question: _question, value, onChange, error, disabled, mediaConfig, className, }: VideoResponseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { SurveyQuestion, FileObject } from "../../types/survey.types";
2
+ import type { EffectiveMediaConfig } from "../../utils/fileUtils";
3
+ export interface VoiceResponseProps {
4
+ question: SurveyQuestion;
5
+ value: FileObject | null;
6
+ onChange: (value: FileObject | null) => void;
7
+ error?: string;
8
+ disabled?: boolean;
9
+ mediaConfig?: EffectiveMediaConfig | null;
10
+ className?: string;
11
+ }
12
+ export declare function VoiceResponse({ question: _question, value, onChange, error, disabled, mediaConfig, className, }: VoiceResponseProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const alertVariants: (props?: ({
4
+ variant?: "default" | "destructive" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): import("react/jsx-runtime").JSX.Element;
7
+ declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
+ declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
9
+ export { Alert, AlertTitle, AlertDescription };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
7
+ asChild?: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export { Badge, badgeVariants };
@@ -0,0 +1,4 @@
1
+ export declare const buttonVariants: (props?: ({
2
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
3
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
4
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { buttonVariants } from "./button-variants";
4
+ interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
5
+ asChild?: boolean;
6
+ bgColor?: string;
7
+ textColor?: string;
8
+ text?: string;
9
+ prefixIcon?: React.ReactNode;
10
+ suffixIcon?: React.ReactNode;
11
+ }
12
+ declare function Button({ className, variant, size, asChild, bgColor, textColor, text, prefixIcon, suffixIcon, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
13
+ export { Button };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ declare function Card({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
4
+ declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
5
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
6
+ declare function CardAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
7
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
9
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
3
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
8
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
9
+ showCloseButton?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
12
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
13
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
14
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
15
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
3
+ export { Input };
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
3
+ className?: string;
4
+ }
5
+ declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
6
+ export { Label };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
3
+ declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
4
+ declare function PaginationItem({ ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
5
+ type PaginationLinkProps = {
6
+ isActive?: boolean;
7
+ size?: "default" | "sm" | "lg" | "icon";
8
+ } & React.ComponentProps<"a">;
9
+ declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): import("react/jsx-runtime").JSX.Element;
10
+ declare function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
11
+ declare function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
12
+ declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
13
+ export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+ declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
6
+ declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
7
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import * as ProgressPrimitive from "@radix-ui/react-progress";
3
+ declare function Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Progress };
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
5
+ declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
6
+ declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
7
+ size?: "sm" | "default";
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
10
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
11
+ declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
12
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
13
+ declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
14
+ declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
15
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as TabsPrimitive from "@radix-ui/react-tabs";
3
+ declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ export { Tabs, TabsList, TabsTrigger, TabsContent };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
3
+ export { Textarea };