gsintegrations 0.0.495 → 0.0.496

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.
@@ -59747,10 +59747,6 @@ var Save$1 = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
59747
59747
  d: "M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"
59748
59748
  }), 'Save');
59749
59749
 
59750
- var SavingsIcon = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
59751
- d: "m19.83 7.5-2.27-2.27c.07-.42.18-.81.32-1.15.08-.18.12-.37.12-.58 0-.83-.67-1.5-1.5-1.5-1.64 0-3.09.79-4 2h-5C4.46 4 2 6.46 2 9.5S4.5 21 4.5 21H10v-2h2v2h5.5l1.68-5.59 2.82-.94V7.5zM13 9H8V7h5zm3 2c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"
59752
- }), 'Savings');
59753
-
59754
59750
  var Schedule = createSvgIcon([/*#__PURE__*/require$$2$1.jsx("path", {
59755
59751
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"
59756
59752
  }, "0"), /*#__PURE__*/require$$2$1.jsx("path", {
@@ -144646,7 +144642,9 @@ const FinancialSummaryHeader = ({ embedded = false, variant = "balance", balance
144646
144642
  ? "Mensalidade"
144647
144643
  : variant === "movements"
144648
144644
  ? "Lançamentos"
144649
- : "Resumo Financeiro";
144645
+ : variant === "accounts"
144646
+ ? "Contas"
144647
+ : "Resumo Financeiro";
144650
144648
  const periodDate = parseMonthValue(periodInputValue);
144651
144649
  return (React$1.createElement(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: ptBR$1, localeText: ptBR.components.MuiLocalizationProvider.defaultProps.localeText },
144652
144650
  React$1.createElement(Box$1, { ref: heroRef, "data-testid": "financial-dashboard-hero", "data-collapsed": isExpanded ? "false" : "true", sx: {
@@ -144694,7 +144692,7 @@ const FinancialSummaryHeader = ({ embedded = false, variant = "balance", balance
144694
144692
  React$1.createElement(Box$1, { sx: { flex: 1, minWidth: 0 } },
144695
144693
  React$1.createElement(Collapse$1, { in: isExpanded, timeout: ANIMATION_DURATION.normal, easing: ANIMATION_EASING.standard },
144696
144694
  React$1.createElement(Typography$1, { variant: "overline", sx: { opacity: 0.8, letterSpacing: "0.08em" } }, overline),
144697
- variant === "balance" ? (React$1.createElement(Typography$1, { variant: "body2", sx: { opacity: 0.9, mt: 1 } }, "Saldo da casa")) : null),
144695
+ variant === "balance" || variant === "accounts" ? (React$1.createElement(Typography$1, { variant: "body2", sx: { opacity: 0.9, mt: 1 } }, variant === "accounts" ? "Saldo das contas" : "Saldo da casa")) : null),
144698
144696
  showMovementSwitch ? null : isLoading ? (React$1.createElement(Skeleton$1, { width: isExpanded ? 180 : 120, height: isExpanded ? 48 : 28, sx: { bgcolor: "rgba(255,255,255,0.16)", my: 0.5 } })) : (React$1.createElement(Typography$1, { component: "p", "data-testid": "financial-dashboard-balance", sx: {
144699
144697
  fontSize: isExpanded ? { xs: "2rem", sm: "2.5rem" } : "1.125rem",
144700
144698
  fontWeight: 700,
@@ -146094,65 +146092,97 @@ const FinancialAppShell = ({ audience, activeTab, showBottomNav = true, showMens
146094
146092
  showBottomNav ? (React$1.createElement(FinancialBottomNav, { audience: audience, activeTab: activeTab, showMensalidade: showMensalidade, onNavigateHome: onNavigateHome, onNavigateMovements: onNavigateMovements, onNavigateAccounts: onNavigateAccounts, onNavigateMonthlyFee: onNavigateMonthlyFee })) : null)));
146095
146093
  };
146096
146094
 
146095
+ const SEARCH_DEBOUNCE_MS$3 = 1000;
146096
+ const SEARCH_MIN_CHARS$3 = 2;
146097
146097
  const formatCurrency$3 = (value) => new Intl.NumberFormat("pt-BR", {
146098
146098
  style: "currency",
146099
146099
  currency: "BRL",
146100
- }).format(Number(value));
146100
+ }).format(Number(value) || 0);
146101
+ const accountDetail = (account) => {
146102
+ const place = account.accountType === "CASH"
146103
+ ? "Caixa"
146104
+ : [
146105
+ account.agency ? `Agência ${account.agency}` : "",
146106
+ account.account ? `Conta ${account.account}` : "",
146107
+ ]
146108
+ .filter(Boolean)
146109
+ .join(" · ");
146110
+ return [place, account.pixKey].filter(Boolean).join(" · ");
146111
+ };
146112
+ function EmptyState$2({ message }) {
146113
+ return (React$1.createElement(Box$1, { role: "status", sx: { py: 4, textAlign: "center" } },
146114
+ React$1.createElement(Typography$1, { variant: "body1", color: "text.secondary" }, message)));
146115
+ }
146101
146116
  const AccountListItem = React$1.memo(({ account, isLastItem, onSelect, }) => {
146102
- var _a, _b;
146103
- const theme = useTheme$1();
146104
- const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
146105
- const currentBalance = parseFloat(account.currentBalance);
146106
- return (React$1.createElement(ListItem$1, { "data-testid": `financial-account-list-item-${account.id}`, sx: {
146107
- width: "100%",
146108
- borderBottom: isLastItem ? "none" : `1px solid ${theme.palette.divider}`,
146109
- cursor: "pointer",
146110
- "&:hover": { backgroundColor: theme.palette.action.hover },
146111
- }, onClick: () => onSelect(account.id) },
146112
- React$1.createElement(ListItemAvatar$1, null,
146113
- React$1.createElement(Avatar$1, { alt: account.name, src: (_a = account.image) !== null && _a !== void 0 ? _a : undefined, sx: {
146114
- bgcolor: theme.palette.primary.main,
146115
- color: theme.palette.primary.contrastText,
146116
- } }, account.accountType === "CASH" ? (React$1.createElement(SavingsIcon, { fontSize: isMobile ? "medium" : "large" })) : (React$1.createElement(AccountBalanceIcon, { fontSize: isMobile ? "medium" : "large" })))),
146117
- React$1.createElement(ListItemText$1, { primary: account.name, secondary: React$1.createElement(Box$1, { sx: { display: "flex", flexDirection: "column", gap: 0.5 } },
146118
- account.accountType === "BANK" ? (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
146119
- "Ag\u00EAncia: ",
146120
- account.agency,
146121
- " | Conta: ",
146122
- account.account)) : null,
146123
- React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
146124
- "Saldo atual: ",
146125
- formatCurrency$3(currentBalance)),
146126
- account.pixKey ? (React$1.createElement(Chip$1, { label: `PIX: ${(_b = account.pixKeyType) !== null && _b !== void 0 ? _b : "Chave"}`, size: "small", color: "primary", variant: "outlined" })) : null) }),
146127
- React$1.createElement(ListItemSecondaryAction$1, null,
146128
- React$1.createElement(ChevronRight$2, { color: "action" }))));
146117
+ const detail = accountDetail(account);
146118
+ return (React$1.createElement(React$1.Fragment, null,
146119
+ React$1.createElement(ListItem$1, { "data-testid": `financial-account-list-item-${account.id}`, onClick: () => onSelect(account.id), onKeyDown: (event) => {
146120
+ if (event.key === "Enter" || event.key === " ") {
146121
+ event.preventDefault();
146122
+ onSelect(account.id);
146123
+ }
146124
+ }, tabIndex: 0, "aria-label": `Selecionar conta: ${account.name}`, sx: {
146125
+ display: "flex",
146126
+ px: 0,
146127
+ minHeight: 44,
146128
+ cursor: "pointer",
146129
+ "&:hover, &:focus": { backgroundColor: "action.hover" },
146130
+ } },
146131
+ React$1.createElement(Box$1, { sx: { flex: 1, minWidth: 0 } },
146132
+ React$1.createElement(Box$1, { sx: {
146133
+ display: "flex",
146134
+ justifyContent: "space-between",
146135
+ gap: 2,
146136
+ alignItems: "baseline",
146137
+ } },
146138
+ React$1.createElement(Typography$1, { variant: "subtitle1", noWrap: true }, account.name),
146139
+ React$1.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 600, flexShrink: 0 } }, formatCurrency$3(account.currentBalance))),
146140
+ detail ? (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" }, detail)) : null)),
146141
+ !isLastItem ? React$1.createElement(Divider$1, { component: "li" }) : null));
146129
146142
  });
146130
146143
  AccountListItem.displayName = "AccountListItem";
146131
146144
  const FinancialAccountsPage = ({ accounts, onBack, onSelectAccount, onAddAccount, }) => {
146132
- useTheme$1();
146133
146145
  const { embedded } = useFinancialChrome();
146134
- const isEmpty = accounts.length === 0;
146135
- const rows = React$1.useMemo(() => accounts.map((account, index) => (React$1.createElement(AccountListItem, { key: account.id, account: account, isLastItem: index === accounts.length - 1, onSelect: onSelectAccount }))), [accounts, onSelectAccount]);
146136
- const handleAdd = React$1.useCallback(() => {
146137
- onAddAccount();
146138
- }, [onAddAccount]);
146146
+ const [searchInput, setSearchInput] = React$1.useState("");
146147
+ const [searchTerm, setSearchTerm] = React$1.useState("");
146148
+ React$1.useEffect(() => {
146149
+ const normalized = searchInput.trim().toLowerCase();
146150
+ if (normalized.length < SEARCH_MIN_CHARS$3) {
146151
+ setSearchTerm("");
146152
+ return;
146153
+ }
146154
+ const timeout = window.setTimeout(() => setSearchTerm(normalized), SEARCH_DEBOUNCE_MS$3);
146155
+ return () => window.clearTimeout(timeout);
146156
+ }, [searchInput]);
146157
+ const balanceLabel = React$1.useMemo(() => {
146158
+ const total = accounts.reduce((sum, account) => {
146159
+ const value = Number(account.currentBalance);
146160
+ return sum + (Number.isFinite(value) ? value : 0);
146161
+ }, 0);
146162
+ return formatCurrency$3(total);
146163
+ }, [accounts]);
146164
+ const visibleAccounts = React$1.useMemo(() => {
146165
+ if (!searchTerm)
146166
+ return accounts;
146167
+ return accounts.filter((account) => account.name.toLowerCase().includes(searchTerm));
146168
+ }, [accounts, searchTerm]);
146139
146169
  return (React$1.createElement(Box$1, { sx: { minHeight: embedded ? "auto" : "100vh", bgcolor: "background.default" } },
146140
- embedded ? null : (React$1.createElement(PageHeader$2, { title: "Contas", onBack: onBack, onAdd: handleAdd, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true })),
146141
- React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
146142
- embedded ? (React$1.createElement(Box$1, { sx: { display: "flex", justifyContent: "flex-end", mb: 1 } },
146143
- React$1.createElement(Button$1, { variant: "outlined", startIcon: React$1.createElement(Add$1, null), onClick: handleAdd, "data-testid": "financial-account-add-button" }, "Adicionar conta"))) : null,
146144
- isEmpty ? (React$1.createElement(Box$1, { sx: {
146145
- display: "flex",
146146
- flexDirection: "column",
146147
- alignItems: "center",
146148
- textAlign: "center",
146149
- py: EMPTY_STATE_VERTICAL_PADDING,
146150
- px: EMPTY_STATE_PADDING,
146151
- } },
146152
- React$1.createElement(AccountBalanceIcon, { sx: { fontSize: 64, color: "text.disabled", mb: 1 } }),
146153
- React$1.createElement(Typography$1, { variant: "h6", sx: { fontWeight: 600, mb: 1 } }, "Nenhuma conta cadastrada"),
146154
- React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: 3, maxWidth: 320 } }, "Cadastre a caixinha ou uma conta para acompanhar o saldo da casa."),
146155
- React$1.createElement(Button$1, { "data-testid": "financial-account-empty-add-button", variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: handleAdd, sx: { borderRadius: RADIUS.default, px: CARD_PADDING } }, "Adicionar Conta"))) : (React$1.createElement(List$1, { "data-testid": "financial-accounts-list", sx: { pb: LIST_CONTENT_BOTTOM_PADDING } }, rows)))));
146170
+ embedded ? null : (React$1.createElement(PageHeader$2, { title: "Contas", onBack: onBack, showAddButton: false })),
146171
+ React$1.createElement(FinancialSummaryHeader, { embedded: embedded, variant: "accounts", balanceLabel: balanceLabel, onAdd: onAddAccount, addLabel: "Adicionar conta" }),
146172
+ React$1.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), { pb: LIST_CONTENT_BOTTOM_PADDING }) },
146173
+ React$1.createElement(TextField$1, { fullWidth: true, placeholder: "Buscar conta", value: searchInput, onChange: (event) => setSearchInput(event.target.value), inputProps: { "aria-label": "Buscar conta" }, InputProps: {
146174
+ startAdornment: (React$1.createElement(InputAdornment$1, { position: "start" },
146175
+ React$1.createElement(Search$1, { sx: { color: "text.secondary" } }))),
146176
+ }, sx: {
146177
+ mb: 2,
146178
+ width: "100%",
146179
+ "& .MuiOutlinedInput-root": {
146180
+ borderRadius: RADIUS.default,
146181
+ minHeight: 44,
146182
+ backgroundColor: "background.paper",
146183
+ },
146184
+ } }),
146185
+ visibleAccounts.length === 0 ? (React$1.createElement(EmptyState$2, { message: searchTerm ? "Nenhuma conta encontrada" : "Nenhuma conta cadastrada" })) : (React$1.createElement(List$1, { "data-testid": "financial-accounts-list", sx: { py: 0 } }, visibleAccounts.map((account, index) => (React$1.createElement(AccountListItem, { key: account.id, account: account, isLastItem: index === visibleAccounts.length - 1, onSelect: onSelectAccount }))))))));
146156
146186
  };
