analytica-frontend-lib 1.4.61 → 1.4.62

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.
@@ -6340,8 +6340,65 @@ AccordionGroup.displayName = "AccordionGroup";
6340
6340
  // src/index.ts
6341
6341
  init_utils();
6342
6342
 
6343
- // src/components/CheckBoxGroup/CheckBoxGroup.tsx
6343
+ // src/components/shared/SendModalBase/components/DeadlineStep.tsx
6344
6344
  var import_jsx_runtime29 = require("react/jsx-runtime");
6345
+ var DeadlineStep = ({
6346
+ startDate,
6347
+ startTime,
6348
+ finalDate,
6349
+ finalTime,
6350
+ onStartDateChange,
6351
+ onStartTimeChange,
6352
+ onFinalDateChange,
6353
+ onFinalTimeChange,
6354
+ errors,
6355
+ testIdPrefix,
6356
+ children
6357
+ }) => {
6358
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
6359
+ "div",
6360
+ {
6361
+ className: "flex flex-col gap-4 sm:gap-6 pt-6",
6362
+ "data-testid": testIdPrefix ? `${testIdPrefix}-deadline-step` : void 0,
6363
+ children: [
6364
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col gap-2 sm:grid sm:grid-cols-2", children: [
6365
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6366
+ DateTimeInput_default,
6367
+ {
6368
+ label: "Iniciar em*",
6369
+ date: startDate,
6370
+ time: startTime,
6371
+ onDateChange: onStartDateChange,
6372
+ onTimeChange: onStartTimeChange,
6373
+ errorMessage: [errors.startDate, errors.startTime].filter(Boolean).join(" ") || void 0,
6374
+ defaultTime: "00:00",
6375
+ testId: testIdPrefix ? `${testIdPrefix}-start-datetime` : "start-datetime",
6376
+ className: "w-full"
6377
+ }
6378
+ ),
6379
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6380
+ DateTimeInput_default,
6381
+ {
6382
+ label: "Finalizar at\xE9*",
6383
+ date: finalDate,
6384
+ time: finalTime,
6385
+ onDateChange: onFinalDateChange,
6386
+ onTimeChange: onFinalTimeChange,
6387
+ errorMessage: [errors.finalDate, errors.finalTime].filter(Boolean).join(" ") || void 0,
6388
+ defaultTime: "23:59",
6389
+ testId: testIdPrefix ? `${testIdPrefix}-final-datetime` : "final-datetime",
6390
+ className: "w-full"
6391
+ }
6392
+ )
6393
+ ] }),
6394
+ children
6395
+ ]
6396
+ }
6397
+ );
6398
+ };
6399
+
6400
+ // src/components/CheckBoxGroup/CheckBoxGroup.tsx
6401
+ var import_jsx_runtime30 = require("react/jsx-runtime");
6345
6402
  var CheckboxGroup = ({
6346
6403
  categories,
6347
6404
  onCategoriesChange,
@@ -6663,8 +6720,8 @@ var CheckboxGroup = ({
6663
6720
  };
6664
6721
  const renderCheckboxItem = (item, categoryKey) => {
6665
6722
  const uniqueId = `${categoryKey}-${item.id}`;
6666
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-3 px-2", children: [
6667
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6723
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-3 px-2", children: [
6724
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6668
6725
  CheckBox_default,
6669
6726
  {
6670
6727
  id: uniqueId,
@@ -6672,7 +6729,7 @@ var CheckboxGroup = ({
6672
6729
  onChange: () => toggleItem(categoryKey, item.id)
6673
6730
  }
6674
6731
  ),
6675
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6732
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6676
6733
  "label",
6677
6734
  {
6678
6735
  htmlFor: uniqueId,
@@ -6682,12 +6739,12 @@ var CheckboxGroup = ({
6682
6739
  )
6683
6740
  ] }, item.id);
6684
6741
  };
6685
- const renderFormattedGroup = (formattedGroup, idx, categoryKey) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
6742
+ const renderFormattedGroup = (formattedGroup, idx, categoryKey) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
6686
6743
  "div",
6687
6744
  {
6688
6745
  className: "flex flex-col gap-3",
6689
6746
  children: [
6690
- "groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { size: "sm", className: "mt-2", weight: "semibold", children: formattedGroup.groupLabel }),
6747
+ "groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "sm", className: "mt-2", weight: "semibold", children: formattedGroup.groupLabel }),
6691
6748
  formattedGroup.itens?.map(
6692
6749
  (item) => renderCheckboxItem(item, categoryKey)
6693
6750
  )
@@ -6698,9 +6755,9 @@ var CheckboxGroup = ({
6698
6755
  const renderAccordionTrigger = (category, isEnabled) => {
6699
6756
  const allSelected = areAllFilteredItemsSelected(category.key);
6700
6757
  const someSelected = isMinimalOneCheckBoxIsSelected(category.key);
6701
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-between w-full p-2", children: [
6702
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-3", children: [
6703
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6758
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center justify-between w-full p-2", children: [
6759
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-3", children: [
6760
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6704
6761
  CheckBox_default,
6705
6762
  {
6706
6763
  checked: allSelected,
@@ -6709,7 +6766,7 @@ var CheckboxGroup = ({
6709
6766
  onChange: () => toggleAllInCategory(category.key)
6710
6767
  }
6711
6768
  ),
6712
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6769
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6713
6770
  Text_default,
6714
6771
  {
6715
6772
  size: "sm",
@@ -6719,7 +6776,7 @@ var CheckboxGroup = ({
6719
6776
  }
6720
6777
  )
6721
6778
  ] }),
6722
- (openAccordion === category.key || isEnabled) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Badge_default, { variant: "solid", action: "info", children: getBadgeText2(category) })
6779
+ (openAccordion === category.key || isEnabled) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Badge_default, { variant: "solid", action: "info", children: getBadgeText2(category) })
6723
6780
  ] });
6724
6781
  };
6725
6782
  const renderCompactSingleItem = (category) => {
@@ -6729,13 +6786,13 @@ var CheckboxGroup = ({
6729
6786
  return null;
6730
6787
  }
6731
6788
  const singleItem = allItems[0];
6732
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
6789
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
6733
6790
  "div",
6734
6791
  {
6735
6792
  className: "flex items-center justify-between w-full px-3 py-2",
6736
6793
  children: [
6737
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-800", children: category.label }),
6738
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { size: "sm", className: "text-text-950", children: singleItem.name })
6794
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-800", children: category.label }),
6795
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "sm", className: "text-text-950", children: singleItem.name })
6739
6796
  ]
6740
6797
  },
