@nice2dev/ui 1.0.28 → 1.0.29

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 (71) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/NiceAssessment.doc-BB1rXcVx.cjs +1 -0
  3. package/dist/NiceAssessment.doc-C3QQawiZ.js +23 -0
  4. package/dist/NiceConfirmDialog-DPfYwO2B.js +81 -0
  5. package/dist/NiceConfirmDialog-Dyh42OiK.cjs +1 -0
  6. package/dist/NiceErrorBoundary-BHCKA1h8.cjs +1 -0
  7. package/dist/NiceErrorBoundary-CBxXcleR.js +695 -0
  8. package/dist/NiceExam.doc-BpTJpwGb.js +23 -0
  9. package/dist/NiceExam.doc-Br8pEbQb.cjs +1 -0
  10. package/dist/NiceForm-C8yEx3VV.cjs +382 -0
  11. package/dist/NiceForm-Ci3XG7s7.js +5000 -0
  12. package/dist/NiceModal-Crbhc7GB.cjs +1 -0
  13. package/dist/NiceModal-XvEKVVLa.js +95 -0
  14. package/dist/NiceModuleLifecyclePanel-D3k8kAey.js +7582 -0
  15. package/dist/NiceModuleLifecyclePanel-MAyTh_s5.cjs +1 -0
  16. package/dist/NicePagination-DUnMbROj.cjs +1 -0
  17. package/dist/NicePagination-DyC6dQ7_.js +171 -0
  18. package/dist/NicePinCodeInput-C43eB9h4.js +13102 -0
  19. package/dist/NicePinCodeInput-p5IFVwfY.cjs +696 -0
  20. package/dist/NicePoll.doc-DCiXvOb0.js +23 -0
  21. package/dist/NicePoll.doc-IOgqVPhc.cjs +1 -0
  22. package/dist/NicePollLive.doc-CdUyiCyf.js +23 -0
  23. package/dist/NicePollLive.doc-xBMqHeyt.cjs +1 -0
  24. package/dist/NiceQuiz.doc-BhAeGrcP.cjs +1 -0
  25. package/dist/NiceQuiz.doc-BiZq8X1P.js +23 -0
  26. package/dist/NiceSavedQueryPanel-DV4a4axz.cjs +596 -0
  27. package/dist/NiceSavedQueryPanel-Dgbn1ExK.js +6893 -0
  28. package/dist/NiceSurvey.doc-9UorYdXy.cjs +1 -0
  29. package/dist/NiceSurvey.doc-CPF1ZEHo.js +23 -0
  30. package/dist/NiceWindow-BehN3PKk.js +1592 -0
  31. package/dist/NiceWindow-Dqu9ik8A.cjs +1 -0
  32. package/dist/charts-CJruxLRY.js +4657 -0
  33. package/dist/charts-D8oj6Nf5.cjs +761 -0
  34. package/dist/charts.cjs +1 -1
  35. package/dist/charts.mjs +1 -1
  36. package/dist/core-BIdbG6p3.js +27212 -0
  37. package/dist/core-bzK0ZnUp.cjs +122 -0
  38. package/dist/data-branching-BzRFsCJu.js +6133 -0
  39. package/dist/data-branching-DahoQa4M.cjs +1 -0
  40. package/dist/data-branching.cjs +1 -1
  41. package/dist/data-branching.mjs +1 -1
  42. package/dist/data.cjs +1 -1
  43. package/dist/data.mjs +1 -1
  44. package/dist/devops-C9gdQxuU.cjs +17 -0
  45. package/dist/devops-CaO_4qGz.js +7684 -0
  46. package/dist/devops.cjs +1 -1
  47. package/dist/devops.mjs +1 -1
  48. package/dist/editors.cjs +1 -1
  49. package/dist/editors.mjs +3 -3
  50. package/dist/feedback.cjs +1 -1
  51. package/dist/feedback.mjs +3 -3
  52. package/dist/index-BK_Uwmz0.js +67774 -0
  53. package/dist/index-CTbp81RF.cjs +5517 -0
  54. package/dist/index.cjs +1 -1
  55. package/dist/index.css +1 -1
  56. package/dist/index.d.ts +437 -400
  57. package/dist/index.mjs +983 -980
  58. package/dist/lazy.cjs +1 -1
  59. package/dist/lazy.mjs +24 -24
  60. package/dist/navigation.cjs +1 -1
  61. package/dist/navigation.mjs +18 -18
  62. package/dist/no-code-B0mG7OQc.cjs +332 -0
  63. package/dist/no-code-CikRvKeJ.js +7133 -0
  64. package/dist/no-code.cjs +1 -1
  65. package/dist/no-code.mjs +1 -1
  66. package/dist/overlays.cjs +1 -1
  67. package/dist/overlays.mjs +2 -2
  68. package/dist/pickerCommons-CqhXp4QL.js +2043 -0
  69. package/dist/pickerCommons-OsYJhnFE.cjs +1 -0
  70. package/dist/style.css +1 -1
  71. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -1087,6 +1087,275 @@ declare interface Assertion {
1087
1087
 
1088
1088
  declare type AssertionMatcher = 'toEqual' | 'toBe' | 'toBeTruthy' | 'toBeFalsy' | 'toBeNull' | 'toBeUndefined' | 'toContain' | 'toHaveLength' | 'toBeInTheDocument' | 'toHaveTextContent' | 'toHaveAttribute' | 'toHaveClass' | 'toHaveStyle' | 'toHaveBeenCalled' | 'toHaveBeenCalledWith' | 'toHaveBeenCalledTimes' | 'toThrow' | 'toMatchSnapshot';
1089
1089
 
1090
+ /** Aggregate (global) results — survey/poll. Display-only; supplied by the host. */
1091
+ export declare interface AssessmentAggregateResults {
1092
+ totalResponses: number;
1093
+ /** Keyed by question id. */
1094
+ perQuestion: Record<string, {
1095
+ responses: number;
1096
+ /** Counts keyed by option id (choice questions). */
1097
+ optionCounts?: Record<string, number>;
1098
+ /** Mean for numeric/rating/scale/nps. */
1099
+ average?: number;
1100
+ /** Collected free-text answers. */
1101
+ textResponses?: string[];
1102
+ }>;
1103
+ }
1104
+
1105
+ export declare interface AssessmentAnswer {
1106
+ questionId: string;
1107
+ value: AssessmentAnswerValue;
1108
+ /** Scored modes: whether the value matched `correctAnswer`. */
1109
+ correct?: boolean;
1110
+ /** Points earned (after partial credit / negative marking). */
1111
+ pointsEarned?: number;
1112
+ /** Seconds spent on the question. */
1113
+ timeSpent?: number;
1114
+ hintsUsed?: number;
1115
+ }
1116
+
1117
+ /** The value a user supplies for a question. */
1118
+ export declare type AssessmentAnswerValue = string | string[] | number | boolean | Record<string, string> | null;
1119
+
1120
+ export declare interface AssessmentContext {
1121
+ mode: AssessmentMode;
1122
+ /** All answers so far, keyed by question id. */
1123
+ answers: Record<string, AssessmentAnswerValue>;
1124
+ setAnswer: (questionId: string, value: AssessmentAnswerValue) => void;
1125
+ getAnswer: (questionId: string) => AssessmentAnswerValue;
1126
+ currentPage: AssessmentPage;
1127
+ currentIndex: number;
1128
+ totalPages: number;
1129
+ isFirst: boolean;
1130
+ isLast: boolean;
1131
+ /** 0–100 progress. */
1132
+ progress: number;
1133
+ goNext: () => void;
1134
+ goPrev: () => void;
1135
+ goTo: (pageId: string) => void;
1136
+ skip: () => void;
1137
+ submit: () => void;
1138
+ /** Running score (scored modes). */
1139
+ result: AssessmentResult | null;
1140
+ /** Remaining seconds for the active timer, or `null`. */
1141
+ timeLeft: number | null;
1142
+ t: (key: string, defaultValue: string) => string;
1143
+ }
1144
+
1145
+ /** When correctness/explanations are revealed. */
1146
+ declare type AssessmentFeedback = 'none' | 'immediate' | 'after-page' | 'at-end';
1147
+
1148
+ /** Keys for {@link NiceAssessmentProps.labels}. */
1149
+ declare type AssessmentLabelKey = 'next' | 'prev' | 'skip' | 'submit' | 'finish' | 'retry' | 'review' | 'exit' | 'start' | 'correct' | 'incorrect' | 'passed' | 'failed' | 'score' | 'timeUp' | 'questionOf' | 'results' | 'hint';
1150
+
1151
+ /** Page rendering layout. */
1152
+ declare type AssessmentLayout = 'one-per-page' | 'all-at-once' | 'paginated';
1153
+
1154
+ /** Quiz gamification lifelines. */
1155
+ declare type AssessmentLifeline = 'fiftyFifty' | 'hint' | 'skipQuestion' | 'extraTime';
1156
+
1157
+ /**
1158
+ * Behaviour profile.
1159
+ * - `quiz` — correct answers + scoring, optional immediate feedback / gamification.
1160
+ * - `exam` — timed, locked navigation, feedback withheld until the end, pass threshold.
1161
+ * - `survey` — no scoring; collects responses and can display aggregate results.
1162
+ * - `poll` — one / few questions; live aggregate.
1163
+ */
1164
+ export declare type AssessmentMode = 'quiz' | 'exam' | 'survey' | 'poll';
1165
+
1166
+ /** A selectable option for choice-style questions. */
1167
+ export declare interface AssessmentOption {
1168
+ id: string;
1169
+ /** Option label — any node (text, image, formula, …). */
1170
+ label: ReactNode;
1171
+ /** Optional leading media/icon. */
1172
+ media?: ReactNode;
1173
+ /** Per-option weight for partial-credit / weighted multi-select scoring. */
1174
+ weight?: number;
1175
+ /** For `matching` / `dragMatch`: the id of the target this option pairs with. */
1176
+ matchTargetId?: string;
1177
+ }
1178
+
1179
+ /**
1180
+ * A page in the flow. Mirrors {@link SetupWizardStep}: it may render **arbitrary
1181
+ * content** and/or carry one or more questions. With `layout="one-per-page"` a page
1182
+ * is typically one question; `all-at-once` renders every page's questions together.
1183
+ */
1184
+ export declare interface AssessmentPage {
1185
+ id: string;
1186
+ title?: string;
1187
+ subtitle?: string;
1188
+ /** Section/group this page belongs to (for sectioned scoring + steppers). */
1189
+ section?: string;
1190
+ /** Free-form content — any node, or a render fn given the live context. */
1191
+ content?: ReactNode | ((ctx: AssessmentContext) => ReactNode);
1192
+ /** Questions on this page. */
1193
+ questions?: AssessmentQuestion[];
1194
+ /** Per-page time limit (seconds). */
1195
+ timeLimit?: number;
1196
+ /** Adaptive branching: resolve the next page id from current answers/score. */
1197
+ nextPage?: string | ((ctx: AssessmentContext) => string | undefined);
1198
+ /** Show this page only when the predicate holds (against current answers). */
1199
+ showWhen?: (answers: Record<string, AssessmentAnswerValue>) => boolean;
1200
+ }
1201
+
1202
+ /** Random pool selection (question bank): pick `count` of the available questions. */
1203
+ declare interface AssessmentPool {
1204
+ count: number;
1205
+ /** Limit the draw to a section id. */
1206
+ section?: string;
1207
+ }
1208
+
1209
+ /** Props for a preset: everything except `mode` (fixed by the preset). */
1210
+ export declare type AssessmentPresetProps = Omit<NiceAssessmentProps, 'mode'>;
1211
+
1212
+ /** A question. `correctAnswer` is omitted in survey/poll mode. */
1213
+ export declare interface AssessmentQuestion {
1214
+ id: string;
1215
+ type: AssessmentQuestionType;
1216
+ /** The question prompt — any node. */
1217
+ prompt: ReactNode;
1218
+ /** Optional media shown with the prompt (image/video/formula/presentation/…). */
1219
+ media?: ReactNode;
1220
+ /** Help text shown under the prompt. */
1221
+ description?: ReactNode;
1222
+ /** Options for choice / ordering / matching questions. */
1223
+ options?: AssessmentOption[];
1224
+ /** Targets for matching / dragMatch / hotspot / fillBlank. */
1225
+ targets?: AssessmentTarget[];
1226
+ /**
1227
+ * Correct answer (scored modes only). Shape depends on `type`:
1228
+ * option id | id[] | boolean | string | number | ordered id[] |
1229
+ * `Record<targetId, optionId>` (matching/dragMatch) | `string[]` (fillBlank).
1230
+ */
1231
+ correctAnswer?: AssessmentAnswerValue;
1232
+ /** Points awarded for a fully-correct answer. Default `1`. */
1233
+ points?: number;
1234
+ /** Award proportional credit for partially-correct multi answers. Default `false`. */
1235
+ partialCredit?: boolean;
1236
+ /** Subtract points for wrong answers (guards against guessing). Default `false`. */
1237
+ negativeMarking?: boolean;
1238
+ /** Whether the question must be answered to advance. */
1239
+ required?: boolean;
1240
+ /** Shown after answering (immediate feedback) or in review. */
1241
+ explanation?: ReactNode;
1242
+ /** A hint, revealable via the `hint` lifeline (quiz). */
1243
+ hint?: ReactNode;
1244
+ /** Shuffle this question's options (overrides the assessment-level flag). */
1245
+ shuffleOptions?: boolean;
1246
+ /** Difficulty tag (quiz gamification / analytics). */
1247
+ difficulty?: 'easy' | 'medium' | 'hard';
1248
+ /** Per-question time limit (seconds). */
1249
+ timeLimit?: number;
1250
+ /** Min/max for `number` / `scale` / `nps`. */
1251
+ min?: number;
1252
+ max?: number;
1253
+ /** Free-form metadata (category, tags, …); not interpreted by the engine. */
1254
+ meta?: Record<string, unknown>;
1255
+ }
1256
+
1257
+ /** Per-question outcome in the result breakdown. */
1258
+ declare interface AssessmentQuestionResult {
1259
+ questionId: string;
1260
+ correct: boolean;
1261
+ pointsEarned: number;
1262
+ pointsMax: number;
1263
+ value: AssessmentAnswerValue;
1264
+ }
1265
+
1266
+ /** All built-in question types. Custom types resolve via `questionRenderers`. */
1267
+ export declare type AssessmentQuestionType = 'single' | 'multiple' | 'trueFalse' | 'text' | 'longText' | 'number' | 'rating' | 'scale' | 'likert' | 'nps' | 'ordering' | 'matching' | 'fillBlank' | 'hotspot' | 'dragMatch' | 'date' | 'time';
1268
+
1269
+ /** Final result for scored modes (quiz/exam). */
1270
+ export declare interface AssessmentResult {
1271
+ totalQuestions: number;
1272
+ answered: number;
1273
+ correct: number;
1274
+ pointsEarned: number;
1275
+ pointsMax: number;
1276
+ /** 0–100. */
1277
+ percentage: number;
1278
+ passed: boolean;
1279
+ timeTaken: number;
1280
+ /** Subscore per section id. */
1281
+ perSection: Record<string, {
1282
+ pointsEarned: number;
1283
+ pointsMax: number;
1284
+ percentage: number;
1285
+ }>;
1286
+ perQuestion: AssessmentQuestionResult[];
1287
+ }
1288
+
1289
+ export declare interface AssessmentScoringConfig {
1290
+ /** Pass threshold as a percentage 0–100. Default `60`. */
1291
+ passThreshold?: number;
1292
+ /** Honour per-question/per-option `weight`. Default `true`. */
1293
+ weighted?: boolean;
1294
+ /** Default partial-credit for multi-answer questions (per-question prop wins). */
1295
+ partialCredit?: boolean;
1296
+ /** Default negative marking (per-question prop wins). */
1297
+ negativeMarking?: boolean;
1298
+ /** Clamp the total to ≥ 0 when negative marking is on. Default `true`. */
1299
+ clampToZero?: boolean;
1300
+ }
1301
+
1302
+ /** A section groups pages for subscores + stepper labels. */
1303
+ export declare interface AssessmentSection {
1304
+ id: string;
1305
+ title: string;
1306
+ timeLimit?: number;
1307
+ }
1308
+
1309
+ /** A submission payload (survey/poll, or any mode's raw answers). */
1310
+ export declare interface AssessmentSubmission {
1311
+ assessmentId: string;
1312
+ participantId?: string;
1313
+ answers: AssessmentAnswer[];
1314
+ submittedAt: string;
1315
+ totalTime: number;
1316
+ completed: boolean;
1317
+ /** Present for scored modes. */
1318
+ result?: AssessmentResult;
1319
+ }
1320
+
1321
+ /** A drop target / blank id for `matching`, `dragMatch`, `fillBlank`, `hotspot`. */
1322
+ export declare interface AssessmentTarget {
1323
+ id: string;
1324
+ label?: ReactNode;
1325
+ /** Hotspot bounding box (percent of image), e.g. `{ x: 10, y: 20, w: 15, h: 10 }`. */
1326
+ rect?: {
1327
+ x: number;
1328
+ y: number;
1329
+ w: number;
1330
+ h: number;
1331
+ };
1332
+ }
1333
+
1334
+ export declare interface AssessmentTimerConfig {
1335
+ /** Whole-assessment limit (seconds). */
1336
+ total?: number;
1337
+ /** Default per-question limit (seconds) — `question.timeLimit` overrides. */
1338
+ perQuestion?: number;
1339
+ /** Auto-advance when a per-question timer expires. Default `false`. */
1340
+ autoAdvance?: boolean;
1341
+ }
1342
+
1343
+ export declare type AssessmentWidget = (props: AssessmentWidgetProps) => ReactNode;
1344
+
1345
+ declare interface AssessmentWidgetProps {
1346
+ question: AssessmentQuestion;
1347
+ value: AssessmentAnswerValue;
1348
+ onChange: (value: AssessmentAnswerValue) => void;
1349
+ /** Reveal correctness (immediate feedback / review). */
1350
+ revealed?: boolean;
1351
+ disabled?: boolean;
1352
+ size?: NiceSize;
1353
+ t: (key: string, defaultValue: string) => string;
1354
+ }
1355
+
1356
+ /** Map of question type → renderer; merged over the built-ins. */
1357
+ export declare type AssessmentWidgetRegistry = Partial<Record<AssessmentQuestionType, AssessmentWidget>>;
1358
+
1090
1359
  /** Collection */
1091
1360
  export declare interface AssetCollection {
1092
1361
  id: string;
@@ -7405,6 +7674,101 @@ export declare interface NiceAspectRatioProps extends NiceStandardProps {
7405
7674
  maxWidth?: number | string;
7406
7675
  }
7407
7676
 
7677
+ export declare const NiceAssessment: default_2.ForwardRefExoticComponent<NiceAssessmentProps & default_2.RefAttributes<HTMLDivElement>>;
7678
+
7679
+ export declare interface NiceAssessmentProps {
7680
+ /** Behaviour profile. Presets (`NiceQuiz`/`NiceExam`/`NiceSurvey`/`NicePoll`) set this. */
7681
+ mode?: AssessmentMode;
7682
+ /** Stable id (persistence, submissions, aria). */
7683
+ id?: string;
7684
+ /** Title / description shown on the intro/header. */
7685
+ title?: ReactNode;
7686
+ description?: ReactNode;
7687
+ /** Pages (preferred) — full control over content + questions per page. */
7688
+ pages?: AssessmentPage[];
7689
+ /** Shorthand: a flat question list (each becomes a one-question page). */
7690
+ questions?: AssessmentQuestion[];
7691
+ /** Section definitions (for subscores + steppers). */
7692
+ sections?: AssessmentSection[];
7693
+ /** Page layout. Default `one-per-page`. */
7694
+ layout?: AssessmentLayout;
7695
+ size?: NiceSize;
7696
+ /**
7697
+ * Self-applied theme (preset name or {@link NiceTheme}) — wraps in a scoped
7698
+ * `NiceThemeProvider` so it themes correctly outside an app provider. Omit when
7699
+ * already inside one.
7700
+ */
7701
+ theme?: NiceTheme | string;
7702
+ /** Scoring config (quiz/exam). */
7703
+ scoring?: AssessmentScoringConfig;
7704
+ /** Timer config. */
7705
+ timer?: AssessmentTimerConfig;
7706
+ /** When feedback (correctness/explanations) is shown. Mode-dependent default. */
7707
+ feedback?: AssessmentFeedback;
7708
+ /** Lock navigation to forward-only (exam). Default depends on mode. */
7709
+ lockNavigation?: boolean;
7710
+ /** Allow going back. Default `true` (except exam). */
7711
+ allowBack?: boolean;
7712
+ /** Allow skipping non-required questions. Default `true` (except exam). */
7713
+ allowSkip?: boolean;
7714
+ /** Allow retrying a wrong answer (quiz). Default `false`. */
7715
+ allowRetry?: boolean;
7716
+ /** Lives — quiz gamification (0/undefined = unlimited). */
7717
+ lives?: number;
7718
+ /** Available lifelines (quiz). */
7719
+ lifelines?: AssessmentLifeline[];
7720
+ /** Show a review screen with explanations after completion. Default `true` (scored). */
7721
+ review?: boolean;
7722
+ /** Reveal the correct answer in review/feedback. Default `true` (quiz), `false` (exam until released). */
7723
+ revealCorrect?: boolean;
7724
+ /** Shuffle questions / options. */
7725
+ shuffleQuestions?: boolean;
7726
+ shuffleOptions?: boolean;
7727
+ /** Deterministic shuffle/pool seed (reproducible). */
7728
+ randomizeSeed?: string | number;
7729
+ /** Random pool selection (question bank). */
7730
+ pool?: AssessmentPool;
7731
+ /** Show the progress bar. Default `true`. */
7732
+ showProgress?: boolean;
7733
+ /** Show question numbers. Default `true`. */
7734
+ showNumbers?: boolean;
7735
+ /** Persist answers/progress to localStorage under this key (resume). */
7736
+ persistKey?: string;
7737
+ /** Aggregate results to display (survey/poll). */
7738
+ results?: AssessmentAggregateResults;
7739
+ /** Async fetch of aggregate results (survey/poll) — called after submit. */
7740
+ fetchAggregateResults?: (submission: AssessmentSubmission) => Promise<AssessmentAggregateResults>;
7741
+ /** Show aggregate charts after submitting (survey/poll). Default `true` when results available. */
7742
+ showAggregate?: boolean;
7743
+ /** Certificate config (exam pass) — `onExport`/built-in. */
7744
+ certificate?: {
7745
+ enabled?: boolean;
7746
+ title?: string;
7747
+ recipient?: string;
7748
+ };
7749
+ /** Custom export hook for result/certificate (PDF/CSV/… by the host). */
7750
+ onExport?: (result: AssessmentResult, submission: AssessmentSubmission) => void;
7751
+ /** Override / add question-type renderers. */
7752
+ questionRenderers?: AssessmentWidgetRegistry;
7753
+ /** Branding / header / footer slots. */
7754
+ branding?: ReactNode;
7755
+ header?: ReactNode;
7756
+ footer?: ReactNode;
7757
+ /** Callbacks. */
7758
+ onAnswer?: (answer: AssessmentAnswer) => void;
7759
+ onPageChange?: (pageId: string, index: number) => void;
7760
+ onComplete?: (result: AssessmentResult) => void | Promise<void>;
7761
+ onSubmit?: (submission: AssessmentSubmission) => void | Promise<void>;
7762
+ onTimeout?: (scope: 'total' | 'page' | 'question') => void;
7763
+ onExit?: () => void;
7764
+ /** Custom labels (i18n-overridable). */
7765
+ labels?: Partial<Record<AssessmentLabelKey, string>>;
7766
+ accessMode?: NiceAccessMode;
7767
+ className?: string;
7768
+ style?: React.CSSProperties;
7769
+ 'data-testid'?: string;
7770
+ }
7771
+
7408
7772
  export declare type NiceAuditAction = 'create' | 'update' | 'delete' | 'view' | 'export' | 'import' | 'login' | 'logout' | 'custom';
7409
7773
 
7410
7774
  export declare interface NiceAuditEntry {
@@ -11885,6 +12249,13 @@ export declare interface NiceEventOrchestratorProps extends NiceBaseProps {
11885
12249
  onTest?: (flowId: string) => void;
11886
12250
  }
11887
12251
 
12252
+ /**
12253
+ * {@link NiceExam} — timed, forward-locked assessment; correctness withheld until the
12254
+ * end, pass threshold, optional certificate. (Named `NiceExam`, not `NiceTest`, to
12255
+ * avoid colliding with the unrelated software `NiceTestBuilder`.)
12256
+ */
12257
+ export declare const NiceExam: default_2.ForwardRefExoticComponent<AssessmentPresetProps & default_2.RefAttributes<HTMLDivElement>>;
12258
+
11888
12259
  /**
11889
12260
  * Unified export function.
11890
12261
  */
@@ -17472,93 +17843,17 @@ declare interface NicePolarChartSeries {
17472
17843
  }
17473
17844
 
17474
17845
  /**
17475
- * NicePoll — Real-time voting/polling component
17476
- *
17477
- * @example
17478
- * ```tsx
17479
- * <NicePoll
17480
- * question="Which feature should we build next?"
17481
- * options={[
17482
- * { id: '1', text: 'Dark mode' },
17483
- * { id: '2', text: 'Mobile app' },
17484
- * { id: '3', text: 'API v2' },
17485
- * ]}
17486
- * results={pollResults}
17487
- * onVote={(ids) => submitVote(ids)}
17488
- * />
17489
- * ```
17846
+ * {@link NicePoll} — one / few questions with live aggregate results.
17490
17847
  */
17491
- export declare const NicePoll: ForwardRefExoticComponent<NicePollProps & RefAttributes<HTMLDivElement>>;
17848
+ export declare const NicePoll: default_2.ForwardRefExoticComponent<AssessmentPresetProps & default_2.RefAttributes<HTMLDivElement>>;
17492
17849
 
17493
17850
  export { NicePollingConfig }
17494
17851
 
17495
17852
  /**
17496
- * NicePollLive — Poll with automatic real-time result updates
17497
- *
17498
- * @example
17499
- * ```tsx
17500
- * <NicePollLive
17501
- * question="Best framework?"
17502
- * options={options}
17503
- * fetchResults={() => api.getPollResults(pollId)}
17504
- * pollInterval={5000}
17505
- * />
17506
- * ```
17853
+ * {@link NicePollLive} — alias of {@link NicePoll} with aggregate results shown by
17854
+ * default (kept for ergonomics / backward-compatible naming).
17507
17855
  */
17508
- export declare const NicePollLive: ForwardRefExoticComponent<NicePollLiveProps & RefAttributes<HTMLDivElement>>;
17509
-
17510
- export declare interface NicePollLiveProps extends Omit<NicePollProps, 'results'> {
17511
- /** Initial results */
17512
- initialResults?: PollResults;
17513
- /** WebSocket URL for live updates */
17514
- wsUrl?: string;
17515
- /** Polling interval in ms (fallback) */
17516
- pollInterval?: number;
17517
- /** Fetch results function */
17518
- fetchResults?: () => Promise<PollResults>;
17519
- }
17520
-
17521
- /**
17522
- * NicePoll props
17523
- */
17524
- export declare interface NicePollProps {
17525
- /** Poll question */
17526
- question: string;
17527
- /** Poll description */
17528
- description?: string;
17529
- /** Poll options */
17530
- options: PollOption[];
17531
- /** Current results (for real-time updates) */
17532
- results?: PollResults;
17533
- /** User's current vote(s) */
17534
- userVotes?: string[];
17535
- /** Poll configuration */
17536
- config?: PollConfig;
17537
- /** Theme variant */
17538
- theme?: 'light' | 'dark';
17539
- /** Size variant */
17540
- size?: 'sm' | 'md' | 'lg';
17541
- /** Custom labels */
17542
- labels?: {
17543
- vote?: string;
17544
- votes?: string;
17545
- voted?: string;
17546
- changeVote?: string;
17547
- closed?: string;
17548
- closesIn?: string;
17549
- totalVotes?: string;
17550
- noVotes?: string;
17551
- selectUpTo?: string;
17552
- };
17553
- /** Called when user votes */
17554
- onVote?: (optionIds: string[]) => void;
17555
- /** Called when user changes vote */
17556
- onChangeVote?: () => void;
17557
- /** Custom class name */
17558
- className?: string;
17559
- /** Children for custom content */
17560
- children?: ReactNode;
17561
- }
17856
+ export declare const NicePollLive: default_2.ForwardRefExoticComponent<AssessmentPresetProps & default_2.RefAttributes<HTMLDivElement>>;
17562
17857
 
17563
17858
  export declare const NicePopover: default_2.FC<NicePopoverProps>;
17564
17859
 
@@ -17925,85 +18220,10 @@ export { NiceQuickHelp }
17925
18220
  export { NiceQuickHelpProps }
17926
18221
 
17927
18222
  /**
17928
- * NiceQuiz — Interactive quiz component with gamification features
17929
- *
17930
- * @example
17931
- * ```tsx
17932
- * <NiceQuiz
17933
- * title="JavaScript Basics"
17934
- * questions={questions}
17935
- * timeLimit={300}
17936
- * lives={3}
17937
- * lifelines={['fiftyFifty', 'hint']}
17938
- * passingScore={70}
17939
- * onComplete={(result) => console.log(result)}
17940
- * />
17941
- * ```
17942
- */
17943
- export declare const NiceQuiz: ForwardRefExoticComponent<NiceQuizProps & RefAttributes<HTMLDivElement>>;
17944
-
17945
- /**
17946
- * NiceQuiz props
18223
+ * {@link NiceQuiz} — correct answers + scoring with immediate feedback and optional
18224
+ * gamification (lives, lifelines, difficulty). Pages can hold any content.
17947
18225
  */
17948
- export declare interface NiceQuizProps {
17949
- /** Quiz title */
17950
- title?: string;
17951
- /** Quiz description */
17952
- description?: string;
17953
- /** Questions array */
17954
- questions: QuizQuestion[];
17955
- /** Theme variant */
17956
- theme?: 'light' | 'dark';
17957
- /** Total time limit in seconds (0 = unlimited) */
17958
- timeLimit?: number;
17959
- /** Time limit per question in seconds (0 = unlimited) */
17960
- timePerQuestion?: number;
17961
- /** Initial lives (0 = unlimited) */
17962
- lives?: number;
17963
- /** Passing score percentage (0-100) */
17964
- passingScore?: number;
17965
- /** Show correct answer after each question */
17966
- showCorrectAnswerImmediately?: boolean;
17967
- /** Allow retry on wrong answer */
17968
- allowRetry?: boolean;
17969
- /** Show progress indicator */
17970
- showProgress?: boolean;
17971
- /** Available lifelines */
17972
- lifelines?: QuizLifeline[];
17973
- /** Shuffle questions */
17974
- shuffleQuestions?: boolean;
17975
- /** Shuffle options within questions */
17976
- shuffleOptions?: boolean;
17977
- /** Custom labels */
17978
- labels?: {
17979
- next?: string;
17980
- submit?: string;
17981
- skip?: string;
17982
- hint?: string;
17983
- fiftyFifty?: string;
17984
- extraTime?: string;
17985
- correct?: string;
17986
- incorrect?: string;
17987
- passed?: string;
17988
- failed?: string;
17989
- score?: string;
17990
- timeUp?: string;
17991
- noLives?: string;
17992
- retry?: string;
17993
- review?: string;
17994
- exit?: string;
17995
- };
17996
- /** Called when answer is submitted */
17997
- onAnswerSubmit?: (answer: QuizAnswer) => void;
17998
- /** Called when quiz is completed */
17999
- onComplete?: (result: QuizResult) => void;
18000
- /** Called when quiz is exited early */
18001
- onExit?: () => void;
18002
- /** Custom class name */
18003
- className?: string;
18004
- /** Children for custom content */
18005
- children?: ReactNode;
18006
- }
18226
+ export declare const NiceQuiz: default_2.ForwardRefExoticComponent<AssessmentPresetProps & default_2.RefAttributes<HTMLDivElement>>;
18007
18227
 
18008
18228
  export declare const NiceRadioGroup: default_2.FC<NiceRadioGroupProps>;
18009
18229
 
@@ -20726,58 +20946,11 @@ declare interface NiceSuffixOption {
20726
20946
  weight?: number;
20727
20947
  }
20728
20948
 
20729
- export declare const NiceSurvey: default_2.ForwardRefExoticComponent<NiceSurveyProps & default_2.RefAttributes<HTMLDivElement>>;
20730
-
20731
- export declare interface NiceSurveyProps {
20732
- /** Unique survey ID. */
20733
- id: string;
20734
- /** Survey title. */
20735
- title: string;
20736
- /** Survey description. */
20737
- description?: string;
20738
- /** List of questions. */
20739
- questions: SurveyQuestion[];
20740
- /** Display mode. */
20741
- mode?: SurveyDisplayMode;
20742
- /** Allow going back to previous questions (question-by-question mode). */
20743
- allowBack?: boolean;
20744
- /** Show progress indicator. */
20745
- showProgress?: boolean;
20746
- /** Show question numbers. */
20747
- showNumbers?: boolean;
20748
- /** Time limit for entire survey (seconds). */
20749
- timeLimit?: number;
20750
- /** Called when survey is submitted. */
20751
- onSubmit?: (submission: SurveySubmission) => void;
20752
- /** Called when an answer changes. */
20753
- onAnswerChange?: (questionId: string, value: SurveyAnswer['value']) => void;
20754
- /** Called when time runs out. */
20755
- onTimeOut?: () => void;
20756
- /** Initial answers (for resuming). */
20757
- initialAnswers?: SurveyAnswer[];
20758
- /** Whether survey is read-only (for review). */
20759
- readOnly?: boolean;
20760
- /** Show results after submission. */
20761
- showResultsAfterSubmit?: boolean;
20762
- /** Existing results to display. */
20763
- results?: SurveyResults;
20764
- /** Custom submit button text. */
20765
- submitText?: string;
20766
- /** Custom next button text. */
20767
- nextText?: string;
20768
- /** Custom back button text. */
20769
- backText?: string;
20770
- /** Custom skip button text. */
20771
- skipText?: string;
20772
- /** Participant ID (for tracking). */
20773
- participantId?: string;
20774
- /** Participant name (for display). */
20775
- participantName?: string;
20776
- /** Theme. */
20777
- theme?: 'light' | 'dark';
20778
- /** Custom class name. */
20779
- className?: string;
20780
- }
20949
+ /**
20950
+ * {@link NiceSurvey} — no scoring; collects responses and can display aggregate
20951
+ * (global) results via `results` / `fetchAggregateResults`.
20952
+ */
20953
+ export declare const NiceSurvey: default_2.ForwardRefExoticComponent<AssessmentPresetProps & default_2.RefAttributes<HTMLDivElement>>;
20781
20954
 
20782
20955
  /**
20783
20956
  * Drop-in replacement for `<React.Suspense>` with a `delay` knob to
@@ -24746,72 +24919,6 @@ export declare interface PlatformConnection {
24746
24919
  error?: string;
24747
24920
  }
24748
24921
 
24749
- /**
24750
- * Poll configuration
24751
- */
24752
- export declare interface PollConfig {
24753
- /** Allow multiple selection */
24754
- multiSelect?: boolean;
24755
- /** Maximum selections when multiSelect is true */
24756
- maxSelections?: number;
24757
- /** Allow changing vote */
24758
- allowChangeVote?: boolean;
24759
- /** Show results before voting */
24760
- showResultsBeforeVote?: boolean;
24761
- /** Show results after voting */
24762
- showResultsAfterVote?: boolean;
24763
- /** Show vote count */
24764
- showVoteCount?: boolean;
24765
- /** Show percentages */
24766
- showPercentages?: boolean;
24767
- /** Animate results */
24768
- animateResults?: boolean;
24769
- /** Poll closes at this date */
24770
- closesAt?: Date;
24771
- /** Poll is closed */
24772
- isClosed?: boolean;
24773
- /** Allow anonymous voting */
24774
- anonymous?: boolean;
24775
- }
24776
-
24777
- /**
24778
- * Poll option
24779
- */
24780
- export declare interface PollOption {
24781
- id: string;
24782
- text: string;
24783
- icon?: string;
24784
- image?: string;
24785
- color?: string;
24786
- }
24787
-
24788
- /**
24789
- * Poll results for an option
24790
- */
24791
- export declare interface PollOptionResult {
24792
- optionId: string;
24793
- votes: number;
24794
- percentage: number;
24795
- }
24796
-
24797
- /**
24798
- * Poll results
24799
- */
24800
- export declare interface PollResults {
24801
- totalVotes: number;
24802
- options: PollOptionResult[];
24803
- lastUpdated: Date;
24804
- }
24805
-
24806
- /**
24807
- * Poll vote
24808
- */
24809
- export declare interface PollVote {
24810
- optionId: string;
24811
- voterId?: string;
24812
- timestamp: Date;
24813
- }
24814
-
24815
24922
  /**
24816
24923
  * Port position
24817
24924
  */
@@ -25103,75 +25210,6 @@ declare interface QuickFilter<T = any> {
25103
25210
  color?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'secondary';
25104
25211
  }
25105
25212
 
25106
- /**
25107
- * Quiz answer
25108
- */
25109
- export declare interface QuizAnswer {
25110
- questionId: string;
25111
- value: string | string[];
25112
- isCorrect: boolean;
25113
- timeTaken: number;
25114
- pointsEarned: number;
25115
- hintsUsed?: number;
25116
- }
25117
-
25118
- /**
25119
- * Quiz difficulty level
25120
- */
25121
- export declare type QuizDifficulty = 'easy' | 'medium' | 'hard';
25122
-
25123
- /**
25124
- * Quiz lifeline type
25125
- */
25126
- export declare type QuizLifeline = 'fiftyFifty' | 'hint' | 'skipQuestion' | 'extraTime';
25127
-
25128
- /**
25129
- * Quiz option
25130
- */
25131
- export declare interface QuizOption {
25132
- id: string;
25133
- text: string;
25134
- icon?: string;
25135
- image?: string;
25136
- }
25137
-
25138
- /**
25139
- * Quiz question
25140
- */
25141
- export declare interface QuizQuestion {
25142
- id: string;
25143
- type: QuizQuestionType;
25144
- text: string;
25145
- description?: string;
25146
- image?: string;
25147
- options?: QuizOption[];
25148
- correctAnswer: string | string[];
25149
- points?: number;
25150
- timeLimit?: number;
25151
- difficulty?: QuizDifficulty;
25152
- explanation?: string;
25153
- hint?: string;
25154
- }
25155
-
25156
- /**
25157
- * Quiz question type
25158
- */
25159
- export declare type QuizQuestionType = 'single' | 'multiple' | 'text' | 'trueFalse' | 'ordering';
25160
-
25161
- /**
25162
- * Quiz result
25163
- */
25164
- export declare interface QuizResult {
25165
- totalQuestions: number;
25166
- answeredCorrectly: number;
25167
- totalPoints: number;
25168
- maxPoints: number;
25169
- percentageScore: number;
25170
- timeTaken: number;
25171
- answers: QuizAnswer[];
25172
- passed: boolean;
25173
- }
25174
-
25175
25213
  export { RADIUS_VALUES }
25176
25214
 
25177
25215
  export { RadiusVariant }
@@ -26937,60 +26975,6 @@ declare interface SuggestionFactor {
26937
26975
  entryValue?: string;
26938
26976
  }
26939
26977
 
26940
- export declare interface SurveyAnswer {
26941
- questionId: string;
26942
- value: string | string[] | number | null;
26943
- answeredAt?: string;
26944
- timeSpent?: number;
26945
- }
26946
-
26947
- export declare type SurveyDisplayMode = 'all-at-once' | 'question-by-question' | 'timed';
26948
-
26949
- export declare interface SurveyOption {
26950
- id: string;
26951
- text: string;
26952
- icon?: default_2.ReactNode;
26953
- imageUrl?: string;
26954
- }
26955
-
26956
- export declare interface SurveyQuestion {
26957
- id: string;
26958
- text: string;
26959
- description?: string;
26960
- type: SurveyQuestionType;
26961
- options?: SurveyOption[];
26962
- required?: boolean;
26963
- minValue?: number;
26964
- maxValue?: number;
26965
- placeholder?: string;
26966
- timeLimit?: number;
26967
- imageUrl?: string;
26968
- category?: string;
26969
- }
26970
-
26971
- export declare type SurveyQuestionType = 'single' | 'multiple' | 'text' | 'rating' | 'scale' | 'date' | 'time';
26972
-
26973
- export declare interface SurveyResults {
26974
- totalResponses: number;
26975
- questionStats: Record<string, {
26976
- responses: number;
26977
- optionCounts: Record<string, number>;
26978
- averageRating?: number;
26979
- textResponses?: string[];
26980
- }>;
26981
- }
26982
-
26983
- export declare interface SurveySubmission {
26984
- id: string;
26985
- surveyId: string;
26986
- participantId?: string;
26987
- participantName?: string;
26988
- answers: SurveyAnswer[];
26989
- submittedAt: string;
26990
- totalTime: number;
26991
- completed: boolean;
26992
- }
26993
-
26994
26978
  /** Swap event types. */
26995
26979
  export declare type SwapEventType = 'swap-start' | 'swap-success' | 'swap-error' | 'swap-rollback';
26996
26980
 
@@ -28155,6 +28139,59 @@ export { useAICompletion }
28155
28139
  */
28156
28140
  export declare function useAnalytics(): AnalyticsContextValue;
28157
28141
 
28142
+ export declare function useAssessment(opts: UseAssessmentOptions): UseAssessmentReturn;
28143
+
28144
+ declare interface UseAssessmentOptions {
28145
+ id?: string;
28146
+ mode: AssessmentMode;
28147
+ pages?: AssessmentPage[];
28148
+ questions?: AssessmentQuestion[];
28149
+ sections?: AssessmentSection[];
28150
+ scoring?: AssessmentScoringConfig;
28151
+ timer?: AssessmentTimerConfig;
28152
+ shuffleQuestions?: boolean;
28153
+ shuffleOptions?: boolean;
28154
+ randomizeSeed?: string | number;
28155
+ pool?: {
28156
+ count: number;
28157
+ section?: string;
28158
+ };
28159
+ lockNavigation?: boolean;
28160
+ allowBack?: boolean;
28161
+ persistKey?: string;
28162
+ /** Translator (injected by the shell). Defaults to the fallback string. */
28163
+ t?: (key: string, defaultValue: string) => string;
28164
+ onAnswer?: (answer: AssessmentAnswer) => void;
28165
+ onPageChange?: (pageId: string, index: number) => void;
28166
+ onComplete?: (result: AssessmentResult) => void | Promise<void>;
28167
+ onSubmit?: (submission: AssessmentSubmission) => void | Promise<void>;
28168
+ onTimeout?: (scope: 'total' | 'page' | 'question') => void;
28169
+ }
28170
+
28171
+ declare interface UseAssessmentReturn {
28172
+ ctx: AssessmentContext;
28173
+ pages: AssessmentPage[];
28174
+ currentPage: AssessmentPage | undefined;
28175
+ currentIndex: number;
28176
+ totalPages: number;
28177
+ isFirst: boolean;
28178
+ isLast: boolean;
28179
+ progress: number;
28180
+ answers: Record<string, AssessmentAnswerValue>;
28181
+ setAnswer: (questionId: string, value: AssessmentAnswerValue) => void;
28182
+ getAnswer: (questionId: string) => AssessmentAnswerValue;
28183
+ goNext: () => void;
28184
+ goPrev: () => void;
28185
+ goTo: (pageId: string) => void;
28186
+ skip: () => void;
28187
+ submit: () => void;
28188
+ restart: () => void;
28189
+ completed: boolean;
28190
+ result: AssessmentResult | null;
28191
+ submission: AssessmentSubmission | null;
28192
+ timeLeft: number | null;
28193
+ }
28194
+
28158
28195
  export declare function useAuditLog(options?: UseAuditLogOptions): UseAuditLogResult;
28159
28196
 
28160
28197
  export declare interface UseAuditLogOptions {