analytica-frontend-lib 1.2.17 → 1.2.19

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 (36) hide show
  1. package/dist/AlertManager/index.d.mts +6 -2
  2. package/dist/AlertManager/index.d.ts +6 -2
  3. package/dist/AlertManager/index.js +66 -16
  4. package/dist/AlertManager/index.js.map +1 -1
  5. package/dist/AlertManager/index.mjs +66 -16
  6. package/dist/AlertManager/index.mjs.map +1 -1
  7. package/dist/AlertManagerView/index.d.mts +8 -3
  8. package/dist/AlertManagerView/index.d.ts +8 -3
  9. package/dist/AlertManagerView/index.js +4 -24
  10. package/dist/AlertManagerView/index.js.map +1 -1
  11. package/dist/AlertManagerView/index.mjs +4 -26
  12. package/dist/AlertManagerView/index.mjs.map +1 -1
  13. package/dist/DropdownMenu/index.d.mts +7 -1
  14. package/dist/DropdownMenu/index.d.ts +7 -1
  15. package/dist/DropdownMenu/index.js +51 -5
  16. package/dist/DropdownMenu/index.js.map +1 -1
  17. package/dist/DropdownMenu/index.mjs +50 -5
  18. package/dist/DropdownMenu/index.mjs.map +1 -1
  19. package/dist/NotificationCard/index.js +49 -5
  20. package/dist/NotificationCard/index.js.map +1 -1
  21. package/dist/NotificationCard/index.mjs +49 -5
  22. package/dist/NotificationCard/index.mjs.map +1 -1
  23. package/dist/Search/index.js +49 -5
  24. package/dist/Search/index.js.map +1 -1
  25. package/dist/Search/index.mjs +49 -5
  26. package/dist/Search/index.mjs.map +1 -1
  27. package/dist/index.d.mts +5 -5
  28. package/dist/index.d.ts +5 -5
  29. package/dist/index.js +394 -361
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +164 -132
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/{types-DMycdI4U.d.mts → types-BXzeefgf.d.mts} +1 -1
  34. package/dist/{types-DMycdI4U.d.ts → types-BXzeefgf.d.ts} +1 -1
  35. package/package.json +1 -1
  36. package/dist/notification-TD7ZFRLL.png +0 -0
@@ -1,12 +1,16 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { A as AlertsConfig } from '../types-DMycdI4U.mjs';
2
+ import { A as AlertsConfig } from '../types-BXzeefgf.mjs';
3
3
  import 'react';
4
4
 
5
5
  interface AlertsManagerProps {
6
6
  config: AlertsConfig;
7
7
  isOpen?: boolean;
8
8
  onClose?: () => void;
9
+ /** URL da imagem após upload (prioritária - será exibida primeiro) */
10
+ imageLink?: string | null;
11
+ /** Imagem padrão a ser exibida quando não há imagem selecionada (deve ser URL string - o front deve converter File para URL se necessário) */
12
+ defaultImage?: string | null;
9
13
  }
10
- declare const AlertsManager: ({ config, isOpen, onClose, }: AlertsManagerProps) => react_jsx_runtime.JSX.Element;
14
+ declare const AlertsManager: ({ config, isOpen, onClose, imageLink, defaultImage, }: AlertsManagerProps) => react_jsx_runtime.JSX.Element;
11
15
 
12
16
  export { AlertsManager };
@@ -1,12 +1,16 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { A as AlertsConfig } from '../types-DMycdI4U.js';
2
+ import { A as AlertsConfig } from '../types-BXzeefgf.js';
3
3
  import 'react';
4
4
 
5
5
  interface AlertsManagerProps {
6
6
  config: AlertsConfig;
7
7
  isOpen?: boolean;
8
8
  onClose?: () => void;
9
+ /** URL da imagem após upload (prioritária - será exibida primeiro) */
10
+ imageLink?: string | null;
11
+ /** Imagem padrão a ser exibida quando não há imagem selecionada (deve ser URL string - o front deve converter File para URL se necessário) */
12
+ defaultImage?: string | null;
9
13
  }
