analytica-frontend-lib 1.2.21 → 1.2.22
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/AlertManager/index.css +0 -3
- package/dist/AlertManager/index.css.map +1 -1
- package/dist/AlertManagerView/index.js +347 -159
- package/dist/AlertManagerView/index.js.map +1 -1
- package/dist/AlertManagerView/index.mjs +346 -159
- package/dist/AlertManagerView/index.mjs.map +1 -1
- package/dist/Radio/index.d.mts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Table/index.d.mts +23 -24
- package/dist/Table/index.d.ts +23 -24
- package/dist/Table/index.js +328 -140
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/index.mjs +323 -136
- package/dist/Table/index.mjs.map +1 -1
- package/dist/TableProvider/index.css +0 -3
- package/dist/TableProvider/index.css.map +1 -1
- package/dist/TableProvider/index.d.mts +1 -1
- package/dist/TableProvider/index.d.ts +1 -1
- package/dist/TableProvider/index.js +826 -629
- package/dist/TableProvider/index.js.map +1 -1
- package/dist/TableProvider/index.mjs +737 -541
- package/dist/TableProvider/index.mjs.map +1 -1
- package/dist/{TableProvider-D4Ak7ofz.d.ts → TableProvider-48a6wb7j.d.ts} +43 -4
- package/dist/{TableProvider-CDcL1tDj.d.mts → TableProvider-DyhwEkPT.d.mts} +43 -4
- package/dist/index.css +0 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +643 -598
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +601 -557
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +0 -3
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
|
@@ -34,10 +34,10 @@ __export(TableProvider_exports, {
|
|
|
34
34
|
default: () => TableProvider_default
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(TableProvider_exports);
|
|
37
|
-
var
|
|
37
|
+
var import_react16 = require("react");
|
|
38
38
|
|
|
39
39
|
// src/components/Table/Table.tsx
|
|
40
|
-
var
|
|
40
|
+
var import_react2 = require("react");
|
|
41
41
|
|
|
42
42
|
// src/utils/utils.ts
|
|
43
43
|
var import_clsx = require("clsx");
|
|
@@ -187,9 +187,161 @@ var Button = ({
|
|
|
187
187
|
};
|
|
188
188
|
var Button_default = Button;
|
|
189
189
|
|
|
190
|
+
// src/components/Skeleton/Skeleton.tsx
|
|
191
|
+
var import_react = require("react");
|
|
192
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
193
|
+
var SKELETON_ANIMATION_CLASSES = {
|
|
194
|
+
pulse: "animate-pulse",
|
|
195
|
+
none: ""
|
|
196
|
+
};
|
|
197
|
+
var SKELETON_VARIANT_CLASSES = {
|
|
198
|
+
text: "h-4 bg-background-200 rounded",
|
|
199
|
+
circular: "bg-background-200 rounded-full",
|
|
200
|
+
rectangular: "bg-background-200",
|
|
201
|
+
rounded: "bg-background-200 rounded-lg"
|
|
202
|
+
};
|
|
203
|
+
var SPACING_CLASSES = {
|
|
204
|
+
none: "",
|
|
205
|
+
small: "space-y-1",
|
|
206
|
+
medium: "space-y-2",
|
|
207
|
+
large: "space-y-3"
|
|
208
|
+
};
|
|
209
|
+
var Skeleton = (0, import_react.forwardRef)(
|
|
210
|
+
({
|
|
211
|
+
variant = "text",
|
|
212
|
+
width,
|
|
213
|
+
height,
|
|
214
|
+
animation = "pulse",
|
|
215
|
+
lines = 1,
|
|
216
|
+
spacing = "none",
|
|
217
|
+
className = "",
|
|
218
|
+
children,
|
|
219
|
+
...props
|
|
220
|
+
}, ref) => {
|
|
221
|
+
const animationClass = SKELETON_ANIMATION_CLASSES[animation];
|
|
222
|
+
const variantClass = SKELETON_VARIANT_CLASSES[variant];
|
|
223
|
+
const spacingClass = SPACING_CLASSES[spacing];
|
|
224
|
+
const style = {
|
|
225
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
226
|
+
height: typeof height === "number" ? `${height}px` : height
|
|
227
|
+
};
|
|
228
|
+
if (variant === "text" && lines > 1) {
|
|
229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
230
|
+
"div",
|
|
231
|
+
{
|
|
232
|
+
ref,
|
|
233
|
+
className: cn("flex flex-col", spacingClass, className),
|
|
234
|
+
...props,
|
|
235
|
+
children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
className: cn(variantClass, animationClass),
|
|
239
|
+
style: index === lines - 1 ? { width: "60%" } : void 0
|
|
240
|
+
},
|
|
241
|
+
index
|
|
242
|
+
))
|
|
243
|
+
}
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
247
|
+
"div",
|
|
248
|
+
{
|
|
249
|
+
ref,
|
|
250
|
+
className: cn(variantClass, animationClass, className),
|
|
251
|
+
style,
|
|
252
|
+
...props,
|
|
253
|
+
children
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
var SkeletonText = (0, import_react.forwardRef)(
|
|
259
|
+
(props, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Skeleton, { ref, variant: "text", ...props })
|
|
260
|
+
);
|
|
261
|
+
var SkeletonCircle = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Skeleton, { ref, variant: "circular", ...props }));
|
|
262
|
+
var SkeletonRectangle = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Skeleton, { ref, variant: "rectangular", ...props }));
|
|
263
|
+
var SkeletonRounded = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Skeleton, { ref, variant: "rounded", ...props }));
|
|
264
|
+
var SkeletonCard = (0, import_react.forwardRef)(
|
|
265
|
+
({
|
|
266
|
+
showAvatar = true,
|
|
267
|
+
showTitle = true,
|
|
268
|
+
showDescription = true,
|
|
269
|
+
showActions = true,
|
|
270
|
+
lines = 2,
|
|
271
|
+
className = "",
|
|
272
|
+
...props
|
|
273
|
+
}, ref) => {
|
|
274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
275
|
+
"div",
|
|
276
|
+
{
|
|
277
|
+
ref,
|
|
278
|
+
className: cn(
|
|
279
|
+
"w-full p-4 bg-background border border-border-200 rounded-lg",
|
|
280
|
+
className
|
|
281
|
+
),
|
|
282
|
+
...props,
|
|
283
|
+
children: [
|
|
284
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start space-x-3", children: [
|
|
285
|
+
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonCircle, { width: 40, height: 40 }),
|
|
286
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
287
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonText, { width: "60%", height: 20 }),
|
|
288
|
+
showDescription && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonText, { lines, spacing: "small" })
|
|
289
|
+
] })
|
|
290
|
+
] }),
|
|
291
|
+
showActions && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex justify-end space-x-2 mt-4", children: [
|
|
292
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonRectangle, { width: 80, height: 32 }),
|
|
293
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonRectangle, { width: 80, height: 32 })
|
|
294
|
+
] })
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
var SkeletonList = (0, import_react.forwardRef)(
|
|
301
|
+
({
|
|
302
|
+
items = 3,
|
|
303
|
+
showAvatar = true,
|
|
304
|
+
showTitle = true,
|
|
305
|
+
showDescription = true,
|
|
306
|
+
lines = 1,
|
|
307
|
+
className = "",
|
|
308
|
+
...props
|
|
309
|
+
}, ref) => {
|
|
310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ref, className: cn("space-y-3", className), ...props, children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start space-x-3 p-3", children: [
|
|
311
|
+
showAvatar && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonCircle, { width: 32, height: 32 }),
|
|
312
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
313
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonText, { width: "40%", height: 16 }),
|
|
314
|
+
showDescription && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonText, { lines, spacing: "small" })
|
|
315
|
+
] })
|
|
316
|
+
] }, index)) });
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
var SkeletonTable = (0, import_react.forwardRef)(
|
|
320
|
+
({ rows = 5, columns = 4, showHeader = true, className = "", ...props }, ref) => {
|
|
321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { ref, className: cn("w-full", className), ...props, children: [
|
|
322
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex space-x-2 mb-3", children: Array.from({ length: columns }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
323
|
+
SkeletonText,
|
|
324
|
+
{
|
|
325
|
+
width: `${100 / columns}%`,
|
|
326
|
+
height: 20
|
|
327
|
+
},
|
|
328
|
+
index
|
|
329
|
+
)) }),
|
|
330
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "space-y-2", children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex space-x-2", children: Array.from({ length: columns }, (_2, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
331
|
+
SkeletonText,
|
|
332
|
+
{
|
|
333
|
+
width: `${100 / columns}%`,
|
|
334
|
+
height: 16
|
|
335
|
+
},
|
|
336
|
+
colIndex
|
|
337
|
+
)) }, rowIndex)) })
|
|
338
|
+
] });
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
|
|
190
342
|
// src/components/Table/TablePagination.tsx
|
|
191
343
|
var import_phosphor_react = require("phosphor-react");
|
|
192
|
-
var
|
|
344
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
193
345
|
var TablePagination = ({
|
|
194
346
|
totalItems,
|
|
195
347
|
currentPage,
|
|
@@ -220,7 +372,7 @@ var TablePagination = ({
|
|
|
220
372
|
};
|
|
221
373
|
const isFirstPage = currentPage === 1;
|
|
222
374
|
const isLastPage = currentPage === totalPages;
|
|
223
|
-
return /* @__PURE__ */ (0,
|
|
375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
224
376
|
"div",
|
|
225
377
|
{
|
|
226
378
|
className: cn(
|
|
@@ -230,29 +382,29 @@ var TablePagination = ({
|
|
|
230
382
|
),
|
|
231
383
|
...props,
|
|
232
384
|
children: [
|
|
233
|
-
/* @__PURE__ */ (0,
|
|
385
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "font-normal text-xs leading-[14px] text-text-800", children: [
|
|
234
386
|
startItem,
|
|
235
387
|
" de ",
|
|
236
388
|
totalItems,
|
|
237
389
|
" ",
|
|
238
390
|
itemLabel
|
|
239
391
|
] }),
|
|
240
|
-
/* @__PURE__ */ (0,
|
|
241
|
-
onItemsPerPageChange && /* @__PURE__ */ (0,
|
|
242
|
-
/* @__PURE__ */ (0,
|
|
392
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-wrap sm:flex-nowrap items-center gap-2 sm:gap-4 justify-center sm:justify-start", children: [
|
|
393
|
+
onItemsPerPageChange && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative", children: [
|
|
394
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
243
395
|
"select",
|
|
244
396
|
{
|
|
245
397
|
value: itemsPerPage,
|
|
246
398
|
onChange: handleItemsPerPageChange,
|
|
247
399
|
className: "w-24 h-9 py-0 px-3 pr-8 bg-background border border-border-300 rounded appearance-none cursor-pointer font-normal text-sm leading-[21px] text-text-900",
|
|
248
400
|
"aria-label": "Items por p\xE1gina",
|
|
249
|
-
children: itemsPerPageOptions.map((option) => /* @__PURE__ */ (0,
|
|
401
|
+
children: itemsPerPageOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("option", { value: option, children: [
|
|
250
402
|
option,
|
|
251
403
|
" itens"
|
|
252
404
|
] }, option))
|
|
253
405
|
}
|
|
254
406
|
),
|
|
255
|
-
/* @__PURE__ */ (0,
|
|
407
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
256
408
|
import_phosphor_react.CaretDown,
|
|
257
409
|
{
|
|
258
410
|
size: 14,
|
|
@@ -261,13 +413,13 @@ var TablePagination = ({
|
|
|
261
413
|
}
|
|
262
414
|
)
|
|
263
415
|
] }),
|
|
264
|
-
/* @__PURE__ */ (0,
|
|
416
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "font-normal text-xs leading-[14px] text-text-950", children: [
|
|
265
417
|
"P\xE1gina ",
|
|
266
418
|
currentPage,
|
|
267
419
|
" de ",
|
|
268
420
|
totalPages
|
|
269
421
|
] }),
|
|
270
|
-
/* @__PURE__ */ (0,
|
|
422
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
271
423
|
"button",
|
|
272
424
|
{
|
|
273
425
|
onClick: handlePrevious,
|
|
@@ -278,12 +430,12 @@ var TablePagination = ({
|
|
|
278
430
|
),
|
|
279
431
|
"aria-label": "P\xE1gina anterior",
|
|
280
432
|
children: [
|
|
281
|
-
/* @__PURE__ */ (0,
|
|
282
|
-
/* @__PURE__ */ (0,
|
|
433
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react.CaretLeft, { size: 12, weight: "bold", className: "text-primary-950" }),
|
|
434
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "font-medium text-xs leading-[14px] text-primary-950", children: "Anterior" })
|
|
283
435
|
]
|
|
284
436
|
}
|
|
285
437
|
),
|
|
286
|
-
/* @__PURE__ */ (0,
|
|
438
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
287
439
|
"button",
|
|
288
440
|
{
|
|
289
441
|
onClick: handleNext,
|
|
@@ -294,8 +446,8 @@ var TablePagination = ({
|
|
|
294
446
|
),
|
|
295
447
|
"aria-label": "Pr\xF3xima p\xE1gina",
|
|
296
448
|
children: [
|
|
297
|
-
/* @__PURE__ */ (0,
|
|
298
|
-
/* @__PURE__ */ (0,
|
|
449
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "font-medium text-xs leading-[14px] text-primary-950", children: "Pr\xF3xima" }),
|
|
450
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_phosphor_react.CaretRight, { size: 12, weight: "bold", className: "text-primary-950" })
|
|
299
451
|
]
|
|
300
452
|
}
|
|
301
453
|
)
|
|
@@ -308,7 +460,7 @@ TablePagination.displayName = "TablePagination";
|
|
|
308
460
|
var TablePagination_default = TablePagination;
|
|
309
461
|
|
|
310
462
|
// src/components/Table/Table.tsx
|
|
311
|
-
var
|
|
463
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
312
464
|
function useTableSort(data, options = {}) {
|
|
313
465
|
const { syncWithUrl = false } = options;
|
|
314
466
|
const getInitialState = () => {
|
|
@@ -327,13 +479,13 @@ function useTableSort(data, options = {}) {
|
|
|
327
479
|
return { column: null, direction: null };
|
|
328
480
|
};
|
|
329
481
|
const initialState = getInitialState();
|
|
330
|
-
const [sortColumn, setSortColumn] = (0,
|
|
482
|
+
const [sortColumn, setSortColumn] = (0, import_react2.useState)(
|
|
331
483
|
initialState.column
|
|
332
484
|
);
|
|
333
|
-
const [sortDirection, setSortDirection] = (0,
|
|
485
|
+
const [sortDirection, setSortDirection] = (0, import_react2.useState)(
|
|
334
486
|
initialState.direction
|
|
335
487
|
);
|
|
336
|
-
(0,
|
|
488
|
+
(0, import_react2.useEffect)(() => {
|
|
337
489
|
if (!syncWithUrl || globalThis.window === void 0) return;
|
|
338
490
|
const url = new URL(globalThis.location.href);
|
|
339
491
|
const params = url.searchParams;
|
|
@@ -359,7 +511,7 @@ function useTableSort(data, options = {}) {
|
|
|
359
511
|
setSortDirection("asc");
|
|
360
512
|
}
|
|
361
513
|
};
|
|
362
|
-
const sortedData = (0,
|
|
514
|
+
const sortedData = (0, import_react2.useMemo)(() => {
|
|
363
515
|
if (!sortColumn || !sortDirection) {
|
|
364
516
|
return data;
|
|
365
517
|
}
|
|
@@ -378,121 +530,157 @@ function useTableSort(data, options = {}) {
|
|
|
378
530
|
}, [data, sortColumn, sortDirection]);
|
|
379
531
|
return { sortedData, sortColumn, sortDirection, handleSort };
|
|
380
532
|
}
|
|
381
|
-
var
|
|
533
|
+
var renderHeaderElements = (children) => {
|
|
534
|
+
return import_react2.Children.map(children, (child) => {
|
|
535
|
+
if ((0, import_react2.isValidElement)(child) && (child.type === TableCaption || child.type === TableHeader)) {
|
|
536
|
+
return child;
|
|
537
|
+
}
|
|
538
|
+
return null;
|
|
539
|
+
});
|
|
540
|
+
};
|
|
541
|
+
var getNoSearchResultContent = (config, defaultTitle, defaultDescription) => {
|
|
542
|
+
if (config.component) {
|
|
543
|
+
return config.component;
|
|
544
|
+
}
|
|
545
|
+
if (config.image) {
|
|
546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
547
|
+
NoSearchResult_default,
|
|
548
|
+
{
|
|
549
|
+
image: config.image,
|
|
550
|
+
title: config.title || defaultTitle,
|
|
551
|
+
description: config.description || defaultDescription
|
|
552
|
+
}
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "text-center", children: [
|
|
556
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-text-600 text-lg font-semibold mb-2", children: config.title || defaultTitle }),
|
|
557
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-text-500 text-sm", children: config.description || defaultDescription })
|
|
558
|
+
] });
|
|
559
|
+
};
|
|
560
|
+
var getEmptyStateContent = (config, defaultMessage, defaultButtonText, onButtonClick) => {
|
|
561
|
+
if (config?.component) {
|
|
562
|
+
return config.component;
|
|
563
|
+
}
|
|
564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col items-center justify-center gap-4", children: [
|
|
565
|
+
config?.image && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
566
|
+
"img",
|
|
567
|
+
{
|
|
568
|
+
src: config.image,
|
|
569
|
+
alt: "Empty state",
|
|
570
|
+
className: "w-auto h-auto max-w-full"
|
|
571
|
+
}
|
|
572
|
+
),
|
|
573
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-text-600 text-base font-normal", children: config?.message || defaultMessage }),
|
|
574
|
+
(config?.onButtonClick || onButtonClick) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
575
|
+
Button_default,
|
|
576
|
+
{
|
|
577
|
+
variant: "solid",
|
|
578
|
+
action: "primary",
|
|
579
|
+
size: "medium",
|
|
580
|
+
onClick: config?.onButtonClick || onButtonClick,
|
|
581
|
+
children: config?.buttonText || defaultButtonText
|
|
582
|
+
}
|
|
583
|
+
)
|
|
584
|
+
] });
|
|
585
|
+
};
|
|
586
|
+
var renderTableWrapper = (variant, tableRef, className, children, stateContent, tableProps) => {
|
|
587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
588
|
+
"div",
|
|
589
|
+
{
|
|
590
|
+
className: cn(
|
|
591
|
+
"relative w-full overflow-x-auto",
|
|
592
|
+
variant === "default" && "border border-border-200 rounded-xl"
|
|
593
|
+
),
|
|
594
|
+
children: [
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
596
|
+
"table",
|
|
597
|
+
{
|
|
598
|
+
ref: tableRef,
|
|
599
|
+
className: cn(
|
|
600
|
+
"analytica-table w-full caption-bottom text-sm border-separate border-spacing-0",
|
|
601
|
+
className
|
|
602
|
+
),
|
|
603
|
+
...tableProps,
|
|
604
|
+
children: renderHeaderElements(children)
|
|
605
|
+
}
|
|
606
|
+
),
|
|
607
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "py-8 flex justify-center", children: stateContent })
|
|
608
|
+
]
|
|
609
|
+
}
|
|
610
|
+
);
|
|
611
|
+
};
|
|
612
|
+
var Table = (0, import_react2.forwardRef)(
|
|
382
613
|
({
|
|
383
614
|
variant = "default",
|
|
384
615
|
className,
|
|
385
616
|
children,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
onEmptyStateButtonClick,
|
|
617
|
+
showLoading = false,
|
|
618
|
+
loadingState,
|
|
619
|
+
showNoSearchResult = false,
|
|
620
|
+
noSearchResultState,
|
|
621
|
+
showEmpty = false,
|
|
622
|
+
emptyState,
|
|
393
623
|
...props
|
|
394
624
|
}, ref) => {
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
});
|
|
407
|
-
return
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
const rowProps = row.props;
|
|
417
|
-
count = import_react.Children.count(rowProps.children);
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
return count || 1;
|
|
423
|
-
}, [children]);
|
|
424
|
-
const hasSearchTerm = searchTerm && searchTerm.trim() !== "";
|
|
425
|
-
const showNoSearchResult = hasSearchTerm && isTableBodyEmpty;
|
|
426
|
-
const showEmptyState = !hasSearchTerm && isTableBodyEmpty;
|
|
625
|
+
const defaultNoSearchResultState = {
|
|
626
|
+
title: "Nenhum resultado encontrado",
|
|
627
|
+
description: "N\xE3o encontramos nenhum resultado com esse nome. Tente revisar a busca ou usar outra palavra-chave."
|
|
628
|
+
};
|
|
629
|
+
const defaultEmptyState = {
|
|
630
|
+
message: "Nenhum dado dispon\xEDvel no momento.",
|
|
631
|
+
buttonText: "Adicionar item"
|
|
632
|
+
};
|
|
633
|
+
const finalNoSearchResultState = noSearchResultState || defaultNoSearchResultState;
|
|
634
|
+
const finalEmptyState = emptyState || defaultEmptyState;
|
|
635
|
+
if (showLoading) {
|
|
636
|
+
const loadingContent = loadingState?.component || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SkeletonTable, { rows: 5, columns: 4, showHeader: false });
|
|
637
|
+
return renderTableWrapper(
|
|
638
|
+
variant,
|
|
639
|
+
ref,
|
|
640
|
+
className,
|
|
641
|
+
children,
|
|
642
|
+
loadingContent,
|
|
643
|
+
props
|
|
644
|
+
);
|
|
645
|
+
}
|
|
427
646
|
if (showNoSearchResult) {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
className: cn(
|
|
441
|
-
"analytica-table w-full caption-bottom text-sm border-separate border-spacing-0",
|
|
442
|
-
className
|
|
443
|
-
),
|
|
444
|
-
...props,
|
|
445
|
-
children: import_react.Children.map(children, (child) => {
|
|
446
|
-
if ((0, import_react.isValidElement)(child) && (child.type === TableCaption || child.type === TableHeader)) {
|
|
447
|
-
return child;
|
|
448
|
-
}
|
|
449
|
-
return null;
|
|
450
|
-
})
|
|
451
|
-
}
|
|
452
|
-
),
|
|
453
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "py-8 flex justify-center", children: noSearchResultImage ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
454
|
-
NoSearchResult_default,
|
|
455
|
-
{
|
|
456
|
-
image: noSearchResultImage,
|
|
457
|
-
title: noSearchResultTitle,
|
|
458
|
-
description: noSearchResultDescription
|
|
459
|
-
}
|
|
460
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "text-center", children: [
|
|
461
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-600 text-lg font-semibold mb-2", children: noSearchResultTitle }),
|
|
462
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-text-500 text-sm", children: noSearchResultDescription })
|
|
463
|
-
] }) })
|
|
464
|
-
]
|
|
465
|
-
}
|
|
647
|
+
const noSearchContent = getNoSearchResultContent(
|
|
648
|
+
finalNoSearchResultState,
|
|
649
|
+
defaultNoSearchResultState.title || "",
|
|
650
|
+
defaultNoSearchResultState.description || ""
|
|
651
|
+
);
|
|
652
|
+
return renderTableWrapper(
|
|
653
|
+
variant,
|
|
654
|
+
ref,
|
|
655
|
+
className,
|
|
656
|
+
children,
|
|
657
|
+
noSearchContent,
|
|
658
|
+
props
|
|
466
659
|
);
|
|
467
660
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
return child;
|
|
487
|
-
});
|
|
488
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
661
|
+
if (showEmpty) {
|
|
662
|
+
const emptyContent = getEmptyStateContent(
|
|
663
|
+
finalEmptyState,
|
|
664
|
+
defaultEmptyState.message || "Nenhum dado dispon\xEDvel no momento.",
|
|
665
|
+
defaultEmptyState.buttonText || "Adicionar item"
|
|
666
|
+
);
|
|
667
|
+
return renderTableWrapper(
|
|
668
|
+
variant,
|
|
669
|
+
ref,
|
|
670
|
+
className,
|
|
671
|
+
children,
|
|
672
|
+
emptyContent,
|
|
673
|
+
props
|
|
674
|
+
);
|
|
675
|
+
}
|
|
676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
489
677
|
"div",
|
|
490
678
|
{
|
|
491
679
|
className: cn(
|
|
492
680
|
"relative w-full overflow-x-auto",
|
|
493
681
|
variant === "default" && "border border-border-200 rounded-xl"
|
|
494
682
|
),
|
|
495
|
-
children: /* @__PURE__ */ (0,
|
|
683
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
496
684
|
"table",
|
|
497
685
|
{
|
|
498
686
|
ref,
|
|
@@ -504,10 +692,10 @@ var Table = (0, import_react.forwardRef)(
|
|
|
504
692
|
),
|
|
505
693
|
...props,
|
|
506
694
|
children: [
|
|
507
|
-
!
|
|
508
|
-
(child) => (0,
|
|
509
|
-
) && /* @__PURE__ */ (0,
|
|
510
|
-
|
|
695
|
+
!import_react2.Children.toArray(children).some(
|
|
696
|
+
(child) => (0, import_react2.isValidElement)(child) && child.type === TableCaption
|
|
697
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("caption", { className: "sr-only", children: "My Table" }),
|
|
698
|
+
children
|
|
511
699
|
]
|
|
512
700
|
}
|
|
513
701
|
)
|
|
@@ -516,7 +704,7 @@ var Table = (0, import_react.forwardRef)(
|
|
|
516
704
|
}
|
|
517
705
|
);
|
|
518
706
|
Table.displayName = "Table";
|
|
519
|
-
var TableHeader = (0,
|
|
707
|
+
var TableHeader = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
520
708
|
"thead",
|
|
521
709
|
{
|
|
522
710
|
ref,
|
|
@@ -525,8 +713,8 @@ var TableHeader = (0, import_react.forwardRef)(({ className, ...props }, ref) =>
|
|
|
525
713
|
}
|
|
526
714
|
));
|
|
527
715
|
TableHeader.displayName = "TableHeader";
|
|
528
|
-
var TableBody = (0,
|
|
529
|
-
({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ (0,
|
|
716
|
+
var TableBody = (0, import_react2.forwardRef)(
|
|
717
|
+
({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
530
718
|
"tbody",
|
|
531
719
|
{
|
|
532
720
|
ref,
|
|
@@ -540,8 +728,8 @@ var TableBody = (0, import_react.forwardRef)(
|
|
|
540
728
|
)
|
|
541
729
|
);
|
|
542
730
|
TableBody.displayName = "TableBody";
|
|
543
|
-
var TableFooter = (0,
|
|
544
|
-
({ variant = "default", className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
731
|
+
var TableFooter = (0, import_react2.forwardRef)(
|
|
732
|
+
({ variant = "default", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
545
733
|
"tfoot",
|
|
546
734
|
{
|
|
547
735
|
ref,
|
|
@@ -577,7 +765,7 @@ var VARIANT_STATES_ROW = {
|
|
|
577
765
|
borderless: "bg-background-50 opacity-50 cursor-not-allowed"
|
|
578
766
|
}
|
|
579
767
|
};
|
|
580
|
-
var TableRow = (0,
|
|
768
|
+
var TableRow = (0, import_react2.forwardRef)(
|
|
581
769
|
({
|
|
582
770
|
variant = "default",
|
|
583
771
|
state = "default",
|
|
@@ -585,7 +773,7 @@ var TableRow = (0, import_react.forwardRef)(
|
|
|
585
773
|
className,
|
|
586
774
|
...props
|
|
587
775
|
}, ref) => {
|
|
588
|
-
return /* @__PURE__ */ (0,
|
|
776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
589
777
|
"tr",
|
|
590
778
|
{
|
|
591
779
|
ref,
|
|
@@ -603,7 +791,7 @@ var TableRow = (0, import_react.forwardRef)(
|
|
|
603
791
|
}
|
|
604
792
|
);
|
|
605
793
|
TableRow.displayName = "TableRow";
|
|
606
|
-
var TableHead = (0,
|
|
794
|
+
var TableHead = (0, import_react2.forwardRef)(
|
|
607
795
|
({
|
|
608
796
|
className,
|
|
609
797
|
sortable = true,
|
|
@@ -617,7 +805,7 @@ var TableHead = (0, import_react.forwardRef)(
|
|
|
617
805
|
onSort();
|
|
618
806
|
}
|
|
619
807
|
};
|
|
620
|
-
return /* @__PURE__ */ (0,
|
|
808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
621
809
|
"th",
|
|
622
810
|
{
|
|
623
811
|
ref,
|
|
@@ -628,11 +816,11 @@ var TableHead = (0, import_react.forwardRef)(
|
|
|
628
816
|
),
|
|
629
817
|
onClick: handleClick,
|
|
630
818
|
...props,
|
|
631
|
-
children: /* @__PURE__ */ (0,
|
|
819
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
632
820
|
children,
|
|
633
|
-
sortable && /* @__PURE__ */ (0,
|
|
634
|
-
sortDirection === "asc" && /* @__PURE__ */ (0,
|
|
635
|
-
sortDirection === "desc" && /* @__PURE__ */ (0,
|
|
821
|
+
sortable && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col", children: [
|
|
822
|
+
sortDirection === "asc" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_phosphor_react2.CaretUp, { size: 16, weight: "fill", className: "text-text-800" }),
|
|
823
|
+
sortDirection === "desc" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_phosphor_react2.CaretDown, { size: 16, weight: "fill", className: "text-text-800" })
|
|
636
824
|
] })
|
|
637
825
|
] })
|
|
638
826
|
}
|
|
@@ -640,7 +828,7 @@ var TableHead = (0, import_react.forwardRef)(
|
|
|
640
828
|
}
|
|
641
829
|
);
|
|
642
830
|
TableHead.displayName = "TableHead";
|
|
643
|
-
var TableCell = (0,
|
|
831
|
+
var TableCell = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
644
832
|
"td",
|
|
645
833
|
{
|
|
646
834
|
ref,
|
|
@@ -652,7 +840,7 @@ var TableCell = (0, import_react.forwardRef)(({ className, ...props }, ref) => /
|
|
|
652
840
|
}
|
|
653
841
|
));
|
|
654
842
|
TableCell.displayName = "TableCell";
|
|
655
|
-
var TableCaption = (0,
|
|
843
|
+
var TableCaption = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
656
844
|
"caption",
|
|
657
845
|
{
|
|
658
846
|
ref,
|
|
@@ -667,10 +855,10 @@ TableCaption.displayName = "TableCaption";
|
|
|
667
855
|
var Table_default = Table;
|
|
668
856
|
|
|
669
857
|
// src/components/Filter/useTableFilter.ts
|
|
670
|
-
var
|
|
858
|
+
var import_react3 = require("react");
|
|
671
859
|
var useTableFilter = (initialConfigs, options = {}) => {
|
|
672
860
|
const { syncWithUrl = false } = options;
|
|
673
|
-
const getInitialState = (0,
|
|
861
|
+
const getInitialState = (0, import_react3.useCallback)(() => {
|
|
674
862
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
675
863
|
return initialConfigs;
|
|
676
864
|
}
|
|
@@ -688,8 +876,8 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
688
876
|
}));
|
|
689
877
|
return configsWithUrlState;
|
|
690
878
|
}, [initialConfigs, syncWithUrl]);
|
|
691
|
-
const [filterConfigs, setFilterConfigs] = (0,
|
|
692
|
-
const activeFilters = (0,
|
|
879
|
+
const [filterConfigs, setFilterConfigs] = (0, import_react3.useState)(getInitialState);
|
|
880
|
+
const activeFilters = (0, import_react3.useMemo)(() => {
|
|
693
881
|
const filters = {};
|
|
694
882
|
for (const config of filterConfigs) {
|
|
695
883
|
for (const category of config.categories) {
|
|
@@ -701,10 +889,10 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
701
889
|
return filters;
|
|
702
890
|
}, [filterConfigs]);
|
|
703
891
|
const hasActiveFilters = Object.keys(activeFilters).length > 0;
|
|
704
|
-
const updateFilters = (0,
|
|
892
|
+
const updateFilters = (0, import_react3.useCallback)((configs) => {
|
|
705
893
|
setFilterConfigs(configs);
|
|
706
894
|
}, []);
|
|
707
|
-
const applyFilters = (0,
|
|
895
|
+
const applyFilters = (0, import_react3.useCallback)(() => {
|
|
708
896
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
709
897
|
return;
|
|
710
898
|
}
|
|
@@ -722,7 +910,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
722
910
|
}
|
|
723
911
|
globalThis.window.history.replaceState({}, "", url.toString());
|
|
724
912
|
}, [filterConfigs, syncWithUrl]);
|
|
725
|
-
const clearFilters = (0,
|
|
913
|
+
const clearFilters = (0, import_react3.useCallback)(() => {
|
|
726
914
|
const clearedConfigs = filterConfigs.map((config) => ({
|
|
727
915
|
...config,
|
|
728
916
|
categories: config.categories.map((category) => ({
|
|
@@ -742,7 +930,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
742
930
|
globalThis.window.history.replaceState({}, "", url.toString());
|
|
743
931
|
}
|
|
744
932
|
}, [filterConfigs, syncWithUrl]);
|
|
745
|
-
(0,
|
|
933
|
+
(0, import_react3.useEffect)(() => {
|
|
746
934
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
747
935
|
return;
|
|
748
936
|
}
|
|
@@ -764,15 +952,15 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
764
952
|
|
|
765
953
|
// src/components/Search/Search.tsx
|
|
766
954
|
var import_phosphor_react6 = require("phosphor-react");
|
|
767
|
-
var
|
|
955
|
+
var import_react9 = require("react");
|
|
768
956
|
|
|
769
957
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
770
958
|
var import_phosphor_react5 = require("phosphor-react");
|
|
771
|
-
var
|
|
959
|
+
var import_react8 = require("react");
|
|
772
960
|
var import_zustand2 = require("zustand");
|
|
773
961
|
|
|
774
962
|
// src/components/Modal/Modal.tsx
|
|
775
|
-
var
|
|
963
|
+
var import_react4 = require("react");
|
|
776
964
|
var import_phosphor_react3 = require("phosphor-react");
|
|
777
965
|
|
|
778
966
|
// src/components/Modal/utils/videoUtils.ts
|
|
@@ -820,7 +1008,7 @@ var getYouTubeEmbedUrl = (videoId) => {
|
|
|
820
1008
|
};
|
|
821
1009
|
|
|
822
1010
|
// src/components/Modal/Modal.tsx
|
|
823
|
-
var
|
|
1011
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
824
1012
|
var SIZE_CLASSES2 = {
|
|
825
1013
|
xs: "max-w-[360px]",
|
|
826
1014
|
sm: "max-w-[420px]",
|
|
@@ -846,8 +1034,8 @@ var Modal = ({
|
|
|
846
1034
|
actionLabel,
|
|
847
1035
|
contentClassName = ""
|
|
848
1036
|
}) => {
|
|
849
|
-
const titleId = (0,
|
|
850
|
-
(0,
|
|
1037
|
+
const titleId = (0, import_react4.useId)();
|
|
1038
|
+
(0, import_react4.useEffect)(() => {
|
|
851
1039
|
if (!isOpen || !closeOnEscape) return;
|
|
852
1040
|
const handleEscape = (event) => {
|
|
853
1041
|
if (event.key === "Escape") {
|
|
@@ -857,7 +1045,7 @@ var Modal = ({
|
|
|
857
1045
|
document.addEventListener("keydown", handleEscape);
|
|
858
1046
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
859
1047
|
}, [isOpen, closeOnEscape, onClose]);
|
|
860
|
-
(0,
|
|
1048
|
+
(0, import_react4.useEffect)(() => {
|
|
861
1049
|
if (!isOpen) return;
|
|
862
1050
|
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
863
1051
|
const originalOverflow = document.body.style.overflow;
|
|
@@ -905,7 +1093,7 @@ var Modal = ({
|
|
|
905
1093
|
}
|
|
906
1094
|
};
|
|
907
1095
|
if (variant === "activity") {
|
|
908
|
-
return /* @__PURE__ */ (0,
|
|
1096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsxs)(
|
|
909
1097
|
"dialog",
|
|
910
1098
|
{
|
|
911
1099
|
className: modalClasses,
|
|
@@ -913,17 +1101,17 @@ var Modal = ({
|
|
|
913
1101
|
"aria-modal": "true",
|
|
914
1102
|
open: true,
|
|
915
1103
|
children: [
|
|
916
|
-
/* @__PURE__ */ (0,
|
|
1104
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex justify-end p-6 pb-0", children: !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
917
1105
|
"button",
|
|
918
1106
|
{
|
|
919
1107
|
onClick: onClose,
|
|
920
1108
|
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",
|
|
921
1109
|
"aria-label": "Fechar modal",
|
|
922
|
-
children: /* @__PURE__ */ (0,
|
|
1110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react3.X, { size: 18 })
|
|
923
1111
|
}
|
|
924
1112
|
) }),
|
|
925
|
-
/* @__PURE__ */ (0,
|
|
926
|
-
image && /* @__PURE__ */ (0,
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col items-center px-6 pb-6 gap-5", children: [
|
|
1114
|
+
image && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
927
1115
|
"img",
|
|
928
1116
|
{
|
|
929
1117
|
src: image,
|
|
@@ -931,7 +1119,7 @@ var Modal = ({
|
|
|
931
1119
|
className: "w-[122px] h-[122px] object-contain"
|
|
932
1120
|
}
|
|
933
1121
|
) }),
|
|
934
|
-
/* @__PURE__ */ (0,
|
|
1122
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
935
1123
|
"h2",
|
|
936
1124
|
{
|
|
937
1125
|
id: titleId,
|
|
@@ -939,15 +1127,15 @@ var Modal = ({
|
|
|
939
1127
|
children: title
|
|
940
1128
|
}
|
|
941
1129
|
),
|
|
942
|
-
description && /* @__PURE__ */ (0,
|
|
943
|
-
actionLink && /* @__PURE__ */ (0,
|
|
1130
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm font-normal text-text-400 text-center max-w-md leading-[21px]", children: description }),
|
|
1131
|
+
actionLink && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w-full", children: [
|
|
944
1132
|
(() => {
|
|
945
1133
|
const normalized = normalizeUrl(actionLink);
|
|
946
1134
|
const isYT = isYouTubeUrl(normalized);
|
|
947
1135
|
if (!isYT) return null;
|
|
948
1136
|
const id = getYouTubeVideoId(normalized);
|
|
949
1137
|
if (!id) {
|
|
950
|
-
return /* @__PURE__ */ (0,
|
|
1138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
951
1139
|
Button_default,
|
|
952
1140
|
{
|
|
953
1141
|
variant: "solid",
|
|
@@ -959,7 +1147,7 @@ var Modal = ({
|
|
|
959
1147
|
}
|
|
960
1148
|
);
|
|
961
1149
|
}
|
|
962
|
-
return /* @__PURE__ */ (0,
|
|
1150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
963
1151
|
"iframe",
|
|
964
1152
|
{
|
|
965
1153
|
src: getYouTubeEmbedUrl(id),
|
|
@@ -970,7 +1158,7 @@ var Modal = ({
|
|
|
970
1158
|
}
|
|
971
1159
|
);
|
|
972
1160
|
})(),
|
|
973
|
-
!isYouTubeUrl(normalizeUrl(actionLink)) && /* @__PURE__ */ (0,
|
|
1161
|
+
!isYouTubeUrl(normalizeUrl(actionLink)) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
974
1162
|
Button_default,
|
|
975
1163
|
{
|
|
976
1164
|
variant: "solid",
|
|
@@ -987,7 +1175,7 @@ var Modal = ({
|
|
|
987
1175
|
}
|
|
988
1176
|
) });
|
|
989
1177
|
}
|
|
990
|
-
return /* @__PURE__ */ (0,
|
|
1178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsxs)(
|
|
991
1179
|
"dialog",
|
|
992
1180
|
{
|
|
993
1181
|
className: modalClasses,
|
|
@@ -995,20 +1183,20 @@ var Modal = ({
|
|
|
995
1183
|
"aria-modal": "true",
|
|
996
1184
|
open: true,
|
|
997
1185
|
children: [
|
|
998
|
-
/* @__PURE__ */ (0,
|
|
999
|
-
/* @__PURE__ */ (0,
|
|
1000
|
-
!hideCloseButton && /* @__PURE__ */ (0,
|
|
1186
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between px-6 py-6", children: [
|
|
1187
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { id: titleId, className: "text-lg font-semibold text-text-950", children: title }),
|
|
1188
|
+
!hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1001
1189
|
"button",
|
|
1002
1190
|
{
|
|
1003
1191
|
onClick: onClose,
|
|
1004
1192
|
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",
|
|
1005
1193
|
"aria-label": "Fechar modal",
|
|
1006
|
-
children: /* @__PURE__ */ (0,
|
|
1194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_phosphor_react3.X, { size: 18 })
|
|
1007
1195
|
}
|
|
1008
1196
|
)
|
|
1009
1197
|
] }),
|
|
1010
|
-
children && /* @__PURE__ */ (0,
|
|
1011
|
-
footer && /* @__PURE__ */ (0,
|
|
1198
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: cn("px-6 pb-6", contentClassName), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
|
|
1199
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
|
|
1012
1200
|
]
|
|
1013
1201
|
}
|
|
1014
1202
|
) });
|
|
@@ -1017,12 +1205,12 @@ var Modal_default = Modal;
|
|
|
1017
1205
|
|
|
1018
1206
|
// src/components/ThemeToggle/ThemeToggle.tsx
|
|
1019
1207
|
var import_phosphor_react4 = require("phosphor-react");
|
|
1020
|
-
var
|
|
1208
|
+
var import_react7 = require("react");
|
|
1021
1209
|
|
|
1022
1210
|
// src/components/SelectionButton/SelectionButton.tsx
|
|
1023
|
-
var
|
|
1024
|
-
var
|
|
1025
|
-
var SelectionButton = (0,
|
|
1211
|
+
var import_react5 = require("react");
|
|
1212
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1213
|
+
var SelectionButton = (0, import_react5.forwardRef)(
|
|
1026
1214
|
({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
|
|
1027
1215
|
const baseClasses = [
|
|
1028
1216
|
"inline-flex",
|
|
@@ -1054,7 +1242,7 @@ var SelectionButton = (0, import_react4.forwardRef)(
|
|
|
1054
1242
|
];
|
|
1055
1243
|
const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
|
|
1056
1244
|
const allClasses = [...baseClasses, ...stateClasses].join(" ");
|
|
1057
|
-
return /* @__PURE__ */ (0,
|
|
1245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1058
1246
|
"button",
|
|
1059
1247
|
{
|
|
1060
1248
|
ref,
|
|
@@ -1064,8 +1252,8 @@ var SelectionButton = (0, import_react4.forwardRef)(
|
|
|
1064
1252
|
"aria-pressed": selected,
|
|
1065
1253
|
...props,
|
|
1066
1254
|
children: [
|
|
1067
|
-
/* @__PURE__ */ (0,
|
|
1068
|
-
/* @__PURE__ */ (0,
|
|
1255
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
|
|
1256
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: label })
|
|
1069
1257
|
]
|
|
1070
1258
|
}
|
|
1071
1259
|
);
|
|
@@ -1075,7 +1263,7 @@ SelectionButton.displayName = "SelectionButton";
|
|
|
1075
1263
|
var SelectionButton_default = SelectionButton;
|
|
1076
1264
|
|
|
1077
1265
|
// src/hooks/useTheme.ts
|
|
1078
|
-
var
|
|
1266
|
+
var import_react6 = require("react");
|
|
1079
1267
|
|
|
1080
1268
|
// src/store/themeStore.ts
|
|
1081
1269
|
var import_zustand = require("zustand");
|
|
@@ -1179,7 +1367,7 @@ var useTheme = () => {
|
|
|
1179
1367
|
initializeTheme,
|
|
1180
1368
|
handleSystemThemeChange
|
|
1181
1369
|
} = useThemeStore();
|
|
1182
|
-
(0,
|
|
1370
|
+
(0, import_react6.useEffect)(() => {
|
|
1183
1371
|
initializeTheme();
|
|
1184
1372
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1185
1373
|
mediaQuery.addEventListener("change", handleSystemThemeChange);
|
|
@@ -1196,31 +1384,31 @@ var useTheme = () => {
|
|
|
1196
1384
|
};
|
|
1197
1385
|
|
|
1198
1386
|
// src/components/ThemeToggle/ThemeToggle.tsx
|
|
1199
|
-
var
|
|
1387
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1200
1388
|
var ThemeToggle = ({
|
|
1201
1389
|
variant = "default",
|
|
1202
1390
|
onToggle
|
|
1203
1391
|
}) => {
|
|
1204
1392
|
const { themeMode, setTheme } = useTheme();
|
|
1205
|
-
const [tempTheme, setTempTheme] = (0,
|
|
1206
|
-
(0,
|
|
1393
|
+
const [tempTheme, setTempTheme] = (0, import_react7.useState)(themeMode);
|
|
1394
|
+
(0, import_react7.useEffect)(() => {
|
|
1207
1395
|
setTempTheme(themeMode);
|
|
1208
1396
|
}, [themeMode]);
|
|
1209
1397
|
const problemTypes = [
|
|
1210
1398
|
{
|
|
1211
1399
|
id: "light",
|
|
1212
1400
|
title: "Claro",
|
|
1213
|
-
icon: /* @__PURE__ */ (0,
|
|
1401
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_phosphor_react4.Sun, { size: 24 })
|
|
1214
1402
|
},
|
|
1215
1403
|
{
|
|
1216
1404
|
id: "dark",
|
|
1217
1405
|
title: "Escuro",
|
|
1218
|
-
icon: /* @__PURE__ */ (0,
|
|
1406
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_phosphor_react4.Moon, { size: 24 })
|
|
1219
1407
|
},
|
|
1220
1408
|
{
|
|
1221
1409
|
id: "system",
|
|
1222
1410
|
title: "Sistema",
|
|
1223
|
-
icon: /* @__PURE__ */ (0,
|
|
1411
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1224
1412
|
"svg",
|
|
1225
1413
|
{
|
|
1226
1414
|
width: "25",
|
|
@@ -1228,7 +1416,7 @@ var ThemeToggle = ({
|
|
|
1228
1416
|
viewBox: "0 0 25 25",
|
|
1229
1417
|
fill: "none",
|
|
1230
1418
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1231
|
-
children: /* @__PURE__ */ (0,
|
|
1419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1232
1420
|
"path",
|
|
1233
1421
|
{
|
|
1234
1422
|
d: "M12.5 2.75C15.085 2.75276 17.5637 3.78054 19.3916 5.6084C21.2195 7.43628 22.2473 9.915 22.25 12.5C22.25 14.4284 21.6778 16.3136 20.6064 17.917C19.5352 19.5201 18.0128 20.7699 16.2314 21.5078C14.4499 22.2458 12.489 22.4387 10.5977 22.0625C8.70642 21.6863 6.96899 20.758 5.60547 19.3945C4.24197 18.031 3.31374 16.2936 2.9375 14.4023C2.56129 12.511 2.75423 10.5501 3.49219 8.76855C4.23012 6.98718 5.47982 5.46483 7.08301 4.39355C8.68639 3.32221 10.5716 2.75 12.5 2.75ZM11.75 4.28516C9.70145 4.47452 7.7973 5.42115 6.41016 6.94043C5.02299 8.4599 4.25247 10.4426 4.25 12.5C4.25247 14.5574 5.02299 16.5401 6.41016 18.0596C7.7973 19.5789 9.70145 20.5255 11.75 20.7148V4.28516Z",
|
|
@@ -1250,7 +1438,7 @@ var ThemeToggle = ({
|
|
|
1250
1438
|
}
|
|
1251
1439
|
};
|
|
1252
1440
|
const currentTheme = variant === "with-save" ? tempTheme : themeMode;
|
|
1253
|
-
return /* @__PURE__ */ (0,
|
|
1441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-row gap-2 sm:gap-4 py-2", children: problemTypes.map((type) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1254
1442
|
SelectionButton_default,
|
|
1255
1443
|
{
|
|
1256
1444
|
icon: type.icon,
|
|
@@ -1264,7 +1452,7 @@ var ThemeToggle = ({
|
|
|
1264
1452
|
};
|
|
1265
1453
|
|
|
1266
1454
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1267
|
-
var
|
|
1455
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1268
1456
|
function createDropdownStore() {
|
|
1269
1457
|
return (0, import_zustand2.create)((set) => ({
|
|
1270
1458
|
open: false,
|
|
@@ -1280,8 +1468,8 @@ var useDropdownStore = (externalStore) => {
|
|
|
1280
1468
|
return externalStore;
|
|
1281
1469
|
};
|
|
1282
1470
|
var injectStore = (children, store) => {
|
|
1283
|
-
return
|
|
1284
|
-
if ((0,
|
|
1471
|
+
return import_react8.Children.map(children, (child) => {
|
|
1472
|
+
if ((0, import_react8.isValidElement)(child)) {
|
|
1285
1473
|
const typedChild = child;
|
|
1286
1474
|
const displayName = typedChild.type.displayName;
|
|
1287
1475
|
const allowed = [
|
|
@@ -1303,7 +1491,7 @@ var injectStore = (children, store) => {
|
|
|
1303
1491
|
if (typedChild.props.children) {
|
|
1304
1492
|
newProps.children = injectStore(typedChild.props.children, store);
|
|
1305
1493
|
}
|
|
1306
|
-
return (0,
|
|
1494
|
+
return (0, import_react8.cloneElement)(typedChild, newProps);
|
|
1307
1495
|
}
|
|
1308
1496
|
return child;
|
|
1309
1497
|
});
|
|
@@ -1313,14 +1501,14 @@ var DropdownMenu = ({
|
|
|
1313
1501
|
open: propOpen,
|
|
1314
1502
|
onOpenChange
|
|
1315
1503
|
}) => {
|
|
1316
|
-
const storeRef = (0,
|
|
1504
|
+
const storeRef = (0, import_react8.useRef)(null);
|
|
1317
1505
|
storeRef.current ??= createDropdownStore();
|
|
1318
1506
|
const store = storeRef.current;
|
|
1319
1507
|
const { open, setOpen: storeSetOpen } = (0, import_zustand2.useStore)(store, (s) => s);
|
|
1320
1508
|
const setOpen = (newOpen) => {
|
|
1321
1509
|
storeSetOpen(newOpen);
|
|
1322
1510
|
};
|
|
1323
|
-
const menuRef = (0,
|
|
1511
|
+
const menuRef = (0, import_react8.useRef)(null);
|
|
1324
1512
|
const handleArrowDownOrArrowUp = (event) => {
|
|
1325
1513
|
const menuContent = menuRef.current?.querySelector('[role="menu"]');
|
|
1326
1514
|
if (menuContent) {
|
|
@@ -1354,7 +1542,7 @@ var DropdownMenu = ({
|
|
|
1354
1542
|
setOpen(false);
|
|
1355
1543
|
}
|
|
1356
1544
|
};
|
|
1357
|
-
(0,
|
|
1545
|
+
(0, import_react8.useEffect)(() => {
|
|
1358
1546
|
if (open) {
|
|
1359
1547
|
document.addEventListener("pointerdown", handleClickOutside);
|
|
1360
1548
|
document.addEventListener("keydown", handleDownkey);
|
|
@@ -1364,15 +1552,15 @@ var DropdownMenu = ({
|
|
|
1364
1552
|
document.removeEventListener("keydown", handleDownkey);
|
|
1365
1553
|
};
|
|
1366
1554
|
}, [open]);
|
|
1367
|
-
(0,
|
|
1555
|
+
(0, import_react8.useEffect)(() => {
|
|
1368
1556
|
onOpenChange?.(open);
|
|
1369
1557
|
}, [open, onOpenChange]);
|
|
1370
|
-
(0,
|
|
1558
|
+
(0, import_react8.useEffect)(() => {
|
|
1371
1559
|
if (propOpen !== void 0) {
|
|
1372
1560
|
setOpen(propOpen);
|
|
1373
1561
|
}
|
|
1374
1562
|
}, [propOpen]);
|
|
1375
|
-
return /* @__PURE__ */ (0,
|
|
1563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
|
|
1376
1564
|
};
|
|
1377
1565
|
var DropdownMenuTrigger = ({
|
|
1378
1566
|
className,
|
|
@@ -1384,7 +1572,7 @@ var DropdownMenuTrigger = ({
|
|
|
1384
1572
|
const store = useDropdownStore(externalStore);
|
|
1385
1573
|
const open = (0, import_zustand2.useStore)(store, (s) => s.open);
|
|
1386
1574
|
const toggleOpen = () => store.setState({ open: !open });
|
|
1387
|
-
return /* @__PURE__ */ (0,
|
|
1575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1388
1576
|
"div",
|
|
1389
1577
|
{
|
|
1390
1578
|
onClick: (e) => {
|
|
@@ -1428,8 +1616,8 @@ var MENUCONTENT_VARIANT_CLASSES = {
|
|
|
1428
1616
|
menu: "p-1",
|
|
1429
1617
|
profile: "p-6"
|
|
1430
1618
|
};
|
|
1431
|
-
var MenuLabel = (0,
|
|
1432
|
-
return /* @__PURE__ */ (0,
|
|
1619
|
+
var MenuLabel = (0, import_react8.forwardRef)(({ className, inset, store: _store, ...props }, ref) => {
|
|
1620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1433
1621
|
"div",
|
|
1434
1622
|
{
|
|
1435
1623
|
ref,
|
|
@@ -1439,7 +1627,7 @@ var MenuLabel = (0, import_react7.forwardRef)(({ className, inset, store: _store
|
|
|
1439
1627
|
);
|
|
1440
1628
|
});
|
|
1441
1629
|
MenuLabel.displayName = "MenuLabel";
|
|
1442
|
-
var DropdownMenuContent = (0,
|
|
1630
|
+
var DropdownMenuContent = (0, import_react8.forwardRef)(
|
|
1443
1631
|
({
|
|
1444
1632
|
className,
|
|
1445
1633
|
align = "start",
|
|
@@ -1452,8 +1640,8 @@ var DropdownMenuContent = (0, import_react7.forwardRef)(
|
|
|
1452
1640
|
}, ref) => {
|
|
1453
1641
|
const store = useDropdownStore(externalStore);
|
|
1454
1642
|
const open = (0, import_zustand2.useStore)(store, (s) => s.open);
|
|
1455
|
-
const [isVisible, setIsVisible] = (0,
|
|
1456
|
-
(0,
|
|
1643
|
+
const [isVisible, setIsVisible] = (0, import_react8.useState)(open);
|
|
1644
|
+
(0, import_react8.useEffect)(() => {
|
|
1457
1645
|
if (open) {
|
|
1458
1646
|
setIsVisible(true);
|
|
1459
1647
|
} else {
|
|
@@ -1468,7 +1656,7 @@ var DropdownMenuContent = (0, import_react7.forwardRef)(
|
|
|
1468
1656
|
return `absolute ${vertical} ${horizontal}`;
|
|
1469
1657
|
};
|
|
1470
1658
|
const variantClasses = MENUCONTENT_VARIANT_CLASSES[variant];
|
|
1471
|
-
return /* @__PURE__ */ (0,
|
|
1659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1472
1660
|
"div",
|
|
1473
1661
|
{
|
|
1474
1662
|
ref,
|
|
@@ -1493,7 +1681,7 @@ var DropdownMenuContent = (0, import_react7.forwardRef)(
|
|
|
1493
1681
|
}
|
|
1494
1682
|
);
|
|
1495
1683
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
1496
|
-
var DropdownMenuItem = (0,
|
|
1684
|
+
var DropdownMenuItem = (0, import_react8.forwardRef)(
|
|
1497
1685
|
({
|
|
1498
1686
|
className,
|
|
1499
1687
|
size = "small",
|
|
@@ -1537,7 +1725,7 @@ var DropdownMenuItem = (0, import_react7.forwardRef)(
|
|
|
1537
1725
|
const getVariantProps = () => {
|
|
1538
1726
|
return variant === "profile" ? { "data-variant": "profile" } : {};
|
|
1539
1727
|
};
|
|
1540
|
-
return /* @__PURE__ */ (0,
|
|
1728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1541
1729
|
"div",
|
|
1542
1730
|
{
|
|
1543
1731
|
ref,
|
|
@@ -1563,7 +1751,7 @@ var DropdownMenuItem = (0, import_react7.forwardRef)(
|
|
|
1563
1751
|
...props,
|
|
1564
1752
|
children: [
|
|
1565
1753
|
iconLeft,
|
|
1566
|
-
/* @__PURE__ */ (0,
|
|
1754
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w-full", children }),
|
|
1567
1755
|
iconRight
|
|
1568
1756
|
]
|
|
1569
1757
|
}
|
|
@@ -1571,7 +1759,7 @@ var DropdownMenuItem = (0, import_react7.forwardRef)(
|
|
|
1571
1759
|
}
|
|
1572
1760
|
);
|
|
1573
1761
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
1574
|
-
var DropdownMenuSeparator = (0,
|
|
1762
|
+
var DropdownMenuSeparator = (0, import_react8.forwardRef)(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1575
1763
|
"div",
|
|
1576
1764
|
{
|
|
1577
1765
|
ref,
|
|
@@ -1580,11 +1768,11 @@ var DropdownMenuSeparator = (0, import_react7.forwardRef)(({ className, store: _
|
|
|
1580
1768
|
}
|
|
1581
1769
|
));
|
|
1582
1770
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
1583
|
-
var ProfileMenuTrigger = (0,
|
|
1771
|
+
var ProfileMenuTrigger = (0, import_react8.forwardRef)(({ className, onClick, store: externalStore, ...props }, ref) => {
|
|
1584
1772
|
const store = useDropdownStore(externalStore);
|
|
1585
1773
|
const open = (0, import_zustand2.useStore)(store, (s) => s.open);
|
|
1586
1774
|
const toggleOpen = () => store.setState({ open: !open });
|
|
1587
|
-
return /* @__PURE__ */ (0,
|
|
1775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1588
1776
|
"button",
|
|
1589
1777
|
{
|
|
1590
1778
|
ref,
|
|
@@ -1599,13 +1787,13 @@ var ProfileMenuTrigger = (0, import_react7.forwardRef)(({ className, onClick, st
|
|
|
1599
1787
|
},
|
|
1600
1788
|
"aria-expanded": open,
|
|
1601
1789
|
...props,
|
|
1602
|
-
children: /* @__PURE__ */ (0,
|
|
1790
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "size-6 rounded-full bg-primary-100 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react5.User, { className: "text-primary-950", size: 18 }) })
|
|
1603
1791
|
}
|
|
1604
1792
|
);
|
|
1605
1793
|
});
|
|
1606
1794
|
ProfileMenuTrigger.displayName = "ProfileMenuTrigger";
|
|
1607
|
-
var ProfileMenuHeader = (0,
|
|
1608
|
-
return /* @__PURE__ */ (0,
|
|
1795
|
+
var ProfileMenuHeader = (0, import_react8.forwardRef)(({ className, name, email, photoUrl, store: _store, ...props }, ref) => {
|
|
1796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1609
1797
|
"div",
|
|
1610
1798
|
{
|
|
1611
1799
|
ref,
|
|
@@ -1616,16 +1804,16 @@ var ProfileMenuHeader = (0, import_react7.forwardRef)(({ className, name, email,
|
|
|
1616
1804
|
),
|
|
1617
1805
|
...props,
|
|
1618
1806
|
children: [
|
|
1619
|
-
/* @__PURE__ */ (0,
|
|
1807
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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_runtime10.jsx)(
|
|
1620
1808
|
"img",
|
|
1621
1809
|
{
|
|
1622
1810
|
src: photoUrl,
|
|
1623
1811
|
alt: "Foto de perfil",
|
|
1624
1812
|
className: "w-full h-full object-cover"
|
|
1625
1813
|
}
|
|
1626
|
-
) : /* @__PURE__ */ (0,
|
|
1627
|
-
/* @__PURE__ */ (0,
|
|
1628
|
-
/* @__PURE__ */ (0,
|
|
1814
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react5.User, { size: 34, className: "text-primary-800" }) }),
|
|
1815
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col min-w-0", children: [
|
|
1816
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1629
1817
|
Text_default,
|
|
1630
1818
|
{
|
|
1631
1819
|
size: "xl",
|
|
@@ -1635,14 +1823,14 @@ var ProfileMenuHeader = (0, import_react7.forwardRef)(({ className, name, email,
|
|
|
1635
1823
|
children: name
|
|
1636
1824
|
}
|
|
1637
1825
|
),
|
|
1638
|
-
/* @__PURE__ */ (0,
|
|
1826
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { size: "md", color: "text-text-600", className: "truncate", children: email })
|
|
1639
1827
|
] })
|
|
1640
1828
|
]
|
|
1641
1829
|
}
|
|
1642
1830
|
);
|
|
1643
1831
|
});
|
|
1644
1832
|
ProfileMenuHeader.displayName = "ProfileMenuHeader";
|
|
1645
|
-
var ProfileMenuInfo = (0,
|
|
1833
|
+
var ProfileMenuInfo = (0, import_react8.forwardRef)(
|
|
1646
1834
|
({
|
|
1647
1835
|
className,
|
|
1648
1836
|
schoolName,
|
|
@@ -1651,7 +1839,7 @@ var ProfileMenuInfo = (0, import_react7.forwardRef)(
|
|
|
1651
1839
|
store: _store,
|
|
1652
1840
|
...props
|
|
1653
1841
|
}, ref) => {
|
|
1654
|
-
return /* @__PURE__ */ (0,
|
|
1842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1655
1843
|
"div",
|
|
1656
1844
|
{
|
|
1657
1845
|
ref,
|
|
@@ -1659,13 +1847,13 @@ var ProfileMenuInfo = (0, import_react7.forwardRef)(
|
|
|
1659
1847
|
className: cn("flex flex-row gap-4 items-center", className),
|
|
1660
1848
|
...props,
|
|
1661
1849
|
children: [
|
|
1662
|
-
/* @__PURE__ */ (0,
|
|
1663
|
-
/* @__PURE__ */ (0,
|
|
1664
|
-
/* @__PURE__ */ (0,
|
|
1665
|
-
/* @__PURE__ */ (0,
|
|
1666
|
-
/* @__PURE__ */ (0,
|
|
1667
|
-
/* @__PURE__ */ (0,
|
|
1668
|
-
/* @__PURE__ */ (0,
|
|
1850
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w-16 h-16" }),
|
|
1851
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col ", children: [
|
|
1852
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { size: "md", color: "text-text-600", children: schoolName }),
|
|
1853
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex flex-row items-center gap-2", children: [
|
|
1854
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { size: "md", color: "text-text-600", children: classYearName }),
|
|
1855
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-text-600 text-xs align-middle", children: "\u25CF" }),
|
|
1856
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { size: "md", color: "text-text-600", children: schoolYearName })
|
|
1669
1857
|
] })
|
|
1670
1858
|
] })
|
|
1671
1859
|
]
|
|
@@ -1679,9 +1867,9 @@ var ProfileToggleTheme = ({
|
|
|
1679
1867
|
...props
|
|
1680
1868
|
}) => {
|
|
1681
1869
|
const { themeMode, setTheme } = useTheme();
|
|
1682
|
-
const [modalThemeToggle, setModalThemeToggle] = (0,
|
|
1683
|
-
const [selectedTheme, setSelectedTheme] = (0,
|
|
1684
|
-
const internalStoreRef = (0,
|
|
1870
|
+
const [modalThemeToggle, setModalThemeToggle] = (0, import_react8.useState)(false);
|
|
1871
|
+
const [selectedTheme, setSelectedTheme] = (0, import_react8.useState)(themeMode);
|
|
1872
|
+
const internalStoreRef = (0, import_react8.useRef)(null);
|
|
1685
1873
|
internalStoreRef.current ??= createDropdownStore();
|
|
1686
1874
|
const store = externalStore ?? internalStoreRef.current;
|
|
1687
1875
|
const setOpen = (0, import_zustand2.useStore)(store, (s) => s.setOpen);
|
|
@@ -1700,14 +1888,14 @@ var ProfileToggleTheme = ({
|
|
|
1700
1888
|
setModalThemeToggle(false);
|
|
1701
1889
|
setOpen(false);
|
|
1702
1890
|
};
|
|
1703
|
-
return /* @__PURE__ */ (0,
|
|
1704
|
-
/* @__PURE__ */ (0,
|
|
1891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1892
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1705
1893
|
DropdownMenuItem,
|
|
1706
1894
|
{
|
|
1707
1895
|
variant: "profile",
|
|
1708
1896
|
preventClose: true,
|
|
1709
1897
|
store,
|
|
1710
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
1898
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1711
1899
|
"svg",
|
|
1712
1900
|
{
|
|
1713
1901
|
width: "24",
|
|
@@ -1715,7 +1903,7 @@ var ProfileToggleTheme = ({
|
|
|
1715
1903
|
viewBox: "0 0 25 25",
|
|
1716
1904
|
fill: "none",
|
|
1717
1905
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1718
|
-
children: /* @__PURE__ */ (0,
|
|
1906
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1719
1907
|
"path",
|
|
1720
1908
|
{
|
|
1721
1909
|
d: "M12.5 2.75C15.085 2.75276 17.5637 3.78054 19.3916 5.6084C21.2195 7.43628 22.2473 9.915 22.25 12.5C22.25 14.4284 21.6778 16.3136 20.6064 17.917C19.5352 19.5201 18.0128 20.7699 16.2314 21.5078C14.4499 22.2458 12.489 22.4387 10.5977 22.0625C8.70642 21.6863 6.96899 20.758 5.60547 19.3945C4.24197 18.031 3.31374 16.2936 2.9375 14.4023C2.56129 12.511 2.75423 10.5501 3.49219 8.76855C4.23012 6.98718 5.47982 5.46483 7.08301 4.39355C8.68639 3.32221 10.5716 2.75 12.5 2.75ZM11.75 4.28516C9.70145 4.47452 7.7973 5.42115 6.41016 6.94043C5.02299 8.4599 4.25247 10.4426 4.25 12.5C4.25247 14.5574 5.02299 16.5401 6.41016 18.0596C7.7973 19.5789 9.70145 20.5255 11.75 20.7148V4.28516Z",
|
|
@@ -1724,7 +1912,7 @@ var ProfileToggleTheme = ({
|
|
|
1724
1912
|
)
|
|
1725
1913
|
}
|
|
1726
1914
|
),
|
|
1727
|
-
iconRight: /* @__PURE__ */ (0,
|
|
1915
|
+
iconRight: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react5.CaretRight, {}),
|
|
1728
1916
|
onClick: handleClick,
|
|
1729
1917
|
onKeyDown: (e) => {
|
|
1730
1918
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -1734,31 +1922,31 @@ var ProfileToggleTheme = ({
|
|
|
1734
1922
|
}
|
|
1735
1923
|
},
|
|
1736
1924
|
...props,
|
|
1737
|
-
children: /* @__PURE__ */ (0,
|
|
1925
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { size: "md", color: "text-text-700", children: "Apar\xEAncia" })
|
|
1738
1926
|
}
|
|
1739
1927
|
),
|
|
1740
|
-
/* @__PURE__ */ (0,
|
|
1928
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1741
1929
|
Modal_default,
|
|
1742
1930
|
{
|
|
1743
1931
|
isOpen: modalThemeToggle,
|
|
1744
1932
|
onClose: handleCancel,
|
|
1745
1933
|
title: "Apar\xEAncia",
|
|
1746
1934
|
size: "md",
|
|
1747
|
-
footer: /* @__PURE__ */ (0,
|
|
1748
|
-
/* @__PURE__ */ (0,
|
|
1749
|
-
/* @__PURE__ */ (0,
|
|
1935
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex gap-3", children: [
|
|
1936
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button_default, { variant: "outline", onClick: handleCancel, children: "Cancelar" }),
|
|
1937
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button_default, { variant: "solid", onClick: handleSave, children: "Salvar" })
|
|
1750
1938
|
] }),
|
|
1751
|
-
children: /* @__PURE__ */ (0,
|
|
1752
|
-
/* @__PURE__ */ (0,
|
|
1753
|
-
/* @__PURE__ */ (0,
|
|
1939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col", children: [
|
|
1940
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-sm text-text-500", children: "Escolha o tema:" }),
|
|
1941
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ThemeToggle, { variant: "with-save", onToggle: setSelectedTheme })
|
|
1754
1942
|
] })
|
|
1755
1943
|
}
|
|
1756
1944
|
)
|
|
1757
1945
|
] });
|
|
1758
1946
|
};
|
|
1759
1947
|
ProfileToggleTheme.displayName = "ProfileToggleTheme";
|
|
1760
|
-
var ProfileMenuSection = (0,
|
|
1761
|
-
return /* @__PURE__ */ (0,
|
|
1948
|
+
var ProfileMenuSection = (0, import_react8.forwardRef)(({ className, children, store: _store, ...props }, ref) => {
|
|
1949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref, className: cn("flex flex-col p-2", className), ...props, children });
|
|
1762
1950
|
});
|
|
1763
1951
|
ProfileMenuSection.displayName = "ProfileMenuSection";
|
|
1764
1952
|
var ProfileMenuFooter = ({
|
|
@@ -1770,7 +1958,7 @@ var ProfileMenuFooter = ({
|
|
|
1770
1958
|
}) => {
|
|
1771
1959
|
const store = useDropdownStore(externalStore);
|
|
1772
1960
|
const setOpen = (0, import_zustand2.useStore)(store, (s) => s.setOpen);
|
|
1773
|
-
return /* @__PURE__ */ (0,
|
|
1961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1774
1962
|
Button_default,
|
|
1775
1963
|
{
|
|
1776
1964
|
variant: "outline",
|
|
@@ -1782,8 +1970,8 @@ var ProfileMenuFooter = ({
|
|
|
1782
1970
|
},
|
|
1783
1971
|
...props,
|
|
1784
1972
|
children: [
|
|
1785
|
-
/* @__PURE__ */ (0,
|
|
1786
|
-
/* @__PURE__ */ (0,
|
|
1973
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_phosphor_react5.SignOut, { className: "text-inherit" }) }),
|
|
1974
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { color: "inherit", children: "Sair" })
|
|
1787
1975
|
]
|
|
1788
1976
|
}
|
|
1789
1977
|
);
|
|
@@ -1792,7 +1980,7 @@ ProfileMenuFooter.displayName = "ProfileMenuFooter";
|
|
|
1792
1980
|
var DropdownMenu_default = DropdownMenu;
|
|
1793
1981
|
|
|
1794
1982
|
// src/components/Search/Search.tsx
|
|
1795
|
-
var
|
|
1983
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1796
1984
|
var filterOptions = (options, query) => {
|
|
1797
1985
|
if (!query || query.length < 1) return [];
|
|
1798
1986
|
return options.filter(
|
|
@@ -1817,7 +2005,7 @@ var updateInputValue = (value, ref, onChange) => {
|
|
|
1817
2005
|
onChange(event);
|
|
1818
2006
|
}
|
|
1819
2007
|
};
|
|
1820
|
-
var Search = (0,
|
|
2008
|
+
var Search = (0, import_react9.forwardRef)(
|
|
1821
2009
|
({
|
|
1822
2010
|
options = [],
|
|
1823
2011
|
onSelect,
|
|
@@ -1838,13 +2026,13 @@ var Search = (0, import_react8.forwardRef)(
|
|
|
1838
2026
|
onKeyDown: userOnKeyDown,
|
|
1839
2027
|
...props
|
|
1840
2028
|
}, ref) => {
|
|
1841
|
-
const [dropdownOpen, setDropdownOpen] = (0,
|
|
1842
|
-
const [forceClose, setForceClose] = (0,
|
|
1843
|
-
const justSelectedRef = (0,
|
|
1844
|
-
const dropdownStore = (0,
|
|
1845
|
-
const dropdownRef = (0,
|
|
1846
|
-
const inputElRef = (0,
|
|
1847
|
-
const filteredOptions = (0,
|
|
2029
|
+
const [dropdownOpen, setDropdownOpen] = (0, import_react9.useState)(false);
|
|
2030
|
+
const [forceClose, setForceClose] = (0, import_react9.useState)(false);
|
|
2031
|
+
const justSelectedRef = (0, import_react9.useRef)(false);
|
|
2032
|
+
const dropdownStore = (0, import_react9.useRef)(createDropdownStore()).current;
|
|
2033
|
+
const dropdownRef = (0, import_react9.useRef)(null);
|
|
2034
|
+
const inputElRef = (0, import_react9.useRef)(null);
|
|
2035
|
+
const filteredOptions = (0, import_react9.useMemo)(() => {
|
|
1848
2036
|
if (!options.length) {
|
|
1849
2037
|
return [];
|
|
1850
2038
|
}
|
|
@@ -1857,7 +2045,7 @@ var Search = (0, import_react8.forwardRef)(
|
|
|
1857
2045
|
dropdownStore.setState({ open });
|
|
1858
2046
|
onDropdownChange?.(open);
|
|
1859
2047
|
};
|
|
1860
|
-
(0,
|
|
2048
|
+
(0, import_react9.useEffect)(() => {
|
|
1861
2049
|
if (justSelectedRef.current) {
|
|
1862
2050
|
justSelectedRef.current = false;
|
|
1863
2051
|
return;
|
|
@@ -1876,7 +2064,7 @@ var Search = (0, import_react8.forwardRef)(
|
|
|
1876
2064
|
setOpenAndNotify(false);
|
|
1877
2065
|
updateInputValue(option, ref, onChange);
|
|
1878
2066
|
};
|
|
1879
|
-
(0,
|
|
2067
|
+
(0, import_react9.useEffect)(() => {
|
|
1880
2068
|
const handleClickOutside = (event) => {
|
|
1881
2069
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1882
2070
|
setOpenAndNotify(false);
|
|
@@ -1889,7 +2077,7 @@ var Search = (0, import_react8.forwardRef)(
|
|
|
1889
2077
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1890
2078
|
};
|
|
1891
2079
|
}, [showDropdown, dropdownStore, onDropdownChange]);
|
|
1892
|
-
const generatedId = (0,
|
|
2080
|
+
const generatedId = (0, import_react9.useId)();
|
|
1893
2081
|
const inputId = id ?? `search-${generatedId}`;
|
|
1894
2082
|
const dropdownId = `${inputId}-dropdown`;
|
|
1895
2083
|
const handleClear = () => {
|
|
@@ -1938,14 +2126,14 @@ var Search = (0, import_react8.forwardRef)(
|
|
|
1938
2126
|
const hasValue = String(value ?? "").length > 0;
|
|
1939
2127
|
const showClearButton = hasValue && !disabled && !readOnly;
|
|
1940
2128
|
const showSearchIcon = !hasValue && !disabled && !readOnly;
|
|
1941
|
-
return /* @__PURE__ */ (0,
|
|
2129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1942
2130
|
"div",
|
|
1943
2131
|
{
|
|
1944
2132
|
ref: dropdownRef,
|
|
1945
2133
|
className: `w-full max-w-lg md:w-[488px] ${containerClassName}`,
|
|
1946
2134
|
children: [
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
1948
|
-
/* @__PURE__ */ (0,
|
|
2135
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative flex items-center", children: [
|
|
2136
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1949
2137
|
"input",
|
|
1950
2138
|
{
|
|
1951
2139
|
ref: (node) => {
|
|
@@ -1973,35 +2161,35 @@ var Search = (0, import_react8.forwardRef)(
|
|
|
1973
2161
|
...props
|
|
1974
2162
|
}
|
|
1975
2163
|
),
|
|
1976
|
-
showClearButton && /* @__PURE__ */ (0,
|
|
2164
|
+
showClearButton && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1977
2165
|
"button",
|
|
1978
2166
|
{
|
|
1979
2167
|
type: "button",
|
|
1980
2168
|
className: "p-0 border-0 bg-transparent cursor-pointer",
|
|
1981
2169
|
onMouseDown: handleClearClick,
|
|
1982
2170
|
"aria-label": "Limpar busca",
|
|
1983
|
-
children: /* @__PURE__ */ (0,
|
|
2171
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-6 h-6 text-text-800 flex items-center justify-center hover:text-text-600 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react6.X, {}) })
|
|
1984
2172
|
}
|
|
1985
2173
|
) }),
|
|
1986
|
-
showSearchIcon && /* @__PURE__ */ (0,
|
|
2174
|
+
showSearchIcon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1987
2175
|
"button",
|
|
1988
2176
|
{
|
|
1989
2177
|
type: "button",
|
|
1990
2178
|
className: "p-0 border-0 bg-transparent cursor-pointer",
|
|
1991
2179
|
onMouseDown: handleSearchIconClick,
|
|
1992
2180
|
"aria-label": "Buscar",
|
|
1993
|
-
children: /* @__PURE__ */ (0,
|
|
2181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-6 h-6 text-text-800 flex items-center justify-center hover:text-text-600 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react6.MagnifyingGlass, {}) })
|
|
1994
2182
|
}
|
|
1995
2183
|
) })
|
|
1996
2184
|
] }),
|
|
1997
|
-
showDropdown && /* @__PURE__ */ (0,
|
|
2185
|
+
showDropdown && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DropdownMenu_default, { open: showDropdown, onOpenChange: setDropdownOpen, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1998
2186
|
DropdownMenuContent,
|
|
1999
2187
|
{
|
|
2000
2188
|
id: dropdownId,
|
|
2001
2189
|
className: "w-full mt-1",
|
|
2002
2190
|
style: { maxHeight: dropdownMaxHeight },
|
|
2003
2191
|
align: "start",
|
|
2004
|
-
children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ (0,
|
|
2192
|
+
children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2005
2193
|
DropdownMenuItem,
|
|
2006
2194
|
{
|
|
2007
2195
|
onClick: () => handleSelectOption(option),
|
|
@@ -2009,7 +2197,7 @@ var Search = (0, import_react8.forwardRef)(
|
|
|
2009
2197
|
children: option
|
|
2010
2198
|
},
|
|
2011
2199
|
option
|
|
2012
|
-
)) : /* @__PURE__ */ (0,
|
|
2200
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "px-3 py-3 text-text-700 text-base", children: noResultsText })
|
|
2013
2201
|
}
|
|
2014
2202
|
) })
|
|
2015
2203
|
]
|
|
@@ -2021,11 +2209,11 @@ Search.displayName = "Search";
|
|
|
2021
2209
|
var Search_default = Search;
|
|
2022
2210
|
|
|
2023
2211
|
// src/components/CheckBoxGroup/CheckBoxGroup.tsx
|
|
2024
|
-
var
|
|
2212
|
+
var import_react15 = require("react");
|
|
2025
2213
|
|
|
2026
2214
|
// src/components/Badge/Badge.tsx
|
|
2027
2215
|
var import_phosphor_react7 = require("phosphor-react");
|
|
2028
|
-
var
|
|
2216
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2029
2217
|
var VARIANT_ACTION_CLASSES2 = {
|
|
2030
2218
|
solid: {
|
|
2031
2219
|
error: "bg-error-background text-error-700 focus-visible:outline-none",
|
|
@@ -2087,14 +2275,14 @@ var Badge = ({
|
|
|
2087
2275
|
const baseClasses = "inline-flex items-center justify-center rounded-xs font-normal gap-1 relative";
|
|
2088
2276
|
const baseClassesIcon = "flex items-center";
|
|
2089
2277
|
if (variant === "notification") {
|
|
2090
|
-
return /* @__PURE__ */ (0,
|
|
2278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2091
2279
|
"div",
|
|
2092
2280
|
{
|
|
2093
2281
|
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
2094
2282
|
...props,
|
|
2095
2283
|
children: [
|
|
2096
|
-
/* @__PURE__ */ (0,
|
|
2097
|
-
notificationActive && /* @__PURE__ */ (0,
|
|
2284
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_phosphor_react7.Bell, { size: 24, className: "text-current", "aria-hidden": "true" }),
|
|
2285
|
+
notificationActive && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2098
2286
|
"span",
|
|
2099
2287
|
{
|
|
2100
2288
|
"data-testid": "notification-dot",
|
|
@@ -2105,15 +2293,15 @@ var Badge = ({
|
|
|
2105
2293
|
}
|
|
2106
2294
|
);
|
|
2107
2295
|
}
|
|
2108
|
-
return /* @__PURE__ */ (0,
|
|
2296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2109
2297
|
"div",
|
|
2110
2298
|
{
|
|
2111
2299
|
className: cn(baseClasses, variantClasses, sizeClasses, className),
|
|
2112
2300
|
...props,
|
|
2113
2301
|
children: [
|
|
2114
|
-
iconLeft && /* @__PURE__ */ (0,
|
|
2302
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconLeft }),
|
|
2115
2303
|
children,
|
|
2116
|
-
iconRight && /* @__PURE__ */ (0,
|
|
2304
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn(baseClassesIcon, sizeClassesIcon), children: iconRight })
|
|
2117
2305
|
]
|
|
2118
2306
|
}
|
|
2119
2307
|
);
|
|
@@ -2121,9 +2309,9 @@ var Badge = ({
|
|
|
2121
2309
|
var Badge_default = Badge;
|
|
2122
2310
|
|
|
2123
2311
|
// src/components/CheckBox/CheckBox.tsx
|
|
2124
|
-
var
|
|
2312
|
+
var import_react10 = require("react");
|
|
2125
2313
|
var import_phosphor_react8 = require("phosphor-react");
|
|
2126
|
-
var
|
|
2314
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2127
2315
|
var SIZE_CLASSES4 = {
|
|
2128
2316
|
small: {
|
|
2129
2317
|
checkbox: "w-4 h-4",
|
|
@@ -2183,7 +2371,7 @@ var STATE_CLASSES = {
|
|
|
2183
2371
|
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
2184
2372
|
}
|
|
2185
2373
|
};
|
|
2186
|
-
var CheckBox = (0,
|
|
2374
|
+
var CheckBox = (0, import_react10.forwardRef)(
|
|
2187
2375
|
({
|
|
2188
2376
|
label,
|
|
2189
2377
|
size = "medium",
|
|
@@ -2199,9 +2387,9 @@ var CheckBox = (0, import_react9.forwardRef)(
|
|
|
2199
2387
|
onChange,
|
|
2200
2388
|
...props
|
|
2201
2389
|
}, ref) => {
|
|
2202
|
-
const generatedId = (0,
|
|
2390
|
+
const generatedId = (0, import_react10.useId)();
|
|
2203
2391
|
const inputId = id ?? `checkbox-${generatedId}`;
|
|
2204
|
-
const [internalChecked, setInternalChecked] = (0,
|
|
2392
|
+
const [internalChecked, setInternalChecked] = (0, import_react10.useState)(false);
|
|
2205
2393
|
const isControlled = checkedProp !== void 0;
|
|
2206
2394
|
const checked = isControlled ? checkedProp : internalChecked;
|
|
2207
2395
|
const handleChange = (event) => {
|
|
@@ -2224,7 +2412,7 @@ var CheckBox = (0, import_react9.forwardRef)(
|
|
|
2224
2412
|
);
|
|
2225
2413
|
const renderIcon = () => {
|
|
2226
2414
|
if (indeterminate) {
|
|
2227
|
-
return /* @__PURE__ */ (0,
|
|
2415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2228
2416
|
import_phosphor_react8.Minus,
|
|
2229
2417
|
{
|
|
2230
2418
|
size: sizeClasses.iconSize,
|
|
@@ -2234,7 +2422,7 @@ var CheckBox = (0, import_react9.forwardRef)(
|
|
|
2234
2422
|
);
|
|
2235
2423
|
}
|
|
2236
2424
|
if (checked) {
|
|
2237
|
-
return /* @__PURE__ */ (0,
|
|
2425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2238
2426
|
import_phosphor_react8.Check,
|
|
2239
2427
|
{
|
|
2240
2428
|
size: sizeClasses.iconSize,
|
|
@@ -2245,8 +2433,8 @@ var CheckBox = (0, import_react9.forwardRef)(
|
|
|
2245
2433
|
}
|
|
2246
2434
|
return null;
|
|
2247
2435
|
};
|
|
2248
|
-
return /* @__PURE__ */ (0,
|
|
2249
|
-
/* @__PURE__ */ (0,
|
|
2436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex flex-col", children: [
|
|
2437
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2250
2438
|
"div",
|
|
2251
2439
|
{
|
|
2252
2440
|
className: cn(
|
|
@@ -2255,7 +2443,7 @@ var CheckBox = (0, import_react9.forwardRef)(
|
|
|
2255
2443
|
disabled ? "opacity-40" : ""
|
|
2256
2444
|
),
|
|
2257
2445
|
children: [
|
|
2258
|
-
/* @__PURE__ */ (0,
|
|
2446
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2259
2447
|
"input",
|
|
2260
2448
|
{
|
|
2261
2449
|
ref,
|
|
@@ -2268,15 +2456,15 @@ var CheckBox = (0, import_react9.forwardRef)(
|
|
|
2268
2456
|
...props
|
|
2269
2457
|
}
|
|
2270
2458
|
),
|
|
2271
|
-
/* @__PURE__ */ (0,
|
|
2272
|
-
label && /* @__PURE__ */ (0,
|
|
2459
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
2460
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2273
2461
|
"div",
|
|
2274
2462
|
{
|
|
2275
2463
|
className: cn(
|
|
2276
2464
|
"flex flex-row items-center",
|
|
2277
2465
|
sizeClasses.labelHeight
|
|
2278
2466
|
),
|
|
2279
|
-
children: /* @__PURE__ */ (0,
|
|
2467
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2280
2468
|
Text_default,
|
|
2281
2469
|
{
|
|
2282
2470
|
as: "label",
|
|
@@ -2295,7 +2483,7 @@ var CheckBox = (0, import_react9.forwardRef)(
|
|
|
2295
2483
|
]
|
|
2296
2484
|
}
|
|
2297
2485
|
),
|
|
2298
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
2486
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2299
2487
|
Text_default,
|
|
2300
2488
|
{
|
|
2301
2489
|
size: "sm",
|
|
@@ -2305,7 +2493,7 @@ var CheckBox = (0, import_react9.forwardRef)(
|
|
|
2305
2493
|
children: errorMessage
|
|
2306
2494
|
}
|
|
2307
2495
|
),
|
|
2308
|
-
helperText && !errorMessage && /* @__PURE__ */ (0,
|
|
2496
|
+
helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2309
2497
|
Text_default,
|
|
2310
2498
|
{
|
|
2311
2499
|
size: "sm",
|
|
@@ -2322,7 +2510,7 @@ CheckBox.displayName = "CheckBox";
|
|
|
2322
2510
|
var CheckBox_default = CheckBox;
|
|
2323
2511
|
|
|
2324
2512
|
// src/components/Divider/Divider.tsx
|
|
2325
|
-
var
|
|
2513
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2326
2514
|
var Divider = ({
|
|
2327
2515
|
orientation = "horizontal",
|
|
2328
2516
|
className = "",
|
|
@@ -2333,7 +2521,7 @@ var Divider = ({
|
|
|
2333
2521
|
horizontal: "w-full h-px",
|
|
2334
2522
|
vertical: "h-full w-px"
|
|
2335
2523
|
};
|
|
2336
|
-
return /* @__PURE__ */ (0,
|
|
2524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2337
2525
|
"hr",
|
|
2338
2526
|
{
|
|
2339
2527
|
className: cn(baseClasses, orientationClasses[orientation], className),
|
|
@@ -2345,7 +2533,7 @@ var Divider = ({
|
|
|
2345
2533
|
var Divider_default = Divider;
|
|
2346
2534
|
|
|
2347
2535
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
2348
|
-
var
|
|
2536
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2349
2537
|
var SIZE_CLASSES5 = {
|
|
2350
2538
|
small: {
|
|
2351
2539
|
container: "h-1",
|
|
@@ -2457,20 +2645,20 @@ var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue,
|
|
|
2457
2645
|
max,
|
|
2458
2646
|
percentage
|
|
2459
2647
|
);
|
|
2460
|
-
return /* @__PURE__ */ (0,
|
|
2648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2461
2649
|
"div",
|
|
2462
2650
|
{
|
|
2463
2651
|
className: cn(
|
|
2464
2652
|
"text-xs font-medium leading-[14px] text-right",
|
|
2465
2653
|
percentageClassName
|
|
2466
2654
|
),
|
|
2467
|
-
children: displayPriority.type === "hitCount" ? /* @__PURE__ */ (0,
|
|
2468
|
-
/* @__PURE__ */ (0,
|
|
2469
|
-
/* @__PURE__ */ (0,
|
|
2655
|
+
children: displayPriority.type === "hitCount" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
2656
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-success-200", children: Math.round(clampedValue) }),
|
|
2657
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "text-text-600", children: [
|
|
2470
2658
|
" de ",
|
|
2471
2659
|
max
|
|
2472
2660
|
] })
|
|
2473
|
-
] }) : /* @__PURE__ */ (0,
|
|
2661
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text_default, { size: "xs", weight: "medium", className: "text-success-200", children: [
|
|
2474
2662
|
Math.round(percentage),
|
|
2475
2663
|
"%"
|
|
2476
2664
|
] })
|
|
@@ -2485,7 +2673,7 @@ var ProgressBarBase = ({
|
|
|
2485
2673
|
variantClasses,
|
|
2486
2674
|
containerClassName,
|
|
2487
2675
|
fillClassName
|
|
2488
|
-
}) => /* @__PURE__ */ (0,
|
|
2676
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2489
2677
|
"div",
|
|
2490
2678
|
{
|
|
2491
2679
|
className: cn(
|
|
@@ -2494,7 +2682,7 @@ var ProgressBarBase = ({
|
|
|
2494
2682
|
"overflow-hidden relative"
|
|
2495
2683
|
),
|
|
2496
2684
|
children: [
|
|
2497
|
-
/* @__PURE__ */ (0,
|
|
2685
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2498
2686
|
"progress",
|
|
2499
2687
|
{
|
|
2500
2688
|
value: clampedValue,
|
|
@@ -2503,7 +2691,7 @@ var ProgressBarBase = ({
|
|
|
2503
2691
|
className: "absolute inset-0 w-full h-full opacity-0"
|
|
2504
2692
|
}
|
|
2505
2693
|
),
|
|
2506
|
-
/* @__PURE__ */ (0,
|
|
2694
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2507
2695
|
"div",
|
|
2508
2696
|
{
|
|
2509
2697
|
className: cn(
|
|
@@ -2529,7 +2717,7 @@ var StackedLayout = ({
|
|
|
2529
2717
|
percentage,
|
|
2530
2718
|
variantClasses,
|
|
2531
2719
|
dimensions
|
|
2532
|
-
}) => /* @__PURE__ */ (0,
|
|
2720
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2533
2721
|
"div",
|
|
2534
2722
|
{
|
|
2535
2723
|
className: cn(
|
|
@@ -2539,8 +2727,8 @@ var StackedLayout = ({
|
|
|
2539
2727
|
className
|
|
2540
2728
|
),
|
|
2541
2729
|
children: [
|
|
2542
|
-
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0,
|
|
2543
|
-
label && /* @__PURE__ */ (0,
|
|
2730
|
+
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
|
|
2731
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2544
2732
|
Text_default,
|
|
2545
2733
|
{
|
|
2546
2734
|
as: "div",
|
|
@@ -2559,7 +2747,7 @@ var StackedLayout = ({
|
|
|
2559
2747
|
percentageClassName
|
|
2560
2748
|
)
|
|
2561
2749
|
] }),
|
|
2562
|
-
/* @__PURE__ */ (0,
|
|
2750
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2563
2751
|
ProgressBarBase,
|
|
2564
2752
|
{
|
|
2565
2753
|
clampedValue,
|
|
@@ -2601,7 +2789,7 @@ var CompactLayout = ({
|
|
|
2601
2789
|
percentageClassName,
|
|
2602
2790
|
labelClassName
|
|
2603
2791
|
});
|
|
2604
|
-
return /* @__PURE__ */ (0,
|
|
2792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2605
2793
|
"div",
|
|
2606
2794
|
{
|
|
2607
2795
|
className: cn(
|
|
@@ -2611,7 +2799,7 @@ var CompactLayout = ({
|
|
|
2611
2799
|
className
|
|
2612
2800
|
),
|
|
2613
2801
|
children: [
|
|
2614
|
-
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0,
|
|
2802
|
+
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2615
2803
|
Text_default,
|
|
2616
2804
|
{
|
|
2617
2805
|
as: "div",
|
|
@@ -2622,7 +2810,7 @@ var CompactLayout = ({
|
|
|
2622
2810
|
children: content
|
|
2623
2811
|
}
|
|
2624
2812
|
),
|
|
2625
|
-
/* @__PURE__ */ (0,
|
|
2813
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2626
2814
|
ProgressBarBase,
|
|
2627
2815
|
{
|
|
2628
2816
|
clampedValue,
|
|
@@ -2658,9 +2846,9 @@ var DefaultLayout = ({
|
|
|
2658
2846
|
label,
|
|
2659
2847
|
showPercentage
|
|
2660
2848
|
);
|
|
2661
|
-
return /* @__PURE__ */ (0,
|
|
2662
|
-
displayConfig.showHeader && /* @__PURE__ */ (0,
|
|
2663
|
-
label && /* @__PURE__ */ (0,
|
|
2849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("flex", sizeClasses.layout, gapClass, className), children: [
|
|
2850
|
+
displayConfig.showHeader && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-row items-center justify-between w-full", children: [
|
|
2851
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2664
2852
|
Text_default,
|
|
2665
2853
|
{
|
|
2666
2854
|
as: "div",
|
|
@@ -2673,7 +2861,7 @@ var DefaultLayout = ({
|
|
|
2673
2861
|
children: label
|
|
2674
2862
|
}
|
|
2675
2863
|
),
|
|
2676
|
-
showPercentage && /* @__PURE__ */ (0,
|
|
2864
|
+
showPercentage && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2677
2865
|
Text_default,
|
|
2678
2866
|
{
|
|
2679
2867
|
size: "xs",
|
|
@@ -2689,7 +2877,7 @@ var DefaultLayout = ({
|
|
|
2689
2877
|
}
|
|
2690
2878
|
)
|
|
2691
2879
|
] }),
|
|
2692
|
-
/* @__PURE__ */ (0,
|
|
2880
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2693
2881
|
ProgressBarBase,
|
|
2694
2882
|
{
|
|
2695
2883
|
clampedValue,
|
|
@@ -2709,7 +2897,7 @@ var DefaultLayout = ({
|
|
|
2709
2897
|
)
|
|
2710
2898
|
}
|
|
2711
2899
|
),
|
|
2712
|
-
displayConfig.showPercentage && /* @__PURE__ */ (0,
|
|
2900
|
+
displayConfig.showPercentage && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2713
2901
|
Text_default,
|
|
2714
2902
|
{
|
|
2715
2903
|
size: "xs",
|
|
@@ -2724,7 +2912,7 @@ var DefaultLayout = ({
|
|
|
2724
2912
|
]
|
|
2725
2913
|
}
|
|
2726
2914
|
),
|
|
2727
|
-
displayConfig.showLabel && /* @__PURE__ */ (0,
|
|
2915
|
+
displayConfig.showLabel && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2728
2916
|
Text_default,
|
|
2729
2917
|
{
|
|
2730
2918
|
as: "div",
|
|
@@ -2760,7 +2948,7 @@ var ProgressBar = ({
|
|
|
2760
2948
|
const sizeClasses = SIZE_CLASSES5[size];
|
|
2761
2949
|
const variantClasses = VARIANT_CLASSES[variant];
|
|
2762
2950
|
if (layout === "stacked") {
|
|
2763
|
-
return /* @__PURE__ */ (0,
|
|
2951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2764
2952
|
StackedLayout,
|
|
2765
2953
|
{
|
|
2766
2954
|
className,
|
|
@@ -2781,7 +2969,7 @@ var ProgressBar = ({
|
|
|
2781
2969
|
);
|
|
2782
2970
|
}
|
|
2783
2971
|
if (layout === "compact") {
|
|
2784
|
-
return /* @__PURE__ */ (0,
|
|
2972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2785
2973
|
CompactLayout,
|
|
2786
2974
|
{
|
|
2787
2975
|
className,
|
|
@@ -2801,7 +2989,7 @@ var ProgressBar = ({
|
|
|
2801
2989
|
}
|
|
2802
2990
|
);
|
|
2803
2991
|
}
|
|
2804
|
-
return /* @__PURE__ */ (0,
|
|
2992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2805
2993
|
DefaultLayout,
|
|
2806
2994
|
{
|
|
2807
2995
|
className,
|
|
@@ -2821,8 +3009,8 @@ var ProgressBar = ({
|
|
|
2821
3009
|
var ProgressBar_default = ProgressBar;
|
|
2822
3010
|
|
|
2823
3011
|
// src/assets/icons/subjects/ChatEN.tsx
|
|
2824
|
-
var
|
|
2825
|
-
var ChatEN = ({ size, color }) => /* @__PURE__ */ (0,
|
|
3012
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3013
|
+
var ChatEN = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2826
3014
|
"svg",
|
|
2827
3015
|
{
|
|
2828
3016
|
width: size,
|
|
@@ -2831,21 +3019,21 @@ var ChatEN = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)
|
|
|
2831
3019
|
fill: "none",
|
|
2832
3020
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2833
3021
|
children: [
|
|
2834
|
-
/* @__PURE__ */ (0,
|
|
3022
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2835
3023
|
"path",
|
|
2836
3024
|
{
|
|
2837
3025
|
d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
|
|
2838
3026
|
fill: color
|
|
2839
3027
|
}
|
|
2840
3028
|
),
|
|
2841
|
-
/* @__PURE__ */ (0,
|
|
3029
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2842
3030
|
"path",
|
|
2843
3031
|
{
|
|
2844
3032
|
d: "M22.5488 12V20.5312H21.0781L17.252 14.4199V20.5312H15.7812V12H17.252L21.0898 18.123V12H22.5488Z",
|
|
2845
3033
|
fill: color
|
|
2846
3034
|
}
|
|
2847
3035
|
),
|
|
2848
|
-
/* @__PURE__ */ (0,
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2849
3037
|
"path",
|
|
2850
3038
|
{
|
|
2851
3039
|
d: "M14.584 19.3652V20.5312H10.0547V19.3652H14.584ZM10.4707 12V20.5312H9V12H10.4707ZM13.9922 15.5625V16.7109H10.0547V15.5625H13.9922ZM14.5547 12V13.1719H10.0547V12H14.5547Z",
|
|
@@ -2857,8 +3045,8 @@ var ChatEN = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)
|
|
|
2857
3045
|
);
|
|
2858
3046
|
|
|
2859
3047
|
// src/assets/icons/subjects/ChatES.tsx
|
|
2860
|
-
var
|
|
2861
|
-
var ChatES = ({ size, color }) => /* @__PURE__ */ (0,
|
|
3048
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3049
|
+
var ChatES = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2862
3050
|
"svg",
|
|
2863
3051
|
{
|
|
2864
3052
|
width: size,
|
|
@@ -2867,21 +3055,21 @@ var ChatES = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)
|
|
|
2867
3055
|
fill: "none",
|
|
2868
3056
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2869
3057
|
children: [
|
|
2870
|
-
/* @__PURE__ */ (0,
|
|
3058
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2871
3059
|
"path",
|
|
2872
3060
|
{
|
|
2873
3061
|
d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
|
|
2874
3062
|
fill: color
|
|
2875
3063
|
}
|
|
2876
3064
|
),
|
|
2877
|
-
/* @__PURE__ */ (0,
|
|
3065
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2878
3066
|
"path",
|
|
2879
3067
|
{
|
|
2880
3068
|
d: "M21.1426 17.8027C21.1426 17.627 21.1152 17.4707 21.0605 17.334C21.0098 17.1973 20.918 17.0723 20.7852 16.959C20.6523 16.8457 20.4648 16.7363 20.2227 16.6309C19.9844 16.5215 19.6797 16.4102 19.3086 16.2969C18.9023 16.1719 18.5273 16.0332 18.1836 15.8809C17.8438 15.7246 17.5469 15.5449 17.293 15.3418C17.0391 15.1348 16.8418 14.8984 16.7012 14.6328C16.5605 14.3633 16.4902 14.0527 16.4902 13.7012C16.4902 13.3535 16.5625 13.0371 16.707 12.752C16.8555 12.4668 17.0645 12.2207 17.334 12.0137C17.6074 11.8027 17.9297 11.6406 18.3008 11.5273C18.6719 11.4102 19.082 11.3516 19.5312 11.3516C20.1641 11.3516 20.709 11.4688 21.166 11.7031C21.627 11.9375 21.9805 12.252 22.2266 12.6465C22.4766 13.041 22.6016 13.4766 22.6016 13.9531H21.1426C21.1426 13.6719 21.082 13.4238 20.9609 13.209C20.8438 12.9902 20.6641 12.8184 20.4219 12.6934C20.1836 12.5684 19.8809 12.5059 19.5137 12.5059C19.166 12.5059 18.877 12.5586 18.6465 12.6641C18.416 12.7695 18.2441 12.9121 18.1309 13.0918C18.0176 13.2715 17.9609 13.4746 17.9609 13.7012C17.9609 13.8613 17.998 14.0078 18.0723 14.1406C18.1465 14.2695 18.2598 14.3906 18.4121 14.5039C18.5645 14.6133 18.7559 14.7168 18.9863 14.8145C19.2168 14.9121 19.4883 15.0059 19.8008 15.0957C20.2734 15.2363 20.6855 15.3926 21.0371 15.5645C21.3887 15.7324 21.6816 15.9238 21.916 16.1387C22.1504 16.3535 22.3262 16.5977 22.4434 16.8711C22.5605 17.1406 22.6191 17.4473 22.6191 17.791C22.6191 18.1504 22.5469 18.4746 22.4023 18.7637C22.2578 19.0488 22.0508 19.293 21.7812 19.4961C21.5156 19.6953 21.1953 19.8496 20.8203 19.959C20.4492 20.0645 20.0352 20.1172 19.5781 20.1172C19.168 20.1172 18.7637 20.0625 18.3652 19.9531C17.9707 19.8438 17.6113 19.6777 17.2871 19.4551C16.9629 19.2285 16.7051 18.9473 16.5137 18.6113C16.3223 18.2715 16.2266 17.875 16.2266 17.4219H17.6973C17.6973 17.6992 17.7441 17.9355 17.8379 18.1309C17.9355 18.3262 18.0703 18.4863 18.2422 18.6113C18.4141 18.7324 18.6133 18.8223 18.8398 18.8809C19.0703 18.9395 19.3164 18.9688 19.5781 18.9688C19.9219 18.9688 20.209 18.9199 20.4395 18.8223C20.6738 18.7246 20.8496 18.5879 20.9668 18.4121C21.084 18.2363 21.1426 18.0332 21.1426 17.8027Z",
|
|
2881
3069
|
fill: color
|
|
2882
3070
|
}
|
|
2883
3071
|
),
|
|
2884
|
-
/* @__PURE__ */ (0,
|
|
3072
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2885
3073
|
"path",
|
|
2886
3074
|
{
|
|
2887
3075
|
d: "M15.4512 18.834V20H10.9219V18.834H15.4512ZM11.3379 11.4688V20H9.86719V11.4688H11.3379ZM14.8594 15.0312V16.1797H10.9219V15.0312H14.8594ZM15.4219 11.4688V12.6406H10.9219V11.4688H15.4219Z",
|
|
@@ -2893,8 +3081,8 @@ var ChatES = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)
|
|
|
2893
3081
|
);
|
|
2894
3082
|
|
|
2895
3083
|
// src/assets/icons/subjects/ChatPT.tsx
|
|
2896
|
-
var
|
|
2897
|
-
var ChatPT = ({ size, color }) => /* @__PURE__ */ (0,
|
|
3084
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3085
|
+
var ChatPT = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2898
3086
|
"svg",
|
|
2899
3087
|
{
|
|
2900
3088
|
width: size,
|
|
@@ -2903,21 +3091,21 @@ var ChatPT = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)
|
|
|
2903
3091
|
fill: "none",
|
|
2904
3092
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2905
3093
|
children: [
|
|
2906
|
-
/* @__PURE__ */ (0,
|
|
3094
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2907
3095
|
"path",
|
|
2908
3096
|
{
|
|
2909
3097
|
d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
|
|
2910
3098
|
fill: color
|
|
2911
3099
|
}
|
|
2912
3100
|
),
|
|
2913
|
-
/* @__PURE__ */ (0,
|
|
3101
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2914
3102
|
"path",
|
|
2915
3103
|
{
|
|
2916
3104
|
d: "M21.1758 12V20.5312H19.7168V12H21.1758ZM23.8535 12V13.1719H17.0625V12H23.8535Z",
|
|
2917
3105
|
fill: color
|
|
2918
3106
|
}
|
|
2919
3107
|
),
|
|
2920
|
-
/* @__PURE__ */ (0,
|
|
3108
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2921
3109
|
"path",
|
|
2922
3110
|
{
|
|
2923
3111
|
d: "M13.2402 17.3496H11.0195V16.1836H13.2402C13.627 16.1836 13.9395 16.1211 14.1777 15.9961C14.416 15.8711 14.5898 15.6992 14.6992 15.4805C14.8125 15.2578 14.8691 15.0039 14.8691 14.7188C14.8691 14.4492 14.8125 14.1973 14.6992 13.9629C14.5898 13.7246 14.416 13.5332 14.1777 13.3887C13.9395 13.2441 13.627 13.1719 13.2402 13.1719H11.4707V20.5312H10V12H13.2402C13.9004 12 14.4609 12.1172 14.9219 12.3516C15.3867 12.582 15.7402 12.9023 15.9824 13.3125C16.2246 13.7188 16.3457 14.1836 16.3457 14.707C16.3457 15.2578 16.2246 15.7305 15.9824 16.125C15.7402 16.5195 15.3867 16.8223 14.9219 17.0332C14.4609 17.2441 13.9004 17.3496 13.2402 17.3496Z",
|
|
@@ -2929,13 +3117,13 @@ var ChatPT = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)
|
|
|
2929
3117
|
);
|
|
2930
3118
|
|
|
2931
3119
|
// src/components/Card/Card.tsx
|
|
2932
|
-
var
|
|
3120
|
+
var import_react12 = require("react");
|
|
2933
3121
|
var import_phosphor_react9 = require("phosphor-react");
|
|
2934
3122
|
|
|
2935
3123
|
// src/components/IconRender/IconRender.tsx
|
|
2936
|
-
var
|
|
3124
|
+
var import_react11 = require("react");
|
|
2937
3125
|
var PhosphorIcons = __toESM(require("phosphor-react"));
|
|
2938
|
-
var
|
|
3126
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2939
3127
|
var IconRender = ({
|
|
2940
3128
|
iconName,
|
|
2941
3129
|
color = "#000000",
|
|
@@ -2945,18 +3133,18 @@ var IconRender = ({
|
|
|
2945
3133
|
if (typeof iconName === "string") {
|
|
2946
3134
|
switch (iconName) {
|
|
2947
3135
|
case "Chat_PT":
|
|
2948
|
-
return /* @__PURE__ */ (0,
|
|
3136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChatPT, { size, color });
|
|
2949
3137
|
case "Chat_EN":
|
|
2950
|
-
return /* @__PURE__ */ (0,
|
|
3138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChatEN, { size, color });
|
|
2951
3139
|
case "Chat_ES":
|
|
2952
|
-
return /* @__PURE__ */ (0,
|
|
3140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChatES, { size, color });
|
|
2953
3141
|
default: {
|
|
2954
3142
|
const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
|
|
2955
|
-
return /* @__PURE__ */ (0,
|
|
3143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IconComponent, { size, color, weight });
|
|
2956
3144
|
}
|
|
2957
3145
|
}
|
|
2958
3146
|
} else {
|
|
2959
|
-
return (0,
|
|
3147
|
+
return (0, import_react11.cloneElement)(iconName, {
|
|
2960
3148
|
size,
|
|
2961
3149
|
color: "currentColor"
|
|
2962
3150
|
});
|
|
@@ -2965,7 +3153,7 @@ var IconRender = ({
|
|
|
2965
3153
|
var IconRender_default = IconRender;
|
|
2966
3154
|
|
|
2967
3155
|
// src/components/Card/Card.tsx
|
|
2968
|
-
var
|
|
3156
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2969
3157
|
var CARD_BASE_CLASSES = {
|
|
2970
3158
|
default: "w-full bg-background border border-border-50 rounded-xl",
|
|
2971
3159
|
compact: "w-full bg-background border border-border-50 rounded-lg",
|
|
@@ -2991,7 +3179,7 @@ var CARD_CURSOR_CLASSES = {
|
|
|
2991
3179
|
default: "",
|
|
2992
3180
|
pointer: "cursor-pointer"
|
|
2993
3181
|
};
|
|
2994
|
-
var CardBase = (0,
|
|
3182
|
+
var CardBase = (0, import_react12.forwardRef)(
|
|
2995
3183
|
({
|
|
2996
3184
|
children,
|
|
2997
3185
|
variant = "default",
|
|
@@ -3007,7 +3195,7 @@ var CardBase = (0, import_react11.forwardRef)(
|
|
|
3007
3195
|
const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
|
|
3008
3196
|
const layoutClasses = CARD_LAYOUT_CLASSES[layout];
|
|
3009
3197
|
const cursorClasses = CARD_CURSOR_CLASSES[cursor];
|
|
3010
|
-
return /* @__PURE__ */ (0,
|
|
3198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3011
3199
|
"div",
|
|
3012
3200
|
{
|
|
3013
3201
|
ref,
|
|
@@ -3049,7 +3237,7 @@ var ACTION_HEADER_CLASSES = {
|
|
|
3049
3237
|
error: "text-error-300",
|
|
3050
3238
|
info: "text-info-300"
|
|
3051
3239
|
};
|
|
3052
|
-
var CardActivitiesResults = (0,
|
|
3240
|
+
var CardActivitiesResults = (0, import_react12.forwardRef)(
|
|
3053
3241
|
({
|
|
3054
3242
|
icon,
|
|
3055
3243
|
title,
|
|
@@ -3065,7 +3253,7 @@ var CardActivitiesResults = (0, import_react11.forwardRef)(
|
|
|
3065
3253
|
const actionIconClasses = ACTION_ICON_CLASSES[action];
|
|
3066
3254
|
const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
|
|
3067
3255
|
const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
|
|
3068
|
-
return /* @__PURE__ */ (0,
|
|
3256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3069
3257
|
"div",
|
|
3070
3258
|
{
|
|
3071
3259
|
ref,
|
|
@@ -3075,7 +3263,7 @@ var CardActivitiesResults = (0, import_react11.forwardRef)(
|
|
|
3075
3263
|
),
|
|
3076
3264
|
...props,
|
|
3077
3265
|
children: [
|
|
3078
|
-
/* @__PURE__ */ (0,
|
|
3266
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3079
3267
|
"div",
|
|
3080
3268
|
{
|
|
3081
3269
|
className: cn(
|
|
@@ -3084,7 +3272,7 @@ var CardActivitiesResults = (0, import_react11.forwardRef)(
|
|
|
3084
3272
|
extended ? "rounded-t-xl" : "rounded-xl"
|
|
3085
3273
|
),
|
|
3086
3274
|
children: [
|
|
3087
|
-
/* @__PURE__ */ (0,
|
|
3275
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3088
3276
|
"span",
|
|
3089
3277
|
{
|
|
3090
3278
|
className: cn(
|
|
@@ -3094,7 +3282,7 @@ var CardActivitiesResults = (0, import_react11.forwardRef)(
|
|
|
3094
3282
|
children: icon
|
|
3095
3283
|
}
|
|
3096
3284
|
),
|
|
3097
|
-
/* @__PURE__ */ (0,
|
|
3285
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3098
3286
|
Text_default,
|
|
3099
3287
|
{
|
|
3100
3288
|
size: "2xs",
|
|
@@ -3103,7 +3291,7 @@ var CardActivitiesResults = (0, import_react11.forwardRef)(
|
|
|
3103
3291
|
children: title
|
|
3104
3292
|
}
|
|
3105
3293
|
),
|
|
3106
|
-
/* @__PURE__ */ (0,
|
|
3294
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3107
3295
|
"p",
|
|
3108
3296
|
{
|
|
3109
3297
|
className: cn("text-lg font-bold truncate", actionSubTitleClasses),
|
|
@@ -3113,8 +3301,8 @@ var CardActivitiesResults = (0, import_react11.forwardRef)(
|
|
|
3113
3301
|
]
|
|
3114
3302
|
}
|
|
3115
3303
|
),
|
|
3116
|
-
extended && /* @__PURE__ */ (0,
|
|
3117
|
-
/* @__PURE__ */ (0,
|
|
3304
|
+
extended && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
|
|
3305
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3118
3306
|
"p",
|
|
3119
3307
|
{
|
|
3120
3308
|
className: cn(
|
|
@@ -3124,14 +3312,14 @@ var CardActivitiesResults = (0, import_react11.forwardRef)(
|
|
|
3124
3312
|
children: header
|
|
3125
3313
|
}
|
|
3126
3314
|
),
|
|
3127
|
-
/* @__PURE__ */ (0,
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Badge_default, { size: "large", action: "info", children: description })
|
|
3128
3316
|
] })
|
|
3129
3317
|
]
|
|
3130
3318
|
}
|
|
3131
3319
|
);
|
|
3132
3320
|
}
|
|
3133
3321
|
);
|
|
3134
|
-
var CardQuestions = (0,
|
|
3322
|
+
var CardQuestions = (0, import_react12.forwardRef)(
|
|
3135
3323
|
({
|
|
3136
3324
|
header,
|
|
3137
3325
|
state = "undone",
|
|
@@ -3143,7 +3331,7 @@ var CardQuestions = (0, import_react11.forwardRef)(
|
|
|
3143
3331
|
const isDone = state === "done";
|
|
3144
3332
|
const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
|
|
3145
3333
|
const buttonLabel = isDone ? "Ver Resultado" : "Responder";
|
|
3146
|
-
return /* @__PURE__ */ (0,
|
|
3334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3147
3335
|
CardBase,
|
|
3148
3336
|
{
|
|
3149
3337
|
ref,
|
|
@@ -3153,9 +3341,9 @@ var CardQuestions = (0, import_react11.forwardRef)(
|
|
|
3153
3341
|
className: cn("justify-between gap-4", className),
|
|
3154
3342
|
...props,
|
|
3155
3343
|
children: [
|
|
3156
|
-
/* @__PURE__ */ (0,
|
|
3157
|
-
/* @__PURE__ */ (0,
|
|
3158
|
-
/* @__PURE__ */ (0,
|
|
3344
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
3345
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
|
|
3346
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex flex-row gap-6 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3159
3347
|
Badge_default,
|
|
3160
3348
|
{
|
|
3161
3349
|
size: "medium",
|
|
@@ -3165,7 +3353,7 @@ var CardQuestions = (0, import_react11.forwardRef)(
|
|
|
3165
3353
|
}
|
|
3166
3354
|
) })
|
|
3167
3355
|
] }),
|
|
3168
|
-
/* @__PURE__ */ (0,
|
|
3356
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3169
3357
|
Button_default,
|
|
3170
3358
|
{
|
|
3171
3359
|
size: "extra-small",
|
|
@@ -3179,7 +3367,7 @@ var CardQuestions = (0, import_react11.forwardRef)(
|
|
|
3179
3367
|
);
|
|
3180
3368
|
}
|
|
3181
3369
|
);
|
|
3182
|
-
var CardProgress = (0,
|
|
3370
|
+
var CardProgress = (0, import_react12.forwardRef)(
|
|
3183
3371
|
({
|
|
3184
3372
|
header,
|
|
3185
3373
|
subhead,
|
|
@@ -3196,19 +3384,19 @@ var CardProgress = (0, import_react11.forwardRef)(
|
|
|
3196
3384
|
}, ref) => {
|
|
3197
3385
|
const isHorizontal = direction === "horizontal";
|
|
3198
3386
|
const contentComponent = {
|
|
3199
|
-
horizontal: /* @__PURE__ */ (0,
|
|
3200
|
-
showDates && /* @__PURE__ */ (0,
|
|
3201
|
-
initialDate && /* @__PURE__ */ (0,
|
|
3202
|
-
/* @__PURE__ */ (0,
|
|
3203
|
-
/* @__PURE__ */ (0,
|
|
3387
|
+
horizontal: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
3388
|
+
showDates && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-row gap-6 items-center", children: [
|
|
3389
|
+
initialDate && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
|
|
3390
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
|
|
3391
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-600", children: initialDate })
|
|
3204
3392
|
] }),
|
|
3205
|
-
endDate && /* @__PURE__ */ (0,
|
|
3206
|
-
/* @__PURE__ */ (0,
|
|
3207
|
-
/* @__PURE__ */ (0,
|
|
3393
|
+
endDate && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
|
|
3394
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-800 font-semibold", children: "Fim" }),
|
|
3395
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-600", children: endDate })
|
|
3208
3396
|
] })
|
|
3209
3397
|
] }),
|
|
3210
|
-
/* @__PURE__ */ (0,
|
|
3211
|
-
/* @__PURE__ */ (0,
|
|
3398
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
|
|
3399
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3212
3400
|
ProgressBar_default,
|
|
3213
3401
|
{
|
|
3214
3402
|
size: "small",
|
|
@@ -3217,7 +3405,7 @@ var CardProgress = (0, import_react11.forwardRef)(
|
|
|
3217
3405
|
"data-testid": "progress-bar"
|
|
3218
3406
|
}
|
|
3219
3407
|
),
|
|
3220
|
-
/* @__PURE__ */ (0,
|
|
3408
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3221
3409
|
Text_default,
|
|
3222
3410
|
{
|
|
3223
3411
|
size: "xs",
|
|
@@ -3233,9 +3421,9 @@ var CardProgress = (0, import_react11.forwardRef)(
|
|
|
3233
3421
|
)
|
|
3234
3422
|
] })
|
|
3235
3423
|
] }),
|
|
3236
|
-
vertical: /* @__PURE__ */ (0,
|
|
3424
|
+
vertical: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-text-800", children: subhead })
|
|
3237
3425
|
};
|
|
3238
|
-
return /* @__PURE__ */ (0,
|
|
3426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3239
3427
|
CardBase,
|
|
3240
3428
|
{
|
|
3241
3429
|
ref,
|
|
@@ -3246,7 +3434,7 @@ var CardProgress = (0, import_react11.forwardRef)(
|
|
|
3246
3434
|
className: cn(isHorizontal ? "h-20" : "", className),
|
|
3247
3435
|
...props,
|
|
3248
3436
|
children: [
|
|
3249
|
-
/* @__PURE__ */ (0,
|
|
3437
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3250
3438
|
"div",
|
|
3251
3439
|
{
|
|
3252
3440
|
className: cn(
|
|
@@ -3259,7 +3447,7 @@ var CardProgress = (0, import_react11.forwardRef)(
|
|
|
3259
3447
|
children: icon
|
|
3260
3448
|
}
|
|
3261
3449
|
),
|
|
3262
|
-
/* @__PURE__ */ (0,
|
|
3450
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3263
3451
|
"div",
|
|
3264
3452
|
{
|
|
3265
3453
|
className: cn(
|
|
@@ -3267,7 +3455,7 @@ var CardProgress = (0, import_react11.forwardRef)(
|
|
|
3267
3455
|
!isHorizontal && "gap-4"
|
|
3268
3456
|
),
|
|
3269
3457
|
children: [
|
|
3270
|
-
/* @__PURE__ */ (0,
|
|
3458
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
|
|
3271
3459
|
contentComponent[direction]
|
|
3272
3460
|
]
|
|
3273
3461
|
}
|
|
@@ -3277,7 +3465,7 @@ var CardProgress = (0, import_react11.forwardRef)(
|
|
|
3277
3465
|
);
|
|
3278
3466
|
}
|
|
3279
3467
|
);
|
|
3280
|
-
var CardTopic = (0,
|
|
3468
|
+
var CardTopic = (0, import_react12.forwardRef)(
|
|
3281
3469
|
({
|
|
3282
3470
|
header,
|
|
3283
3471
|
subHead,
|
|
@@ -3287,7 +3475,7 @@ var CardTopic = (0, import_react11.forwardRef)(
|
|
|
3287
3475
|
className = "",
|
|
3288
3476
|
...props
|
|
3289
3477
|
}, ref) => {
|
|
3290
|
-
return /* @__PURE__ */ (0,
|
|
3478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3291
3479
|
CardBase,
|
|
3292
3480
|
{
|
|
3293
3481
|
ref,
|
|
@@ -3298,13 +3486,13 @@ var CardTopic = (0, import_react11.forwardRef)(
|
|
|
3298
3486
|
className: cn("justify-center gap-2 py-2 px-4", className),
|
|
3299
3487
|
...props,
|
|
3300
3488
|
children: [
|
|
3301
|
-
subHead && /* @__PURE__ */ (0,
|
|
3302
|
-
/* @__PURE__ */ (0,
|
|
3303
|
-
index < subHead.length - 1 && /* @__PURE__ */ (0,
|
|
3489
|
+
subHead && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react12.Fragment, { children: [
|
|
3490
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: text }),
|
|
3491
|
+
index < subHead.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "\u2022" })
|
|
3304
3492
|
] }, `${text} - ${index}`)) }),
|
|
3305
|
-
/* @__PURE__ */ (0,
|
|
3306
|
-
/* @__PURE__ */ (0,
|
|
3307
|
-
/* @__PURE__ */ (0,
|
|
3493
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
|
|
3494
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
|
|
3495
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3308
3496
|
ProgressBar_default,
|
|
3309
3497
|
{
|
|
3310
3498
|
size: "small",
|
|
@@ -3313,7 +3501,7 @@ var CardTopic = (0, import_react11.forwardRef)(
|
|
|
3313
3501
|
"data-testid": "progress-bar"
|
|
3314
3502
|
}
|
|
3315
3503
|
),
|
|
3316
|
-
showPercentage && /* @__PURE__ */ (0,
|
|
3504
|
+
showPercentage && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3317
3505
|
Text_default,
|
|
3318
3506
|
{
|
|
3319
3507
|
size: "xs",
|
|
@@ -3333,7 +3521,7 @@ var CardTopic = (0, import_react11.forwardRef)(
|
|
|
3333
3521
|
);
|
|
3334
3522
|
}
|
|
3335
3523
|
);
|
|
3336
|
-
var CardPerformance = (0,
|
|
3524
|
+
var CardPerformance = (0, import_react12.forwardRef)(
|
|
3337
3525
|
({
|
|
3338
3526
|
header,
|
|
3339
3527
|
progress,
|
|
@@ -3347,7 +3535,7 @@ var CardPerformance = (0, import_react11.forwardRef)(
|
|
|
3347
3535
|
...props
|
|
3348
3536
|
}, ref) => {
|
|
3349
3537
|
const hasProgress = progress !== void 0;
|
|
3350
|
-
return /* @__PURE__ */ (0,
|
|
3538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3351
3539
|
CardBase,
|
|
3352
3540
|
{
|
|
3353
3541
|
ref,
|
|
@@ -3361,10 +3549,10 @@ var CardPerformance = (0, import_react11.forwardRef)(
|
|
|
3361
3549
|
onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
|
|
3362
3550
|
...props,
|
|
3363
3551
|
children: [
|
|
3364
|
-
/* @__PURE__ */ (0,
|
|
3365
|
-
/* @__PURE__ */ (0,
|
|
3366
|
-
/* @__PURE__ */ (0,
|
|
3367
|
-
actionVariant === "button" && /* @__PURE__ */ (0,
|
|
3552
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w-full flex flex-col justify-between gap-2", children: [
|
|
3553
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-row justify-between items-center gap-2", children: [
|
|
3554
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
3555
|
+
actionVariant === "button" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3368
3556
|
Button_default,
|
|
3369
3557
|
{
|
|
3370
3558
|
variant: "outline",
|
|
@@ -3375,16 +3563,16 @@ var CardPerformance = (0, import_react11.forwardRef)(
|
|
|
3375
3563
|
}
|
|
3376
3564
|
)
|
|
3377
3565
|
] }),
|
|
3378
|
-
/* @__PURE__ */ (0,
|
|
3566
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3379
3567
|
ProgressBar_default,
|
|
3380
3568
|
{
|
|
3381
3569
|
value: progress,
|
|
3382
3570
|
label: `${progress}% ${labelProgress}`,
|
|
3383
3571
|
variant: progressVariant
|
|
3384
3572
|
}
|
|
3385
|
-
) : /* @__PURE__ */ (0,
|
|
3573
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs text-text-600 truncate", children: description }) })
|
|
3386
3574
|
] }),
|
|
3387
|
-
actionVariant == "caret" && /* @__PURE__ */ (0,
|
|
3575
|
+
actionVariant == "caret" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3388
3576
|
import_phosphor_react9.CaretRight,
|
|
3389
3577
|
{
|
|
3390
3578
|
className: "size-4.5 text-text-800 cursor-pointer",
|
|
@@ -3396,7 +3584,7 @@ var CardPerformance = (0, import_react11.forwardRef)(
|
|
|
3396
3584
|
);
|
|
3397
3585
|
}
|
|
3398
3586
|
);
|
|
3399
|
-
var CardResults = (0,
|
|
3587
|
+
var CardResults = (0, import_react12.forwardRef)(
|
|
3400
3588
|
({
|
|
3401
3589
|
header,
|
|
3402
3590
|
correct_answers,
|
|
@@ -3408,7 +3596,7 @@ var CardResults = (0, import_react11.forwardRef)(
|
|
|
3408
3596
|
...props
|
|
3409
3597
|
}, ref) => {
|
|
3410
3598
|
const isRow = direction == "row";
|
|
3411
|
-
return /* @__PURE__ */ (0,
|
|
3599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3412
3600
|
CardBase,
|
|
3413
3601
|
{
|
|
3414
3602
|
ref,
|
|
@@ -3418,7 +3606,7 @@ var CardResults = (0, import_react11.forwardRef)(
|
|
|
3418
3606
|
className: cn("items-stretch cursor-pointer pr-4", className),
|
|
3419
3607
|
...props,
|
|
3420
3608
|
children: [
|
|
3421
|
-
/* @__PURE__ */ (0,
|
|
3609
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3422
3610
|
"div",
|
|
3423
3611
|
{
|
|
3424
3612
|
className: cn(
|
|
@@ -3427,11 +3615,11 @@ var CardResults = (0, import_react11.forwardRef)(
|
|
|
3427
3615
|
style: {
|
|
3428
3616
|
backgroundColor: color
|
|
3429
3617
|
},
|
|
3430
|
-
children: /* @__PURE__ */ (0,
|
|
3618
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconRender_default, { iconName: icon, color: "currentColor", size: 20 })
|
|
3431
3619
|
}
|
|
3432
3620
|
),
|
|
3433
|
-
/* @__PURE__ */ (0,
|
|
3434
|
-
/* @__PURE__ */ (0,
|
|
3621
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w-full flex flex-row justify-between items-center", children: [
|
|
3622
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3435
3623
|
"div",
|
|
3436
3624
|
{
|
|
3437
3625
|
className: cn(
|
|
@@ -3439,28 +3627,28 @@ var CardResults = (0, import_react11.forwardRef)(
|
|
|
3439
3627
|
isRow ? "flex-row items-center gap-2" : "flex-col"
|
|
3440
3628
|
),
|
|
3441
3629
|
children: [
|
|
3442
|
-
/* @__PURE__ */ (0,
|
|
3443
|
-
/* @__PURE__ */ (0,
|
|
3444
|
-
/* @__PURE__ */ (0,
|
|
3630
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm font-bold text-text-950 flex-1", children: header }),
|
|
3631
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "flex flex-wrap flex-row gap-1 items-center", children: [
|
|
3632
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3445
3633
|
Badge_default,
|
|
3446
3634
|
{
|
|
3447
3635
|
action: "success",
|
|
3448
3636
|
variant: "solid",
|
|
3449
3637
|
size: "large",
|
|
3450
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
3638
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.CheckCircle, {}),
|
|
3451
3639
|
children: [
|
|
3452
3640
|
correct_answers,
|
|
3453
3641
|
" Corretas"
|
|
3454
3642
|
]
|
|
3455
3643
|
}
|
|
3456
3644
|
),
|
|
3457
|
-
/* @__PURE__ */ (0,
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3458
3646
|
Badge_default,
|
|
3459
3647
|
{
|
|
3460
3648
|
action: "error",
|
|
3461
3649
|
variant: "solid",
|
|
3462
3650
|
size: "large",
|
|
3463
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
3651
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.XCircle, {}),
|
|
3464
3652
|
children: [
|
|
3465
3653
|
incorrect_answers,
|
|
3466
3654
|
" Incorretas"
|
|
@@ -3471,14 +3659,14 @@ var CardResults = (0, import_react11.forwardRef)(
|
|
|
3471
3659
|
]
|
|
3472
3660
|
}
|
|
3473
3661
|
),
|
|
3474
|
-
/* @__PURE__ */ (0,
|
|
3662
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.CaretRight, { className: "min-w-6 min-h-6 text-text-800" })
|
|
3475
3663
|
] })
|
|
3476
3664
|
]
|
|
3477
3665
|
}
|
|
3478
3666
|
);
|
|
3479
3667
|
}
|
|
3480
3668
|
);
|
|
3481
|
-
var CardStatus = (0,
|
|
3669
|
+
var CardStatus = (0, import_react12.forwardRef)(
|
|
3482
3670
|
({ header, className, status, label, ...props }, ref) => {
|
|
3483
3671
|
const getLabelBadge = (status2) => {
|
|
3484
3672
|
switch (status2) {
|
|
@@ -3497,13 +3685,13 @@ var CardStatus = (0, import_react11.forwardRef)(
|
|
|
3497
3685
|
const getIconBadge = (status2) => {
|
|
3498
3686
|
switch (status2) {
|
|
3499
3687
|
case "correct":
|
|
3500
|
-
return /* @__PURE__ */ (0,
|
|
3688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.CheckCircle, {});
|
|
3501
3689
|
case "incorrect":
|
|
3502
|
-
return /* @__PURE__ */ (0,
|
|
3690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.XCircle, {});
|
|
3503
3691
|
case "pending":
|
|
3504
|
-
return /* @__PURE__ */ (0,
|
|
3692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.Clock, {});
|
|
3505
3693
|
default:
|
|
3506
|
-
return /* @__PURE__ */ (0,
|
|
3694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.XCircle, {});
|
|
3507
3695
|
}
|
|
3508
3696
|
};
|
|
3509
3697
|
const getActionBadge = (status2) => {
|
|
@@ -3518,7 +3706,7 @@ var CardStatus = (0, import_react11.forwardRef)(
|
|
|
3518
3706
|
return "info";
|
|
3519
3707
|
}
|
|
3520
3708
|
};
|
|
3521
|
-
return /* @__PURE__ */ (0,
|
|
3709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3522
3710
|
CardBase,
|
|
3523
3711
|
{
|
|
3524
3712
|
ref,
|
|
@@ -3527,10 +3715,10 @@ var CardStatus = (0, import_react11.forwardRef)(
|
|
|
3527
3715
|
minHeight: "medium",
|
|
3528
3716
|
className: cn("items-center cursor-pointer", className),
|
|
3529
3717
|
...props,
|
|
3530
|
-
children: /* @__PURE__ */ (0,
|
|
3531
|
-
/* @__PURE__ */ (0,
|
|
3532
|
-
/* @__PURE__ */ (0,
|
|
3533
|
-
status && /* @__PURE__ */ (0,
|
|
3718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
|
|
3719
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
3720
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
|
|
3721
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3534
3722
|
Badge_default,
|
|
3535
3723
|
{
|
|
3536
3724
|
action: getActionBadge(status),
|
|
@@ -3540,17 +3728,17 @@ var CardStatus = (0, import_react11.forwardRef)(
|
|
|
3540
3728
|
children: getLabelBadge(status)
|
|
3541
3729
|
}
|
|
3542
3730
|
),
|
|
3543
|
-
label && /* @__PURE__ */ (0,
|
|
3731
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-text-800", children: label })
|
|
3544
3732
|
] }),
|
|
3545
|
-
/* @__PURE__ */ (0,
|
|
3733
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.CaretRight, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
|
|
3546
3734
|
] })
|
|
3547
3735
|
}
|
|
3548
3736
|
);
|
|
3549
3737
|
}
|
|
3550
3738
|
);
|
|
3551
|
-
var CardSettings = (0,
|
|
3739
|
+
var CardSettings = (0, import_react12.forwardRef)(
|
|
3552
3740
|
({ header, className, icon, ...props }, ref) => {
|
|
3553
|
-
return /* @__PURE__ */ (0,
|
|
3741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3554
3742
|
CardBase,
|
|
3555
3743
|
{
|
|
3556
3744
|
ref,
|
|
@@ -3563,17 +3751,17 @@ var CardSettings = (0, import_react11.forwardRef)(
|
|
|
3563
3751
|
),
|
|
3564
3752
|
...props,
|
|
3565
3753
|
children: [
|
|
3566
|
-
/* @__PURE__ */ (0,
|
|
3567
|
-
/* @__PURE__ */ (0,
|
|
3568
|
-
/* @__PURE__ */ (0,
|
|
3754
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "[&>svg]:size-6", children: icon }),
|
|
3755
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "w-full text-sm truncate", children: header }),
|
|
3756
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.CaretRight, { size: 24, className: "cursor-pointer" })
|
|
3569
3757
|
]
|
|
3570
3758
|
}
|
|
3571
3759
|
);
|
|
3572
3760
|
}
|
|
3573
3761
|
);
|
|
3574
|
-
var CardSupport = (0,
|
|
3762
|
+
var CardSupport = (0, import_react12.forwardRef)(
|
|
3575
3763
|
({ header, className, direction = "col", children, ...props }, ref) => {
|
|
3576
|
-
return /* @__PURE__ */ (0,
|
|
3764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3577
3765
|
CardBase,
|
|
3578
3766
|
{
|
|
3579
3767
|
ref,
|
|
@@ -3586,7 +3774,7 @@ var CardSupport = (0, import_react11.forwardRef)(
|
|
|
3586
3774
|
),
|
|
3587
3775
|
...props,
|
|
3588
3776
|
children: [
|
|
3589
|
-
/* @__PURE__ */ (0,
|
|
3777
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3590
3778
|
"div",
|
|
3591
3779
|
{
|
|
3592
3780
|
className: cn(
|
|
@@ -3594,18 +3782,18 @@ var CardSupport = (0, import_react11.forwardRef)(
|
|
|
3594
3782
|
direction == "col" ? "flex-col" : "flex-row items-center"
|
|
3595
3783
|
),
|
|
3596
3784
|
children: [
|
|
3597
|
-
/* @__PURE__ */ (0,
|
|
3598
|
-
/* @__PURE__ */ (0,
|
|
3785
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "flex flex-row gap-1", children })
|
|
3599
3787
|
]
|
|
3600
3788
|
}
|
|
3601
3789
|
),
|
|
3602
|
-
/* @__PURE__ */ (0,
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.CaretRight, { className: "text-text-800 cursor-pointer", size: 24 })
|
|
3603
3791
|
]
|
|
3604
3792
|
}
|
|
3605
3793
|
);
|
|
3606
3794
|
}
|
|
3607
3795
|
);
|
|
3608
|
-
var CardForum = (0,
|
|
3796
|
+
var CardForum = (0, import_react12.forwardRef)(
|
|
3609
3797
|
({
|
|
3610
3798
|
title,
|
|
3611
3799
|
content,
|
|
@@ -3619,7 +3807,7 @@ var CardForum = (0, import_react11.forwardRef)(
|
|
|
3619
3807
|
hour,
|
|
3620
3808
|
...props
|
|
3621
3809
|
}, ref) => {
|
|
3622
|
-
return /* @__PURE__ */ (0,
|
|
3810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3623
3811
|
CardBase,
|
|
3624
3812
|
{
|
|
3625
3813
|
ref,
|
|
@@ -3630,7 +3818,7 @@ var CardForum = (0, import_react11.forwardRef)(
|
|
|
3630
3818
|
className: cn("w-auto h-auto gap-3", className),
|
|
3631
3819
|
...props,
|
|
3632
3820
|
children: [
|
|
3633
|
-
/* @__PURE__ */ (0,
|
|
3821
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3634
3822
|
"button",
|
|
3635
3823
|
{
|
|
3636
3824
|
type: "button",
|
|
@@ -3639,18 +3827,18 @@ var CardForum = (0, import_react11.forwardRef)(
|
|
|
3639
3827
|
className: "min-w-8 h-8 rounded-full bg-background-950"
|
|
3640
3828
|
}
|
|
3641
3829
|
),
|
|
3642
|
-
/* @__PURE__ */ (0,
|
|
3643
|
-
/* @__PURE__ */ (0,
|
|
3644
|
-
/* @__PURE__ */ (0,
|
|
3645
|
-
/* @__PURE__ */ (0,
|
|
3830
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
|
|
3831
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
|
|
3832
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
|
|
3833
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "text-xs text-text-600", children: [
|
|
3646
3834
|
"\u2022 ",
|
|
3647
3835
|
date,
|
|
3648
3836
|
" \u2022 ",
|
|
3649
3837
|
hour
|
|
3650
3838
|
] })
|
|
3651
3839
|
] }),
|
|
3652
|
-
/* @__PURE__ */ (0,
|
|
3653
|
-
/* @__PURE__ */ (0,
|
|
3840
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
|
|
3841
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3654
3842
|
"button",
|
|
3655
3843
|
{
|
|
3656
3844
|
type: "button",
|
|
@@ -3658,8 +3846,8 @@ var CardForum = (0, import_react11.forwardRef)(
|
|
|
3658
3846
|
onClick: () => onClickComments?.(valueComments),
|
|
3659
3847
|
className: "text-text-600 flex flex-row gap-2 items-center",
|
|
3660
3848
|
children: [
|
|
3661
|
-
/* @__PURE__ */ (0,
|
|
3662
|
-
/* @__PURE__ */ (0,
|
|
3849
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.ChatCircleText, { "aria-hidden": "true", size: 16 }),
|
|
3850
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "text-xs", children: [
|
|
3663
3851
|
comments,
|
|
3664
3852
|
" respostas"
|
|
3665
3853
|
] })
|
|
@@ -3672,7 +3860,7 @@ var CardForum = (0, import_react11.forwardRef)(
|
|
|
3672
3860
|
);
|
|
3673
3861
|
}
|
|
3674
3862
|
);
|
|
3675
|
-
var CardAudio = (0,
|
|
3863
|
+
var CardAudio = (0, import_react12.forwardRef)(
|
|
3676
3864
|
({
|
|
3677
3865
|
src,
|
|
3678
3866
|
title,
|
|
@@ -3686,16 +3874,16 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3686
3874
|
className,
|
|
3687
3875
|
...props
|
|
3688
3876
|
}, ref) => {
|
|
3689
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
3690
|
-
const [currentTime, setCurrentTime] = (0,
|
|
3691
|
-
const [duration, setDuration] = (0,
|
|
3692
|
-
const [volume, setVolume] = (0,
|
|
3693
|
-
const [showVolumeControl, setShowVolumeControl] = (0,
|
|
3694
|
-
const [showSpeedMenu, setShowSpeedMenu] = (0,
|
|
3695
|
-
const [playbackRate, setPlaybackRate] = (0,
|
|
3696
|
-
const audioRef = (0,
|
|
3697
|
-
const volumeControlRef = (0,
|
|
3698
|
-
const speedMenuRef = (0,
|
|
3877
|
+
const [isPlaying, setIsPlaying] = (0, import_react12.useState)(false);
|
|
3878
|
+
const [currentTime, setCurrentTime] = (0, import_react12.useState)(0);
|
|
3879
|
+
const [duration, setDuration] = (0, import_react12.useState)(0);
|
|
3880
|
+
const [volume, setVolume] = (0, import_react12.useState)(1);
|
|
3881
|
+
const [showVolumeControl, setShowVolumeControl] = (0, import_react12.useState)(false);
|
|
3882
|
+
const [showSpeedMenu, setShowSpeedMenu] = (0, import_react12.useState)(false);
|
|
3883
|
+
const [playbackRate, setPlaybackRate] = (0, import_react12.useState)(1);
|
|
3884
|
+
const audioRef = (0, import_react12.useRef)(null);
|
|
3885
|
+
const volumeControlRef = (0, import_react12.useRef)(null);
|
|
3886
|
+
const speedMenuRef = (0, import_react12.useRef)(null);
|
|
3699
3887
|
const formatTime = (time) => {
|
|
3700
3888
|
const minutes = Math.floor(time / 60);
|
|
3701
3889
|
const seconds = Math.floor(time % 60);
|
|
@@ -3762,14 +3950,14 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3762
3950
|
};
|
|
3763
3951
|
const getVolumeIcon = () => {
|
|
3764
3952
|
if (volume === 0) {
|
|
3765
|
-
return /* @__PURE__ */ (0,
|
|
3953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.SpeakerSimpleX, { size: 24 });
|
|
3766
3954
|
}
|
|
3767
3955
|
if (volume < 0.5) {
|
|
3768
|
-
return /* @__PURE__ */ (0,
|
|
3956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.SpeakerLow, { size: 24 });
|
|
3769
3957
|
}
|
|
3770
|
-
return /* @__PURE__ */ (0,
|
|
3958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.SpeakerHigh, { size: 24 });
|
|
3771
3959
|
};
|
|
3772
|
-
(0,
|
|
3960
|
+
(0, import_react12.useEffect)(() => {
|
|
3773
3961
|
const handleClickOutside = (event) => {
|
|
3774
3962
|
if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
|
|
3775
3963
|
setShowVolumeControl(false);
|
|
@@ -3783,7 +3971,7 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3783
3971
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
3784
3972
|
};
|
|
3785
3973
|
}, []);
|
|
3786
|
-
return /* @__PURE__ */ (0,
|
|
3974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3787
3975
|
CardBase,
|
|
3788
3976
|
{
|
|
3789
3977
|
ref,
|
|
@@ -3796,7 +3984,7 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3796
3984
|
),
|
|
3797
3985
|
...props,
|
|
3798
3986
|
children: [
|
|
3799
|
-
/* @__PURE__ */ (0,
|
|
3987
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3800
3988
|
"audio",
|
|
3801
3989
|
{
|
|
3802
3990
|
ref: audioRef,
|
|
@@ -3808,7 +3996,7 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3808
3996
|
onEnded: handleEnded,
|
|
3809
3997
|
"data-testid": "audio-element",
|
|
3810
3998
|
"aria-label": title,
|
|
3811
|
-
children: tracks ? tracks.map((track) => /* @__PURE__ */ (0,
|
|
3999
|
+
children: tracks ? tracks.map((track) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3812
4000
|
"track",
|
|
3813
4001
|
{
|
|
3814
4002
|
kind: track.kind,
|
|
@@ -3818,7 +4006,7 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3818
4006
|
default: track.default
|
|
3819
4007
|
},
|
|
3820
4008
|
track.src
|
|
3821
|
-
)) : /* @__PURE__ */ (0,
|
|
4009
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3822
4010
|
"track",
|
|
3823
4011
|
{
|
|
3824
4012
|
kind: "captions",
|
|
@@ -3829,7 +4017,7 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3829
4017
|
)
|
|
3830
4018
|
}
|
|
3831
4019
|
),
|
|
3832
|
-
/* @__PURE__ */ (0,
|
|
4020
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3833
4021
|
"button",
|
|
3834
4022
|
{
|
|
3835
4023
|
type: "button",
|
|
@@ -3837,14 +4025,14 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3837
4025
|
disabled: !src,
|
|
3838
4026
|
className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
|
|
3839
4027
|
"aria-label": isPlaying ? "Pausar" : "Reproduzir",
|
|
3840
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
3841
|
-
/* @__PURE__ */ (0,
|
|
3842
|
-
/* @__PURE__ */ (0,
|
|
3843
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
4028
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex gap-0.5", children: [
|
|
4029
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" }),
|
|
4030
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-1 h-4 bg-current rounded-sm" })
|
|
4031
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.Play, { size: 24 })
|
|
3844
4032
|
}
|
|
3845
4033
|
),
|
|
3846
|
-
/* @__PURE__ */ (0,
|
|
3847
|
-
/* @__PURE__ */ (0,
|
|
4034
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(currentTime) }),
|
|
4035
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3848
4036
|
"button",
|
|
3849
4037
|
{
|
|
3850
4038
|
type: "button",
|
|
@@ -3859,7 +4047,7 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3859
4047
|
}
|
|
3860
4048
|
},
|
|
3861
4049
|
"aria-label": "Barra de progresso do \xE1udio",
|
|
3862
|
-
children: /* @__PURE__ */ (0,
|
|
4050
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3863
4051
|
"div",
|
|
3864
4052
|
{
|
|
3865
4053
|
className: "h-full bg-primary-600 rounded-full transition-all duration-100",
|
|
@@ -3870,19 +4058,19 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3870
4058
|
)
|
|
3871
4059
|
}
|
|
3872
4060
|
) }),
|
|
3873
|
-
/* @__PURE__ */ (0,
|
|
3874
|
-
/* @__PURE__ */ (0,
|
|
3875
|
-
/* @__PURE__ */ (0,
|
|
4061
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(duration) }),
|
|
4062
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative h-6", ref: volumeControlRef, children: [
|
|
4063
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3876
4064
|
"button",
|
|
3877
4065
|
{
|
|
3878
4066
|
type: "button",
|
|
3879
4067
|
onClick: toggleVolumeControl,
|
|
3880
4068
|
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
3881
4069
|
"aria-label": "Controle de volume",
|
|
3882
|
-
children: /* @__PURE__ */ (0,
|
|
4070
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
|
|
3883
4071
|
}
|
|
3884
4072
|
),
|
|
3885
|
-
showVolumeControl && /* @__PURE__ */ (0,
|
|
4073
|
+
showVolumeControl && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3886
4074
|
"button",
|
|
3887
4075
|
{
|
|
3888
4076
|
type: "button",
|
|
@@ -3892,7 +4080,7 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3892
4080
|
setShowVolumeControl(false);
|
|
3893
4081
|
}
|
|
3894
4082
|
},
|
|
3895
|
-
children: /* @__PURE__ */ (0,
|
|
4083
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3896
4084
|
"input",
|
|
3897
4085
|
{
|
|
3898
4086
|
type: "range",
|
|
@@ -3933,22 +4121,22 @@ var CardAudio = (0, import_react11.forwardRef)(
|
|
|
3933
4121
|
}
|
|
3934
4122
|
)
|
|
3935
4123
|
] }),
|
|
3936
|
-
/* @__PURE__ */ (0,
|
|
3937
|
-
/* @__PURE__ */ (0,
|
|
4124
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative h-6", ref: speedMenuRef, children: [
|
|
4125
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3938
4126
|
"button",
|
|
3939
4127
|
{
|
|
3940
4128
|
type: "button",
|
|
3941
4129
|
onClick: toggleSpeedMenu,
|
|
3942
4130
|
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
3943
4131
|
"aria-label": "Op\xE7\xF5es de velocidade",
|
|
3944
|
-
children: /* @__PURE__ */ (0,
|
|
4132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.DotsThreeVertical, { size: 24 })
|
|
3945
4133
|
}
|
|
3946
4134
|
),
|
|
3947
|
-
showSpeedMenu && /* @__PURE__ */ (0,
|
|
4135
|
+
showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg min-w-24 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex flex-col gap-1", children: [
|
|
3948
4136
|
{ speed: 1, label: "1x" },
|
|
3949
4137
|
{ speed: 1.5, label: "1.5x" },
|
|
3950
4138
|
{ speed: 2, label: "2x" }
|
|
3951
|
-
].map(({ speed, label }) => /* @__PURE__ */ (0,
|
|
4139
|
+
].map(({ speed, label }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3952
4140
|
"button",
|
|
3953
4141
|
{
|
|
3954
4142
|
type: "button",
|
|
@@ -3973,10 +4161,10 @@ var SIMULADO_BACKGROUND_CLASSES = {
|
|
|
3973
4161
|
simuladao: "bg-exam-3",
|
|
3974
4162
|
vestibular: "bg-exam-4"
|
|
3975
4163
|
};
|
|
3976
|
-
var CardSimulado = (0,
|
|
4164
|
+
var CardSimulado = (0, import_react12.forwardRef)(
|
|
3977
4165
|
({ title, duration, info, backgroundColor, className, ...props }, ref) => {
|
|
3978
4166
|
const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
|
|
3979
|
-
return /* @__PURE__ */ (0,
|
|
4167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3980
4168
|
CardBase,
|
|
3981
4169
|
{
|
|
3982
4170
|
ref,
|
|
@@ -3989,18 +4177,18 @@ var CardSimulado = (0, import_react11.forwardRef)(
|
|
|
3989
4177
|
className
|
|
3990
4178
|
),
|
|
3991
4179
|
...props,
|
|
3992
|
-
children: /* @__PURE__ */ (0,
|
|
3993
|
-
/* @__PURE__ */ (0,
|
|
3994
|
-
/* @__PURE__ */ (0,
|
|
3995
|
-
/* @__PURE__ */ (0,
|
|
3996
|
-
duration && /* @__PURE__ */ (0,
|
|
3997
|
-
/* @__PURE__ */ (0,
|
|
3998
|
-
/* @__PURE__ */ (0,
|
|
4180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex justify-between items-center w-full gap-4", children: [
|
|
4181
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
4182
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
|
|
4183
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-4 text-text-700", children: [
|
|
4184
|
+
duration && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
4185
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.Clock, { size: 16, className: "flex-shrink-0" }),
|
|
4186
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text_default, { size: "sm", children: duration })
|
|
3999
4187
|
] }),
|
|
4000
|
-
/* @__PURE__ */ (0,
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text_default, { size: "sm", className: "truncate", children: info })
|
|
4001
4189
|
] })
|
|
4002
4190
|
] }),
|
|
4003
|
-
/* @__PURE__ */ (0,
|
|
4191
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4004
4192
|
import_phosphor_react9.CaretRight,
|
|
4005
4193
|
{
|
|
4006
4194
|
size: 24,
|
|
@@ -4013,7 +4201,7 @@ var CardSimulado = (0, import_react11.forwardRef)(
|
|
|
4013
4201
|
);
|
|
4014
4202
|
}
|
|
4015
4203
|
);
|
|
4016
|
-
var CardTest = (0,
|
|
4204
|
+
var CardTest = (0, import_react12.forwardRef)(
|
|
4017
4205
|
({
|
|
4018
4206
|
title,
|
|
4019
4207
|
duration,
|
|
@@ -4045,7 +4233,7 @@ var CardTest = (0, import_react11.forwardRef)(
|
|
|
4045
4233
|
const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
|
|
4046
4234
|
const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
|
|
4047
4235
|
if (isSelectable) {
|
|
4048
|
-
return /* @__PURE__ */ (0,
|
|
4236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4049
4237
|
"button",
|
|
4050
4238
|
{
|
|
4051
4239
|
ref,
|
|
@@ -4057,8 +4245,8 @@ var CardTest = (0, import_react11.forwardRef)(
|
|
|
4057
4245
|
onKeyDown: handleKeyDown,
|
|
4058
4246
|
"aria-pressed": selected,
|
|
4059
4247
|
...props,
|
|
4060
|
-
children: /* @__PURE__ */ (0,
|
|
4061
|
-
/* @__PURE__ */ (0,
|
|
4248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
4249
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4062
4250
|
Text_default,
|
|
4063
4251
|
{
|
|
4064
4252
|
size: "md",
|
|
@@ -4067,10 +4255,10 @@ var CardTest = (0, import_react11.forwardRef)(
|
|
|
4067
4255
|
children: title
|
|
4068
4256
|
}
|
|
4069
4257
|
),
|
|
4070
|
-
/* @__PURE__ */ (0,
|
|
4071
|
-
duration && /* @__PURE__ */ (0,
|
|
4072
|
-
/* @__PURE__ */ (0,
|
|
4073
|
-
/* @__PURE__ */ (0,
|
|
4258
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
|
|
4259
|
+
duration && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
|
|
4260
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.Clock, { size: 16, className: "text-text-700" }),
|
|
4261
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4074
4262
|
Text_default,
|
|
4075
4263
|
{
|
|
4076
4264
|
size: "sm",
|
|
@@ -4079,7 +4267,7 @@ var CardTest = (0, import_react11.forwardRef)(
|
|
|
4079
4267
|
}
|
|
4080
4268
|
)
|
|
4081
4269
|
] }),
|
|
4082
|
-
/* @__PURE__ */ (0,
|
|
4270
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4083
4271
|
Text_default,
|
|
4084
4272
|
{
|
|
4085
4273
|
size: "sm",
|
|
@@ -4092,14 +4280,14 @@ var CardTest = (0, import_react11.forwardRef)(
|
|
|
4092
4280
|
}
|
|
4093
4281
|
);
|
|
4094
4282
|
}
|
|
4095
|
-
return /* @__PURE__ */ (0,
|
|
4283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4096
4284
|
"div",
|
|
4097
4285
|
{
|
|
4098
4286
|
ref,
|
|
4099
4287
|
className: cn(`${baseClasses} ${className}`.trim()),
|
|
4100
4288
|
...props,
|
|
4101
|
-
children: /* @__PURE__ */ (0,
|
|
4102
|
-
/* @__PURE__ */ (0,
|
|
4289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
4290
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4103
4291
|
Text_default,
|
|
4104
4292
|
{
|
|
4105
4293
|
size: "md",
|
|
@@ -4108,10 +4296,10 @@ var CardTest = (0, import_react11.forwardRef)(
|
|
|
4108
4296
|
children: title
|
|
4109
4297
|
}
|
|
4110
4298
|
),
|
|
4111
|
-
/* @__PURE__ */ (0,
|
|
4112
|
-
duration && /* @__PURE__ */ (0,
|
|
4113
|
-
/* @__PURE__ */ (0,
|
|
4114
|
-
/* @__PURE__ */ (0,
|
|
4299
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
|
|
4300
|
+
duration && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
|
|
4301
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.Clock, { size: 16, className: "text-text-700" }),
|
|
4302
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4115
4303
|
Text_default,
|
|
4116
4304
|
{
|
|
4117
4305
|
size: "sm",
|
|
@@ -4120,7 +4308,7 @@ var CardTest = (0, import_react11.forwardRef)(
|
|
|
4120
4308
|
}
|
|
4121
4309
|
)
|
|
4122
4310
|
] }),
|
|
4123
|
-
/* @__PURE__ */ (0,
|
|
4311
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4124
4312
|
Text_default,
|
|
4125
4313
|
{
|
|
4126
4314
|
size: "sm",
|
|
@@ -4156,15 +4344,15 @@ var SIMULATION_TYPE_STYLES = {
|
|
|
4156
4344
|
text: "Vestibular"
|
|
4157
4345
|
}
|
|
4158
4346
|
};
|
|
4159
|
-
var CardSimulationHistory = (0,
|
|
4160
|
-
return /* @__PURE__ */ (0,
|
|
4347
|
+
var CardSimulationHistory = (0, import_react12.forwardRef)(({ data, onSimulationClick, className, ...props }, ref) => {
|
|
4348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4161
4349
|
"div",
|
|
4162
4350
|
{
|
|
4163
4351
|
ref,
|
|
4164
4352
|
className: cn("w-full max-w-[992px] h-auto", className),
|
|
4165
4353
|
...props,
|
|
4166
|
-
children: /* @__PURE__ */ (0,
|
|
4167
|
-
data.map((section, sectionIndex) => /* @__PURE__ */ (0,
|
|
4354
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-0", children: [
|
|
4355
|
+
data.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
4168
4356
|
"div",
|
|
4169
4357
|
{
|
|
4170
4358
|
className: cn(
|
|
@@ -4172,7 +4360,7 @@ var CardSimulationHistory = (0, import_react11.forwardRef)(({ data, onSimulation
|
|
|
4172
4360
|
sectionIndex === 0 ? "rounded-t-3xl" : ""
|
|
4173
4361
|
),
|
|
4174
4362
|
children: [
|
|
4175
|
-
/* @__PURE__ */ (0,
|
|
4363
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4176
4364
|
Text_default,
|
|
4177
4365
|
{
|
|
4178
4366
|
size: "xs",
|
|
@@ -4181,9 +4369,9 @@ var CardSimulationHistory = (0, import_react11.forwardRef)(({ data, onSimulation
|
|
|
4181
4369
|
children: section.date
|
|
4182
4370
|
}
|
|
4183
4371
|
),
|
|
4184
|
-
/* @__PURE__ */ (0,
|
|
4372
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
|
|
4185
4373
|
const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
|
|
4186
|
-
return /* @__PURE__ */ (0,
|
|
4374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4187
4375
|
CardBase,
|
|
4188
4376
|
{
|
|
4189
4377
|
layout: "horizontal",
|
|
@@ -4195,9 +4383,9 @@ var CardSimulationHistory = (0, import_react11.forwardRef)(({ data, onSimulation
|
|
|
4195
4383
|
transition-shadow duration-200 h-auto min-h-[61px]`
|
|
4196
4384
|
),
|
|
4197
4385
|
onClick: () => onSimulationClick?.(simulation),
|
|
4198
|
-
children: /* @__PURE__ */ (0,
|
|
4199
|
-
/* @__PURE__ */ (0,
|
|
4200
|
-
/* @__PURE__ */ (0,
|
|
4386
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex justify-between items-center w-full gap-2", children: [
|
|
4387
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-wrap flex-col justify-between sm:flex-row gap-2 flex-1 min-w-0", children: [
|
|
4388
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4201
4389
|
Text_default,
|
|
4202
4390
|
{
|
|
4203
4391
|
size: "lg",
|
|
@@ -4206,8 +4394,8 @@ var CardSimulationHistory = (0, import_react11.forwardRef)(({ data, onSimulation
|
|
|
4206
4394
|
children: simulation.title
|
|
4207
4395
|
}
|
|
4208
4396
|
),
|
|
4209
|
-
/* @__PURE__ */ (0,
|
|
4210
|
-
/* @__PURE__ */ (0,
|
|
4397
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4398
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4211
4399
|
Badge_default,
|
|
4212
4400
|
{
|
|
4213
4401
|
variant: "examsOutlined",
|
|
@@ -4216,10 +4404,10 @@ var CardSimulationHistory = (0, import_react11.forwardRef)(({ data, onSimulation
|
|
|
4216
4404
|
children: typeStyles.text
|
|
4217
4405
|
}
|
|
4218
4406
|
),
|
|
4219
|
-
/* @__PURE__ */ (0,
|
|
4407
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
|
|
4220
4408
|
] })
|
|
4221
4409
|
] }),
|
|
4222
|
-
/* @__PURE__ */ (0,
|
|
4410
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4223
4411
|
import_phosphor_react9.CaretRight,
|
|
4224
4412
|
{
|
|
4225
4413
|
size: 24,
|
|
@@ -4235,17 +4423,17 @@ var CardSimulationHistory = (0, import_react11.forwardRef)(({ data, onSimulation
|
|
|
4235
4423
|
]
|
|
4236
4424
|
}
|
|
4237
4425
|
) }, section.date)),
|
|
4238
|
-
data.length > 0 && /* @__PURE__ */ (0,
|
|
4426
|
+
data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-full h-6 bg-background rounded-b-3xl" })
|
|
4239
4427
|
] })
|
|
4240
4428
|
}
|
|
4241
4429
|
);
|
|
4242
4430
|
});
|
|
4243
4431
|
|
|
4244
4432
|
// src/components/Accordation/Accordation.tsx
|
|
4245
|
-
var
|
|
4433
|
+
var import_react13 = require("react");
|
|
4246
4434
|
var import_phosphor_react10 = require("phosphor-react");
|
|
4247
|
-
var
|
|
4248
|
-
var CardAccordation = (0,
|
|
4435
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4436
|
+
var CardAccordation = (0, import_react13.forwardRef)(
|
|
4249
4437
|
({
|
|
4250
4438
|
trigger,
|
|
4251
4439
|
children,
|
|
@@ -4257,13 +4445,13 @@ var CardAccordation = (0, import_react12.forwardRef)(
|
|
|
4257
4445
|
disabled = false,
|
|
4258
4446
|
...props
|
|
4259
4447
|
}, ref) => {
|
|
4260
|
-
const [internalExpanded, setInternalExpanded] = (0,
|
|
4261
|
-
const generatedId = (0,
|
|
4448
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react13.useState)(defaultExpanded);
|
|
4449
|
+
const generatedId = (0, import_react13.useId)();
|
|
4262
4450
|
const contentId = value ? `accordion-content-${value}` : generatedId;
|
|
4263
4451
|
const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
|
|
4264
4452
|
const isControlled = controlledExpanded !== void 0;
|
|
4265
4453
|
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
4266
|
-
(0,
|
|
4454
|
+
(0, import_react13.useEffect)(() => {
|
|
4267
4455
|
if (isControlled) {
|
|
4268
4456
|
setInternalExpanded(controlledExpanded);
|
|
4269
4457
|
}
|
|
@@ -4283,7 +4471,7 @@ var CardAccordation = (0, import_react12.forwardRef)(
|
|
|
4283
4471
|
handleToggle();
|
|
4284
4472
|
}
|
|
4285
4473
|
};
|
|
4286
|
-
return /* @__PURE__ */ (0,
|
|
4474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4287
4475
|
CardBase,
|
|
4288
4476
|
{
|
|
4289
4477
|
ref,
|
|
@@ -4293,7 +4481,7 @@ var CardAccordation = (0, import_react12.forwardRef)(
|
|
|
4293
4481
|
className: cn("overflow-hidden", className),
|
|
4294
4482
|
...props,
|
|
4295
4483
|
children: [
|
|
4296
|
-
/* @__PURE__ */ (0,
|
|
4484
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
4297
4485
|
"button",
|
|
4298
4486
|
{
|
|
4299
4487
|
id: headerId,
|
|
@@ -4311,7 +4499,7 @@ var CardAccordation = (0, import_react12.forwardRef)(
|
|
|
4311
4499
|
"data-value": value,
|
|
4312
4500
|
children: [
|
|
4313
4501
|
trigger,
|
|
4314
|
-
/* @__PURE__ */ (0,
|
|
4502
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4315
4503
|
import_phosphor_react10.CaretRight,
|
|
4316
4504
|
{
|
|
4317
4505
|
size: 20,
|
|
@@ -4326,7 +4514,7 @@ var CardAccordation = (0, import_react12.forwardRef)(
|
|
|
4326
4514
|
]
|
|
4327
4515
|
}
|
|
4328
4516
|
),
|
|
4329
|
-
/* @__PURE__ */ (0,
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4330
4518
|
"section",
|
|
4331
4519
|
{
|
|
4332
4520
|
id: contentId,
|
|
@@ -4338,7 +4526,7 @@ var CardAccordation = (0, import_react12.forwardRef)(
|
|
|
4338
4526
|
),
|
|
4339
4527
|
"data-testid": "accordion-content",
|
|
4340
4528
|
"data-value": value,
|
|
4341
|
-
children: /* @__PURE__ */ (0,
|
|
4529
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "p-4 pt-0", children })
|
|
4342
4530
|
}
|
|
4343
4531
|
)
|
|
4344
4532
|
]
|
|
@@ -4349,9 +4537,9 @@ var CardAccordation = (0, import_react12.forwardRef)(
|
|
|
4349
4537
|
CardAccordation.displayName = "CardAccordation";
|
|
4350
4538
|
|
|
4351
4539
|
// src/components/Accordation/AccordionGroup.tsx
|
|
4352
|
-
var
|
|
4540
|
+
var import_react14 = require("react");
|
|
4353
4541
|
var import_zustand3 = require("zustand");
|
|
4354
|
-
var
|
|
4542
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4355
4543
|
function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
4356
4544
|
return (0, import_zustand3.create)((set, get) => ({
|
|
4357
4545
|
type,
|
|
@@ -4369,8 +4557,8 @@ function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
|
4369
4557
|
}));
|
|
4370
4558
|
}
|
|
4371
4559
|
var injectStore2 = (children, store, indexRef, onItemToggle) => {
|
|
4372
|
-
return
|
|
4373
|
-
if (!(0,
|
|
4560
|
+
return import_react14.Children.map(children, (child) => {
|
|
4561
|
+
if (!(0, import_react14.isValidElement)(child)) {
|
|
4374
4562
|
return child;
|
|
4375
4563
|
}
|
|
4376
4564
|
const typedChild = child;
|
|
@@ -4397,16 +4585,16 @@ var injectStore2 = (children, store, indexRef, onItemToggle) => {
|
|
|
4397
4585
|
if (displayName === "CardAccordation") {
|
|
4398
4586
|
newProps.children = processedChildren;
|
|
4399
4587
|
} else if (processedChildren !== typedChild.props.children) {
|
|
4400
|
-
return (0,
|
|
4588
|
+
return (0, import_react14.cloneElement)(typedChild, { children: processedChildren });
|
|
4401
4589
|
}
|
|
4402
4590
|
}
|
|
4403
4591
|
if (Object.keys(newProps).length > 0) {
|
|
4404
|
-
return (0,
|
|
4592
|
+
return (0, import_react14.cloneElement)(typedChild, newProps);
|
|
4405
4593
|
}
|
|
4406
4594
|
return child;
|
|
4407
4595
|
});
|
|
4408
4596
|
};
|
|
4409
|
-
var AccordionGroup = (0,
|
|
4597
|
+
var AccordionGroup = (0, import_react14.forwardRef)(
|
|
4410
4598
|
({
|
|
4411
4599
|
type = "single",
|
|
4412
4600
|
defaultValue,
|
|
@@ -4417,12 +4605,12 @@ var AccordionGroup = (0, import_react13.forwardRef)(
|
|
|
4417
4605
|
className,
|
|
4418
4606
|
...props
|
|
4419
4607
|
}, ref) => {
|
|
4420
|
-
const [internalValue, setInternalValue] = (0,
|
|
4608
|
+
const [internalValue, setInternalValue] = (0, import_react14.useState)(
|
|
4421
4609
|
defaultValue || (type === "single" ? "" : [])
|
|
4422
4610
|
);
|
|
4423
4611
|
const isControlled = controlledValue !== void 0;
|
|
4424
4612
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
4425
|
-
const storeRef = (0,
|
|
4613
|
+
const storeRef = (0, import_react14.useRef)(null);
|
|
4426
4614
|
if (storeRef.current) {
|
|
4427
4615
|
storeRef.current.setState((prev) => {
|
|
4428
4616
|
const nextState = {};
|
|
@@ -4442,10 +4630,10 @@ var AccordionGroup = (0, import_react13.forwardRef)(
|
|
|
4442
4630
|
);
|
|
4443
4631
|
}
|
|
4444
4632
|
const store = storeRef.current;
|
|
4445
|
-
(0,
|
|
4633
|
+
(0, import_react14.useEffect)(() => {
|
|
4446
4634
|
store.setState({ value: currentValue });
|
|
4447
4635
|
}, [currentValue, store]);
|
|
4448
|
-
(0,
|
|
4636
|
+
(0, import_react14.useEffect)(() => {
|
|
4449
4637
|
if (!isControlled) {
|
|
4450
4638
|
setInternalValue((prev) => {
|
|
4451
4639
|
if (type === "single") {
|
|
@@ -4491,22 +4679,22 @@ var AccordionGroup = (0, import_react13.forwardRef)(
|
|
|
4491
4679
|
indexRef,
|
|
4492
4680
|
handleItemToggle
|
|
4493
4681
|
);
|
|
4494
|
-
return /* @__PURE__ */ (0,
|
|
4682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { ref, className, ...props, children: enhancedChildren });
|
|
4495
4683
|
}
|
|
4496
4684
|
);
|
|
4497
4685
|
AccordionGroup.displayName = "AccordionGroup";
|
|
4498
4686
|
|
|
4499
4687
|
// src/components/CheckBoxGroup/CheckBoxGroup.tsx
|
|
4500
|
-
var
|
|
4688
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4501
4689
|
var CheckboxGroup = ({
|
|
4502
4690
|
categories,
|
|
4503
4691
|
onCategoriesChange
|
|
4504
4692
|
}) => {
|
|
4505
|
-
const [openAccordion, setOpenAccordion] = (0,
|
|
4506
|
-
const autoSelectionAppliedRef = (0,
|
|
4507
|
-
const onCategoriesChangeRef = (0,
|
|
4508
|
-
const previousCategoriesRef = (0,
|
|
4509
|
-
(0,
|
|
4693
|
+
const [openAccordion, setOpenAccordion] = (0, import_react15.useState)("");
|
|
4694
|
+
const autoSelectionAppliedRef = (0, import_react15.useRef)(false);
|
|
4695
|
+
const onCategoriesChangeRef = (0, import_react15.useRef)(onCategoriesChange);
|
|
4696
|
+
const previousCategoriesRef = (0, import_react15.useRef)(categories);
|
|
4697
|
+
(0, import_react15.useEffect)(() => {
|
|
4510
4698
|
onCategoriesChangeRef.current = onCategoriesChange;
|
|
4511
4699
|
}, [onCategoriesChange]);
|
|
4512
4700
|
const areSelectedIdsEqual = (ids1, ids2) => {
|
|
@@ -4518,7 +4706,7 @@ var CheckboxGroup = ({
|
|
|
4518
4706
|
}
|
|
4519
4707
|
return true;
|
|
4520
4708
|
};
|
|
4521
|
-
const categoriesWithAutoSelection = (0,
|
|
4709
|
+
const categoriesWithAutoSelection = (0, import_react15.useMemo)(() => {
|
|
4522
4710
|
return categories.map((category) => {
|
|
4523
4711
|
if (category.itens?.length === 1 && (!category.selectedIds || category.selectedIds.length === 0)) {
|
|
4524
4712
|
return {
|
|
@@ -4529,7 +4717,7 @@ var CheckboxGroup = ({
|
|
|
4529
4717
|
return category;
|
|
4530
4718
|
});
|
|
4531
4719
|
}, [categories]);
|
|
4532
|
-
(0,
|
|
4720
|
+
(0, import_react15.useEffect)(() => {
|
|
4533
4721
|
const categoriesChanged = categories !== previousCategoriesRef.current;
|
|
4534
4722
|
if (!categoriesChanged && autoSelectionAppliedRef.current) {
|
|
4535
4723
|
return;
|
|
@@ -4647,7 +4835,7 @@ var CheckboxGroup = ({
|
|
|
4647
4835
|
);
|
|
4648
4836
|
return groupedItems.length ? groupedItems : [{ itens: [] }];
|
|
4649
4837
|
};
|
|
4650
|
-
const formattedItemsMap = (0,
|
|
4838
|
+
const formattedItemsMap = (0, import_react15.useMemo)(() => {
|
|
4651
4839
|
const formattedItemsMap2 = {};
|
|
4652
4840
|
for (const category of categories) {
|
|
4653
4841
|
const formattedItems = calculateFormattedItems(category.key);
|
|
@@ -4785,7 +4973,7 @@ var CheckboxGroup = ({
|
|
|
4785
4973
|
};
|
|
4786
4974
|
const renderCheckboxItem = (item, categoryKey) => {
|
|
4787
4975
|
const uniqueId = `${categoryKey}-${item.id}`;
|
|
4788
|
-
return /* @__PURE__ */ (0,
|
|
4976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4789
4977
|
"div",
|
|
4790
4978
|
{
|
|
4791
4979
|
className: "flex items-center gap-3 px-2",
|
|
@@ -4795,7 +4983,7 @@ var CheckboxGroup = ({
|
|
|
4795
4983
|
onMouseUp: (e) => e.stopPropagation(),
|
|
4796
4984
|
onKeyDown: (e) => e.stopPropagation(),
|
|
4797
4985
|
children: [
|
|
4798
|
-
/* @__PURE__ */ (0,
|
|
4986
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4799
4987
|
CheckBox_default,
|
|
4800
4988
|
{
|
|
4801
4989
|
id: uniqueId,
|
|
@@ -4803,7 +4991,7 @@ var CheckboxGroup = ({
|
|
|
4803
4991
|
onChange: () => toggleItem(categoryKey, item.id)
|
|
4804
4992
|
}
|
|
4805
4993
|
),
|
|
4806
|
-
/* @__PURE__ */ (0,
|
|
4994
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4807
4995
|
"label",
|
|
4808
4996
|
{
|
|
4809
4997
|
htmlFor: uniqueId,
|
|
@@ -4816,12 +5004,12 @@ var CheckboxGroup = ({
|
|
|
4816
5004
|
item.id
|
|
4817
5005
|
);
|
|
4818
5006
|
};
|
|
4819
|
-
const renderFormattedGroup = (formattedGroup, idx, categoryKey) => /* @__PURE__ */ (0,
|
|
5007
|
+
const renderFormattedGroup = (formattedGroup, idx, categoryKey) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4820
5008
|
"div",
|
|
4821
5009
|
{
|
|
4822
5010
|
className: "flex flex-col gap-3",
|
|
4823
5011
|
children: [
|
|
4824
|
-
"groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ (0,
|
|
5012
|
+
"groupLabel" in formattedGroup && formattedGroup.groupLabel && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default, { size: "sm", className: "mt-2", weight: "semibold", children: formattedGroup.groupLabel }),
|
|
4825
5013
|
formattedGroup.itens?.map(
|
|
4826
5014
|
(item) => renderCheckboxItem(item, categoryKey)
|
|
4827
5015
|
)
|
|
@@ -4829,9 +5017,9 @@ var CheckboxGroup = ({
|
|
|
4829
5017
|
},
|
|
4830
5018
|
formattedGroup.groupLabel || `group-${idx}`
|
|
4831
5019
|
);
|
|
4832
|
-
const renderAccordionTrigger = (category, isEnabled) => /* @__PURE__ */ (0,
|
|
4833
|
-
/* @__PURE__ */ (0,
|
|
4834
|
-
/* @__PURE__ */ (0,
|
|
5020
|
+
const renderAccordionTrigger = (category, isEnabled) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center justify-between w-full p-2", children: [
|
|
5021
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4835
5023
|
CheckBox_default,
|
|
4836
5024
|
{
|
|
4837
5025
|
checked: isMinimalOneCheckBoxIsSelected(category.key),
|
|
@@ -4840,7 +5028,7 @@ var CheckboxGroup = ({
|
|
|
4840
5028
|
onChange: () => toggleAllInCategory(category.key)
|
|
4841
5029
|
}
|
|
4842
5030
|
),
|
|
4843
|
-
/* @__PURE__ */ (0,
|
|
5031
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4844
5032
|
Text_default,
|
|
4845
5033
|
{
|
|
4846
5034
|
size: "sm",
|
|
@@ -4850,7 +5038,7 @@ var CheckboxGroup = ({
|
|
|
4850
5038
|
}
|
|
4851
5039
|
)
|
|
4852
5040
|
] }),
|
|
4853
|
-
(openAccordion === category.key || isEnabled) && /* @__PURE__ */ (0,
|
|
5041
|
+
(openAccordion === category.key || isEnabled) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Badge_default, { variant: "solid", action: "info", children: (() => {
|
|
4854
5042
|
const visibleIds = getFormattedItems(category.key).flatMap((group) => group.itens || []).map((i) => i.id);
|
|
4855
5043
|
const selectedVisibleCount = visibleIds.filter(
|
|
4856
5044
|
(id) => category.selectedIds?.includes(id)
|
|
@@ -4872,8 +5060,8 @@ var CheckboxGroup = ({
|
|
|
4872
5060
|
const hasNoItems = formattedItems.every(
|
|
4873
5061
|
(group) => !group.itens || group.itens.length === 0
|
|
4874
5062
|
);
|
|
4875
|
-
return /* @__PURE__ */ (0,
|
|
4876
|
-
/* @__PURE__ */ (0,
|
|
5063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
5064
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4877
5065
|
CardAccordation,
|
|
4878
5066
|
{
|
|
4879
5067
|
value: category.key,
|
|
@@ -4883,15 +5071,15 @@ var CheckboxGroup = ({
|
|
|
4883
5071
|
openAccordion === category.key && "bg-background-50 border-none"
|
|
4884
5072
|
),
|
|
4885
5073
|
trigger: renderAccordionTrigger(category, isEnabled),
|
|
4886
|
-
children: /* @__PURE__ */ (0,
|
|
5074
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-col gap-3 pt-2", children: hasNoItems && isEnabled ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "px-2 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default, { size: "sm", className: "text-text-500 text-center", children: "Sem dados" }) }) : formattedItems.map(
|
|
4887
5075
|
(formattedGroup, idx) => renderFormattedGroup(formattedGroup, idx, category.key)
|
|
4888
5076
|
) })
|
|
4889
5077
|
}
|
|
4890
5078
|
),
|
|
4891
|
-
openAccordion !== category.key && /* @__PURE__ */ (0,
|
|
5079
|
+
openAccordion !== category.key && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Divider_default, {})
|
|
4892
5080
|
] }, category.key);
|
|
4893
5081
|
};
|
|
4894
|
-
(0,
|
|
5082
|
+
(0, import_react15.useEffect)(() => {
|
|
4895
5083
|
if (!openAccordion) return;
|
|
4896
5084
|
const category = categories.find((c) => c.key === openAccordion);
|
|
4897
5085
|
if (!category) return;
|
|
@@ -4905,7 +5093,7 @@ var CheckboxGroup = ({
|
|
|
4905
5093
|
}, 0);
|
|
4906
5094
|
}
|
|
4907
5095
|
}, [categories, openAccordion]);
|
|
4908
|
-
return /* @__PURE__ */ (0,
|
|
5096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4909
5097
|
AccordionGroup,
|
|
4910
5098
|
{
|
|
4911
5099
|
type: "single",
|
|
@@ -4932,7 +5120,7 @@ var CheckboxGroup = ({
|
|
|
4932
5120
|
};
|
|
4933
5121
|
|
|
4934
5122
|
// src/components/Filter/FilterModal.tsx
|
|
4935
|
-
var
|
|
5123
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4936
5124
|
var FilterModal = ({
|
|
4937
5125
|
isOpen,
|
|
4938
5126
|
onClose,
|
|
@@ -4960,20 +5148,20 @@ var FilterModal = ({
|
|
|
4960
5148
|
const handleClear = () => {
|
|
4961
5149
|
onClear();
|
|
4962
5150
|
};
|
|
4963
|
-
return /* @__PURE__ */ (0,
|
|
5151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4964
5152
|
Modal_default,
|
|
4965
5153
|
{
|
|
4966
5154
|
isOpen,
|
|
4967
5155
|
onClose,
|
|
4968
5156
|
title,
|
|
4969
5157
|
size,
|
|
4970
|
-
footer: /* @__PURE__ */ (0,
|
|
4971
|
-
/* @__PURE__ */ (0,
|
|
4972
|
-
/* @__PURE__ */ (0,
|
|
5158
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex gap-3 justify-end w-full", children: [
|
|
5159
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button_default, { variant: "outline", onClick: handleClear, children: clearLabel }),
|
|
5160
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button_default, { onClick: handleApply, children: applyLabel })
|
|
4973
5161
|
] }),
|
|
4974
|
-
children: /* @__PURE__ */ (0,
|
|
4975
|
-
/* @__PURE__ */ (0,
|
|
4976
|
-
config.key === "academic" && /* @__PURE__ */ (0,
|
|
5162
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col gap-6", children: filterConfigs.map((config, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
5163
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2 text-text-400 text-sm font-medium uppercase", children: [
|
|
5164
|
+
config.key === "academic" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4977
5165
|
"svg",
|
|
4978
5166
|
{
|
|
4979
5167
|
width: "16",
|
|
@@ -4983,7 +5171,7 @@ var FilterModal = ({
|
|
|
4983
5171
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4984
5172
|
className: "text-text-400",
|
|
4985
5173
|
children: [
|
|
4986
|
-
/* @__PURE__ */ (0,
|
|
5174
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4987
5175
|
"path",
|
|
4988
5176
|
{
|
|
4989
5177
|
d: "M8 2L2 5.33333L8 8.66667L14 5.33333L8 2Z",
|
|
@@ -4993,7 +5181,7 @@ var FilterModal = ({
|
|
|
4993
5181
|
strokeLinejoin: "round"
|
|
4994
5182
|
}
|
|
4995
5183
|
),
|
|
4996
|
-
/* @__PURE__ */ (0,
|
|
5184
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4997
5185
|
"path",
|
|
4998
5186
|
{
|
|
4999
5187
|
d: "M2 10.6667L8 14L14 10.6667",
|
|
@@ -5003,7 +5191,7 @@ var FilterModal = ({
|
|
|
5003
5191
|
strokeLinejoin: "round"
|
|
5004
5192
|
}
|
|
5005
5193
|
),
|
|
5006
|
-
/* @__PURE__ */ (0,
|
|
5194
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
5007
5195
|
"path",
|
|
5008
5196
|
{
|
|
5009
5197
|
d: "M2 8L8 11.3333L14 8",
|
|
@@ -5016,7 +5204,7 @@ var FilterModal = ({
|
|
|
5016
5204
|
]
|
|
5017
5205
|
}
|
|
5018
5206
|
),
|
|
5019
|
-
config.key === "content" && /* @__PURE__ */ (0,
|
|
5207
|
+
config.key === "content" && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
5020
5208
|
"svg",
|
|
5021
5209
|
{
|
|
5022
5210
|
width: "16",
|
|
@@ -5026,7 +5214,7 @@ var FilterModal = ({
|
|
|
5026
5214
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5027
5215
|
className: "text-text-400",
|
|
5028
5216
|
children: [
|
|
5029
|
-
/* @__PURE__ */ (0,
|
|
5217
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
5030
5218
|
"path",
|
|
5031
5219
|
{
|
|
5032
5220
|
d: "M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z",
|
|
@@ -5036,7 +5224,7 @@ var FilterModal = ({
|
|
|
5036
5224
|
strokeLinejoin: "round"
|
|
5037
5225
|
}
|
|
5038
5226
|
),
|
|
5039
|
-
/* @__PURE__ */ (0,
|
|
5227
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
5040
5228
|
"path",
|
|
5041
5229
|
{
|
|
5042
5230
|
d: "M2 6H14",
|
|
@@ -5046,7 +5234,7 @@ var FilterModal = ({
|
|
|
5046
5234
|
strokeLinejoin: "round"
|
|
5047
5235
|
}
|
|
5048
5236
|
),
|
|
5049
|
-
/* @__PURE__ */ (0,
|
|
5237
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
5050
5238
|
"path",
|
|
5051
5239
|
{
|
|
5052
5240
|
d: "M6 2V14",
|
|
@@ -5059,9 +5247,9 @@ var FilterModal = ({
|
|
|
5059
5247
|
]
|
|
5060
5248
|
}
|
|
5061
5249
|
),
|
|
5062
|
-
/* @__PURE__ */ (0,
|
|
5250
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: config.label })
|
|
5063
5251
|
] }),
|
|
5064
|
-
/* @__PURE__ */ (0,
|
|
5252
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
5065
5253
|
CheckboxGroup,
|
|
5066
5254
|
{
|
|
5067
5255
|
categories: config.categories,
|
|
@@ -5075,7 +5263,7 @@ var FilterModal = ({
|
|
|
5075
5263
|
|
|
5076
5264
|
// src/components/TableProvider/TableProvider.tsx
|
|
5077
5265
|
var import_phosphor_react11 = require("phosphor-react");
|
|
5078
|
-
var
|
|
5266
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
5079
5267
|
function TableProvider({
|
|
5080
5268
|
data,
|
|
5081
5269
|
headers,
|
|
@@ -5089,13 +5277,15 @@ function TableProvider({
|
|
|
5089
5277
|
initialFilters = [],
|
|
5090
5278
|
paginationConfig = {},
|
|
5091
5279
|
searchPlaceholder = "Buscar...",
|
|
5092
|
-
|
|
5280
|
+
emptyState,
|
|
5281
|
+
loadingState,
|
|
5282
|
+
noSearchResultState,
|
|
5093
5283
|
rowKey,
|
|
5094
5284
|
onParamsChange,
|
|
5095
5285
|
onRowClick,
|
|
5096
5286
|
children
|
|
5097
5287
|
}) {
|
|
5098
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
5288
|
+
const [searchQuery, setSearchQuery] = (0, import_react16.useState)("");
|
|
5099
5289
|
const sortResultRaw = useTableSort(data, { syncWithUrl: true });
|
|
5100
5290
|
const sortResult = enableTableSort ? sortResultRaw : {
|
|
5101
5291
|
sortedData: data,
|
|
@@ -5106,7 +5296,7 @@ function TableProvider({
|
|
|
5106
5296
|
};
|
|
5107
5297
|
const { sortedData, sortColumn, sortDirection, handleSort } = sortResult;
|
|
5108
5298
|
const filterResultRaw = useTableFilter(initialFilters, { syncWithUrl: true });
|
|
5109
|
-
const disabledFilterResult = (0,
|
|
5299
|
+
const disabledFilterResult = (0, import_react16.useMemo)(
|
|
5110
5300
|
() => ({
|
|
5111
5301
|
filterConfigs: [],
|
|
5112
5302
|
activeFilters: {},
|
|
@@ -5136,10 +5326,10 @@ function TableProvider({
|
|
|
5136
5326
|
totalItems,
|
|
5137
5327
|
totalPages
|
|
5138
5328
|
} = paginationConfig;
|
|
5139
|
-
const [currentPage, setCurrentPage] = (0,
|
|
5140
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
5141
|
-
const [isFilterModalOpen, setIsFilterModalOpen] = (0,
|
|
5142
|
-
const combinedParams = (0,
|
|
5329
|
+
const [currentPage, setCurrentPage] = (0, import_react16.useState)(1);
|
|
5330
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react16.useState)(defaultItemsPerPage);
|
|
5331
|
+
const [isFilterModalOpen, setIsFilterModalOpen] = (0, import_react16.useState)(false);
|
|
5332
|
+
const combinedParams = (0, import_react16.useMemo)(() => {
|
|
5143
5333
|
const params = {
|
|
5144
5334
|
page: currentPage,
|
|
5145
5335
|
limit: itemsPerPage
|
|
@@ -5166,26 +5356,26 @@ function TableProvider({
|
|
|
5166
5356
|
enableFilters,
|
|
5167
5357
|
enableTableSort
|
|
5168
5358
|
]);
|
|
5169
|
-
(0,
|
|
5359
|
+
(0, import_react16.useEffect)(() => {
|
|
5170
5360
|
onParamsChange?.(combinedParams);
|
|
5171
5361
|
}, [combinedParams]);
|
|
5172
|
-
const handleSearchChange = (0,
|
|
5362
|
+
const handleSearchChange = (0, import_react16.useCallback)((value) => {
|
|
5173
5363
|
setSearchQuery(value);
|
|
5174
5364
|
setCurrentPage(1);
|
|
5175
5365
|
}, []);
|
|
5176
|
-
const handleFilterApply = (0,
|
|
5366
|
+
const handleFilterApply = (0, import_react16.useCallback)(() => {
|
|
5177
5367
|
applyFilters();
|
|
5178
5368
|
setIsFilterModalOpen(false);
|
|
5179
5369
|
setCurrentPage(1);
|
|
5180
5370
|
}, [applyFilters]);
|
|
5181
|
-
const handlePageChange = (0,
|
|
5371
|
+
const handlePageChange = (0, import_react16.useCallback)((page) => {
|
|
5182
5372
|
setCurrentPage(page);
|
|
5183
5373
|
}, []);
|
|
5184
|
-
const handleItemsPerPageChange = (0,
|
|
5374
|
+
const handleItemsPerPageChange = (0, import_react16.useCallback)((items) => {
|
|
5185
5375
|
setItemsPerPage(items);
|
|
5186
5376
|
setCurrentPage(1);
|
|
5187
5377
|
}, []);
|
|
5188
|
-
const handleRowClickInternal = (0,
|
|
5378
|
+
const handleRowClickInternal = (0, import_react16.useCallback)(
|
|
5189
5379
|
(row, index) => {
|
|
5190
5380
|
if (enableRowClick && onRowClick) {
|
|
5191
5381
|
onRowClick(row, index);
|
|
@@ -5193,7 +5383,7 @@ function TableProvider({
|
|
|
5193
5383
|
},
|
|
5194
5384
|
[enableRowClick, onRowClick]
|
|
5195
5385
|
);
|
|
5196
|
-
const useInternalPagination = (0,
|
|
5386
|
+
const useInternalPagination = (0, import_react16.useMemo)(
|
|
5197
5387
|
() => enablePagination && !onParamsChange && totalItems === void 0 && totalPages === void 0,
|
|
5198
5388
|
[enablePagination, onParamsChange, totalItems, totalPages]
|
|
5199
5389
|
);
|
|
@@ -5201,29 +5391,32 @@ function TableProvider({
|
|
|
5201
5391
|
(totalItems ?? (useInternalPagination ? sortedData.length : data.length)) / itemsPerPage
|
|
5202
5392
|
);
|
|
5203
5393
|
const calculatedTotalItems = totalItems ?? (useInternalPagination ? sortedData.length : data.length);
|
|
5204
|
-
const displayData = (0,
|
|
5394
|
+
const displayData = (0, import_react16.useMemo)(() => {
|
|
5205
5395
|
if (!useInternalPagination) {
|
|
5206
5396
|
return sortedData;
|
|
5207
5397
|
}
|
|
5208
5398
|
const start = (currentPage - 1) * itemsPerPage;
|
|
5209
5399
|
return sortedData.slice(start, start + itemsPerPage);
|
|
5210
5400
|
}, [useInternalPagination, sortedData, currentPage, itemsPerPage]);
|
|
5211
|
-
const isEmpty =
|
|
5212
|
-
const
|
|
5213
|
-
|
|
5401
|
+
const isEmpty = data.length === 0;
|
|
5402
|
+
const showLoading = loading;
|
|
5403
|
+
const showNoSearchResult = !loading && data.length === 0 && searchQuery.trim() !== "";
|
|
5404
|
+
const showEmpty = !loading && data.length === 0 && searchQuery.trim() === "";
|
|
5405
|
+
const controls = (enableSearch || enableFilters) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
5406
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
5214
5407
|
Button_default,
|
|
5215
5408
|
{
|
|
5216
5409
|
variant: "outline",
|
|
5217
5410
|
size: "medium",
|
|
5218
5411
|
onClick: () => setIsFilterModalOpen(true),
|
|
5219
5412
|
children: [
|
|
5220
|
-
/* @__PURE__ */ (0,
|
|
5413
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_phosphor_react11.Funnel, { size: 20 }),
|
|
5221
5414
|
"Filtros",
|
|
5222
|
-
hasActiveFilters && /* @__PURE__ */ (0,
|
|
5415
|
+
hasActiveFilters && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "ml-2 rounded-full bg-primary-500 px-2 py-0.5 text-xs text-white", children: Object.keys(activeFilters).length })
|
|
5223
5416
|
]
|
|
5224
5417
|
}
|
|
5225
5418
|
),
|
|
5226
|
-
enableSearch && /* @__PURE__ */ (0,
|
|
5419
|
+
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5227
5420
|
Search_default,
|
|
5228
5421
|
{
|
|
5229
5422
|
value: searchQuery,
|
|
@@ -5234,18 +5427,22 @@ function TableProvider({
|
|
|
5234
5427
|
}
|
|
5235
5428
|
) })
|
|
5236
5429
|
] });
|
|
5237
|
-
const table = /* @__PURE__ */ (0,
|
|
5430
|
+
const table = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
5238
5431
|
Table_default,
|
|
5239
5432
|
{
|
|
5240
5433
|
variant,
|
|
5241
|
-
|
|
5242
|
-
|
|
5434
|
+
showLoading,
|
|
5435
|
+
loadingState,
|
|
5436
|
+
showNoSearchResult,
|
|
5437
|
+
noSearchResultState,
|
|
5438
|
+
showEmpty,
|
|
5439
|
+
emptyState,
|
|
5243
5440
|
children: [
|
|
5244
|
-
/* @__PURE__ */ (0,
|
|
5441
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5245
5442
|
TableRow,
|
|
5246
5443
|
{
|
|
5247
5444
|
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
5248
|
-
children: headers.map((header, index) => /* @__PURE__ */ (0,
|
|
5445
|
+
children: headers.map((header, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5249
5446
|
TableHead,
|
|
5250
5447
|
{
|
|
5251
5448
|
sortable: enableTableSort && header.sortable,
|
|
@@ -5259,7 +5456,7 @@ function TableProvider({
|
|
|
5259
5456
|
))
|
|
5260
5457
|
}
|
|
5261
5458
|
) }),
|
|
5262
|
-
/* @__PURE__ */ (0,
|
|
5459
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TableCell, { colSpan: headers.length, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-text-400 text-sm", children: "Carregando..." }) }) }) : displayData.map((row, rowIndex) => {
|
|
5263
5460
|
const effectiveIndex = useInternalPagination ? (currentPage - 1) * itemsPerPage + rowIndex : rowIndex;
|
|
5264
5461
|
const rowKeyValue = rowKey ? (() => {
|
|
5265
5462
|
const keyValue = row[rowKey];
|
|
@@ -5271,7 +5468,7 @@ function TableProvider({
|
|
|
5271
5468
|
}
|
|
5272
5469
|
return String(keyValue);
|
|
5273
5470
|
})() : `row-${effectiveIndex}`;
|
|
5274
|
-
return /* @__PURE__ */ (0,
|
|
5471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5275
5472
|
TableRow,
|
|
5276
5473
|
{
|
|
5277
5474
|
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
@@ -5292,7 +5489,7 @@ function TableProvider({
|
|
|
5292
5489
|
}
|
|
5293
5490
|
}
|
|
5294
5491
|
const content = header.render ? header.render(value, row, effectiveIndex) : defaultContent;
|
|
5295
|
-
return /* @__PURE__ */ (0,
|
|
5492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5296
5493
|
TableCell,
|
|
5297
5494
|
{
|
|
5298
5495
|
className: header.className,
|
|
@@ -5311,7 +5508,7 @@ function TableProvider({
|
|
|
5311
5508
|
]
|
|
5312
5509
|
}
|
|
5313
5510
|
) });
|
|
5314
|
-
const pagination = enablePagination && !isEmpty && /* @__PURE__ */ (0,
|
|
5511
|
+
const pagination = enablePagination && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5315
5512
|
TablePagination_default,
|
|
5316
5513
|
{
|
|
5317
5514
|
currentPage,
|
|
@@ -5325,9 +5522,9 @@ function TableProvider({
|
|
|
5325
5522
|
}
|
|
5326
5523
|
) });
|
|
5327
5524
|
if (children) {
|
|
5328
|
-
return /* @__PURE__ */ (0,
|
|
5525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
5329
5526
|
children({ controls, table, pagination }),
|
|
5330
|
-
enableFilters && /* @__PURE__ */ (0,
|
|
5527
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5331
5528
|
FilterModal,
|
|
5332
5529
|
{
|
|
5333
5530
|
isOpen: isFilterModalOpen,
|
|
@@ -5340,11 +5537,11 @@ function TableProvider({
|
|
|
5340
5537
|
)
|
|
5341
5538
|
] });
|
|
5342
5539
|
}
|
|
5343
|
-
return /* @__PURE__ */ (0,
|
|
5540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "w-full space-y-4", children: [
|
|
5344
5541
|
controls,
|
|
5345
5542
|
table,
|
|
5346
5543
|
pagination,
|
|
5347
|
-
enableFilters && /* @__PURE__ */ (0,
|
|
5544
|
+
enableFilters && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
5348
5545
|
FilterModal,
|
|
5349
5546
|
{
|
|
5350
5547
|
isOpen: isFilterModalOpen,
|