146157
146187
 
146158
146188
  const FinancialMonthlyFeePage = ({ formatCurrency, monthlyFee, dueDay, paymentMethod, receivingAccount, onBack, onEdit, summary, receiptForm, children, }) => {
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/bundle.cjs.js.map
3
- size: 59672513 bytes
4
- sha256: 8edc2a239685a4b3842b5cb6ca657b358be7e5f076de84c19597df3dca473538
3
+ size: 59674939 bytes
4
+ sha256: 17d3bc73c6378b3cc3bb4e5829c716a85081da505abca232597cdd0db08fb5c9
@@ -59727,10 +59727,6 @@ var Save$1 = createSvgIcon( /*#__PURE__*/jsx$1("path", {
59727
59727
  d: "M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"
59728
59728
  }), 'Save');
59729
59729
 
59730
- var SavingsIcon = createSvgIcon( /*#__PURE__*/jsx$1("path", {
59731
- d: "m19.83 7.5-2.27-2.27c.07-.42.18-.81.32-1.15.08-.18.12-.37.12-.58 0-.83-.67-1.5-1.5-1.5-1.64 0-3.09.79-4 2h-5C4.46 4 2 6.46 2 9.5S4.5 21 4.5 21H10v-2h2v2h5.5l1.68-5.59 2.82-.94V7.5zM13 9H8V7h5zm3 2c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"
59732
- }), 'Savings');
59733
-
59734
59730
  var Schedule = createSvgIcon([/*#__PURE__*/jsx$1("path", {
59735
59731
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"
59736
59732
  }, "0"), /*#__PURE__*/jsx$1("path", {
@@ -144626,7 +144622,9 @@ const FinancialSummaryHeader = ({ embedded = false, variant = "balance", balance
144626
144622
  ? "Mensalidade"
144627
144623
  : variant === "movements"
144628
144624
  ? "Lançamentos"
144629
- : "Resumo Financeiro";
144625
+ : variant === "accounts"
144626
+ ? "Contas"
144627
+ : "Resumo Financeiro";
144630
144628
  const periodDate = parseMonthValue(periodInputValue);
144631
144629
  return (React__default.createElement(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: ptBR$1, localeText: ptBR.components.MuiLocalizationProvider.defaultProps.localeText },
144632
144630
  React__default.createElement(Box$1, { ref: heroRef, "data-testid": "financial-dashboard-hero", "data-collapsed": isExpanded ? "false" : "true", sx: {
@@ -144674,7 +144672,7 @@ const FinancialSummaryHeader = ({ embedded = false, variant = "balance", balance
144674
144672
  React__default.createElement(Box$1, { sx: { flex: 1, minWidth: 0 } },
144675
144673
  React__default.createElement(Collapse$1, { in: isExpanded, timeout: ANIMATION_DURATION.normal, easing: ANIMATION_EASING.standard },
144676
144674
  React__default.createElement(Typography$1, { variant: "overline", sx: { opacity: 0.8, letterSpacing: "0.08em" } }, overline),
144677
- variant === "balance" ? (React__default.createElement(Typography$1, { variant: "body2", sx: { opacity: 0.9, mt: 1 } }, "Saldo da casa")) : null),
144675
+ variant === "balance" || variant === "accounts" ? (React__default.createElement(Typography$1, { variant: "body2", sx: { opacity: 0.9, mt: 1 } }, variant === "accounts" ? "Saldo das contas" : "Saldo da casa")) : null),
144678
144676
  showMovementSwitch ? null : isLoading ? (React__default.createElement(Skeleton$1, { width: isExpanded ? 180 : 120, height: isExpanded ? 48 : 28, sx: { bgcolor: "rgba(255,255,255,0.16)", my: 0.5 } })) : (React__default.createElement(Typography$1, { component: "p", "data-testid": "financial-dashboard-balance", sx: {
144679
144677
  fontSize: isExpanded ? { xs: "2rem", sm: "2.5rem" } : "1.125rem",
144680
144678
  fontWeight: 700,
@@ -146074,65 +146072,97 @@ const FinancialAppShell = ({ audience, activeTab, showBottomNav = true, showMens
146074
146072
  showBottomNav ? (React__default.createElement(FinancialBottomNav, { audience: audience, activeTab: activeTab, showMensalidade: showMensalidade, onNavigateHome: onNavigateHome, onNavigateMovements: onNavigateMovements, onNavigateAccounts: onNavigateAccounts, onNavigateMonthlyFee: onNavigateMonthlyFee })) : null)));
146075
146073
  };
146076
146074
 
146075
+ const SEARCH_DEBOUNCE_MS$3 = 1000;
146076
+ const SEARCH_MIN_CHARS$3 = 2;
146077
146077
  const formatCurrency$3 = (value) => new Intl.NumberFormat("pt-BR", {
146078
146078
  style: "currency",
146079
146079
  currency: "BRL",
146080
- }).format(Number(value));
146080
+ }).format(Number(value) || 0);
146081
+ const accountDetail = (account) => {
146082
+ const place = account.accountType === "CASH"
146083
+ ? "Caixa"
146084
+ : [
146085
+ account.agency ? `Agência ${account.agency}` : "",
146086
+ account.account ? `Conta ${account.account}` : "",
146087
+ ]
146088
+ .filter(Boolean)
146089
+ .join(" · ");
146090
+ return [place, account.pixKey].filter(Boolean).join(" · ");
146091
+ };
146092
+ function EmptyState$2({ message }) {
146093
+ return (React__default.createElement(Box$1, { role: "status", sx: { py: 4, textAlign: "center" } },
146094
+ React__default.createElement(Typography$1, { variant: "body1", color: "text.secondary" }, message)));
146095
+ }
146081
146096
  const AccountListItem = memo(({ account, isLastItem, onSelect, }) => {
146082
- var _a, _b;
146083
- const theme = useTheme$1();
146084
- const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
146085
- const currentBalance = parseFloat(account.currentBalance);
146086
- return (React__default.createElement(ListItem$1, { "data-testid": `financial-account-list-item-${account.id}`, sx: {
146087
- width: "100%",
146088
- borderBottom: isLastItem ? "none" : `1px solid ${theme.palette.divider}`,
146089
- cursor: "pointer",
146090
- "&:hover": { backgroundColor: theme.palette.action.hover },
146091
- }, onClick: () => onSelect(account.id) },
146092
- React__default.createElement(ListItemAvatar$1, null,
146093
- React__default.createElement(Avatar$1, { alt: account.name, src: (_a = account.image) !== null && _a !== void 0 ? _a : undefined, sx: {
146094
- bgcolor: theme.palette.primary.main,
146095
- color: theme.palette.primary.contrastText,
146096
- } }, account.accountType === "CASH" ? (React__default.createElement(SavingsIcon, { fontSize: isMobile ? "medium" : "large" })) : (React__default.createElement(AccountBalanceIcon, { fontSize: isMobile ? "medium" : "large" })))),
146097
- React__default.createElement(ListItemText$1, { primary: account.name, secondary: React__default.createElement(Box$1, { sx: { display: "flex", flexDirection: "column", gap: 0.5 } },
146098
- account.accountType === "BANK" ? (React__default.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
146099
- "Ag\u00EAncia: ",
146100
- account.agency,
146101
- " | Conta: ",
146102
- account.account)) : null,
146103
- React__default.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
146104
- "Saldo atual: ",
146105
- formatCurrency$3(currentBalance)),
146106
- account.pixKey ? (React__default.createElement(Chip$1, { label: `PIX: ${(_b = account.pixKeyType) !== null && _b !== void 0 ? _b : "Chave"}`, size: "small", color: "primary", variant: "outlined" })) : null) }),
146107
- React__default.createElement(ListItemSecondaryAction$1, null,
146108
- React__default.createElement(ChevronRight$2, { color: "action" }))));
146097
+ const detail = accountDetail(account);
146098
+ return (React__default.createElement(React__default.Fragment, null,
146099
+ React__default.createElement(ListItem$1, { "data-testid": `financial-account-list-item-${account.id}`, onClick: () => onSelect(account.id), onKeyDown: (event) => {
146100
+ if (event.key === "Enter" || event.key === " ") {
146101
+ event.preventDefault();
146102
+ onSelect(account.id);
146103
+ }
146104
+ }, tabIndex: 0, "aria-label": `Selecionar conta: ${account.name}`, sx: {
146105
+ display: "flex",
146106
+ px: 0,
146107
+ minHeight: 44,
146108
+ cursor: "pointer",
146109
+ "&:hover, &:focus": { backgroundColor: "action.hover" },
146110
+ } },
146111
+ React__default.createElement(Box$1, { sx: { flex: 1, minWidth: 0 } },
146112
+ React__default.createElement(Box$1, { sx: {
146113
+ display: "flex",
146114
+ justifyContent: "space-between",
146115
+ gap: 2,
146116
+ alignItems: "baseline",
146117
+ } },
146118
+ React__default.createElement(Typography$1, { variant: "subtitle1", noWrap: true }, account.name),
146119
+ React__default.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 600, flexShrink: 0 } }, formatCurrency$3(account.currentBalance))),
146120
+ detail ? (React__default.createElement(Typography$1, { variant: "body2", color: "text.secondary" }, detail)) : null)),
146121
+ !isLastItem ? React__default.createElement(Divider$1, { component: "li" }) : null));
146109
146122
  });
146110
146123
  AccountListItem.displayName = "AccountListItem";
146111
146124
  const FinancialAccountsPage = ({ accounts, onBack, onSelectAccount, onAddAccount, }) => {
146112
- useTheme$1();
146113
146125
  const { embedded } = useFinancialChrome();
146114
- const isEmpty = accounts.length === 0;
146115
- const rows = useMemo(() => accounts.map((account, index) => (React__default.createElement(AccountListItem, { key: account.id, account: account, isLastItem: index === accounts.length - 1, onSelect: onSelectAccount }))), [accounts, onSelectAccount]);
146116
- const handleAdd = useCallback(() => {
146117
- onAddAccount();
146118
- }, [onAddAccount]);
146126
+ const [searchInput, setSearchInput] = useState("");
146127
+ const [searchTerm, setSearchTerm] = useState("");
146128
+ useEffect(() => {
146129
+ const normalized = searchInput.trim().toLowerCase();
146130
+ if (normalized.length < SEARCH_MIN_CHARS$3) {
146131
+ setSearchTerm("");
146132
+ return;
146133
+ }
146134
+ const timeout = window.setTimeout(() => setSearchTerm(normalized), SEARCH_DEBOUNCE_MS$3);
146135
+ return () => window.clearTimeout(timeout);
146136
+ }, [searchInput]);
146137
+ const balanceLabel = useMemo(() => {
146138
+ const total = accounts.reduce((sum, account) => {
146139
+ const value = Number(account.currentBalance);
146140
+ return sum + (Number.isFinite(value) ? value : 0);
146141
+ }, 0);
146142
+ return formatCurrency$3(total);
146143
+ }, [accounts]);
146144
+ const visibleAccounts = useMemo(() => {
146145
+ if (!searchTerm)
146146
+ return accounts;
146147
+ return accounts.filter((account) => account.name.toLowerCase().includes(searchTerm));
146148
+ }, [accounts, searchTerm]);
146119
146149
  return (React__default.createElement(Box$1, { sx: { minHeight: embedded ? "auto" : "100vh", bgcolor: "background.default" } },
146120
- embedded ? null : (React__default.createElement(PageHeader$2, { title: "Contas", onBack: onBack, onAdd: handleAdd, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true })),
146121
- React__default.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
146122
- embedded ? (React__default.createElement(Box$1, { sx: { display: "flex", justifyContent: "flex-end", mb: 1 } },
146123
- React__default.createElement(Button$1, { variant: "outlined", startIcon: React__default.createElement(Add$1, null), onClick: handleAdd, "data-testid": "financial-account-add-button" }, "Adicionar conta"))) : null,
146124
- isEmpty ? (React__default.createElement(Box$1, { sx: {
146125
- display: "flex",
146126
- flexDirection: "column",
146127
- alignItems: "center",
146128
- textAlign: "center",
146129
- py: EMPTY_STATE_VERTICAL_PADDING,
146130
- px: EMPTY_STATE_PADDING,
146131
- } },
146132
- React__default.createElement(AccountBalanceIcon, { sx: { fontSize: 64, color: "text.disabled", mb: 1 } }),
146133
- React__default.createElement(Typography$1, { variant: "h6", sx: { fontWeight: 600, mb: 1 } }, "Nenhuma conta cadastrada"),
146134
- React__default.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: 3, maxWidth: 320 } }, "Cadastre a caixinha ou uma conta para acompanhar o saldo da casa."),
146135
- React__default.createElement(Button$1, { "data-testid": "financial-account-empty-add-button", variant: "contained", startIcon: React__default.createElement(Add$1, null), onClick: handleAdd, sx: { borderRadius: RADIUS.default, px: CARD_PADDING } }, "Adicionar Conta"))) : (React__default.createElement(List$1, { "data-testid": "financial-accounts-list", sx: { pb: LIST_CONTENT_BOTTOM_PADDING } }, rows)))));
146150
+ embedded ? null : (React__default.createElement(PageHeader$2, { title: "Contas", onBack: onBack, showAddButton: false })),
146151
+ React__default.createElement(FinancialSummaryHeader, { embedded: embedded, variant: "accounts", balanceLabel: balanceLabel, onAdd: onAddAccount, addLabel: "Adicionar conta" }),
146152
+ React__default.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), { pb: LIST_CONTENT_BOTTOM_PADDING }) },
146153
+ React__default.createElement(TextField$1, { fullWidth: true, placeholder: "Buscar conta", value: searchInput, onChange: (event) => setSearchInput(event.target.value), inputProps: { "aria-label": "Buscar conta" }, InputProps: {
146154
+ startAdornment: (React__default.createElement(InputAdornment$1, { position: "start" },
146155
+ React__default.createElement(Search$1, { sx: { color: "text.secondary" } }))),
146156
+ }, sx: {
146157
+ mb: 2,
146158
+ width: "100%",
146159
+ "& .MuiOutlinedInput-root": {
146160
+ borderRadius: RADIUS.default,
146161
+ minHeight: 44,
146162
+ backgroundColor: "background.paper",
146163
+ },
146164
+ } }),
146165
+ visibleAccounts.length === 0 ? (React__default.createElement(EmptyState$2, { message: searchTerm ? "Nenhuma conta encontrada" : "Nenhuma conta cadastrada" })) : (React__default.createElement(List$1, { "data-testid": "financial-accounts-list", sx: { py: 0 } }, visibleAccounts.map((account, index) => (React__default.createElement(AccountListItem, { key: account.id, account: account, isLastItem: index === visibleAccounts.length - 1, onSelect: onSelectAccount }))))))));
146136
146166
  };