6741
6798
  category.key
@@ -6751,16 +6808,16 @@ var CheckboxGroup = ({
6751
6808
  const allItems = formattedItems.flatMap((group) => group.itens || []);
6752
6809
  const hasOnlyOneAvailableItem = allItems.length === 1;
6753
6810
  if (compactSingleItem && hasOnlyOneAvailableItem && isEnabled) {
6754
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
6811
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
6755
6812
  renderCompactSingleItem(category),
6756
- showDivider && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Divider_default, {})
6813
+ showDivider && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Divider_default, {})
6757
6814
  ] }, category.key);
6758
6815
  }
6759
6816
  const hasNoItems = formattedItems.every(
6760
6817
  (group) => !group.itens || group.itens.length === 0
6761
6818
  );
6762
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
6763
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6819
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
6820
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6764
6821
  CardAccordation,
6765
6822
  {
6766
6823
  value: category.key,
@@ -6770,12 +6827,12 @@ var CheckboxGroup = ({
6770
6827
  openAccordion === category.key && "bg-background-50 border-none"
6771
6828
  ),
6772
6829
  trigger: renderAccordionTrigger(category, isEnabled),
6773
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex flex-col gap-3 pt-2", children: hasNoItems && isEnabled ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "px-2 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { size: "sm", className: "text-text-500 text-center", children: "Sem dados" }) }) : formattedItems.map(
6830
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-col gap-3 pt-2", children: hasNoItems && isEnabled ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "px-2 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "sm", className: "text-text-500 text-center", children: "Sem dados" }) }) : formattedItems.map(
6774
6831
  (formattedGroup, idx) => renderFormattedGroup(formattedGroup, idx, category.key)
6775
6832
  ) })
6776
6833
  }
6777
6834
  ),
6778
- openAccordion !== category.key && showDivider && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Divider_default, {})
6835
+ openAccordion !== category.key && showDivider && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Divider_default, {})
6779
6836
  ] }, category.key);
6780
6837
  };
6781
6838
  (0, import_react20.useEffect)(() => {
@@ -6789,7 +6846,7 @@ var CheckboxGroup = ({
6789
6846
  }, 0);
6790
6847
  }
6791
6848
  }, [categories, openAccordion]);
6792
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6849
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6793
6850
  AccordionGroup,
