@tesouro/embedded-components-react 0.5.284 → 0.5.285

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/README.md +27 -28
  2. package/dist/index.d.ts +6 -19
  3. package/dist/lib/ReceivablesWidget.d.ts +6 -19
  4. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +268 -285
  5. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +35 -60
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +4 -6
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +124 -147
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +6 -2
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +10 -9
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +54 -48
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +3 -4
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +2 -12
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +54 -87
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +185 -51
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +38 -187
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +33 -33
  18. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  19. package/package.json +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +0 -45
@@ -25,9 +25,11 @@ function g({ messages: g }) {
25
25
  }, []), W = p(() => v(void 0), []), G = p((e) => {
26
26
  S(e), _?.inlineItems.length ? b("products") : W();
27
27
  }, [W, _]), K = p(() => {
28
- y === "issue" ? G("issued") : W();
28
+ I || k || (y === "issue" ? G("issued") : W());
29
29
  }, [
30
30
  W,
31
+ k,
32
+ I,
31
33
  G,
32
34
  y
33
35
  ]), q = p(async () => {
@@ -79,11 +81,13 @@ function g({ messages: g }) {
79
81
  ]), ee = m(() => {
80
82
  if (_) return y === "issue" ? {
81
83
  step: "issue",
82
- title: g.actionsIssueTitle.replace("{name}", z),
84
+ icon: _.isResend ? "send" : "check",
85
+ title: (_.isResend ? g.actionsResendTitle : g.actionsIssueTitle).replace("{name}", z),
83
86
  recipient: B ? `${z} <${B}>` : z,
84
87
  subject: H,
85
88
  message: T,
86
89
  attachments: c(V),
90
+ dismissLabel: _.isResend ? g.actionsResendDismiss : g.actionsIssueDismiss,
87
91
  sendDisabled: I || !H.trim() || !T.trim(),
88
92
  inProgress: I
89
93
  } : {
@@ -9,19 +9,20 @@ import "../../../../../shared/counterpart-management/feature/dist/index.js";
9
9
  import { useReceivableRequiredFieldsQuery as n } from "../../../../data-access/dist/index14.js";
10
10
  import "../../../../data-access/dist/index.js";
11
11
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js
12
- function r({ counterpartId: r, billingAddressId: i, billingCountry: a, inlineCustomerType: o }) {
13
- let s = e(), c = t(r || void 0), l = c.data?.id === r ? c.data : void 0, u = n({
12
+ function r({ counterpartId: r, billingAddressId: i, billingCountry: a, inlineCustomerType: o, checkRequiredFields: s = !0 }) {
13
+ let c = e(), l = t(r || void 0), u = l.data?.id === r ? l.data : void 0, d = n({
14
14
  counterpart_id: r || void 0,
15
15
  counterpart_billing_address_id: i || void 0,
16
16
  counterpart_country: a,
17
- counterpart_type: l?.type ?? o,
18
- enabled: !!(r || o)
19
- }), d = !!u.data?.entity?.tax_id?.required, f = !!r && !l && (c.isLoading || c.isFetching);
17
+ counterpart_type: u?.type ?? o,
18
+ enabled: s && !!(u || o)
19
+ }), f = !!d.data?.entity?.tax_id?.required, p = !!r && !u && (l.isLoading || l.isFetching);
20
20
  return {
21
- counterpart: l,
22
- isCounterpartLoading: f,
23
- isLoading: s.isLoading || u.isLoading || f,
24
- isTaxIdMissing: d && !s.data?.tax_id
21
+ counterpart: u,
22
+ isCounterpartLoading: p,
23
+ isCounterpartError: !!r && !u && l.isError,
24
+ isLoading: c.isLoading || d.isLoading || p,
25
+ isTaxIdMissing: f && !c.data?.tax_id
25
26
  };
26
27
  }
27
28
  //#endregion
@@ -37,7 +37,7 @@ function x({ values: x, errors: S, lockSchedule: C, messages: w, onChange: T, on
37
37
  L.current = {
38
38
  id: x.customerId,
39
39
  email: k
40
- }, e.email && e.email !== k && T(e.id === x.customerId ? s : a);
40
+ }, e.email && e.email !== k && T(!e.id || e.id === x.customerId ? s : a);
41
41
  }, [
42
42
  O.isLoading,
43
43
  k,
@@ -24,22 +24,22 @@ import { useReceivableForm as pe } from "./useReceivableForm.js";
24
24
  import { useReceivablesTable as me } from "./useReceivablesTable.js";
25
25
  import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
26
26
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js
27
- function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankName: ge, filterLabels: _e, initialCounterpartId: f, initialView: p, messageLabels: m, onReceivableCreated: h, onReceivableOpened: g, pageSizeOptions: ve, screenLabels: ye }) {
28
- let be = n();
27
+ function he({ auditHistoryLabels: he, counterpartMessageLabels: ge, embeddedBankName: _e, filterLabels: ve, initialCounterpartId: d, initialView: f, messageLabels: p, onReceivableCreated: m, onReceivableOpened: h, pageSizeOptions: ye, screenLabels: be }) {
28
+ let g = n();
29
29
  o(() => {
30
- be(re.Mounted);
31
- }, [be]);
30
+ g(re.Mounted);
31
+ }, [g]);
32
32
  let { initResponse: _, widgetToken: xe } = i(), v = ne(), Se = ee(), Ce = r(), y = te(), b = !!_ && !y, x = s(() => le(_?.scopes), [_?.scopes]), we = !!_ && y, S = !!_ && x.canRead, C = !!_ && x.canWrite, w = b && x.canRead, T = b && x.canWrite, E = !!Se && !b && !v, D = !b && !E && !!(xe || v), O = s(() => ({
33
33
  ...ce,
34
- ...m
35
- }), [m]), k = ye?.statusBadge, A = s(() => ({
34
+ ...p
35
+ }), [p]), k = be?.statusBadge, A = s(() => ({
36
36
  ...ie,
37
37
  ...k
38
38
  }), [k]), [j, M] = l(), [N, P] = l(!1), [F, Te] = l(j);
39
39
  j && j !== F && Te(j);
40
40
  let [I, L] = l(!1), [Ee, R] = l(), z = e(_?.scopes, [t.CounterpartReadOrg]), De = a(() => R(void 0), []), [B, V] = l(!1), Oe = a(() => V(!0), []), H = a(() => V(!1), []), ke = a((e, t) => {
41
- M(e), P(!0), h?.(e, t);
42
- }, [h]), U = de({ messages: O }), W = U.open, Ae = a((e, t, n) => {
41
+ M(e), P(!0), m?.(e, t);
42
+ }, [m]), U = de({ messages: O }), W = U.open, Ae = a((e, t, n) => {
43
43
  let r = oe(n);
44
44
  r.openDetails && (M(e), P(!0)), r.actionsModal && W({
45
45
  action: n.mode,
@@ -48,24 +48,24 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
48
48
  counterpartId: n.counterpartId,
49
49
  inlineItems: n.inlineItems,
50
50
  showEmailStep: r.actionsModal.showEmailStep
51
- }), h?.(e, t);
52
- }, [h, W]), G = me({
53
- initialCounterpartId: p === "create" ? void 0 : f,
51
+ }), m?.(e, t);
52
+ }, [m, W]), G = me({
53
+ initialCounterpartId: f === "create" ? void 0 : d,
54
54
  messages: O,
55
55
  statusLabels: A,
56
- filterLabels: _e,
57
- pageSizeOptions: ve,
56
+ filterLabels: ve,
57
+ pageSizeOptions: ye,
58
58
  enabled: w,
59
59
  visible: S
60
60
  }), je = a((e) => {
61
- M(e), P(!0), g?.(e, "invoice");
62
- }, [g]), K = fe({
61
+ M(e), P(!0), h?.(e, "invoice");
62
+ }, [h]), K = fe({
63
63
  selectedReceivableId: j,
64
64
  enabled: N && w,
65
65
  canWrite: C,
66
66
  messages: O,
67
67
  statusLabels: A,
68
- auditHistoryLabels: u,
68
+ auditHistoryLabels: he,
69
69
  onOpenReceivable: je,
70
70
  onOpenCustomer: z ? R : void 0
71
71
  }), q = c("edit"), Me = a((e, t, n) => {
@@ -80,8 +80,8 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
80
80
  });
81
81
  }, [W]), J = pe({
82
82
  messages: O,
83
- counterpartMessageLabels: he,
84
- embeddedBankName: ge,
83
+ counterpartMessageLabels: ge,
84
+ embeddedBankName: _e,
85
85
  canCreateCustomer: x.canCreateCustomer,
86
86
  onCreated: Ae,
87
87
  onUpdated: Me
@@ -89,12 +89,12 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
89
89
  T && J.openCreate("invoice");
90
90
  }, [T, J.openCreate]), Y = c(!1);
