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.
package/dist/index.mjs CHANGED
@@ -4859,12 +4859,12 @@ var CardAudio = forwardRef12(
4859
4859
  };
4860
4860
  const getVolumeIcon = () => {
4861
4861
  if (volume === 0) {
4862
- return /* @__PURE__ */ jsx27(SpeakerSimpleX, {});
4862
+ return /* @__PURE__ */ jsx27(SpeakerSimpleX, { size: 24 });
4863
4863
  }
4864
4864
  if (volume < 0.5) {
4865
- return /* @__PURE__ */ jsx27(SpeakerLow, {});
4865
+ return /* @__PURE__ */ jsx27(SpeakerLow, { size: 24 });
4866
4866
  }
4867
- return /* @__PURE__ */ jsx27(SpeakerHigh, {});
4867
+ return /* @__PURE__ */ jsx27(SpeakerHigh, { size: 24 });
4868
4868
  };
4869
4869
  return /* @__PURE__ */ jsxs21(
4870
4870
  CardBase,
@@ -4873,7 +4873,10 @@ var CardAudio = forwardRef12(
4873
4873
  layout: "horizontal",
4874
4874
  padding: "medium",
4875
4875
  minHeight: "none",
4876
- className: cn("w-auto h-14 items-center gap-2", className),
4876
+ className: cn(
4877
+ "flex flex-row w-auto h-14 items-center gap-2",
4878
+ className
4879
+ ),
4877
4880
  ...props,
4878
4881
  children: [
4879
4882
  /* @__PURE__ */ jsx27(
@@ -4923,7 +4926,7 @@ var CardAudio = forwardRef12(
4923
4926
  ] }) }) : /* @__PURE__ */ jsx27(Play, { size: 24 })
4924
4927
  }
4925
4928
  ),
4926
- /* @__PURE__ */ jsx27("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime2(currentTime) }),
4929
+ /* @__PURE__ */ jsx27("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime2(currentTime) }),
4927
4930
  /* @__PURE__ */ jsx27("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ jsx27(
4928
4931
  "button",
4929
4932
  {
@@ -4950,8 +4953,8 @@ var CardAudio = forwardRef12(
4950
4953
  )
4951
4954
  }
4952
4955
  ) }),
4953
- /* @__PURE__ */ jsx27("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime2(duration) }),
4954
- /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
4956
+ /* @__PURE__ */ jsx27("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime2(duration) }),
4957
+ /* @__PURE__ */ jsxs21("div", { className: "relative h-6", children: [
4955
4958
  /* @__PURE__ */ jsx27(
4956
4959
  "button",
4957
4960
  {
@@ -5013,7 +5016,7 @@ var CardAudio = forwardRef12(
5013
5016
  }
5014
5017
  )
5015
5018
  ] }),
5016
- /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
5019
+ /* @__PURE__ */ jsxs21("div", { className: "relative h-6", children: [
5017
5020
  /* @__PURE__ */ jsx27(
5018
5021
  "button",
5019
5022
  {
@@ -8057,10 +8060,12 @@ var ANSWER_STATUS = /* @__PURE__ */ ((ANSWER_STATUS2) => {
8057
8060
  ANSWER_STATUS2["NAO_RESPONDIDO"] = "NAO_RESPONDIDO";
8058
8061
  return ANSWER_STATUS2;
8059
8062
  })(ANSWER_STATUS || {});
8063
+ var MINUTE_INTERVAL_MS = 6e4;
8060
8064
  var useQuizStore = create7()(
8061
8065
  devtools(
8062
8066
  (set, get) => {
8063
8067
  let timerInterval = null;
8068
+ let minuteCallbackInterval = null;
8064
8069
  const startTimer = () => {
8065
8070
  if (get().isFinished) {
8066
8071
  return;
@@ -8079,6 +8084,35 @@ var useQuizStore = create7()(
8079
8084
  timerInterval = null;
8080
8085
  }
8081
8086
  };
8087
+ const setMinuteCallback = (callback) => {
8088
+ set({ minuteCallback: callback });
8089
+ };
8090
+ const startMinuteCallback = () => {
8091
+ const { minuteCallback, isFinished } = get();
8092
+ if (isFinished || !minuteCallback) {
8093
+ return;
8094
+ }
8095
+ if (minuteCallbackInterval) {
8096
+ clearInterval(minuteCallbackInterval);
8097
+ }
8098
+ minuteCallbackInterval = setInterval(() => {
8099
+ const {
8100
+ minuteCallback: currentCallback,
8101
+ isFinished: currentIsFinished
8102
+ } = get();
8103
+ if (currentIsFinished || !currentCallback) {
8104
+ stopMinuteCallback();
8105
+ return;
8106
+ }
8107
+ currentCallback();
8108
+ }, MINUTE_INTERVAL_MS);
8109
+ };
8110
+ const stopMinuteCallback = () => {
8111
+ if (minuteCallbackInterval) {
8112
+ clearInterval(minuteCallbackInterval);
8113
+ minuteCallbackInterval = null;
8114
+ }
8115
+ };
8082
8116
  return {
8083
8117
  // Initial State
8084
8118
  currentQuestionIndex: 0,
@@ -8089,6 +8123,7 @@ var useQuizStore = create7()(
8089
8123
  isFinished: false,
8090
8124
  userId: "",
8091
8125
  variant: "default",
8126
+ minuteCallback: null,
8092
8127
  questionsResult: null,
8093
8128
  currentQuestionResult: null,
8094
8129
  // Setters
@@ -8323,13 +8358,16 @@ var useQuizStore = create7()(
8323
8358
  startQuiz: () => {
8324
8359
  set({ isStarted: true, timeElapsed: 0 });
8325
8360
  startTimer();
8361
+ startMinuteCallback();
8326
8362
  },
8327
8363
  finishQuiz: () => {
8328
8364
  set({ isFinished: true });
8329
8365
  stopTimer();
8366
+ stopMinuteCallback();
8330
8367
  },
8331
8368
  resetQuiz: () => {
8332
8369
  stopTimer();
8370
+ stopMinuteCallback();
8333
8371
  set({
8334
8372
  currentQuestionIndex: 0,
8335
8373
  selectedAnswers: {},
@@ -8339,6 +8377,7 @@ var useQuizStore = create7()(
8339
8377
  isFinished: false,
8340
8378
  userId: "",
8341
8379
  variant: "default",
8380
+ minuteCallback: null,
8342
8381
  questionsResult: null,
8343
8382
  currentQuestionResult: null
8344
8383
  });
@@ -8347,6 +8386,10 @@ var useQuizStore = create7()(
8347
8386
  updateTime: (time) => set({ timeElapsed: time }),
8348
8387
  startTimer,
8349
8388
  stopTimer,
8389
+ // Minute Callback
8390
+ setMinuteCallback,
8391
+ startMinuteCallback,
8392
+ stopMinuteCallback,
8350
8393
  // Getters
8351
8394
  getCurrentQuestion: () => {
8352
8395
  const { currentQuestionIndex, getActiveQuiz } = get();