6794
6851
  {
6795
6852
  type: "single",
@@ -6802,7 +6859,7 @@ var CheckboxGroup = ({
6802
6859
  };
6803
6860
 
6804
6861
  // src/components/shared/SendModalBase/components/RecipientStep.tsx
6805
- var import_jsx_runtime30 = require("react/jsx-runtime");
6862
+ var import_jsx_runtime31 = require("react/jsx-runtime");
6806
6863
  var RecipientStep = ({
6807
6864
  categories,
6808
6865
  onCategoriesChange,
@@ -6810,13 +6867,13 @@ var RecipientStep = ({
6810
6867
  studentsError,
6811
6868
  testIdPrefix
6812
6869
  }) => {
6813
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
6870
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
6814
6871
  "div",
6815
6872
  {
6816
6873
  className: "flex flex-col gap-4 min-h-0 flex-1",
6817
6874
  "data-testid": testIdPrefix ? `${testIdPrefix}-recipient-step` : void 0,
6818
6875
  children: [
6819
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
6876
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
6820
6877
  Text_default,
6821
6878
  {
6822
6879
  size: "sm",
@@ -6830,7 +6887,7 @@ var RecipientStep = ({
6830
6887
  ]
6831
6888
  }
6832
6889
  ),
6833
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6890
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6834
6891
  "div",
6835
6892
  {
6836
6893
  className: cn(
@@ -6838,7 +6895,7 @@ var RecipientStep = ({
6838
6895
  "scrollbar-thin scrollbar-thumb-border-300 scrollbar-track-transparent"
6839
6896
  ),
6840
6897
  "data-testid": testIdPrefix ? `${testIdPrefix}-scroll-container` : "scroll-container",
6841
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6898
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6842
6899
  CheckboxGroup,
6843
6900
  {
6844
6901
  categories,
@@ -6849,7 +6906,7 @@ var RecipientStep = ({
6849
6906
  )
6850
6907
  }
6851
6908
  ),
6852
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
6909
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6853
6910
  SendModalError,
6854
6911
  {
6855
6912
  error: studentsError,
@@ -6862,63 +6919,6 @@ var RecipientStep = ({
6862
6919
  );
6863
6920
  };
6864
6921
 
6865
- // src/components/shared/SendModalBase/components/DeadlineStep.tsx
6866
- var import_jsx_runtime31 = require("react/jsx-runtime");
6867
- var DeadlineStep = ({
6868
- startDate,
6869
- startTime,
6870
- finalDate,
6871
- finalTime,
6872
- onStartDateChange,
6873
- onStartTimeChange,
6874
- onFinalDateChange,
6875
- onFinalTimeChange,
6876
- errors,
6877
- testIdPrefix,
6878
- children
6879
- }) => {
6880
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
6881
- "div",
6882
- {
6883
- className: "flex flex-col gap-4 sm:gap-6 pt-6",
6884
- "data-testid": testIdPrefix ? `${testIdPrefix}-deadline-step` : void 0,
6885
- children: [
6886
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col gap-2 sm:grid sm:grid-cols-2", children: [
6887
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6888
- DateTimeInput_default,
6889
- {
6890
- label: "Iniciar em*",
6891
- date: startDate,
6892
- time: startTime,
6893
- onDateChange: onStartDateChange,
6894
- onTimeChange: onStartTimeChange,
6895
- errorMessage: [errors.startDate, errors.startTime].filter(Boolean).join(" ") || void 0,
6896
- defaultTime: "00:00",
6897
- testId: testIdPrefix ? `${testIdPrefix}-start-datetime` : "start-datetime",
6898
- className: "w-full"
6899
- }
6900
- ),
6901
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
6902
- DateTimeInput_default,
6903
- {
6904
- label: "Finalizar at\xE9*",
6905
- date: finalDate,
6906
- time: finalTime,
6907
- onDateChange: onFinalDateChange,
6908
- onTimeChange: onFinalTimeChange,
6909
- errorMessage: [errors.finalDate, errors.finalTime].filter(Boolean).join(" ") || void 0,
6910
- defaultTime: "23:59",
6911
- testId: testIdPrefix ? `${testIdPrefix}-final-datetime` : "final-datetime",
6912
- className: "w-full"
6913
- }
6914
- )
6915
- ] }),
6916
- children
6917
- ]
6918
- }
6919
- );
6920
- };
6921
-
6922
6922
  // src/components/shared/SendModalBase/components/SendModalFooter.tsx
6923
6923
  var import_phosphor_react14 = require("phosphor-react");
6924
6924
  init_Button();