gsintegrations 0.0.490 → 0.0.491

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.
@@ -143948,7 +143948,9 @@ const MonthlyFeeCard = React$1.memo(({ formatCurrency, monthlyFee, dueDay, payme
143948
143948
  };
143949
143949
  return (React$1.createElement(Card$1, { "data-testid": "monthly-fee-action-card", sx: {
143950
143950
  borderRadius: RADIUS.default,
143951
- boxShadow: theme.shadows[2],
143951
+ boxShadow: "none",
143952
+ border: 1,
143953
+ borderColor: "divider",
143952
143954
  overflow: "hidden",
143953
143955
  } },
143954
143956
  React$1.createElement(CardHeader$1, { title: React$1.createElement(Stack$1, { direction: "row", alignItems: "center", justifyContent: "space-between", spacing: LIST_GAP },
@@ -143982,13 +143984,17 @@ const MonthlyFeeCard = React$1.memo(({ formatCurrency, monthlyFee, dueDay, payme
143982
143984
  cursor: isSelectable ? "pointer" : "default",
143983
143985
  borderRadius: RADIUS.default,
143984
143986
  outline: "none",
143985
- transition: "background-color 0.2s ease, box-shadow 0.2s ease",
143987
+ transition: "background-color 0.2s ease",
143986
143988
  "&:hover": isSelectable
143987
143989
  ? {
143988
143990
  bgcolor: theme.palette.action.hover,
143989
- boxShadow: `inset 0 0 0 1px ${alpha(theme.palette.info.main, 0.24)}`,
143990
143991
  }
143991
143992
  : undefined,
143993
+ "&:focus-visible": {
143994
+ outline: "2px solid",
143995
+ outlineColor: theme.palette.primary.main,
143996
+ outlineOffset: 2,
143997
+ },
143992
143998
  } },
143993
143999
  React$1.createElement(Stack$1, { spacing: 0.5, sx: { mb: 1.5 } },
143994
144000
  React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { letterSpacing: 0.2 } }, "Valor da mensalidade"),
@@ -144056,7 +144062,7 @@ const MetricItem = React$1.memo(({ icon, label, value, color, isLoading, }) => {
144056
144062
  });
144057
144063
  MetricItem.displayName = "MetricItem";
144058
144064
  // Member payments progress component
144059
- const MemberPaymentsSection = React$1.memo(({ data, isLoading }) => {
144065
+ const MemberPaymentsSection = React$1.memo(({ data, isLoading, collectedLabel, expectedLabel, }) => {
144060
144066
  const theme = useTheme$1();
144061
144067
  if (isLoading) {
144062
144068
  return (React$1.createElement(Box$1, { sx: {
@@ -144099,7 +144105,11 @@ const MemberPaymentsSection = React$1.memo(({ data, isLoading }) => {
144099
144105
  bgcolor: progressColor,
144100
144106
  borderRadius: RADIUS.default,
144101
144107
  },
144102
- } })));
144108
+ } }),
144109
+ collectedLabel && expectedLabel ? (React$1.createElement(Typography$1, { variant: "caption", color: "text.secondary", sx: { mt: 0.75 } },
144110
+ collectedLabel,
144111
+ " recebidos de ",
144112
+ expectedLabel)) : null));
144103
144113
  });
144104
144114
  MemberPaymentsSection.displayName = "MemberPaymentsSection";
144105
144115
  // Category breakdown list component
@@ -144148,7 +144158,7 @@ const CategoryBreakdownSection = React$1.memo(({ title, categories, color, isLoa
144148
144158
  });
144149
144159
  CategoryBreakdownSection.displayName = "CategoryBreakdownSection";
144150
144160
  const FinancialOverviewCard = React$1.memo(({ data, isLoading = false, formatCurrency, onClick, defaultExpanded = false, showMemberPayments = true, }) => {
144151
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
144161
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
144152
144162
  const theme = useTheme$1();
144153
144163
  const [isExpandedManually, setIsExpandedManually] = React$1.useState(defaultExpanded);
144154
144164
  // Helper to format values
@@ -144162,66 +144172,47 @@ const FinancialOverviewCard = React$1.memo(({ data, isLoading = false, formatCur
144162
144172
  currency: "BRL",
144163
144173
  }).format(value);
144164
144174
  };
144165
- // Get the current month name in Portuguese
144166
- const getCurrentMonthName = () => {
144167
- var _a, _b;
144168
- if ((_b = (_a = data === null || data === void 0 ? void 0 : data.overview) === null || _a === void 0 ? void 0 : _a.period) === null || _b === void 0 ? void 0 : _b.start) {
144169
- const date = new Date(data.overview.period.start);
144170
- // Use UTC methods to avoid timezone conversion issues
144171
- const year = date.getUTCFullYear();
144172
- const month = date.getUTCMonth();
144173
- // Create a date in the local timezone with the correct year/month
144174
- const localDate = new Date(year, month, 1);
144175
- return localDate.toLocaleDateString("pt-BR", {
144176
- month: "long",
144177
- year: "numeric",
144178
- });
144179
- }
144180
- return new Date().toLocaleDateString("pt-BR", {
144181
- month: "long",
144182
- year: "numeric",
144183
- });
144184
- };
144185
144175
  // Determine if net flow is positive or negative
144186
- const netFlowColor = ((_b = (_a = data === null || data === void 0 ? void 0 : data.overview) === null || _a === void 0 ? void 0 : _a.netFlow) !== null && _b !== void 0 ? _b : 0) >= 0
144176
+ const balanceColor = ((_b = (_a = data === null || data === void 0 ? void 0 : data.overview) === null || _a === void 0 ? void 0 : _a.totalBalance) !== null && _b !== void 0 ? _b : 0) < 0
144177
+ ? theme.palette.error.main
144178
+ : theme.palette.success.main;
144179
+ const netFlowColor = ((_d = (_c = data === null || data === void 0 ? void 0 : data.overview) === null || _c === void 0 ? void 0 : _c.netFlow) !== null && _d !== void 0 ? _d : 0) >= 0
144187
144180
  ? theme.palette.success.main
144188
144181
  : theme.palette.error.main;
144189
- const hasCorrections = ((_d = (_c = data === null || data === void 0 ? void 0 : data.corrections) === null || _c === void 0 ? void 0 : _c.totalCorrections) !== null && _d !== void 0 ? _d : 0) > 0;
144182
+ const hasCorrections = ((_f = (_e = data === null || data === void 0 ? void 0 : data.corrections) === null || _e === void 0 ? void 0 : _e.totalCorrections) !== null && _f !== void 0 ? _f : 0) > 0;
144190
144183
  const hasMemberPayments = showMemberPayments &&
144191
144184
  (data === null || data === void 0 ? void 0 : data.memberPayments) &&
144192
144185
  data.memberPayments.totalMembers > 0;
144193
144186
  const hasCategories = ((data === null || data === void 0 ? void 0 : data.incomeByCategory) && data.incomeByCategory.length > 0) ||
144194
144187
  ((data === null || data === void 0 ? void 0 : data.outcomeByCategory) && data.outcomeByCategory.length > 0);
144195
- const hasMultipleCategories = ((_f = (_e = data === null || data === void 0 ? void 0 : data.incomeByCategory) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0) > 1 ||
144196
- ((_h = (_g = data === null || data === void 0 ? void 0 : data.outcomeByCategory) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) > 1;
144197
- const expanded = hasMultipleCategories ? true : isExpandedManually;
144188
+ const expanded = isExpandedManually;
144198
144189
  React$1.useEffect(() => {
144199
144190
  setIsExpandedManually(defaultExpanded);
144200
144191
  }, [defaultExpanded]);
144201
144192
  const handleToggleExpand = (e) => {
144202
- if (hasMultipleCategories)
144203
- return;
144204
144193
  e.stopPropagation();
144205
144194
  setIsExpandedManually((current) => !current);
144206
144195
  };
144207
144196
  return (React$1.createElement(Card$1, { onClick: onClick, sx: {
144208
144197
  borderRadius: RADIUS.default,
144209
- boxShadow: theme.shadows[2],
144198
+ boxShadow: "none",
144199
+ border: 1,
144200
+ borderColor: "divider",
144210
144201
  overflow: "hidden",
144211
144202
  cursor: onClick ? "pointer" : "default",
144212
- "&:hover": onClick ? { boxShadow: theme.shadows[4] } : undefined,
144213
- transition: "box-shadow 0.2s ease",
144203
+ outline: "none",
144204
+ "&:hover": onClick
144205
+ ? { borderColor: "primary.main", boxShadow: "none" }
144206
+ : undefined,
144207
+ "&:focus-visible": {
144208
+ outline: "2px solid",
144209
+ outlineColor: "primary.main",
144210
+ outlineOffset: 2,
144211
+ },
144214
144212
  } },
144215
144213
  React$1.createElement(CardHeader$1, { title: React$1.createElement(Stack$1, { direction: "row", alignItems: "center", justifyContent: "space-between", spacing: LIST_GAP },
144216
- React$1.createElement(Stack$1, { direction: "row", alignItems: "center", spacing: 1 },
144217
- React$1.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 700, color: "text.primary" } }, "Resumo Financeiro"),
144218
- React$1.createElement(Chip$1, { size: "small", label: getCurrentMonthName(), color: "primary", variant: "outlined", sx: {
144219
- bgcolor: alpha(theme.palette.primary.main, 0.08),
144220
- borderColor: alpha(theme.palette.primary.main, 0.3),
144221
- fontWeight: 500,
144222
- textTransform: "capitalize",
144223
- } })),
144224
- hasCorrections && (React$1.createElement(Chip$1, { size: "small", icon: React$1.createElement(BuildIcon, { sx: { fontSize: 14 } }), label: `${(_j = data === null || data === void 0 ? void 0 : data.corrections) === null || _j === void 0 ? void 0 : _j.totalCorrections} correções`, color: "warning", variant: "outlined", sx: {
144214
+ React$1.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 700, color: "text.primary" } }, "Resumo Financeiro"),
144215
+ hasCorrections && (React$1.createElement(Chip$1, { size: "small", icon: React$1.createElement(BuildIcon, { sx: { fontSize: 14 } }), label: `${(_g = data === null || data === void 0 ? void 0 : data.corrections) === null || _g === void 0 ? void 0 : _g.totalCorrections} correções`, color: "warning", variant: "outlined", sx: {
144225
144216
  bgcolor: alpha(theme.palette.warning.main, 0.08),
144226
144217
  borderColor: alpha(theme.palette.warning.main, 0.3),
144227
144218
  fontWeight: 500,
@@ -144235,28 +144226,18 @@ const FinancialOverviewCard = React$1.memo(({ data, isLoading = false, formatCur
144235
144226
  React$1.createElement(Box$1, { sx: {
144236
144227
  p: CARD_PADDING,
144237
144228
  borderRadius: RADIUS.default,
144238
- bgcolor: alpha(((_l = (_k = data === null || data === void 0 ? void 0 : data.overview) === null || _k === void 0 ? void 0 : _k.totalBalance) !== null && _l !== void 0 ? _l : 0) < 0
144239
- ? theme.palette.primary.main
144240
- : theme.palette.success.main, 0.04),
144241
- border: `1px solid ${alpha(((_o = (_m = data === null || data === void 0 ? void 0 : data.overview) === null || _m === void 0 ? void 0 : _m.totalBalance) !== null && _o !== void 0 ? _o : 0) < 0
144242
- ? theme.palette.primary.main
144243
- : theme.palette.success.main, 0.1)}`,
144229
+ bgcolor: alpha(balanceColor, 0.04),
144230
+ border: `1px solid ${alpha(balanceColor, 0.1)}`,
144244
144231
  } },
144245
144232
  React$1.createElement(MetricItem, { icon: React$1.createElement(AccountBalanceIcon, { fontSize: "small" }), label: "Saldo Total (todas as contas)", value: isLoading
144246
144233
  ? ""
144247
- : format((_q = (_p = data === null || data === void 0 ? void 0 : data.overview) === null || _p === void 0 ? void 0 : _p.totalBalance) !== null && _q !== void 0 ? _q : 0, (_r = data === null || data === void 0 ? void 0 : data.formatted) === null || _r === void 0 ? void 0 : _r.totalBalance), color: ((_t = (_s = data === null || data === void 0 ? void 0 : data.overview) === null || _s === void 0 ? void 0 : _s.totalBalance) !== null && _t !== void 0 ? _t : 0) < 0
144248
- ? theme.palette.primary.main
144249
- : theme.palette.success.main, isLoading: isLoading }))),
144234
+ : format((_j = (_h = data === null || data === void 0 ? void 0 : data.overview) === null || _h === void 0 ? void 0 : _h.totalBalance) !== null && _j !== void 0 ? _j : 0, (_k = data === null || data === void 0 ? void 0 : data.formatted) === null || _k === void 0 ? void 0 : _k.totalBalance), color: balanceColor, isLoading: isLoading }))),
144250
144235
  (hasMemberPayments || isLoading) && (React$1.createElement(Grid$1, { item: true, xs: 12 },
144251
- React$1.createElement(MemberPaymentsSection, { data: data === null || data === void 0 ? void 0 : data.memberPayments, isLoading: isLoading }))),
144252
- React$1.createElement(Grid$1, { item: true, xs: 6 },
144253
- React$1.createElement(MetricItem, { icon: React$1.createElement(TrendingUp$1, { fontSize: "small" }), label: "Entradas (m\u00EAs)", value: isLoading
144254
- ? ""
144255
- : format((_v = (_u = data === null || data === void 0 ? void 0 : data.overview) === null || _u === void 0 ? void 0 : _u.totalIncome) !== null && _v !== void 0 ? _v : 0, (_w = data === null || data === void 0 ? void 0 : data.formatted) === null || _w === void 0 ? void 0 : _w.totalIncome), color: theme.palette.success.main, isLoading: isLoading })),
144256
- React$1.createElement(Grid$1, { item: true, xs: 6 },
144257
- React$1.createElement(MetricItem, { icon: React$1.createElement(TrendingDownIcon, { fontSize: "small" }), label: "Sa\u00EDdas (m\u00EAs)", value: isLoading
144258
- ? ""
144259
- : format((_y = (_x = data === null || data === void 0 ? void 0 : data.overview) === null || _x === void 0 ? void 0 : _x.totalOutcome) !== null && _y !== void 0 ? _y : 0, (_z = data === null || data === void 0 ? void 0 : data.formatted) === null || _z === void 0 ? void 0 : _z.totalOutcome), color: theme.palette.error.main, isLoading: isLoading })),
144236
+ React$1.createElement(MemberPaymentsSection, { data: data === null || data === void 0 ? void 0 : data.memberPayments, isLoading: isLoading, collectedLabel: isLoading
144237
+ ? undefined
144238
+ : format((_m = (_l = data === null || data === void 0 ? void 0 : data.memberPayments) === null || _l === void 0 ? void 0 : _l.collectedAmount) !== null && _m !== void 0 ? _m : 0, (_o = data === null || data === void 0 ? void 0 : data.formatted) === null || _o === void 0 ? void 0 : _o.memberPaymentsCollected), expectedLabel: isLoading
144239
+ ? undefined
144240
+ : format((_q = (_p = data === null || data === void 0 ? void 0 : data.memberPayments) === null || _p === void 0 ? void 0 : _p.expectedAmount) !== null && _q !== void 0 ? _q : 0, (_r = data === null || data === void 0 ? void 0 : data.formatted) === null || _r === void 0 ? void 0 : _r.memberPaymentsExpected) }))),
144260
144241
  React$1.createElement(Grid$1, { item: true, xs: 12 },
144261
144242
  React$1.createElement(Box$1, { sx: {
144262
144243
  p: LIST_CARD_CONTENT_PADDING,
@@ -144272,37 +144253,39 @@ const FinancialOverviewCard = React$1.memo(({ data, isLoading = false, formatCur
144272
144253
  fontWeight: 700,
144273
144254
  color: netFlowColor,
144274
144255
  } },
144275
- ((_1 = (_0 = data === null || data === void 0 ? void 0 : data.overview) === null || _0 === void 0 ? void 0 : _0.netFlow) !== null && _1 !== void 0 ? _1 : 0) >= 0 ? "+" : "",
144276
- format((_3 = (_2 = data === null || data === void 0 ? void 0 : data.overview) === null || _2 === void 0 ? void 0 : _2.netFlow) !== null && _3 !== void 0 ? _3 : 0, (_4 = data === null || data === void 0 ? void 0 : data.formatted) === null || _4 === void 0 ? void 0 : _4.netFlow))))),
144256
+ ((_t = (_s = data === null || data === void 0 ? void 0 : data.overview) === null || _s === void 0 ? void 0 : _s.netFlow) !== null && _t !== void 0 ? _t : 0) >= 0 ? "+" : "",
144257
+ format((_v = (_u = data === null || data === void 0 ? void 0 : data.overview) === null || _u === void 0 ? void 0 : _u.netFlow) !== null && _v !== void 0 ? _v : 0, (_w = data === null || data === void 0 ? void 0 : data.formatted) === null || _w === void 0 ? void 0 : _w.netFlow))))),
144277
144258
  (hasCategories || isLoading) && (React$1.createElement(Grid$1, { item: true, xs: 12 },
144278
- React$1.createElement(Box$1, { onClick: hasMultipleCategories ? undefined : handleToggleExpand, sx: {
144279
- cursor: hasMultipleCategories ? "default" : "pointer",
144259
+ React$1.createElement(Box$1, { component: "button", type: "button", onClick: handleToggleExpand, sx: {
144260
+ width: "100%",
144261
+ cursor: "pointer",
144280
144262
  display: "flex",
144281
144263
  alignItems: "center",
144282
144264
  justifyContent: "center",
144283
144265
  py: 0.5,
144284
144266
  color: theme.palette.text.secondary,
144267
+ background: "none",
144268
+ border: 0,
144285
144269
  "&:hover": {
144286
- color: hasMultipleCategories
144287
- ? theme.palette.text.secondary
144288
- : theme.palette.primary.main,
144270
+ color: theme.palette.primary.main,
144271
+ },
144272
+ "&:focus-visible": {
144273
+ outline: "2px solid",
144274
+ outlineColor: theme.palette.primary.main,
144275
+ outlineOffset: 2,
144289
144276
  },
144290
144277
  } },
144291
144278
  React$1.createElement(CategoryIcon, { sx: { fontSize: 16, mr: 0.5 } }),
144292
- React$1.createElement(Typography$1, { variant: "caption" }, hasMultipleCategories
144293
- ? "Categorias detalhadas"
144294
- : expanded
144295
- ? "Ocultar categorias"
144296
- : "Ver por categoria")),
144279
+ React$1.createElement(Typography$1, { variant: "caption", component: "span" }, expanded ? "Ocultar categorias" : "Ver por categoria")),
144297
144280
  React$1.createElement(Collapse$1, { in: expanded },
144298
144281
  React$1.createElement(Divider$1, { sx: { my: 1.5 } }),
144299
144282
  React$1.createElement(Grid$1, { container: true, spacing: GRID_GAP },
144300
- (((_5 = data === null || data === void 0 ? void 0 : data.incomeByCategory) === null || _5 === void 0 ? void 0 : _5.length) || isLoading) && (React$1.createElement(Grid$1, { item: true, xs: 12, sm: 6 },
144283
+ (((_x = data === null || data === void 0 ? void 0 : data.incomeByCategory) === null || _x === void 0 ? void 0 : _x.length) || isLoading) && (React$1.createElement(Grid$1, { item: true, xs: 12, sm: 6 },
144301
144284
  React$1.createElement(CategoryBreakdownSection, { title: "Entradas por Categoria", categories: data === null || data === void 0 ? void 0 : data.incomeByCategory, color: theme.palette.success.main, isLoading: isLoading, icon: React$1.createElement(TrendingUp$1, { sx: {
144302
144285
  fontSize: 16,
144303
144286
  color: theme.palette.success.main,
144304
144287
  } }) }))),
144305
- (((_6 = data === null || data === void 0 ? void 0 : data.outcomeByCategory) === null || _6 === void 0 ? void 0 : _6.length) || isLoading) && (React$1.createElement(Grid$1, { item: true, xs: 12, sm: 6 },
144288
+ (((_y = data === null || data === void 0 ? void 0 : data.outcomeByCategory) === null || _y === void 0 ? void 0 : _y.length) || isLoading) && (React$1.createElement(Grid$1, { item: true, xs: 12, sm: 6 },
144306
144289
  React$1.createElement(CategoryBreakdownSection, { title: "Sa\u00EDdas por Categoria", categories: data === null || data === void 0 ? void 0 : data.outcomeByCategory, color: theme.palette.error.main, isLoading: isLoading, icon: React$1.createElement(TrendingDownIcon, { sx: {
144307
144290
  fontSize: 16,
144308
144291
  color: theme.palette.error.main,
@@ -144412,7 +144395,6 @@ const AccountListItem = React$1.memo(({ account, isLastItem, onSelect, formatCur
144412
144395
  const theme = useTheme$1();
144413
144396
  const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
144414
144397
  // Convert string balances to numbers for formatting
144415
- const initialBalance = parseFloat(account.initialBalance);
144416
144398
  const currentBalance = parseFloat(account.currentBalance);
144417
144399
  return (React$1.createElement(ListItem$1, { "data-testid": `financial-account-list-item-${account.id}`, sx: {
144418
144400
  width: "100%",
@@ -144445,9 +144427,6 @@ const AccountListItem = React$1.memo(({ account, isLastItem, onSelect, formatCur
144445
144427
  account.agency,
144446
144428
  " | Conta: ",
144447
144429
  account.account)),
144448
- React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { fontSize: { xs: "0.75rem", sm: "0.875rem" } } },
144449
- "Saldo inicial: ",
144450
- formatCurrency(initialBalance)),
144451
144430
  React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { fontSize: { xs: "0.75rem", sm: "0.875rem" } } },
144452
144431
  "Saldo atual: ",
144453
144432
  formatCurrency(currentBalance)),
@@ -144495,8 +144474,7 @@ const EmptyState$2 = React$1.memo(({ onAddAccount, theme }) => {
144495
144474
  });
144496
144475
  EmptyState$2.displayName = "EmptyState";
144497
144476
  // Income/Outcome card component
144498
- const FinanceMetricCard = React$1.memo(({ title, value, month, year, color, icon, formatCurrency, onClick, showAmount = true, ctaLabel, ctaDescription, ariaLabel, testId, }) => {
144499
- const theme = useTheme$1();
144477
+ const FinanceMetricCard = React$1.memo(({ title, value, color, icon, formatCurrency, onClick, ctaLabel = "Ver lista", ariaLabel, testId, }) => {
144500
144478
  const handleKeyDown = (e) => {
144501
144479
  if (!onClick)
144502
144480
  return;
@@ -144507,17 +144485,26 @@ const FinanceMetricCard = React$1.memo(({ title, value, month, year, color, icon
144507
144485
  };
144508
144486
  return (React$1.createElement(Card$1, { "data-testid": testId, onClick: onClick, onKeyDown: handleKeyDown, role: onClick ? "button" : undefined, tabIndex: onClick ? 0 : undefined, "aria-label": onClick ? ariaLabel : undefined, sx: {
144509
144487
  borderRadius: RADIUS.default,
144510
- boxShadow: theme.shadows[2],
144488
+ boxShadow: "none",
144489
+ border: 1,
144490
+ borderColor: "divider",
144511
144491
  height: "100%",
144512
144492
  cursor: onClick ? "pointer" : "default",
144513
- // subtle hover elevation when clickable
144514
- "&:hover": onClick ? { boxShadow: theme.shadows[4] } : undefined,
144515
144493
  outline: "none",
144494
+ "&:hover": onClick
144495
+ ? { borderColor: "primary.main", boxShadow: "none" }
144496
+ : undefined,
144497
+ "&:focus-visible": {
144498
+ outline: "2px solid",
144499
+ outlineColor: "primary.main",
144500
+ outlineOffset: 2,
144501
+ },
144516
144502
  } },
144517
144503
  React$1.createElement(CardContent$1, { sx: LIST_CARD_CONTENT_SX },
144518
144504
  React$1.createElement(Box$1, { sx: {
144519
144505
  display: "flex",
144520
144506
  justifyContent: "space-between",
144507
+ alignItems: "flex-start",
144521
144508
  } },
144522
144509
  React$1.createElement(Box$1, { sx: { display: "flex", alignItems: "center", mb: 1 } },
144523
144510
  icon,
@@ -144525,24 +144512,13 @@ const FinanceMetricCard = React$1.memo(({ title, value, month, year, color, icon
144525
144512
  fontWeight: 600,
144526
144513
  ml: 1,
144527
144514
  } }, title)),
144528
- React$1.createElement(Typography$1, { variant: "body2", sx: {
144529
- fontWeight: 100,
144530
- ml: 1,
144531
- } }, showAmount
144532
- ? `${month}/${year}`
144533
- : ctaLabel || (onClick ? "Ver lista" : ""))),
144534
- showAmount ? (React$1.createElement(Typography$1, { variant: "h6", sx: {
144515
+ onClick ? (React$1.createElement(ChevronRight$2, { sx: { color, fontSize: 20 }, "aria-hidden": "true" })) : null),
144516
+ React$1.createElement(Typography$1, { variant: "h6", sx: {
144535
144517
  color: color,
144536
144518
  fontWeight: 600,
144537
144519
  fontSize: { xs: "1rem", sm: "1.25rem" },
144538
- } }, formatCurrency(value))) : (React$1.createElement(Box$1, { sx: {
144539
- display: "flex",
144540
- justifyContent: "space-between",
144541
- alignItems: "center",
144542
- mt: 0.5,
144543
- } },
144544
- React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { fontWeight: 500 } }, ctaDescription || "Abrir lista"),
144545
- React$1.createElement(ChevronRight$2, { sx: { color: color, fontSize: 20 }, "aria-hidden": "true" }))))));
144520
+ } }, formatCurrency(value)),
144521
+ onClick ? (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { fontWeight: 500, mt: 0.5 } }, ctaLabel)) : null)));
144546
144522
  });
144547
144523
  FinanceMetricCard.displayName = "FinanceMetricCard";
144548
144524
  const FinancialAccountsList = (props) => {
@@ -144550,7 +144526,6 @@ const FinancialAccountsList = (props) => {
144550
144526
  const theme = useTheme$1();
144551
144527
  const { data, fns } = useFinancialAccountsList(props);
144552
144528
  const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
144553
- const hasOverviewData = Boolean(props.financialOverview) && !props.isOverviewLoading;
144554
144529
  const showPeriodFilter = (_a = props.showPeriodFilter) !== null && _a !== void 0 ? _a : Boolean(props.periodLabel ||
144555
144530
  props.periodInputValue ||
144556
144531
  props.onPeriodInputChange ||
@@ -144568,25 +144543,23 @@ const FinancialAccountsList = (props) => {
144568
144543
  } },
144569
144544
  React$1.createElement(PageHeader$2, { title: "Financeiro", onBack: props.onBack, onAdd: props.onAddAccount, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
144570
144545
  React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
144571
- showPeriodFilter && (React$1.createElement(Stack$1, { direction: { xs: "column", sm: "row" }, spacing: SECTION_GAP, alignItems: { xs: "flex-start", sm: "center" }, justifyContent: "space-between", sx: { pb: LIST_CONTROLS_MARGIN_BOTTOM } },
144572
- React$1.createElement(Stack$1, { spacing: 0.5 },
144573
- React$1.createElement(Typography$1, { variant: "subtitle2", color: "text.secondary" }, "Compet\u00EAncia"),
144574
- React$1.createElement(Typography$1, { variant: "body2", sx: { textTransform: "capitalize" } }, props.periodLabel || "-")),
144575
- React$1.createElement(Stack$1, { direction: "row", spacing: 1, alignItems: "center" },
144546
+ showPeriodFilter && (React$1.createElement(Stack$1, { spacing: 1, sx: { pb: LIST_CONTROLS_MARGIN_BOTTOM } },
144547
+ React$1.createElement(Stack$1, { direction: "row", spacing: 1, alignItems: "center", flexWrap: "wrap" },
144576
144548
  React$1.createElement(LabeledMonthPicker, { label: "Selecionar m\u00EAs", value: props.periodInputValue || "", onChange: (value) => { var _a; return (_a = props.onPeriodInputChange) === null || _a === void 0 ? void 0 : _a.call(props, value); }, minMonth: props.periodInputMin || "2000-01", maxMonth: props.periodInputMax || "2100-12", "data-testid": "financial-period-input" }),
144577
144549
  React$1.createElement(Button$1, { variant: "text", onClick: props.onResetToCurrentPeriod, "data-testid": "financial-period-current-month-button" }, "M\u00EAs atual"),
144578
144550
  props.canExportFinancialReport &&
144579
144551
  props.onExportFinancialReport && (React$1.createElement(Button$1, { variant: "outlined", onClick: props.onExportFinancialReport, disabled: props.isExportingFinancialReport, "data-testid": "financial-report-export-button" }, props.isExportingFinancialReport
144580
144552
  ? "Exportando..."
144581
- : "Exportar CSV"))))),
144553
+ : "Exportar CSV"))),
144554
+ props.financialReportExportError ? (React$1.createElement(Alert$1, { severity: "error", "data-testid": "financial-report-export-error" }, props.financialReportExportError)) : null)),
144582
144555
  React$1.createElement(Box$1, { sx: { mb: SECTION_GAP } },
144583
144556
  (props.financialOverview || props.isOverviewLoading) && (React$1.createElement(Box$1, { sx: { mb: LIST_CONTROLS_MARGIN_BOTTOM } },
144584
144557
  React$1.createElement(FinancialOverviewCard, { data: props.financialOverview, isLoading: props.isOverviewLoading, formatCurrency: data.formatCurrency, defaultExpanded: props.financialOverviewExpanded, showMemberPayments: Boolean(props.isTerreiro) }))),
144585
144558
  React$1.createElement(Grid$1, { container: true, spacing: GRID_GAP, sx: { mb: LIST_CONTROLS_MARGIN_BOTTOM } },
144586
144559
  React$1.createElement(Grid$1, { item: true, xs: 6 },
144587
- React$1.createElement(FinanceMetricCard, { title: "Entrada", value: data.income.totalAmount || 0, month: data.income.month, year: data.income.year, color: theme.palette.success.main, icon: React$1.createElement(TrendingUp$1, { sx: { color: theme.palette.success.main } }), formatCurrency: data.formatCurrency, onClick: props.onClickIncome, showAmount: !hasOverviewData, ctaLabel: "Ver lista", ctaDescription: "Ir para lista de entradas", ariaLabel: "Ver lista de entradas", testId: "financial-income-metric-card" })),
144560
+ React$1.createElement(FinanceMetricCard, { title: "Entrada", value: data.income.totalAmount || 0, color: theme.palette.success.main, icon: React$1.createElement(TrendingUp$1, { sx: { color: theme.palette.success.main } }), formatCurrency: data.formatCurrency, onClick: props.onClickIncome, ctaLabel: "Ver lista", ariaLabel: "Ver lista de entradas", testId: "financial-income-metric-card" })),
144588
144561
  React$1.createElement(Grid$1, { item: true, xs: 6 },
144589
- React$1.createElement(FinanceMetricCard, { title: "Sa\u00EDda", value: data.outcome.totalAmount || 0, month: data.outcome.month, year: data.outcome.year, color: theme.palette.error.main, icon: React$1.createElement(TrendingDownIcon, { sx: { color: theme.palette.error.main } }), formatCurrency: data.formatCurrency, onClick: props.onClickOutcome, showAmount: !hasOverviewData, ctaLabel: "Ver lista", ctaDescription: "Ir para lista de sa\u00EDdas", ariaLabel: "Ver lista de sa\u00EDdas", testId: "financial-outcome-metric-card" }))),
144562
+ React$1.createElement(FinanceMetricCard, { title: "Sa\u00EDda", value: data.outcome.totalAmount || 0, color: theme.palette.error.main, icon: React$1.createElement(TrendingDownIcon, { sx: { color: theme.palette.error.main } }), formatCurrency: data.formatCurrency, onClick: props.onClickOutcome, ctaLabel: "Ver lista", ariaLabel: "Ver lista de sa\u00EDdas", testId: "financial-outcome-metric-card" }))),
144590
144563
  props.isTerreiro && (React$1.createElement(MonthlyFeeCard, { formatCurrency: data.formatCurrency, monthlyFee: data.monthlyFee || 0, dueDay: data.monthlyFeeDueDay !== undefined
144591
144564
  ? String(data.monthlyFeeDueDay)
144592
144565
  : "-", paymentMethod: data.monthlyFeePaymentMethod !== undefined
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/bundle.cjs.js.map
3
- size: 59331107 bytes
4
- sha256: 91e63aa22b6910291cd7573e4134629e2e5e4ebbd48fe0ff7b16752cf7b55191
3
+ size: 59316926 bytes
4
+ sha256: 731687a6c66ec4748f3039f6c725adb7eb36872b649d6e0baa3947107f84c117
@@ -143928,7 +143928,9 @@ const MonthlyFeeCard = memo(({ formatCurrency, monthlyFee, dueDay, paymentMethod
143928
143928
  };
143929
143929
  return (React__default.createElement(Card$1, { "data-testid": "monthly-fee-action-card", sx: {
143930
143930
  borderRadius: RADIUS.default,
143931
- boxShadow: theme.shadows[2],
143931
+ boxShadow: "none",
143932
+ border: 1,
143933
+ borderColor: "divider",
143932
143934
  overflow: "hidden",
143933
143935
  } },
143934
143936
  React__default.createElement(CardHeader$1, { title: React__default.createElement(Stack$1, { direction: "row", alignItems: "center", justifyContent: "space-between", spacing: LIST_GAP },
@@ -143962,13 +143964,17 @@ const MonthlyFeeCard = memo(({ formatCurrency, monthlyFee, dueDay, paymentMethod
143962
143964
  cursor: isSelectable ? "pointer" : "default",
143963
143965
  borderRadius: RADIUS.default,
143964
143966
  outline: "none",
143965
- transition: "background-color 0.2s ease, box-shadow 0.2s ease",
143967
+ transition: "background-color 0.2s ease",
143966
143968
  "&:hover": isSelectable
143967
143969
  ? {
143968
143970
  bgcolor: theme.palette.action.hover,
143969
- boxShadow: `inset 0 0 0 1px ${alpha(theme.palette.info.main, 0.24)}`,
143970
143971
  }
143971
143972
  : undefined,
143973
+ "&:focus-visible": {
143974
+ outline: "2px solid",
143975
+ outlineColor: theme.palette.primary.main,
143976
+ outlineOffset: 2,
143977
+ },
143972
143978
  } },
143973
143979
  React__default.createElement(Stack$1, { spacing: 0.5, sx: { mb: 1.5 } },
143974
143980
  React__default.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { letterSpacing: 0.2 } }, "Valor da mensalidade"),
@@ -144036,7 +144042,7 @@ const MetricItem = memo(({ icon, label, value, color, isLoading, }) => {
144036
144042
  });
144037
144043
  MetricItem.displayName = "MetricItem";
144038
144044
  // Member payments progress component
144039
- const MemberPaymentsSection = memo(({ data, isLoading }) => {
144045
+ const MemberPaymentsSection = memo(({ data, isLoading, collectedLabel, expectedLabel, }) => {
144040
144046
  const theme = useTheme$1();
144041
144047
  if (isLoading) {
144042
144048
  return (React__default.createElement(Box$1, { sx: {
@@ -144079,7 +144085,11 @@ const MemberPaymentsSection = memo(({ data, isLoading }) => {
144079
144085
  bgcolor: progressColor,
144080
144086
  borderRadius: RADIUS.default,
144081
144087
  },
144082
- } })));
144088
+ } }),
144089
+ collectedLabel && expectedLabel ? (React__default.createElement(Typography$1, { variant: "caption", color: "text.secondary", sx: { mt: 0.75 } },
144090
+ collectedLabel,
144091
+ " recebidos de ",
144092
+ expectedLabel)) : null));
144083
144093
  });
144084
144094
  MemberPaymentsSection.displayName = "MemberPaymentsSection";
144085
144095
  // Category breakdown list component
@@ -144128,7 +144138,7 @@ const CategoryBreakdownSection = memo(({ title, categories, color, isLoading, ic
144128
144138
  });
144129
144139
  CategoryBreakdownSection.displayName = "CategoryBreakdownSection";
144130
144140
  const FinancialOverviewCard = memo(({ data, isLoading = false, formatCurrency, onClick, defaultExpanded = false, showMemberPayments = true, }) => {
144131
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
144141
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
144132
144142
  const theme = useTheme$1();
144133
144143
  const [isExpandedManually, setIsExpandedManually] = useState(defaultExpanded);
144134
144144
  // Helper to format values
@@ -144142,66 +144152,47 @@ const FinancialOverviewCard = memo(({ data, isLoading = false, formatCurrency, o
144142
144152
  currency: "BRL",
144143
144153
  }).format(value);
144144
144154
  };
144145
- // Get the current month name in Portuguese
144146
- const getCurrentMonthName = () => {
144147
- var _a, _b;
144148
- if ((_b = (_a = data === null || data === void 0 ? void 0 : data.overview) === null || _a === void 0 ? void 0 : _a.period) === null || _b === void 0 ? void 0 : _b.start) {
144149
- const date = new Date(data.overview.period.start);
144150
- // Use UTC methods to avoid timezone conversion issues
144151
- const year = date.getUTCFullYear();
144152
- const month = date.getUTCMonth();
144153
- // Create a date in the local timezone with the correct year/month
144154
- const localDate = new Date(year, month, 1);
144155
- return localDate.toLocaleDateString("pt-BR", {
144156
- month: "long",
144157
- year: "numeric",
144158
- });
144159
- }
144160
- return new Date().toLocaleDateString("pt-BR", {
144161
- month: "long",
144162
- year: "numeric",
144163
- });
144164
- };
144165
144155
  // Determine if net flow is positive or negative
144166
- const netFlowColor = ((_b = (_a = data === null || data === void 0 ? void 0 : data.overview) === null || _a === void 0 ? void 0 : _a.netFlow) !== null && _b !== void 0 ? _b : 0) >= 0
144156
+ const balanceColor = ((_b = (_a = data === null || data === void 0 ? void 0 : data.overview) === null || _a === void 0 ? void 0 : _a.totalBalance) !== null && _b !== void 0 ? _b : 0) < 0
144157
+ ? theme.palette.error.main
144158
+ : theme.palette.success.main;
144159
+ const netFlowColor = ((_d = (_c = data === null || data === void 0 ? void 0 : data.overview) === null || _c === void 0 ? void 0 : _c.netFlow) !== null && _d !== void 0 ? _d : 0) >= 0
144167
144160
  ? theme.palette.success.main
144168
144161
  : theme.palette.error.main;
144169
- const hasCorrections = ((_d = (_c = data === null || data === void 0 ? void 0 : data.corrections) === null || _c === void 0 ? void 0 : _c.totalCorrections) !== null && _d !== void 0 ? _d : 0) > 0;
144162
+ const hasCorrections = ((_f = (_e = data === null || data === void 0 ? void 0 : data.corrections) === null || _e === void 0 ? void 0 : _e.totalCorrections) !== null && _f !== void 0 ? _f : 0) > 0;
144170
144163
  const hasMemberPayments = showMemberPayments &&
144171
144164
  (data === null || data === void 0 ? void 0 : data.memberPayments) &&
144172
144165
  data.memberPayments.totalMembers > 0;
144173
144166
  const hasCategories = ((data === null || data === void 0 ? void 0 : data.incomeByCategory) && data.incomeByCategory.length > 0) ||
144174
144167
  ((data === null || data === void 0 ? void 0 : data.outcomeByCategory) && data.outcomeByCategory.length > 0);
144175
- const hasMultipleCategories = ((_f = (_e = data === null || data === void 0 ? void 0 : data.incomeByCategory) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0) > 1 ||
144176
- ((_h = (_g = data === null || data === void 0 ? void 0 : data.outcomeByCategory) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) > 1;
144177
- const expanded = hasMultipleCategories ? true : isExpandedManually;
144168
+ const expanded = isExpandedManually;
144178
144169
  useEffect(() => {
144179
144170
  setIsExpandedManually(defaultExpanded);
144180
144171
  }, [defaultExpanded]);
144181
144172
  const handleToggleExpand = (e) => {
144182
- if (hasMultipleCategories)
144183
- return;
144184
144173
  e.stopPropagation();
144185
144174
  setIsExpandedManually((current) => !current);
144186
144175
  };
144187
144176
  return (React__default.createElement(Card$1, { onClick: onClick, sx: {
144188
144177
  borderRadius: RADIUS.default,
144189
- boxShadow: theme.shadows[2],
144178
+ boxShadow: "none",
144179
+ border: 1,
144180
+ borderColor: "divider",
144190
144181
  overflow: "hidden",
144191
144182
  cursor: onClick ? "pointer" : "default",
144192
- "&:hover": onClick ? { boxShadow: theme.shadows[4] } : undefined,
144193
- transition: "box-shadow 0.2s ease",
144183
+ outline: "none",
144184
+ "&:hover": onClick
144185
+ ? { borderColor: "primary.main", boxShadow: "none" }
144186
+ : undefined,
144187
+ "&:focus-visible": {
144188
+ outline: "2px solid",
144189
+ outlineColor: "primary.main",
144190
+ outlineOffset: 2,
144191
+ },
144194
144192
  } },
144195
144193
  React__default.createElement(CardHeader$1, { title: React__default.createElement(Stack$1, { direction: "row", alignItems: "center", justifyContent: "space-between", spacing: LIST_GAP },
144196
- React__default.createElement(Stack$1, { direction: "row", alignItems: "center", spacing: 1 },
144197
- React__default.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 700, color: "text.primary" } }, "Resumo Financeiro"),
144198
- React__default.createElement(Chip$1, { size: "small", label: getCurrentMonthName(), color: "primary", variant: "outlined", sx: {
144199
- bgcolor: alpha(theme.palette.primary.main, 0.08),
144200
- borderColor: alpha(theme.palette.primary.main, 0.3),
144201
- fontWeight: 500,
144202
- textTransform: "capitalize",
144203
- } })),
144204
- hasCorrections && (React__default.createElement(Chip$1, { size: "small", icon: React__default.createElement(BuildIcon, { sx: { fontSize: 14 } }), label: `${(_j = data === null || data === void 0 ? void 0 : data.corrections) === null || _j === void 0 ? void 0 : _j.totalCorrections} correções`, color: "warning", variant: "outlined", sx: {
144194
+ React__default.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 700, color: "text.primary" } }, "Resumo Financeiro"),
144195
+ hasCorrections && (React__default.createElement(Chip$1, { size: "small", icon: React__default.createElement(BuildIcon, { sx: { fontSize: 14 } }), label: `${(_g = data === null || data === void 0 ? void 0 : data.corrections) === null || _g === void 0 ? void 0 : _g.totalCorrections} correções`, color: "warning", variant: "outlined", sx: {
144205
144196
  bgcolor: alpha(theme.palette.warning.main, 0.08),
144206
144197
  borderColor: alpha(theme.palette.warning.main, 0.3),
144207
144198
  fontWeight: 500,
@@ -144215,28 +144206,18 @@ const FinancialOverviewCard = memo(({ data, isLoading = false, formatCurrency, o
144215
144206
  React__default.createElement(Box$1, { sx: {
144216
144207
  p: CARD_PADDING,
144217
144208
  borderRadius: RADIUS.default,
144218
- bgcolor: alpha(((_l = (_k = data === null || data === void 0 ? void 0 : data.overview) === null || _k === void 0 ? void 0 : _k.totalBalance) !== null && _l !== void 0 ? _l : 0) < 0
144219
- ? theme.palette.primary.main
144220
- : theme.palette.success.main, 0.04),
144221
- border: `1px solid ${alpha(((_o = (_m = data === null || data === void 0 ? void 0 : data.overview) === null || _m === void 0 ? void 0 : _m.totalBalance) !== null && _o !== void 0 ? _o : 0) < 0
144222
- ? theme.palette.primary.main
144223
- : theme.palette.success.main, 0.1)}`,
144209
+ bgcolor: alpha(balanceColor, 0.04),
144210
+ border: `1px solid ${alpha(balanceColor, 0.1)}`,
144224
144211
  } },
144225
144212
  React__default.createElement(MetricItem, { icon: React__default.createElement(AccountBalanceIcon, { fontSize: "small" }), label: "Saldo Total (todas as contas)", value: isLoading
144226
144213
  ? ""
144227
- : format((_q = (_p = data === null || data === void 0 ? void 0 : data.overview) === null || _p === void 0 ? void 0 : _p.totalBalance) !== null && _q !== void 0 ? _q : 0, (_r = data === null || data === void 0 ? void 0 : data.formatted) === null || _r === void 0 ? void 0 : _r.totalBalance), color: ((_t = (_s = data === null || data === void 0 ? void 0 : data.overview) === null || _s === void 0 ? void 0 : _s.totalBalance) !== null && _t !== void 0 ? _t : 0) < 0
144228
- ? theme.palette.primary.main
144229
- : theme.palette.success.main, isLoading: isLoading }))),
144214
+ : format((_j = (_h = data === null || data === void 0 ? void 0 : data.overview) === null || _h === void 0 ? void 0 : _h.totalBalance) !== null && _j !== void 0 ? _j : 0, (_k = data === null || data === void 0 ? void 0 : data.formatted) === null || _k === void 0 ? void 0 : _k.totalBalance), color: balanceColor, isLoading: isLoading }))),
144230
144215
  (hasMemberPayments || isLoading) && (React__default.createElement(Grid$1, { item: true, xs: 12 },
144231
- React__default.createElement(MemberPaymentsSection, { data: data === null || data === void 0 ? void 0 : data.memberPayments, isLoading: isLoading }))),
144232
- React__default.createElement(Grid$1, { item: true, xs: 6 },
144233
- React__default.createElement(MetricItem, { icon: React__default.createElement(TrendingUp$1, { fontSize: "small" }), label: "Entradas (m\u00EAs)", value: isLoading
144234
- ? ""
144235
- : format((_v = (_u = data === null || data === void 0 ? void 0 : data.overview) === null || _u === void 0 ? void 0 : _u.totalIncome) !== null && _v !== void 0 ? _v : 0, (_w = data === null || data === void 0 ? void 0 : data.formatted) === null || _w === void 0 ? void 0 : _w.totalIncome), color: theme.palette.success.main, isLoading: isLoading })),
144236
- React__default.createElement(Grid$1, { item: true, xs: 6 },
144237
- React__default.createElement(MetricItem, { icon: React__default.createElement(TrendingDownIcon, { fontSize: "small" }), label: "Sa\u00EDdas (m\u00EAs)", value: isLoading
144238
- ? ""
144239
- : format((_y = (_x = data === null || data === void 0 ? void 0 : data.overview) === null || _x === void 0 ? void 0 : _x.totalOutcome) !== null && _y !== void 0 ? _y : 0, (_z = data === null || data === void 0 ? void 0 : data.formatted) === null || _z === void 0 ? void 0 : _z.totalOutcome), color: theme.palette.error.main, isLoading: isLoading })),
144216
+ React__default.createElement(MemberPaymentsSection, { data: data === null || data === void 0 ? void 0 : data.memberPayments, isLoading: isLoading, collectedLabel: isLoading
144217
+ ? undefined
144218
+ : format((_m = (_l = data === null || data === void 0 ? void 0 : data.memberPayments) === null || _l === void 0 ? void 0 : _l.collectedAmount) !== null && _m !== void 0 ? _m : 0, (_o = data === null || data === void 0 ? void 0 : data.formatted) === null || _o === void 0 ? void 0 : _o.memberPaymentsCollected), expectedLabel: isLoading
144219
+ ? undefined
144220
+ : format((_q = (_p = data === null || data === void 0 ? void 0 : data.memberPayments) === null || _p === void 0 ? void 0 : _p.expectedAmount) !== null && _q !== void 0 ? _q : 0, (_r = data === null || data === void 0 ? void 0 : data.formatted) === null || _r === void 0 ? void 0 : _r.memberPaymentsExpected) }))),
144240
144221
  React__default.createElement(Grid$1, { item: true, xs: 12 },
144241
144222
  React__default.createElement(Box$1, { sx: {
144242
144223
  p: LIST_CARD_CONTENT_PADDING,
@@ -144252,37 +144233,39 @@ const FinancialOverviewCard = memo(({ data, isLoading = false, formatCurrency, o
144252
144233
  fontWeight: 700,
144253
144234
  color: netFlowColor,
144254
144235
  } },
144255
- ((_1 = (_0 = data === null || data === void 0 ? void 0 : data.overview) === null || _0 === void 0 ? void 0 : _0.netFlow) !== null && _1 !== void 0 ? _1 : 0) >= 0 ? "+" : "",
144256
- format((_3 = (_2 = data === null || data === void 0 ? void 0 : data.overview) === null || _2 === void 0 ? void 0 : _2.netFlow) !== null && _3 !== void 0 ? _3 : 0, (_4 = data === null || data === void 0 ? void 0 : data.formatted) === null || _4 === void 0 ? void 0 : _4.netFlow))))),
144236
+ ((_t = (_s = data === null || data === void 0 ? void 0 : data.overview) === null || _s === void 0 ? void 0 : _s.netFlow) !== null && _t !== void 0 ? _t : 0) >= 0 ? "+" : "",
144237
+ format((_v = (_u = data === null || data === void 0 ? void 0 : data.overview) === null || _u === void 0 ? void 0 : _u.netFlow) !== null && _v !== void 0 ? _v : 0, (_w = data === null || data === void 0 ? void 0 : data.formatted) === null || _w === void 0 ? void 0 : _w.netFlow))))),
144257
144238
  (hasCategories || isLoading) && (React__default.createElement(Grid$1, { item: true, xs: 12 },
144258
- React__default.createElement(Box$1, { onClick: hasMultipleCategories ? undefined : handleToggleExpand, sx: {
144259
- cursor: hasMultipleCategories ? "default" : "pointer",
144239
+ React__default.createElement(Box$1, { component: "button", type: "button", onClick: handleToggleExpand, sx: {
144240
+ width: "100%",
144241
+ cursor: "pointer",
144260
144242
  display: "flex",
144261
144243
  alignItems: "center",
144262
144244
  justifyContent: "center",
144263
144245
  py: 0.5,
144264
144246
  color: theme.palette.text.secondary,
144247
+ background: "none",
144248
+ border: 0,
144265
144249
  "&:hover": {
144266
- color: hasMultipleCategories
144267
- ? theme.palette.text.secondary
144268
- : theme.palette.primary.main,
144250
+ color: theme.palette.primary.main,
144251
+ },
144252
+ "&:focus-visible": {
144253
+ outline: "2px solid",
144254
+ outlineColor: theme.palette.primary.main,
144255
+ outlineOffset: 2,
144269
144256
  },
144270
144257
  } },
144271
144258
  React__default.createElement(CategoryIcon, { sx: { fontSize: 16, mr: 0.5 } }),
144272
- React__default.createElement(Typography$1, { variant: "caption" }, hasMultipleCategories
144273
- ? "Categorias detalhadas"
144274
- : expanded
144275
- ? "Ocultar categorias"
144276
- : "Ver por categoria")),
144259
+ React__default.createElement(Typography$1, { variant: "caption", component: "span" }, expanded ? "Ocultar categorias" : "Ver por categoria")),
144277
144260
  React__default.createElement(Collapse$1, { in: expanded },
144278
144261
  React__default.createElement(Divider$1, { sx: { my: 1.5 } }),
144279
144262
  React__default.createElement(Grid$1, { container: true, spacing: GRID_GAP },
144280
- (((_5 = data === null || data === void 0 ? void 0 : data.incomeByCategory) === null || _5 === void 0 ? void 0 : _5.length) || isLoading) && (React__default.createElement(Grid$1, { item: true, xs: 12, sm: 6 },
144263
+ (((_x = data === null || data === void 0 ? void 0 : data.incomeByCategory) === null || _x === void 0 ? void 0 : _x.length) || isLoading) && (React__default.createElement(Grid$1, { item: true, xs: 12, sm: 6 },
144281
144264
  React__default.createElement(CategoryBreakdownSection, { title: "Entradas por Categoria", categories: data === null || data === void 0 ? void 0 : data.incomeByCategory, color: theme.palette.success.main, isLoading: isLoading, icon: React__default.createElement(TrendingUp$1, { sx: {
144282
144265
  fontSize: 16,
144283
144266
  color: theme.palette.success.main,
144284
144267
  } }) }))),
144285
- (((_6 = data === null || data === void 0 ? void 0 : data.outcomeByCategory) === null || _6 === void 0 ? void 0 : _6.length) || isLoading) && (React__default.createElement(Grid$1, { item: true, xs: 12, sm: 6 },
144268
+ (((_y = data === null || data === void 0 ? void 0 : data.outcomeByCategory) === null || _y === void 0 ? void 0 : _y.length) || isLoading) && (React__default.createElement(Grid$1, { item: true, xs: 12, sm: 6 },
144286
144269
  React__default.createElement(CategoryBreakdownSection, { title: "Sa\u00EDdas por Categoria", categories: data === null || data === void 0 ? void 0 : data.outcomeByCategory, color: theme.palette.error.main, isLoading: isLoading, icon: React__default.createElement(TrendingDownIcon, { sx: {
144287
144270
  fontSize: 16,
144288
144271
  color: theme.palette.error.main,
@@ -144392,7 +144375,6 @@ const AccountListItem = memo(({ account, isLastItem, onSelect, formatCurrency })
144392
144375
  const theme = useTheme$1();
144393
144376
  const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
144394
144377
  // Convert string balances to numbers for formatting
144395
- const initialBalance = parseFloat(account.initialBalance);
144396
144378
  const currentBalance = parseFloat(account.currentBalance);
144397
144379
  return (React__default.createElement(ListItem$1, { "data-testid": `financial-account-list-item-${account.id}`, sx: {
144398
144380
  width: "100%",
@@ -144425,9 +144407,6 @@ const AccountListItem = memo(({ account, isLastItem, onSelect, formatCurrency })
144425
144407
  account.agency,
144426
144408
  " | Conta: ",
144427
144409
  account.account)),
144428
- React__default.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { fontSize: { xs: "0.75rem", sm: "0.875rem" } } },
144429
- "Saldo inicial: ",
144430
- formatCurrency(initialBalance)),
144431
144410
  React__default.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { fontSize: { xs: "0.75rem", sm: "0.875rem" } } },
144432
144411
  "Saldo atual: ",
144433
144412
  formatCurrency(currentBalance)),
@@ -144475,8 +144454,7 @@ const EmptyState$2 = memo(({ onAddAccount, theme }) => {
144475
144454
  });
144476
144455
  EmptyState$2.displayName = "EmptyState";
144477
144456
  // Income/Outcome card component
144478
- const FinanceMetricCard = memo(({ title, value, month, year, color, icon, formatCurrency, onClick, showAmount = true, ctaLabel, ctaDescription, ariaLabel, testId, }) => {
144479
- const theme = useTheme$1();
144457
+ const FinanceMetricCard = memo(({ title, value, color, icon, formatCurrency, onClick, ctaLabel = "Ver lista", ariaLabel, testId, }) => {
144480
144458
  const handleKeyDown = (e) => {
144481
144459
  if (!onClick)
144482
144460
  return;
@@ -144487,17 +144465,26 @@ const FinanceMetricCard = memo(({ title, value, month, year, color, icon, format
144487
144465
  };
144488
144466
  return (React__default.createElement(Card$1, { "data-testid": testId, onClick: onClick, onKeyDown: handleKeyDown, role: onClick ? "button" : undefined, tabIndex: onClick ? 0 : undefined, "aria-label": onClick ? ariaLabel : undefined, sx: {
144489
144467
  borderRadius: RADIUS.default,
144490
- boxShadow: theme.shadows[2],
144468
+ boxShadow: "none",
144469
+ border: 1,
144470
+ borderColor: "divider",
144491
144471
  height: "100%",
144492
144472
  cursor: onClick ? "pointer" : "default",
144493
- // subtle hover elevation when clickable
144494
- "&:hover": onClick ? { boxShadow: theme.shadows[4] } : undefined,
144495
144473
  outline: "none",
144474
+ "&:hover": onClick
144475
+ ? { borderColor: "primary.main", boxShadow: "none" }
144476
+ : undefined,
144477
+ "&:focus-visible": {
144478
+ outline: "2px solid",
144479
+ outlineColor: "primary.main",
144480
+ outlineOffset: 2,
144481
+ },
144496
144482
  } },
144497
144483
  React__default.createElement(CardContent$1, { sx: LIST_CARD_CONTENT_SX },
144498
144484
  React__default.createElement(Box$1, { sx: {
144499
144485
  display: "flex",
144500
144486
  justifyContent: "space-between",
144487
+ alignItems: "flex-start",
144501
144488
  } },
144502
144489
  React__default.createElement(Box$1, { sx: { display: "flex", alignItems: "center", mb: 1 } },
144503
144490
  icon,
@@ -144505,24 +144492,13 @@ const FinanceMetricCard = memo(({ title, value, month, year, color, icon, format
144505
144492
  fontWeight: 600,
144506
144493
  ml: 1,
144507
144494
  } }, title)),
144508
- React__default.createElement(Typography$1, { variant: "body2", sx: {
144509
- fontWeight: 100,
144510
- ml: 1,
144511
- } }, showAmount
144512
- ? `${month}/${year}`
144513
- : ctaLabel || (onClick ? "Ver lista" : ""))),
144514
- showAmount ? (React__default.createElement(Typography$1, { variant: "h6", sx: {
144495
+ onClick ? (React__default.createElement(ChevronRight$2, { sx: { color, fontSize: 20 }, "aria-hidden": "true" })) : null),
144496
+ React__default.createElement(Typography$1, { variant: "h6", sx: {
144515
144497
  color: color,
144516
144498
  fontWeight: 600,
144517
144499
  fontSize: { xs: "1rem", sm: "1.25rem" },
144518
- } }, formatCurrency(value))) : (React__default.createElement(Box$1, { sx: {
144519
- display: "flex",
144520
- justifyContent: "space-between",
144521
- alignItems: "center",
144522
- mt: 0.5,
144523
- } },
144524
- React__default.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { fontWeight: 500 } }, ctaDescription || "Abrir lista"),
144525
- React__default.createElement(ChevronRight$2, { sx: { color: color, fontSize: 20 }, "aria-hidden": "true" }))))));
144500
+ } }, formatCurrency(value)),
144501
+ onClick ? (React__default.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { fontWeight: 500, mt: 0.5 } }, ctaLabel)) : null)));
144526
144502
  });
144527
144503
  FinanceMetricCard.displayName = "FinanceMetricCard";
144528
144504
  const FinancialAccountsList = (props) => {
@@ -144530,7 +144506,6 @@ const FinancialAccountsList = (props) => {
144530
144506
  const theme = useTheme$1();
144531
144507
  const { data, fns } = useFinancialAccountsList(props);
144532
144508
  const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
144533
- const hasOverviewData = Boolean(props.financialOverview) && !props.isOverviewLoading;
144534
144509
  const showPeriodFilter = (_a = props.showPeriodFilter) !== null && _a !== void 0 ? _a : Boolean(props.periodLabel ||
144535
144510
  props.periodInputValue ||
144536
144511
  props.onPeriodInputChange ||
@@ -144548,25 +144523,23 @@ const FinancialAccountsList = (props) => {
144548
144523
  } },
144549
144524
  React__default.createElement(PageHeader$2, { title: "Financeiro", onBack: props.onBack, onAdd: props.onAddAccount, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
144550
144525
  React__default.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
144551
- showPeriodFilter && (React__default.createElement(Stack$1, { direction: { xs: "column", sm: "row" }, spacing: SECTION_GAP, alignItems: { xs: "flex-start", sm: "center" }, justifyContent: "space-between", sx: { pb: LIST_CONTROLS_MARGIN_BOTTOM } },
144552
- React__default.createElement(Stack$1, { spacing: 0.5 },
144553
- React__default.createElement(Typography$1, { variant: "subtitle2", color: "text.secondary" }, "Compet\u00EAncia"),
144554
- React__default.createElement(Typography$1, { variant: "body2", sx: { textTransform: "capitalize" } }, props.periodLabel || "-")),
144555
- React__default.createElement(Stack$1, { direction: "row", spacing: 1, alignItems: "center" },
144526
+ showPeriodFilter && (React__default.createElement(Stack$1, { spacing: 1, sx: { pb: LIST_CONTROLS_MARGIN_BOTTOM } },
144527
+ React__default.createElement(Stack$1, { direction: "row", spacing: 1, alignItems: "center", flexWrap: "wrap" },
144556
144528
  React__default.createElement(LabeledMonthPicker, { label: "Selecionar m\u00EAs", value: props.periodInputValue || "", onChange: (value) => { var _a; return (_a = props.onPeriodInputChange) === null || _a === void 0 ? void 0 : _a.call(props, value); }, minMonth: props.periodInputMin || "2000-01", maxMonth: props.periodInputMax || "2100-12", "data-testid": "financial-period-input" }),
144557
144529
  React__default.createElement(Button$1, { variant: "text", onClick: props.onResetToCurrentPeriod, "data-testid": "financial-period-current-month-button" }, "M\u00EAs atual"),
144558
144530
  props.canExportFinancialReport &&
144559
144531
  props.onExportFinancialReport && (React__default.createElement(Button$1, { variant: "outlined", onClick: props.onExportFinancialReport, disabled: props.isExportingFinancialReport, "data-testid": "financial-report-export-button" }, props.isExportingFinancialReport
144560
144532
  ? "Exportando..."
144561
- : "Exportar CSV"))))),
144533
+ : "Exportar CSV"))),
144534
+ props.financialReportExportError ? (React__default.createElement(Alert$1, { severity: "error", "data-testid": "financial-report-export-error" }, props.financialReportExportError)) : null)),
144562
144535
  React__default.createElement(Box$1, { sx: { mb: SECTION_GAP } },
144563
144536
  (props.financialOverview || props.isOverviewLoading) && (React__default.createElement(Box$1, { sx: { mb: LIST_CONTROLS_MARGIN_BOTTOM } },
144564
144537
  React__default.createElement(FinancialOverviewCard, { data: props.financialOverview, isLoading: props.isOverviewLoading, formatCurrency: data.formatCurrency, defaultExpanded: props.financialOverviewExpanded, showMemberPayments: Boolean(props.isTerreiro) }))),
144565
144538
  React__default.createElement(Grid$1, { container: true, spacing: GRID_GAP, sx: { mb: LIST_CONTROLS_MARGIN_BOTTOM } },
144566
144539
  React__default.createElement(Grid$1, { item: true, xs: 6 },
144567
- React__default.createElement(FinanceMetricCard, { title: "Entrada", value: data.income.totalAmount || 0, month: data.income.month, year: data.income.year, color: theme.palette.success.main, icon: React__default.createElement(TrendingUp$1, { sx: { color: theme.palette.success.main } }), formatCurrency: data.formatCurrency, onClick: props.onClickIncome, showAmount: !hasOverviewData, ctaLabel: "Ver lista", ctaDescription: "Ir para lista de entradas", ariaLabel: "Ver lista de entradas", testId: "financial-income-metric-card" })),
144540
+ React__default.createElement(FinanceMetricCard, { title: "Entrada", value: data.income.totalAmount || 0, color: theme.palette.success.main, icon: React__default.createElement(TrendingUp$1, { sx: { color: theme.palette.success.main } }), formatCurrency: data.formatCurrency, onClick: props.onClickIncome, ctaLabel: "Ver lista", ariaLabel: "Ver lista de entradas", testId: "financial-income-metric-card" })),
144568
144541
  React__default.createElement(Grid$1, { item: true, xs: 6 },
144569
- React__default.createElement(FinanceMetricCard, { title: "Sa\u00EDda", value: data.outcome.totalAmount || 0, month: data.outcome.month, year: data.outcome.year, color: theme.palette.error.main, icon: React__default.createElement(TrendingDownIcon, { sx: { color: theme.palette.error.main } }), formatCurrency: data.formatCurrency, onClick: props.onClickOutcome, showAmount: !hasOverviewData, ctaLabel: "Ver lista", ctaDescription: "Ir para lista de sa\u00EDdas", ariaLabel: "Ver lista de sa\u00EDdas", testId: "financial-outcome-metric-card" }))),
144542
+ React__default.createElement(FinanceMetricCard, { title: "Sa\u00EDda", value: data.outcome.totalAmount || 0, color: theme.palette.error.main, icon: React__default.createElement(TrendingDownIcon, { sx: { color: theme.palette.error.main } }), formatCurrency: data.formatCurrency, onClick: props.onClickOutcome, ctaLabel: "Ver lista", ariaLabel: "Ver lista de sa\u00EDdas", testId: "financial-outcome-metric-card" }))),
144570
144543
  props.isTerreiro && (React__default.createElement(MonthlyFeeCard, { formatCurrency: data.formatCurrency, monthlyFee: data.monthlyFee || 0, dueDay: data.monthlyFeeDueDay !== undefined
144571
144544
  ? String(data.monthlyFeeDueDay)
144572
144545
  : "-", paymentMethod: data.monthlyFeePaymentMethod !== undefined
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/bundle.esm.js.map
3
- size: 59418794 bytes
4
- sha256: dfbafa4ee8a9d237fe60d326a3c80e76e209dfcc8bdd62b7b9da646106a370f2
3
+ size: 59404263 bytes
4
+ sha256: 50a144e5aaf9445633251a235010a37c7df3c82c4a59b22830c5a301fdc86760
package/dist/index.d.ts CHANGED
@@ -21100,6 +21100,7 @@ declare const _default$7: React__default.NamedExoticComponent<{
21100
21100
  canExportFinancialReport?: boolean | undefined;
21101
21101
  isExportingFinancialReport?: boolean | undefined;
21102
21102
  onExportFinancialReport?: (() => void) | undefined;
21103
+ financialReportExportError?: string | null | undefined;
21103
21104
  }>;
21104
21105
 
21105
21106
  declare const FinancialOverviewSchema: z.ZodObject<{
@@ -21723,6 +21724,7 @@ declare const FinancialAccountsListPropsSchema: z.ZodObject<{
21723
21724
  canExportFinancialReport: z.ZodOptional<z.ZodBoolean>;
21724
21725
  isExportingFinancialReport: z.ZodOptional<z.ZodBoolean>;
21725
21726
  onExportFinancialReport: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], null>, z.ZodVoid>>;
21727
+ financialReportExportError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21726
21728
  }, "strip", z.ZodTypeAny, {
21727
21729
  onBack: () => void;
21728
21730
  monthlyFee: {
@@ -21834,6 +21836,7 @@ declare const FinancialAccountsListPropsSchema: z.ZodObject<{
21834
21836
  canExportFinancialReport?: boolean | undefined;
21835
21837
  isExportingFinancialReport?: boolean | undefined;
21836
21838
  onExportFinancialReport?: (() => void) | undefined;
21839
+ financialReportExportError?: string | null | undefined;
21837
21840
  }, {
21838
21841
  onBack: () => void;
21839
21842
  monthlyFee: {
@@ -21945,6 +21948,7 @@ declare const FinancialAccountsListPropsSchema: z.ZodObject<{
21945
21948
  canExportFinancialReport?: boolean | undefined;
21946
21949
  isExportingFinancialReport?: boolean | undefined;
21947
21950
  onExportFinancialReport?: (() => void) | undefined;
21951
+ financialReportExportError?: string | null | undefined;
21948
21952
  }>;
21949
21953
  type FinancialAccountsListProps = z.infer<typeof FinancialAccountsListPropsSchema>;
21950
21954
 
@@ -110,5 +110,6 @@ declare const _default: React.NamedExoticComponent<{
110
110
  canExportFinancialReport?: boolean | undefined;
111
111
  isExportingFinancialReport?: boolean | undefined;
112
112
  onExportFinancialReport?: (() => void) | undefined;
113
+ financialReportExportError?: string | null | undefined;
113
114
  }>;
114
115
  export default _default;
@@ -883,6 +883,7 @@ export declare const FinancialAccountsListPropsSchema: z.ZodObject<{
883
883
  canExportFinancialReport: z.ZodOptional<z.ZodBoolean>;
884
884
  isExportingFinancialReport: z.ZodOptional<z.ZodBoolean>;
885
885
  onExportFinancialReport: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], null>, z.ZodVoid>>;
886
+ financialReportExportError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
886
887
  }, "strip", z.ZodTypeAny, {
887
888
  onBack: () => void;
888
889
  monthlyFee: {
@@ -994,6 +995,7 @@ export declare const FinancialAccountsListPropsSchema: z.ZodObject<{
994
995
  canExportFinancialReport?: boolean | undefined;
995
996
  isExportingFinancialReport?: boolean | undefined;
996
997
  onExportFinancialReport?: (() => void) | undefined;
998
+ financialReportExportError?: string | null | undefined;
997
999
  }, {
998
1000
  onBack: () => void;
999
1001
  monthlyFee: {
@@ -1105,6 +1107,7 @@ export declare const FinancialAccountsListPropsSchema: z.ZodObject<{
1105
1107
  canExportFinancialReport?: boolean | undefined;
1106
1108
  isExportingFinancialReport?: boolean | undefined;
1107
1109
  onExportFinancialReport?: (() => void) | undefined;
1110
+ financialReportExportError?: string | null | undefined;
1108
1111
  }>;
1109
1112
  export type BankAccountOption = z.infer<typeof BankAccountOptionSchema>;
1110
1113
  export type ReceivingAccount = z.infer<typeof ReceivingAccountSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsintegrations",
3
- "version": "0.0.490",
3
+ "version": "0.0.491",
4
4
  "description": "A React component library template with TypeScript, Storybook, and testing setup",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",