146137
146167
 
146138
146168
  const FinancialMonthlyFeePage = ({ formatCurrency, monthlyFee, dueDay, paymentMethod, receivingAccount, onBack, onEdit, summary, receiptForm, children, }) => {
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/bundle.esm.js.map
3
- size: 59760411 bytes
4
- sha256: eae62f8da63e30ce6ae185094fbf0b6a4ba2fd2b9259fd6b027cd60e8cf2fbf1
3
+ size: 59762430 bytes
4
+ sha256: 8526a701fb0040c2db96c4fc5f7c68597f3e56de89292cf56a8e6f95eaff505f
package/dist/index.d.ts CHANGED
@@ -22185,7 +22185,7 @@ type FinancialSummaryDetailLine = {
22185
22185
  type FinancialMovementKind$1 = "income" | "outcome";
22186
22186
  type FinancialSummaryHeaderProps = {
22187
22187
  embedded?: boolean;
22188
- variant?: "balance" | "monthlyFee" | "movements";
22188
+ variant?: "balance" | "monthlyFee" | "movements" | "accounts";
22189
22189
  balanceLabel: string;
22190
22190
  movementKind?: FinancialMovementKind$1;
22191
22191
  incomeTotalLabel?: string;
@@ -23851,18 +23851,6 @@ declare const FinancialRegisterPagePropsSchema: z.ZodObject<{
23851
23851
  name: string;
23852
23852
  unit?: string | undefined;
23853
23853
  }[];
23854
- categories: {
23855
- id: string;
23856
- name: string;
23857
- subcategories: {
23858
- id: string;
23859
- name: string;
23860
- description?: string | null | undefined;
23861
- }[];
23862
- type?: string | undefined;
23863
- flow?: string | undefined;
23864
- description?: string | null | undefined;
23865
- }[];
23866
23854
  accounts: {
23867
23855
  id: string;
23868
23856
  name: string;
@@ -23879,6 +23867,18 @@ declare const FinancialRegisterPagePropsSchema: z.ZodObject<{
23879
23867
  } | null | undefined;
23880
23868
  accountType?: string | undefined;
23881
23869
  }[];
23870
+ categories: {
23871
+ id: string;
23872
+ name: string;
23873
+ subcategories: {
23874
+ id: string;
23875
+ name: string;
23876
+ description?: string | null | undefined;
23877
+ }[];
23878
+ type?: string | undefined;
23879
+ flow?: string | undefined;
23880
+ description?: string | null | undefined;
23881
+ }[];
23882
23882
  canShareWithMembers: boolean;
23883
23883
  onCancel?: (() => void) | undefined;
23884
23884
  onSave?: ((args_0: {
@@ -23972,18 +23972,6 @@ declare const FinancialRegisterPagePropsSchema: z.ZodObject<{
23972
23972
  inventoryItemId?: string | undefined;
23973
23973
  purchasedQuantity?: number | undefined;
23974
23974
  } | undefined;
23975
- categories?: {
23976
- id: string;
23977
- name: string;
23978
- type?: string | undefined;
23979
- flow?: string | undefined;
23980
- description?: string | null | undefined;
23981
- subcategories?: {
23982
- id: string;
23983
- name: string;
23984
- description?: string | null | undefined;
23985
- }[] | undefined;
23986
- }[] | undefined;
23987
23975
  accounts?: {
23988
23976
  id: string;
23989
23977
  name: string;
@@ -24000,6 +23988,18 @@ declare const FinancialRegisterPagePropsSchema: z.ZodObject<{
24000
23988
  } | null | undefined;
24001
23989
  accountType?: string | undefined;
24002
23990
  }[] | undefined;
23991
+ categories?: {
23992
+ id: string;
23993
+ name: string;
23994
+ type?: string | undefined;
23995
+ flow?: string | undefined;
23996
+ description?: string | null | undefined;
23997
+ subcategories?: {
23998
+ id: string;
23999
+ name: string;
24000
+ description?: string | null | undefined;
24001
+ }[] | undefined;
24002
+ }[] | undefined;
24003
24003
  canShareWithMembers?: boolean | undefined;
24004
24004
  }>;
24005
24005
  type FinancialRegisterPageProps = z.infer<typeof FinancialRegisterPagePropsSchema>;
@@ -7,7 +7,7 @@ export type FinancialSummaryDetailLine = {
7
7
  export type FinancialMovementKind = "income" | "outcome";
8
8
  export type FinancialSummaryHeaderProps = {
9
9
  embedded?: boolean;
10
- variant?: "balance" | "monthlyFee" | "movements";
10
+ variant?: "balance" | "monthlyFee" | "movements" | "accounts";
11
11
  balanceLabel: string;
12
12
  movementKind?: FinancialMovementKind;
13
13
  incomeTotalLabel?: string;
@@ -513,18 +513,6 @@ export declare const FinancialRegisterPagePropsSchema: z.ZodObject<{
513
513
  name: string;
514
514
  unit?: string | undefined;
515
515
  }[];
516
- categories: {
517
- id: string;
518
- name: string;
519
- subcategories: {
520
- id: string;
521
- name: string;
522
- description?: string | null | undefined;
523
- }[];
524
- type?: string | undefined;
525
- flow?: string | undefined;
526
- description?: string | null | undefined;
527
- }[];
528
516
  accounts: {
529
517
  id: string;
530
518
  name: string;
@@ -541,6 +529,18 @@ export declare const FinancialRegisterPagePropsSchema: z.ZodObject<{
541
529
  } | null | undefined;
542
530
  accountType?: string | undefined;
543
531
  }[];
532
+ categories: {
533
+ id: string;
534
+ name: string;
535
+ subcategories: {
536
+ id: string;
537
+ name: string;
538
+ description?: string | null | undefined;
539
+ }[];
540
+ type?: string | undefined;
541
+ flow?: string | undefined;
542
+ description?: string | null | undefined;
543
+ }[];
544
544
  canShareWithMembers: boolean;
545
545
  onCancel?: (() => void) | undefined;
546
546
  onSave?: ((args_0: {
@@ -634,18 +634,6 @@ export declare const FinancialRegisterPagePropsSchema: z.ZodObject<{
634
634
  inventoryItemId?: string | undefined;
635
635
  purchasedQuantity?: number | undefined;
636
636
  } | undefined;
637
- categories?: {
638
- id: string;
639
- name: string;
640
- type?: string | undefined;
641
- flow?: string | undefined;
642
- description?: string | null | undefined;
643
- subcategories?: {
644
- id: string;
645
- name: string;
646
- description?: string | null | undefined;
647
- }[] | undefined;
648
- }[] | undefined;
649
637
  accounts?: {
650
638
  id: string;
651
639
  name: string;
@@ -662,6 +650,18 @@ export declare const FinancialRegisterPagePropsSchema: z.ZodObject<{
662
650
  } | null | undefined;
663
651
  accountType?: string | undefined;
664
652
  }[] | undefined;
653
+ categories?: {
654
+ id: string;
655
+ name: string;
656
+ type?: string | undefined;
657
+ flow?: string | undefined;
658
+ description?: string | null | undefined;
659
+ subcategories?: {
660
+ id: string;
661
+ name: string;
662
+ description?: string | null | undefined;
663
+ }[] | undefined;
664
+ }[] | undefined;
665
665
  canShareWithMembers?: boolean | undefined;
666
666
  }>;
667
667
  export type FinancialRegisterPageProps = z.infer<typeof FinancialRegisterPagePropsSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsintegrations",
3
- "version": "0.0.495",
3
+ "version": "0.0.496",
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",