10
- declare const AlertsManager: ({ config, isOpen, onClose, }: AlertsManagerProps) => react_jsx_runtime.JSX.Element;
14
+ declare const AlertsManager: ({ config, isOpen, onClose, imageLink, defaultImage, }: AlertsManagerProps) => react_jsx_runtime.JSX.Element;
11
15
 
12
16
  export { AlertsManager };
@@ -1450,9 +1450,6 @@ var Divider = ({
1450
1450
  };
1451
1451
  var Divider_default = Divider;
1452
1452
 
1453
- // src/assets/img/notification.png
1454
- var notification_default = "../notification-TD7ZFRLL.png";
1455
-
1456
1453
  // src/components/TextArea/TextArea.tsx
1457
1454
  var import_react6 = require("react");
1458
1455
  var import_phosphor_react5 = require("phosphor-react");
@@ -2330,10 +2327,13 @@ var ProfileMenuHeader = (0, import_react10.forwardRef)(({ className, name, email
2330
2327
  {
2331
2328
  ref,
2332
2329
  "data-component": "ProfileMenuHeader",
2333
- className: cn("flex flex-row gap-4 items-center", className),
2330
+ className: cn(
2331
+ "flex flex-row gap-4 items-center min-w-[280px]",
2332
+ className
2333
+ ),
2334
2334
  ...props,
2335
2335
  children: [
2336
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center overflow-hidden", children: photoUrl ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2336
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center overflow-hidden flex-shrink-0", children: photoUrl ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2337
2337
  "img",
2338
2338
  {
2339
2339
  src: photoUrl,
@@ -2341,15 +2341,56 @@ var ProfileMenuHeader = (0, import_react10.forwardRef)(({ className, name, email
2341
2341
  className: "w-full h-full object-cover"
2342
2342
  }
2343
2343
  ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react8.User, { size: 34, className: "text-primary-800" }) }),
2344
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col ", children: [
2345
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { size: "xl", weight: "bold", color: "text-text-950", children: name }),
2346
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { size: "md", color: "text-text-600", children: email })
2344
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col min-w-0", children: [
2345
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2346
+ Text_default,
2347
+ {
2348
+ size: "xl",
2349
+ weight: "bold",
2350
+ color: "text-text-950",
2351
+ className: "truncate",
2352
+ children: name
2353
+ }
2354
+ ),
2355
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { size: "md", color: "text-text-600", className: "truncate", children: email })
2347
2356
  ] })
2348
2357
  ]
2349
2358
  }
2350
2359
  );
2351
2360
  });
2352
2361
  ProfileMenuHeader.displayName = "ProfileMenuHeader";
