analytica-frontend-lib 1.1.31 → 1.1.33

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.
@@ -69,6 +69,6 @@ declare const CheckBox: react.ForwardRefExoticComponent<{
69
69
  className?: string;
70
70
  /** Label CSS classes */
71
71
  labelClassName?: string;
72
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & react.RefAttributes<HTMLInputElement>>;
72
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & react.RefAttributes<HTMLInputElement>>;
73
73
 
74
74
  export { type CheckBoxProps, CheckBox as default };
@@ -69,6 +69,6 @@ declare const CheckBox: react.ForwardRefExoticComponent<{
69
69
  className?: string;
70
70
  /** Label CSS classes */
71
71
  labelClassName?: string;
72
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & react.RefAttributes<HTMLInputElement>>;
72
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & react.RefAttributes<HTMLInputElement>>;
73
73
 
74
74
  export { type CheckBoxProps, CheckBox as default };
@@ -976,10 +976,12 @@ var import_react12 = require("react");
976
976
  // src/components/Quiz/useQuizStore.ts
977
977
  var import_zustand2 = require("zustand");
978
978
  var import_middleware = require("zustand/middleware");
979
+ var MINUTE_INTERVAL_MS = 6e4;
979
980
  var useQuizStore = (0, import_zustand2.create)()(
980
981
  (0, import_middleware.devtools)(
981
982
  (set, get) => {
982
983
  let timerInterval = null;
984
+ let minuteCallbackInterval = null;
983
985
  const startTimer = () => {
984
986
  if (get().isFinished) {
985
987
  return;
@@ -998,6 +1000,35 @@ var useQuizStore = (0, import_zustand2.create)()(
998
1000
  timerInterval = null;
999
1001
  }
1000
1002
  };
1003
+ const setMinuteCallback = (callback) => {
1004
+ set({ minuteCallback: callback });
1005
+ };
1006
+ const startMinuteCallback = () => {
1007
+ const { minuteCallback, isFinished } = get();
1008
+ if (isFinished || !minuteCallback) {
1009
+ return;
1010
+ }
1011
+ if (minuteCallbackInterval) {
1012
+ clearInterval(minuteCallbackInterval);
1013
+ }
1014
+ minuteCallbackInterval = setInterval(() => {
1015
+ const {
1016
+ minuteCallback: currentCallback,
1017
+ isFinished: currentIsFinished
1018
+ } = get();
1019
+ if (currentIsFinished || !currentCallback) {
1020
+ stopMinuteCallback();
1021
+ return;
1022
+ }
1023
+ currentCallback();
1024
+ }, MINUTE_INTERVAL_MS);
1025
+ };
1026
+ const stopMinuteCallback = () => {
1027
+ if (minuteCallbackInterval) {
1028
+ clearInterval(minuteCallbackInterval);
1029
+ minuteCallbackInterval = null;
1030
+ }
1031
+ };
1001
1032
  return {
1002
1033
  // Initial State
1003
1034
  currentQuestionIndex: 0,
@@ -1008,6 +1039,7 @@ var useQuizStore = (0, import_zustand2.create)()(
1008
1039
  isFinished: false,
1009
1040
  userId: "",
1010
1041
  variant: "default",
1042
+ minuteCallback: null,
1011
1043
  questionsResult: null,
1012
1044
  currentQuestionResult: null,
1013
1045
  // Setters
@@ -1242,13 +1274,16 @@ var useQuizStore = (0, import_zustand2.create)()(
1242
1274
  startQuiz: () => {
1243
1275
  set({ isStarted: true, timeElapsed: 0 });
1244
1276
  startTimer();
1277
+ startMinuteCallback();
1245
1278
  },
1246
1279
  finishQuiz: () => {
1247
1280
  set({ isFinished: true });
1248
1281
  stopTimer();
1282
+ stopMinuteCallback();
1249
1283
  },
1250
1284
  resetQuiz: () => {
1251
1285
  stopTimer();
1286
+ stopMinuteCallback();
1252
1287
  set({
1253
1288
  currentQuestionIndex: 0,
1254
1289
  selectedAnswers: {},
@@ -1258,6 +1293,7 @@ var useQuizStore = (0, import_zustand2.create)()(
1258
1293
  isFinished: false,
1259
1294
  userId: "",
1260
1295
  variant: "default",
1296
+ minuteCallback: null,
1261
1297
  questionsResult: null,
1262
1298
  currentQuestionResult: null
1263
1299
  });
@@ -1266,6 +1302,10 @@ var useQuizStore = (0, import_zustand2.create)()(
1266
1302
  updateTime: (time) => set({ timeElapsed: time }),
1267
1303
  startTimer,
1268
1304
  stopTimer,
1305
+ // Minute Callback
1306
+ setMinuteCallback,
1307
+ startMinuteCallback,
1308
+ stopMinuteCallback,
1269
1309
  // Getters
1270
1310
  getCurrentQuestion: () => {
1271
1311
  const { currentQuestionIndex, getActiveQuiz } = get();
@@ -3456,12 +3496,12 @@ var CardAudio = (0, import_react7.forwardRef)(
3456
3496
  };
3457
3497
  const getVolumeIcon = () => {
3458
3498
  if (volume === 0) {
3459
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react5.SpeakerSimpleX, {});
3499
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react5.SpeakerSimpleX, { size: 24 });
3460
3500
  }
3461
3501
  if (volume < 0.5) {
3462
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react5.SpeakerLow, {});
3502
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react5.SpeakerLow, { size: 24 });
3463
3503
  }
3464
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react5.SpeakerHigh, {});
3504
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react5.SpeakerHigh, { size: 24 });
3465
3505
  };
3466
3506
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3467
3507
  CardBase,
@@ -3470,7 +3510,10 @@ var CardAudio = (0, import_react7.forwardRef)(
3470
3510
  layout: "horizontal",
3471
3511
  padding: "medium",
3472
3512
  minHeight: "none",
3473
- className: cn("w-auto h-14 items-center gap-2", className),
3513
+ className: cn(
3514
+ "flex flex-row w-auto h-14 items-center gap-2",
3515
+ className
3516
+ ),
3474
3517
  ...props,
3475
3518
  children: [
3476
3519
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
@@ -3520,7 +3563,7 @@ var CardAudio = (0, import_react7.forwardRef)(
3520
3563
  ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react5.Play, { size: 24 })
3521
3564
  }
3522
3565
  ),
3523
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime(currentTime) }),
3566
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(currentTime) }),
3524
3567
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3525
3568
  "button",
3526
3569
  {
@@ -3547,8 +3590,8 @@ var CardAudio = (0, import_react7.forwardRef)(
3547
3590
  )
3548
3591
  }
3549
3592
  ) }),
3550
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime(duration) }),
3551
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative", children: [
3593
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(duration) }),
3594
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative h-6", children: [
3552
3595
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3553
3596
  "button",
3554
3597
  {
@@ -3610,7 +3653,7 @@ var CardAudio = (0, import_react7.forwardRef)(
3610
3653
  }
3611
3654
  )
3612
3655
  ] }),
3613
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative", children: [
3656
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative h-6", children: [
3614
3657
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3615
3658
  "button",
3616
3659
  {