91
91
  o(() => {
92
- Y.current || p === "create" && T && (Y.current = !0, J.openCreate("invoice", { customerId: f }));
92
+ Y.current || f === "create" && T && (Y.current = !0, J.openCreate("invoice", { customerId: d }));
93
93
  }, [
94
94
  T,
95
95
  J.openCreate,
96
- f,
97
- p
96
+ d,
97
+ f
98
98
  ]);
99
99
  let X = ue({
100
100
  selectedReceivable: K.receivable,
@@ -114,6 +114,15 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
114
114
  counterpartId: t,
115
115
  inlineItems: [],
116
116
  showEmailStep: !0
117
+ }),
118
+ onResend: (e, t) => W({
119
+ action: "issue",
120
+ receivableId: e,
121
+ documentType: "invoice",
122
+ counterpartId: t,
123
+ inlineItems: [],
124
+ showEmailStep: !0,
125
+ isResend: !0
117
126
  })
118
127
  });
119
128
  o(() => {
@@ -121,25 +130,24 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
121
130
  }, [J.open]), o(() => {
122
131
  !J.open && I && (L(!1), P(!0));
123
132
  }, [J.open, I]);
124
- let Z = b && !x.canWrite, Pe = J.open || J.counterpartView !== "none" || !!X.actionTarget || X.sendOpen || X.payment.isOpen || U.isOpen || B, Fe = J.close, Ie = J.counterpartForm.close, { closeAction: Le, closeSend: Re } = X, Q = X.payment.close, $ = U.close;
133
+ let Z = b && !x.canWrite, Q = J.open || J.counterpartView !== "none" || !!X.actionTarget || X.payment.isOpen || U.isOpen || B, Pe = J.close, Fe = J.counterpartForm.close, { closeAction: Ie } = X, Le = X.payment.close, $ = U.close;
125
134
  o(() => {
126
- Z && Pe && (Fe(), Ie(), Le(), Re(), Q(), $(), H());
135
+ Z && Q && (Pe(), Fe(), Ie(), Le(), $(), H());
127
136
  }, [
128
- Le,
129
- $,
130
137
  Ie,
138
+ $,
131
139
  Fe,
140
+ Pe,
132
141
  H,
142
+ Le,
133
143
  Q,
134
- Re,
135
- Pe,
136
144
  Z
137
145
  ]);