2362
+ var ProfileMenuInfo = (0, import_react10.forwardRef)(
2363
+ ({
2364
+ className,
2365
+ schoolName,
2366
+ classYearName,
2367
+ schoolYearName,
2368
+ store: _store,
2369
+ ...props
2370
+ }, ref) => {
2371
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
2372
+ "div",
2373
+ {
2374
+ ref,
2375
+ "data-component": "ProfileMenuInfo",
2376
+ className: cn("flex flex-row gap-4 items-center", className),
2377
+ ...props,
2378
+ children: [
2379
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w-16 h-16" }),
2380
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col ", children: [
2381
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { size: "md", color: "text-text-600", children: schoolName }),
2382
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "flex flex-row items-center gap-2", children: [
2383
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { size: "md", color: "text-text-600", children: classYearName }),
2384
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-text-600 text-xs align-middle", children: "\u25CF" }),
2385
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text_default, { size: "md", color: "text-text-600", children: schoolYearName })
2386
+ ] })
2387
+ ] })
2388
+ ]
2389
+ }
2390
+ );
2391
+ }
2392
+ );
2393
+ ProfileMenuInfo.displayName = "ProfileMenuInfo";
2353
2394
  var ProfileToggleTheme = ({
2354
2395
  store: externalStore,
2355
2396
  ...props
@@ -5439,6 +5480,7 @@ var MessageStep = ({
5439
5480
  const handleRemoveFile = () => {
5440
5481
  setImage(null);
5441
5482
  };
5483
+ const isImageFile = image instanceof File;
5442
5484
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: "flex flex-col gap-4", children: [
5443
5485
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
5444
5486
  Input_default,
@@ -5464,7 +5506,7 @@ var MessageStep = ({
5464
5506
  allowImageAttachment && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
5465
5507
  ImageUpload,
5466
5508
  {
5467
- selectedFile: image,
5509
+ selectedFile: isImageFile ? image : null,
5468
5510
  onFileSelect: handleFileSelect,
5469
5511
  onRemoveFile: handleRemoveFile
5470
5512
  }
@@ -5668,7 +5710,7 @@ var DateStep = ({
5668
5710
  // src/components/AlertManager/AlertSteps/PreviewStep.tsx
5669
5711
  var import_react18 = require("react");
5670
5712
  var import_jsx_runtime27 = require("react/jsx-runtime");
5671
- var PreviewStep = () => {
5713
+ var PreviewStep = ({ imageLink, defaultImage }) => {
5672
5714
  const title = useAlertFormStore((state) => state.title);
5673
5715
  const message = useAlertFormStore((state) => state.message);
5674
5716
  const image = useAlertFormStore((state) => state.image);
@@ -5679,17 +5721,21 @@ var PreviewStep = () => {
5679
5721
  if (image instanceof File) {
5680
5722
  return globalThis.window.URL.createObjectURL(image);
5681
5723
  }
5724
+ if (typeof image === "string") {
5725
+ return image;
5726
+ }
5682
5727
  return void 0;
5683
5728
  }, [image]);
5684
5729
  (0, import_react18.useEffect)(() => {
5685
5730
  return () => {
5686
- if (imageUrl && globalThis.window !== void 0) {
5731
+ if (globalThis.window !== void 0 && imageUrl && image instanceof File) {
5687
5732
  URL.revokeObjectURL(imageUrl);
5688
5733
  }
5689
5734
  };
5690
- }, [imageUrl]);
5735
+ }, [imageUrl, image]);
5736
+ const finalImageUrl = imageLink || imageUrl || defaultImage || void 0;
5691
5737
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("section", { className: "flex flex-col gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "bg-background-50 px-5 py-6 flex flex-col items-center gap-4 rounded-xl", children: [
5692
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", { src: imageUrl || notification_default, alt: title || "Imagem do alerta" }),
5738
+ finalImageUrl && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", { src: finalImageUrl, alt: title || "Imagem do alerta" }),
5693
5739
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col items-center text-center gap-3", children: [
5694
5740
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text_default, { size: "lg", weight: "semibold", children: title || "Nenhum T\xEDtulo de Alerta" }),
5695
5741
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text_default, { size: "sm", weight: "normal", className: "text-text-500", children: message || "Aqui aparecer\xE1 a mensagem do alerta definido pelo usu\xE1rio" })
@@ -5783,7 +5829,9 @@ var StepWrapper = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx
5783
5829
  var AlertsManager = ({
5784
5830
  config,
5785
5831
  isOpen = false,
5786
- onClose
5832
+ onClose,
5833
+ imageLink,
5834
+ defaultImage
5787
5835
  }) => {
5788
5836
  const [isModalOpen, setIsModalOpen] = (0, import_react19.useState)(isOpen);
5789
5837
  const [currentStep, setCurrentStep] = (0, import_react19.useState)(0);
@@ -5942,7 +5990,7 @@ var AlertsManager = ({
5942
5990
  }
5943
5991
  ) });
5944
5992
  case 3:
5945
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(StepWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PreviewStep, {}) });
5993
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(StepWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PreviewStep, { imageLink, defaultImage }) });
5946
5994
  default:
5947
5995
  return null;
5948
5996
  }
@@ -5953,7 +6001,9 @@ var AlertsManager = ({
5953
6001
  labels,
5954
6002
  behavior,
5955
6003
  handleNext2,
5956
- handlePrevious
6004
+ handlePrevious,
6005
+ imageLink,
6006
+ defaultImage
5957
6007
  ]);
5958
6008
  const isFirstStep = currentStep === 0;
5959
6009
  const isLastStep = currentStep === steps.length - 1;