analytica-frontend-lib 1.2.11 → 1.2.13

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 (58) hide show
  1. package/dist/AlertManager/index.css +19114 -0
  2. package/dist/AlertManager/index.css.map +1 -0
  3. package/dist/AlertManager/index.d.mts +12 -0
  4. package/dist/AlertManager/index.d.ts +12 -0
  5. package/dist/AlertManager/index.js +6018 -0
  6. package/dist/AlertManager/index.js.map +1 -0
  7. package/dist/AlertManager/index.mjs +6045 -0
  8. package/dist/AlertManager/index.mjs.map +1 -0
  9. package/dist/AlertManagerView/index.d.mts +25 -0
  10. package/dist/AlertManagerView/index.d.ts +25 -0
  11. package/dist/AlertManagerView/index.js +835 -0
  12. package/dist/AlertManagerView/index.js.map +1 -0
  13. package/dist/AlertManagerView/index.mjs +815 -0
  14. package/dist/AlertManagerView/index.mjs.map +1 -0
  15. package/dist/DropdownMenu/index.js +3 -2
  16. package/dist/DropdownMenu/index.js.map +1 -1
  17. package/dist/DropdownMenu/index.mjs +3 -2
  18. package/dist/DropdownMenu/index.mjs.map +1 -1
  19. package/dist/Modal/index.d.mts +2 -1
  20. package/dist/Modal/index.d.ts +2 -1
  21. package/dist/Modal/index.js +3 -2
  22. package/dist/Modal/index.js.map +1 -1
  23. package/dist/Modal/index.mjs +3 -2
  24. package/dist/Modal/index.mjs.map +1 -1
  25. package/dist/NotificationCard/index.js +3 -2
  26. package/dist/NotificationCard/index.js.map +1 -1
  27. package/dist/NotificationCard/index.mjs +3 -2
  28. package/dist/NotificationCard/index.mjs.map +1 -1
  29. package/dist/Quiz/index.js +3 -2
  30. package/dist/Quiz/index.js.map +1 -1
  31. package/dist/Quiz/index.mjs +3 -2
  32. package/dist/Quiz/index.mjs.map +1 -1
  33. package/dist/Search/index.js +3 -2
  34. package/dist/Search/index.js.map +1 -1
  35. package/dist/Search/index.mjs +3 -2
  36. package/dist/Search/index.mjs.map +1 -1
  37. package/dist/Stepper/index.js +1 -1
  38. package/dist/Stepper/index.js.map +1 -1
  39. package/dist/Stepper/index.mjs +1 -1
  40. package/dist/Stepper/index.mjs.map +1 -1
  41. package/dist/Table/index.d.mts +1 -1
  42. package/dist/Table/index.d.ts +1 -1
  43. package/dist/Table/index.js.map +1 -1
  44. package/dist/Table/index.mjs.map +1 -1
  45. package/dist/index.css +32 -0
  46. package/dist/index.css.map +1 -1
  47. package/dist/index.d.mts +121 -19
  48. package/dist/index.d.ts +121 -19
  49. package/dist/index.js +3341 -2200
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.mjs +3272 -2129
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/notification-TD7ZFRLL.png +0 -0
  54. package/dist/styles.css +32 -0
  55. package/dist/styles.css.map +1 -1
  56. package/dist/types-DMycdI4U.d.mts +88 -0
  57. package/dist/types-DMycdI4U.d.ts +88 -0
  58. package/package.json +1 -1