138
- let ze = a((e) => {
139
- ae() || (M(e.id), P(!0), g?.(e.id, e.type));
140
- }, [g]), Be = a(() => {
146
+ let Re = a((e) => {
147
+ ae() || (M(e.id), P(!0), h?.(e.id, e.type));
148
+ }, [h]), ze = a(() => {
141
149
  P(!1), M(void 0), R(void 0);
142
- }, []), Ve = a((e, t) => {
150
+ }, []), Be = a((e, t) => {
143
151
  if (T) {
144
152
  if (e === "edit") {
145
153
  K.receivable && (q.current = "edit", J.openEdit(K.receivable), L(!0), P(!1));
@@ -174,7 +182,7 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
174
182
  onRetry: E ? Ce : G.onRetry,
175
183
  details: K,
176
184
  detailsOpen: N && S,
177
- closeDetails: Be,
185
+ closeDetails: ze,
178
186
  detailsPanelKey: F,
179
187
  customerDetailsId: Ee,
180
188
  closeCustomerDetails: De,
@@ -187,11 +195,11 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
187
195
  counterpartView: C ? J.counterpartView : "none",
188
196
  counterpartForm: {
189
197
  ...J.counterpartForm,
190
- submit: d(T, J.counterpartForm.submit)
198
+ submit: u(T, J.counterpartForm.submit)
191
199
  },
192
- submit: d(T, J.submit),
193
- submitDraft: d(T, J.submitDraft),
194
- submitPrimary: d(T, J.submitPrimary)
200
+ submit: u(T, J.submit),
201
+ submitDraft: u(T, J.submitDraft),
202
+ submitPrimary: u(T, J.submitPrimary)
195
203
  },
196
204
  openCreate: Ne,
197
205
  measureUnitsOpen: C && B,
@@ -200,31 +208,29 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
200
208
  actions: {
201
209
  ...X,
202
210
  actionDialog: C ? X.actionDialog : void 0,
203
- sendOpen: C && X.sendOpen,
204
- openAction: d(T, X.openAction),
205
- confirmAction: d(T, X.confirmAction),
206
- submitSend: d(T, X.submitSend),
211
+ openAction: u(T, X.openAction),
212
+ confirmAction: u(T, X.confirmAction),
207
213
  payment: {
208
214
  ...X.payment,
209
215
  isOpen: C && X.payment.isOpen,
210
- save: d(T, X.payment.save),
211
- confirm: d(T, X.payment.confirm)
216
+ save: u(T, X.payment.save),
217
+ confirm: u(T, X.payment.confirm)
212
218
  }
213
219
  },
214
220
  actionsModal: {
215
221
  ...U,
216
222
  isOpen: C && U.isOpen,
217
- send: d(T, U.send),
218
- saveItems: d(T, U.saveItems)
223
+ send: u(T, U.send),
224
+ saveItems: u(T, U.saveItems)
219
225
  },
220
- handleRowClick: ze,
221
- handleDetailsActionClick: Ve
226
+ handleRowClick: Re,
227
+ handleDetailsActionClick: Be
222
228
  };
223
229
  }
224
- function d(e, t) {
230
+ function u(e, t) {
225
231
  return (...n) => {
226
232
  e && t(...n);
227
233
  };
228
234
  }
229
235
  //#endregion
230
- export { u as useReceivablesWidget };
236
+ export { he as useReceivablesWidget };
@@ -30,7 +30,6 @@ import { ReceivableRecurrenceEmailDialog as g } from "./index51.js";
30
30
  import { ReceivableRecurrenceSection as _ } from "./index53.js";
31
31
  import "./index54.js";
32
32
  import { ReceivableRemindersSection as v } from "./index55.js";
33
- import { ReceivableSendDialog as y } from "./index56.js";
34
- import { ReceivablesScreen as b } from "./index58.js";
35
- import { UnsavedInvoiceDialog as x } from "./index59.js";
36
- export { t as InvoicesFilterBar, e as InvoicesFilterField, d as RECEIVABLE_DETAILS_SECTION, s as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, c as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE, r as RECEIVABLE_STATUS_BADGE_LABELS_EN, i as ReceivableActionDialog, n as ReceivableActionsModal, o as ReceivableAttachmentsSection, a as ReceivableBankAccountSection, l as ReceivableBillingSection, u as ReceivableCustomerSection, f as ReceivableDetailsPanel, p as ReceivableFormDialog, m as ReceivablePaymentDialog, h as ReceivablePreview, g as ReceivableRecurrenceEmailDialog, _ as ReceivableRecurrenceSection, v as ReceivableRemindersSection, y as ReceivableSendDialog, b as ReceivablesScreen, x as UnsavedInvoiceDialog };
33
+ import { ReceivablesScreen as y } from "./index57.js";
34
+ import { UnsavedInvoiceDialog as b } from "./index58.js";
35
+ export { t as InvoicesFilterBar, e as InvoicesFilterField, d as RECEIVABLE_DETAILS_SECTION, s as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, c as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE, r as RECEIVABLE_STATUS_BADGE_LABELS_EN, i as ReceivableActionDialog, n as ReceivableActionsModal, o as ReceivableAttachmentsSection, a as ReceivableBankAccountSection, l as ReceivableBillingSection, u as ReceivableCustomerSection, f as ReceivableDetailsPanel, p as ReceivableFormDialog, m as ReceivablePaymentDialog, h as ReceivablePreview, g as ReceivableRecurrenceEmailDialog, _ as ReceivableRecurrenceSection, v as ReceivableRemindersSection, y as ReceivablesScreen, b as UnsavedInvoiceDialog };
@@ -192,16 +192,6 @@ var i = {
192
192
  cancelRecurrenceButton: "Cancel series",
193
193
  recurringBadge: "Recurring"
194
194
  }, u = {
195
- title: "Send receivable",
196
- description: "Send this document to the customer by email.",
197
- toLabel: "To",
198
- ccLabel: "CC",
199
- bccLabel: "BCC",
200
- subjectLabel: "Subject",
201
- bodyLabel: "Message",
202
- cancelButton: "Cancel",
203
- sendButton: "Send"
204
- }, d = {
205
195
  title: "Record payment",
206
196
  amountLabel: "Amount",
207
197
  amountPlaceholder: "0",
@@ -219,11 +209,11 @@ var i = {
219
209
  reviewWarning: "Please, check the details of your payment record. You won't be able to change or delete it after.",
220
210
  editRecordButton: "Edit record",
221
211
  confirmButton: "Confirm"
222
- }, f = {
212
+ }, d = {
223
213
  cancelButton: "Cancel",
224
214
  confirmButton: "Confirm",
225
215
  commentLabel: "Comment (optional)",
226
216
  commentPlaceholder: "Add a comment"
227
217
  };
228
218
  //#endregion
229
- export { o as RECEIVABLES_SCREEN_LABELS_EN, f as RECEIVABLE_ACTION_DIALOG_LABELS_EN, l as RECEIVABLE_DETAILS_PANEL_LABELS_EN, c as RECEIVABLE_FORM_DIALOG_LABELS_EN, d as RECEIVABLE_PAYMENT_DIALOG_LABELS_EN, u as RECEIVABLE_SEND_DIALOG_LABELS_EN, i as RECEIVABLE_STATUS_BADGE_LABELS_EN, a as RECEIVABLE_STATUS_CARDS_LABELS_EN, s as UNSAVED_INVOICE_DIALOG_LABELS_EN };
219
+ export { o as RECEIVABLES_SCREEN_LABELS_EN, d as RECEIVABLE_ACTION_DIALOG_LABELS_EN, l as RECEIVABLE_DETAILS_PANEL_LABELS_EN, c as RECEIVABLE_FORM_DIALOG_LABELS_EN, u as RECEIVABLE_PAYMENT_DIALOG_LABELS_EN, i as RECEIVABLE_STATUS_BADGE_LABELS_EN, a as RECEIVABLE_STATUS_CARDS_LABELS_EN, s as UNSAVED_INVOICE_DIALOG_LABELS_EN };
@@ -1,93 +1,60 @@
1
- import { Button as e, Dialog as t, DialogContent as n, DialogDescription as r, DialogFooter as i, DialogHeader as a, DialogTitle as o, Input as s, Label as c, Textarea as l } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { RECEIVABLE_SEND_DIALOG_LABELS_EN as u } from "./index14.js";
3
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
1
+ import { Skeleton as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_STATUS_CARDS_LABELS_EN as n } from "./index14.js";
3
+ import { ReceivableStatusBadge as r } from "./index25.js";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
5
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js
5
- function p({ message: e }) {
6
- return e ? /* @__PURE__ */ d("p", {
7
- className: "ttw:text-sm ttw:text-destructive",
8
- children: e
9
- }) : null;
6
+ var o = 6;
7
+ function s({ selected: e, onClick: n, children: r }) {
8
+ return /* @__PURE__ */ i("button", {
9
+ type: "button",
10
+ "aria-pressed": e,
11
+ onClick: n,
12
+ className: t("ttw:flex ttw:w-42 ttw:shrink-0 ttw:cursor-pointer ttw:flex-col ttw:gap-2 ttw:rounded-xl ttw:border ttw:bg-card ttw:px-4 ttw:py-2 ttw:text-left ttw:transition-colors", e ? "ttw:border-primary" : "ttw:border-card ttw:hover:border-primary"),
13
+ children: r
14
+ });
10
15
  }
11
- function m({ open: m, onOpenChange: h, values: g, errors: _, inProgress: v, onChange: y, onSubmit: b, onCancel: x, labels: S }) {
12
- let C = {
13
- ...u,
14
- ...S
16
+ function c({ view: t, onSelect: c, labels: l }) {
17
+ let u = {
18
+ ...n,
19
+ ...l
15
20
  };
16
- return /* @__PURE__ */ d(t, {
17
- open: m,
18
- onOpenChange: h,
19
- children: /* @__PURE__ */ f(n, { children: [
20
- /* @__PURE__ */ f(a, { children: [/* @__PURE__ */ d(o, { children: C.title }), /* @__PURE__ */ d(r, { children: C.description })] }),
21
- /* @__PURE__ */ f("div", {
22
- className: "ttw:flex ttw:flex-col ttw:gap-4",
23
- children: [
24
- _?.form && /* @__PURE__ */ d("p", {
25
- className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
26
- children: _.form
27
- }),
28
- /* @__PURE__ */ f("div", {
29
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
30
- children: [
31
- /* @__PURE__ */ d(c, { children: C.toLabel }),
32
- /* @__PURE__ */ d(s, {
33
- value: g.to,
34
- onChange: (e) => y({ to: e.target.value })
35
- }),
36
- /* @__PURE__ */ d(p, { message: _?.to })
37
- ]
38
- }),
39
- /* @__PURE__ */ f("div", {
40
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
41
- children: [/* @__PURE__ */ f("div", {
42
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
43
- children: [/* @__PURE__ */ d(c, { children: C.ccLabel }), /* @__PURE__ */ d(s, {
44
- value: g.cc,
45
- onChange: (e) => y({ cc: e.target.value })
46
- })]
47
- }), /* @__PURE__ */ f("div", {
48
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
49
- children: [/* @__PURE__ */ d(c, { children: C.bccLabel }), /* @__PURE__ */ d(s, {
50
- value: g.bcc,
51
- onChange: (e) => y({ bcc: e.target.value })
52
- })]
53
- })]
54
- }),
55
- /* @__PURE__ */ f("div", {
56
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
57
- children: [
58
- /* @__PURE__ */ d(c, { children: C.subjectLabel }),
59
- /* @__PURE__ */ d(s, {
60
- value: g.subject,
61
- onChange: (e) => y({ subject: e.target.value })
62
- }),
63
- /* @__PURE__ */ d(p, { message: _?.subject })
64
- ]
65
- }),
66
- /* @__PURE__ */ f("div", {
67
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
68
- children: [
69
- /* @__PURE__ */ d(c, { children: C.bodyLabel }),
70
- /* @__PURE__ */ d(l, {
71
- rows: 6,
72
- value: g.body,
73
- onChange: (e) => y({ body: e.target.value })
74
- }),
75
- /* @__PURE__ */ d(p, { message: _?.body })
76
- ]
77
- })
78
- ]
79
- }),
80
- /* @__PURE__ */ f(i, { children: [/* @__PURE__ */ d(e, {
81
- variant: "ghost",
82
- onClick: x,
83
- children: C.cancelButton
84
- }), /* @__PURE__ */ d(e, {
85
- loading: v,
86
- onClick: b,
87
- children: C.sendButton
88
- })] })
89
- ] })
21
+ return t.kind === "loading" ? /* @__PURE__ */ i("div", {
22
+ className: "ttw:flex ttw:gap-2",
23
+ children: Array.from({ length: o }).map((t, n) => /* @__PURE__ */ i(e, { className: "ttw:h-16.5 ttw:w-42 ttw:rounded-xl" }, n))
24
+ }) : /* @__PURE__ */ a("div", {
25
+ className: "ttw:mb-6 ttw:flex ttw:gap-2 ttw:overflow-x-auto ttw:[scrollbar-width:none] ttw:[&::-webkit-scrollbar]:hidden",
26
+ children: [/* @__PURE__ */ a(s, {
27
+ selected: t.all.selected,
28
+ onClick: () => c(t.all.value),
29
+ children: [/* @__PURE__ */ i("span", {
30
+ className: "ttw:text-xs ttw:font-medium ttw:text-foreground",
31
+ children: u.all
32
+ }), /* @__PURE__ */ i("span", {
33
+ className: "ttw:text-2xl ttw:font-medium ttw:leading-8 ttw:tabular-nums ttw:text-foreground",
34
+ children: t.all.countLabel
35
+ })]
36
+ }), t.statuses.map((e) => /* @__PURE__ */ i(s, {
37
+ selected: e.selected,
38
+ onClick: () => c(e.value),
39
+ children: /* @__PURE__ */ a("div", {
40
+ className: "ttw:flex ttw:flex-col",
41
+ children: [/* @__PURE__ */ a("div", {
42
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
43
+ children: [/* @__PURE__ */ i(r, {
44
+ label: e.statusLabel,
45
+ status: e.value,
46
+ variant: "filled"
47
+ }), /* @__PURE__ */ i("span", {
48
+ className: "ttw:text-xs ttw:font-medium ttw:leading-4.5 ttw:tabular-nums ttw:text-foreground",
49
+ children: e.countLabel
50
+ })]
51
+ }), /* @__PURE__ */ i("span", {
52
+ className: "ttw:overflow-hidden ttw:text-ellipsis ttw:whitespace-nowrap ttw:text-2xl ttw:font-medium ttw:leading-8 ttw:tabular-nums ttw:text-foreground",
53
+ children: e.amountLabel
54
+ })]
55
+ })
56
+ }, e.value))]
90
57
  });
91
58
  }
92
59
  //#endregion
93
- export { m as ReceivableSendDialog, m as default };
60
+ export { c as ReceivableStatusCards, c as default };