@@ -0,0 +1,835 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/AlertManagerView/AlertsManagerView.tsx
21
+ var AlertsManagerView_exports = {};
22
+ __export(AlertsManagerView_exports, {
23
+ AlertsManagerView: () => AlertsManagerView
24
+ });
25
+ module.exports = __toCommonJS(AlertsManagerView_exports);
26
+ var import_react3 = require("react");
27
+
28
+ // src/components/Modal/Modal.tsx
29
+ var import_react = require("react");
30
+ var import_phosphor_react = require("phosphor-react");
31
+
32
+ // src/utils/utils.ts
33
+ var import_clsx = require("clsx");
34
+ var import_tailwind_merge = require("tailwind-merge");
35
+ function cn(...inputs) {
36
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
37
+ }
38
+
39
+ // src/components/Button/Button.tsx
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ var VARIANT_ACTION_CLASSES = {
42
+ solid: {
43
+ primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
44
+ positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
45
+ negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
46
+ },
47
+ outline: {
48
+ primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
49
+ positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
50
+ negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
51
+ },
52
+ link: {
53
+ primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
54
+ positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
55
+ negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
56
+ }
57
+ };
58
+ var SIZE_CLASSES = {
59
+ "extra-small": "text-xs px-3.5 py-2",
60
+ small: "text-sm px-4 py-2.5",
61
+ medium: "text-md px-5 py-2.5",
62
+ large: "text-lg px-6 py-3",
63
+ "extra-large": "text-lg px-7 py-3.5"
64
+ };
65
+ var Button = ({
66
+ children,
67
+ iconLeft,
68
+ iconRight,
69
+ size = "medium",
70
+ variant = "solid",
71
+ action = "primary",
72
+ className = "",
73
+ disabled,
74
+ type = "button",
75
+ ...props
76
+ }) => {
77
+ const sizeClasses = SIZE_CLASSES[size];
78
+ const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
79
+ const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
81
+ "button",
82
+ {
83
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
84
+ disabled,
85
+ type,
86
+ ...props,
87
+ children: [
88
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
89
+ children,
90
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
91
+ ]
92
+ }
93
+ );
94
+ };
95
+ var Button_default = Button;
96
+
97
+ // src/components/Modal/utils/videoUtils.ts
98
+ var isYouTubeUrl = (url) => {
99
+ const youtubeRegex = /^(https?:\/\/)?((www|m|music)\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/.+/i;
100
+ return youtubeRegex.test(url);
101
+ };
102
+ var isValidYouTubeHost = (host) => {
103
+ if (host === "youtu.be") return "youtu.be";
104
+ const isValidYouTubeCom = host === "youtube.com" || host.endsWith(".youtube.com") && /^(www|m|music)\.youtube\.com$/.test(host);
105
+ if (isValidYouTubeCom) return "youtube";
106
+ const isValidNoCookie = host === "youtube-nocookie.com" || host.endsWith(".youtube-nocookie.com") && /^(www|m|music)\.youtube-nocookie\.com$/.test(host);
107
+ if (isValidNoCookie) return "nocookie";
108
+ return null;
109
+ };
110
+ var extractYoutuBeId = (pathname) => {
111
+ const firstSeg = pathname.split("/").filter(Boolean)[0];
112
+ return firstSeg || null;
113
+ };
114
+ var extractYouTubeId = (pathname, searchParams) => {
115
+ const parts = pathname.split("/").filter(Boolean);
116
+ const [first, second] = parts;
117
+ if (first === "embed" && second) return second;
118
+ if (first === "shorts" && second) return second;
119
+ if (first === "live" && second) return second;
120
+ const v = searchParams.get("v");
121
+ if (v) return v;
122
+ return null;
123
+ };
124
+ var getYouTubeVideoId = (url) => {
125
+ try {
126
+ const u = new URL(url);
127
+ const hostType = isValidYouTubeHost(u.hostname.toLowerCase());
128
+ if (!hostType) return null;
129
+ if (hostType === "youtu.be") {
130
+ return extractYoutuBeId(u.pathname);
131
+ }
132
+ return extractYouTubeId(u.pathname, u.searchParams);
133
+ } catch {
134
+ return null;
135
+ }
136
+ };
137
+ var getYouTubeEmbedUrl = (videoId) => {
138
+ return `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=0&rel=0&modestbranding=1`;
139
+ };
140
+
141
+ // src/components/Modal/Modal.tsx
142
+ var import_jsx_runtime2 = require("react/jsx-runtime");
143
+ var SIZE_CLASSES2 = {
144
+ xs: "max-w-[360px]",
145
+ sm: "max-w-[420px]",
146
+ md: "max-w-[510px]",
147
+ lg: "max-w-[640px]",
148
+ xl: "max-w-[970px]"
149
+ };
150
+ var Modal = ({
151
+ isOpen,
152
+ onClose,
153
+ title,
154
+ children,
155
+ size = "md",
156
+ className = "",
157
+ closeOnEscape = true,
158
+ footer,
159
+ hideCloseButton = false,
160
+ variant = "default",
161
+ description,
162
+ image,
163
+ imageAlt,
164
+ actionLink,
165
+ actionLabel,
166
+ contentClassName = ""
167
+ }) => {
168
+ const titleId = (0, import_react.useId)();
169
+ (0, import_react.useEffect)(() => {
170
+ if (!isOpen || !closeOnEscape) return;
171
+ const handleEscape = (event) => {
172
+ if (event.key === "Escape") {
173
+ onClose();
174
+ }
175
+ };
176
+ document.addEventListener("keydown", handleEscape);
177
+ return () => document.removeEventListener("keydown", handleEscape);
178
+ }, [isOpen, closeOnEscape, onClose]);
179
+ (0, import_react.useEffect)(() => {
180
+ if (!isOpen) return;
181
+ const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
182
+ const originalOverflow = document.body.style.overflow;
183
+ const originalPaddingRight = document.body.style.paddingRight;
184
+ document.body.style.overflow = "hidden";
185
+ if (scrollbarWidth > 0) {
186
+ document.body.style.paddingRight = `${scrollbarWidth}px`;
187
+ const overlay = document.createElement("div");
188
+ overlay.id = "modal-scrollbar-overlay";
189
+ overlay.style.cssText = `
190
+ position: fixed;
191
+ top: 0;
192
+ right: 0;
193
+ width: ${scrollbarWidth}px;
194
+ height: 100vh;
195
+ background-color: rgb(0 0 0 / 0.6);
196
+ z-index: 40;
197
+ pointer-events: none;
198
+ `;
199
+ document.body.appendChild(overlay);
200
+ }
201
+ return () => {
202
+ document.body.style.overflow = originalOverflow;
203
+ document.body.style.paddingRight = originalPaddingRight;
204
+ const overlay = document.getElementById("modal-scrollbar-overlay");
205
+ if (overlay) {
206
+ overlay.remove();
207
+ }
208
+ };
209
+ }, [isOpen]);
210
+ if (!isOpen) return null;
211
+ const sizeClasses = SIZE_CLASSES2[size];
212
+ const baseClasses = "bg-secondary-50 rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
213
+ const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
214
+ const modalClasses = cn(
215
+ baseClasses,
216
+ sizeClasses,
217
+ dialogResetClasses,
218
+ className
219
+ );
220
+ const normalizeUrl = (href) => /^https?:\/\//i.test(href) ? href : `https://${href}`;
221
+ const handleActionClick = () => {
222
+ if (actionLink) {
223
+ window.open(normalizeUrl(actionLink), "_blank", "noopener,noreferrer");
224
+ }
225
+ };
226
+ if (variant === "activity") {
227
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
228
+ "dialog",
229
+ {
230
+ className: modalClasses,
231
+ "aria-labelledby": titleId,
232
+ "aria-modal": "true",
233
+ open: true,
234
+ children: [
235
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex justify-end p-6 pb-0", children: !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
236
+ "button",
237
+ {
238
+ onClick: onClose,
239
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
240
+ "aria-label": "Fechar modal",
241
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_phosphor_react.X, { size: 18 })
242
+ }
243
+ ) }),
244
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex flex-col items-center px-6 pb-6 gap-5", children: [
245
+ image && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
246
+ "img",
247
+ {
248
+ src: image,
249
+ alt: imageAlt ?? "",
250
+ className: "w-[122px] h-[122px] object-contain"
251
+ }
252
+ ) }),
253
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
254
+ "h2",
255
+ {
256
+ id: titleId,
257
+ className: "text-lg font-semibold text-text-950 text-center",
258
+ children: title
259
+ }
260
+ ),
261
+ description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-sm font-normal text-text-400 text-center max-w-md leading-[21px]", children: description }),
262
+ actionLink && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "w-full", children: [
263
+ (() => {
264
+ const normalized = normalizeUrl(actionLink);
265
+ const isYT = isYouTubeUrl(normalized);
266
+ if (!isYT) return null;
267
+ const id = getYouTubeVideoId(normalized);
268
+ if (!id) {
269
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
270
+ Button_default,
271
+ {
272
+ variant: "solid",
273
+ action: "primary",
274
+ size: "large",
275
+ className: "w-full",
276
+ onClick: handleActionClick,
277
+ children: actionLabel || "Iniciar Atividade"
278
+ }
279
+ );
280
+ }
281
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
282
+ "iframe",
283
+ {
284
+ src: getYouTubeEmbedUrl(id),
285
+ className: "w-full aspect-video rounded-lg",
286
+ allowFullScreen: true,
287
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
288
+ title: "V\xEDdeo YouTube"
289
+ }
290
+ );
291
+ })(),
292
+ !isYouTubeUrl(normalizeUrl(actionLink)) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
293
+ Button_default,
294
+ {
295
+ variant: "solid",
296
+ action: "primary",
297
+ size: "large",
298
+ className: "w-full",
299
+ onClick: handleActionClick,
300
+ children: actionLabel || "Iniciar Atividade"
301
+ }
302
+ )
303
+ ] })
304
+ ] })
305
+ ]
306
+ }
307
+ ) });
308
+ }
309
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
310
+ "dialog",
311
+ {
312
+ className: modalClasses,
313
+ "aria-labelledby": titleId,
314
+ "aria-modal": "true",
315
+ open: true,
316
+ children: [
317
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center justify-between px-6 py-6", children: [
318
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { id: titleId, className: "text-lg font-semibold text-text-950", children: title }),
319
+ !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
320
+ "button",
321
+ {
322
+ onClick: onClose,
323
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
324
+ "aria-label": "Fechar modal",
325
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_phosphor_react.X, { size: 18 })
326
+ }
327
+ )
328
+ ] }),
329
+ children && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn("px-6 pb-6", contentClassName), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
330
+ footer && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
331
+ ]
332
+ }
333
+ ) });
334
+ };
335
+ var Modal_default = Modal;
336
+
337
+ // src/components/Text/Text.tsx
338
+ var import_jsx_runtime3 = require("react/jsx-runtime");
339
+ var Text = ({
340
+ children,
341
+ size = "md",
342
+ weight = "normal",
343
+ color = "text-text-950",
344
+ as,
345
+ className = "",
346
+ ...props
347
+ }) => {
348
+ let sizeClasses = "";
349
+ let weightClasses = "";
350
+ const sizeClassMap = {
351
+ "2xs": "text-2xs",
352
+ xs: "text-xs",
353
+ sm: "text-sm",
354
+ md: "text-md",
355
+ lg: "text-lg",
356
+ xl: "text-xl",
357
+ "2xl": "text-2xl",
358
+ "3xl": "text-3xl",
359
+ "4xl": "text-4xl",
360
+ "5xl": "text-5xl",
361
+ "6xl": "text-6xl"
362
+ };
363
+ sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
364
+ const weightClassMap = {
365
+ hairline: "font-hairline",
366
+ light: "font-light",
367
+ normal: "font-normal",
368
+ medium: "font-medium",
369
+ semibold: "font-semibold",
370
+ bold: "font-bold",
371
+ extrabold: "font-extrabold",
372
+ black: "font-black"
373
+ };
374
+ weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
375
+ const baseClasses = "font-primary";
376
+ const Component = as ?? "p";
377
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
378
+ Component,
379
+ {
380
+ className: cn(baseClasses, sizeClasses, weightClasses, color, className),
381
+ ...props,
382
+ children
383
+ }
384
+ );
385
+ };
386
+ var Text_default = Text;
387
+
388
+ // src/components/Divider/Divider.tsx
389
+ var import_jsx_runtime4 = require("react/jsx-runtime");
390
+ var Divider = ({
391
+ orientation = "horizontal",
392
+ className = "",
393
+ ...props
394
+ }) => {
395
+ const baseClasses = "bg-border-200 border-0";
396
+ const orientationClasses = {
397
+ horizontal: "w-full h-px",
398
+ vertical: "h-full w-px"
399
+ };
400
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
401
+ "hr",
402
+ {
403
+ className: cn(baseClasses, orientationClasses[orientation], className),
404
+ "aria-orientation": orientation,
405
+ ...props
406
+ }
407
+ );
408
+ };
409
+ var Divider_default = Divider;
410
+
411
+ // src/components/Table/Table.tsx
412
+ var import_react2 = require("react");
413
+ var import_phosphor_react2 = require("phosphor-react");
414
+ var import_jsx_runtime5 = require("react/jsx-runtime");
415
+ var Table = (0, import_react2.forwardRef)(
416
+ ({ variant = "default", className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
417
+ "div",
418
+ {
419
+ className: cn(
420
+ "relative w-full overflow-x-auto",
421
+ variant === "default" && "border border-border-200 rounded-xl"
422
+ ),
423
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
424
+ "table",
425
+ {
426
+ ref,
427
+ className: cn(
428
+ "analytica-table w-full caption-bottom text-sm border-separate border-spacing-0",
429
+ className
430
+ ),
431
+ ...props,
432
+ children: [
433
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("caption", { className: "sr-only", children: "My Table" }),
434
+ children
435
+ ]
436
+ }
437
+ )
438
+ }
439
+ )
440
+ );
441
+ Table.displayName = "Table";
442
+ var TableHeader = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
443
+ "thead",
444
+ {
445
+ ref,
446
+ className: cn("[&_tr:first-child]:border-0", className),
447
+ ...props
448
+ }
449
+ ));
450
+ TableHeader.displayName = "TableHeader";
451
+ var TableBody = (0, import_react2.forwardRef)(
452
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
453
+ "tbody",
454
+ {
455
+ ref,
456
+ className: cn("[&_tr:last-child]:border-border-200", className),
457
+ ...props
458
+ }
459
+ )
460
+ );
461
+ TableBody.displayName = "TableBody";
462
+ var TableFooter = (0, import_react2.forwardRef)(
463
+ ({ variant = "default", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
464
+ "tfoot",
465
+ {
466
+ ref,
467
+ className: cn(
468
+ "bg-background-50 font-medium [&>tr]:last:border-b-0 px-6 py-3.5",
469
+ variant === "default" && "border-t border-border-200",
470
+ className
471
+ ),
472
+ ...props
473
+ }
474
+ )
475
+ );
476
+ TableFooter.displayName = "TableFooter";
477
+ var VARIANT_STATES_ROW = {
478
+ default: {
479
+ default: "border border-border-200",
480
+ borderless: ""
481
+ },
482
+ selected: {
483
+ default: "border-b-2 border-indicator-primary",
484
+ borderless: "bg-indicator-primary/10"
485
+ },
486
+ invalid: {
487
+ default: "border-b-2 border-indicator-error",
488
+ borderless: "bg-indicator-error/10"
489
+ },
490
+ disabled: {
491
+ default: "border-b border-border-100 bg-background-50 opacity-50 cursor-not-allowed",
492
+ borderless: "bg-background-50 opacity-50 cursor-not-allowed"
493
+ }
494
+ };
495
+ var TableRow = (0, import_react2.forwardRef)(
496
+ ({
497
+ variant = "default",
498
+ state = "default",
499
+ clickable = false,
500
+ className,
501
+ ...props
502
+ }, ref) => {
503
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
504
+ "tr",
505
+ {
506
+ ref,
507
+ className: cn(
508
+ "transition-colors",
509
+ state !== "disabled" ? "hover:bg-muted/50" : "",
510
+ clickable && state !== "disabled" ? "cursor-pointer" : "",
511
+ VARIANT_STATES_ROW[state][variant],
512
+ className
513
+ ),
514
+ "aria-disabled": state === "disabled",
515
+ ...props
516
+ }
517
+ );
518
+ }
519
+ );
520
+ TableRow.displayName = "TableRow";
521
+ var TableHead = (0, import_react2.forwardRef)(
522
+ ({
523
+ className,
524
+ sortable = true,
525
+ sortDirection = null,
526
+ onSort,
527
+ children,
528
+ ...props
529
+ }, ref) => {
530
+ const handleClick = () => {
531
+ if (sortable && onSort) {
532
+ onSort();
533
+ }
534
+ };
535
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
536
+ "th",
537
+ {
538
+ ref,
539
+ className: cn(
540
+ "h-10 px-6 py-3.5 text-left align-middle font-bold text-base text-text-800 tracking-[0.2px] leading-none [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] whitespace-nowrap",
541
+ sortable && "cursor-pointer select-none hover:bg-muted/30",
542
+ className
543
+ ),
544
+ onClick: handleClick,
545
+ ...props,
546
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2", children: [
547
+ children,
548
+ sortable && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col", children: [
549
+ sortDirection === "asc" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CaretUp, { size: 16, weight: "fill", className: "text-text-800" }),
550
+ sortDirection === "desc" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react2.CaretDown, { size: 16, weight: "fill", className: "text-text-800" })
551
+ ] })
552
+ ] })
553
+ }
554
+ );
555
+ }
556
+ );
557
+ TableHead.displayName = "TableHead";
558
+ var TableCell = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
559
+ "td",
560
+ {
561
+ ref,
562
+ className: cn(
563
+ "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-base font-normal text-text-800 leading-[150%] tracking-normal px-6 py-3.5 whitespace-nowrap",
564
+ className
565
+ ),
566
+ ...props
567
+ }
568
+ ));
569
+ TableCell.displayName = "TableCell";
570
+ var TableCaption = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
571
+ "caption",
572
+ {
573
+ ref,
574
+ className: cn(
575
+ "border-t border-border-200 text-sm text-text-800 px-6 py-3.5",
576
+ className
577
+ ),
578
+ ...props
579
+ }
580
+ ));
581
+ TableCaption.displayName = "TableCaption";
582
+ var Table_default = Table;
583
+
584
+ // src/components/Badge/Badge.tsx
585
+ var import_phosphor_react3 = require("phosphor-react");
586
+ var import_jsx_runtime6 = require("react/jsx-runtime");
587
+ var VARIANT_ACTION_CLASSES2 = {
588
+ solid: {
589
+ error: "bg-error-background text-error-700 focus-visible:outline-none",
590
+ warning: "bg-warning text-warning-800 focus-visible:outline-none",
591
+ success: "bg-success text-success-800 focus-visible:outline-none",
592
+ info: "bg-info text-info-800 focus-visible:outline-none",
593
+ muted: "bg-background-muted text-background-800 focus-visible:outline-none"
594
+ },
595
+ outlined: {
596
+ error: "bg-error text-error-700 border border-error-300 focus-visible:outline-none",
597
+ warning: "bg-warning text-warning-800 border border-warning-300 focus-visible:outline-none",
598
+ success: "bg-success text-success-800 border border-success-300 focus-visible:outline-none",
599
+ info: "bg-info text-info-800 border border-info-300 focus-visible:outline-none",
600
+ muted: "bg-background-muted text-background-800 border border-border-300 focus-visible:outline-none"
601
+ },
602
+ exams: {
603
+ exam1: "bg-exam-1 text-info-700 focus-visible:outline-none",
604
+ exam2: "bg-exam-2 text-typography-1 focus-visible:outline-none",
605
+ exam3: "bg-exam-3 text-typography-2 focus-visible:outline-none",
606
+ exam4: "bg-exam-4 text-success-700 focus-visible:outline-none"
607
+ },
608
+ examsOutlined: {
609
+ exam1: "bg-exam-1 text-info-700 border border-info-700 focus-visible:outline-none",
610
+ exam2: "bg-exam-2 text-typography-1 border border-typography-1 focus-visible:outline-none",
611
+ exam3: "bg-exam-3 text-typography-2 border border-typography-2 focus-visible:outline-none",
612
+ exam4: "bg-exam-4 text-success-700 border border-success-700 focus-visible:outline-none"
613
+ },
614
+ resultStatus: {
615
+ negative: "bg-error text-error-800 focus-visible:outline-none",
616
+ positive: "bg-success text-success-800 focus-visible:outline-none"
617
+ },
618
+ notification: "text-primary"
619
+ };
620
+ var SIZE_CLASSES3 = {
621
+ small: "text-2xs px-2 py-1",
622
+ medium: "text-xs px-2 py-1",
623
+ large: "text-sm px-2 py-1"
624
+ };
625
+ var SIZE_CLASSES_ICON = {
626
+ small: "size-3",
627
+ medium: "size-3.5",
628
+ large: "size-4"
629
+ };
630
+ var Badge = ({
631
+ children,
632
+ iconLeft,
633
+ iconRight,
634
+ size = "medium",
635
+ variant = "solid",
636
+ action = "error",
637
+ className = "",
638
+ notificationActive = false,
639
+ ...props
640
+ }) => {
641
+ const sizeClasses = SIZE_CLASSES3[size];
642
+ const sizeClassesIcon = SIZE_CLASSES_ICON[size];
643
+ const variantActionMap = VARIANT_ACTION_CLASSES2[variant] || {};
644
+ const variantClasses = typeof variantActionMap === "string" ? variantActionMap : variantActionMap[action] ?? variantActionMap.muted ?? "";
645
+ const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
646
+ const baseClassesIcon = "flex items-center";
647
+ if (variant === "notification") {
648
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
649
+ "div",
650
+ {
651
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
652
+ ...props,
653
+ children: [
654
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_phosphor_react3.Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
655
+ notificationActive && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
656
+ "span",
657
+ {
658
+ "data-testid": "notification-dot",
659
+ className: "absolute top-[5px] right-[10px] block h-2 w-2 rounded-full bg-indicator-error ring-2 ring-white"
660
+ }
661
+ )
662
+ ]
663
+ }
664
+ );
665
+ }
666
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
667
+ "div",
668
+ {
669
+ className: cn(baseClasses, variantClasses, sizeClasses, className),
670
+ ...props,
671
+ children: [
672
+ iconLeft && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
673
+ children,
674
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
675
+ ]
676
+ }
677
+ );
678
+ };
679
+ var Badge_default = Badge;
680
+
681
+ // src/components/AlertManagerView/AlertsManagerView.tsx
682
+ var import_phosphor_react4 = require("phosphor-react");
683
+
684
+ // src/assets/img/notification.png
685
+ var notification_default = "../notification-TD7ZFRLL.png";
686
+
687
+ // src/components/AlertManagerView/AlertsManagerView.tsx
688
+ var import_jsx_runtime7 = require("react/jsx-runtime");
689
+ var AlertsManagerView = ({
690
+ alertData,
691
+ isOpen = false,
692
+ onClose,
693
+ currentPage = 1,
694
+ totalPages: externalTotalPages,
695
+ onPageChange,
696
+ itemsPerPage = 10
697
+ }) => {
698
+ const imageUrl = (0, import_react3.useMemo)(() => {
699
+ if (globalThis.window == void 0) {
700
+ return void 0;
701
+ }
702
+ if (alertData.image instanceof File) {
703
+ return globalThis.window.URL.createObjectURL(alertData.image);
704
+ }
705
+ return void 0;
706
+ }, [alertData.image]);
707
+ (0, import_react3.useEffect)(() => {
708
+ return () => {
709
+ if (imageUrl && globalThis.window !== void 0) {
710
+ URL.revokeObjectURL(imageUrl);
711
+ }
712
+ };
713
+ }, [imageUrl]);
714
+ const totalPages = externalTotalPages ?? Math.ceil(alertData.recipients.length / itemsPerPage);
715
+ const effectiveCurrentPage = Math.min(totalPages, Math.max(1, currentPage));
716
+ const startIndex = (effectiveCurrentPage - 1) * itemsPerPage;
717
+ const endIndex = startIndex + itemsPerPage;
718
+ const paginatedRecipients = alertData.recipients.slice(startIndex, endIndex);
719
+ const handleClose = () => {
720
+ onClose?.();
721
+ };
722
+ const formatDate = (dateInput) => {
723
+ const date = dateInput instanceof Date ? dateInput : new Date(dateInput);
724
+ if (Number.isNaN(date.getTime())) return String(dateInput);
725
+ return date.toLocaleDateString("pt-BR", {
726
+ day: "2-digit",
727
+ month: "2-digit",
728
+ year: "numeric"
729
+ });
730
+ };
731
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
732
+ Modal_default,
733
+ {
734
+ isOpen,
735
+ onClose: handleClose,
736
+ title: alertData.title,
737
+ size: "md",
738
+ contentClassName: "p-0",
739
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex flex-col h-[calc(100vh-8rem)] max-h-[700px]", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: [
740
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "bg-background-50 px-5 py-6 flex flex-col items-center gap-4 rounded-xl mb-4", children: [
741
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
742
+ "img",
743
+ {
744
+ src: imageUrl || notification_default,
745
+ alt: alertData.title || "Imagem do alerta"
746
+ }
747
+ ),
748
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col items-center text-center gap-3", children: [
749
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text_default, { size: "lg", weight: "semibold", children: alertData.title || "Sem T\xEDtulo" }),
750
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text_default, { size: "sm", weight: "normal", className: "text-text-500", children: alertData.message || "Sem mensagem" })
751
+ ] })
752
+ ] }),
753
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Divider_default, { className: "my-4" }),
754
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex justify-between items-center mb-4 px-2", children: [
755
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-700", children: "Enviado em" }),
756
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text_default, { size: "sm", weight: "medium", className: "text-text-900", children: formatDate(alertData.sentAt) })
757
+ ] }),
758
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Divider_default, { className: "my-4" }),
759
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Table_default, { variant: "borderless", className: "table-fixed", children: [
760
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(TableRow, { variant: "borderless", children: [
761
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableHead, { className: "py-2 px-3.5 text-start", children: "Destinat\xE1rio" }),
762
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableHead, { className: "py-2 px-3.5 w-[120px] text-start", children: "Status" })
763
+ ] }) }),
764
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableBody, { variant: "borderless", children: paginatedRecipients.map((recipient) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(TableRow, { children: [
765
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(TableCell, { className: "py-2 px-3.5 flex flex-row gap-2 text-start truncate", children: [
766
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "rounded-full size-6 bg-primary-100 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react4.User, { className: "text-primary-950", size: 18 }) }),
767
+ recipient.name
768
+ ] }),
769
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableCell, { className: "py-2 px-3.5 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex justify-center items-center gap-1", children: recipient.status === "viewed" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge_default, { variant: "solid", action: "success", children: "Visualizado" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge_default, { variant: "solid", action: "error", children: "Pendente" }) }) })
770
+ ] }, recipient.id)) })
771
+ ] }) }),
772
+ totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex justify-end items-center gap-2 bg-background-50 border border-border-200 py-3.5 px-2 rounded-b-2xl", children: [
773
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Text_default, { size: "sm", className: "text-text-600", children: [
774
+ "P\xE1gina ",
775
+ effectiveCurrentPage,
776
+ " de ",
777
+ totalPages
778
+ ] }),
779
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex gap-2", children: onPageChange ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
780
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
781
+ Button_default,
782
+ {
783
+ variant: "link",
784
+ size: "extra-small",
785
+ onClick: () => onPageChange(Math.max(1, effectiveCurrentPage - 1)),
786
+ disabled: effectiveCurrentPage === 1,
787
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react4.CaretLeft, {}),
788
+ children: "Anterior"
789
+ }
790
+ ),
791
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
792
+ Button_default,
793
+ {
794
+ variant: "link",
795
+ size: "extra-small",
796
+ onClick: () => onPageChange(
797
+ Math.min(totalPages, effectiveCurrentPage + 1)
798
+ ),
799
+ disabled: effectiveCurrentPage === totalPages,
800
+ iconRight: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react4.CaretRight, {}),
801
+ children: "Pr\xF3ximo"
802
+ }
803
+ )
804
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
805
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
806
+ Button_default,
807
+ {
808
+ variant: "link",
809
+ size: "extra-small",
810
+ disabled: effectiveCurrentPage === 1,
811
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react4.CaretLeft, {}),
812
+ children: "Anterior"
813
+ }
814
+ ),
815
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
816
+ Button_default,
817
+ {
818
+ variant: "link",
819
+ size: "extra-small",
820
+ disabled: effectiveCurrentPage === totalPages,
821
+ iconRight: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react4.CaretRight, {}),
822
+ children: "Pr\xF3ximo"
823
+ }
824
+ )
825
+ ] }) })
826
+ ] })
827
+ ] }) })
828
+ }
829
+ );
830
+ };
831
+ // Annotate the CommonJS export names for ESM import in node:
832
+ 0 && (module.exports = {
833
+ AlertsManagerView
834
+ });
835
+ //# sourceMappingURL=index.js.map