@tesouro/embedded-components-react 0.5.228 → 0.5.230

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 (85) hide show
  1. package/README.md +22 -21
  2. package/dist/index.d.ts +34 -1
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +34 -1
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +32 -33
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +34 -32
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +120 -52
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +44 -100
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +93 -337
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +356 -211
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +225 -157
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +152 -21
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +18 -221
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +224 -56
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -231
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +53 -298
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +232 -43
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +295 -118
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +38 -145
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +126 -46
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +145 -117
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +38 -91
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +113 -107
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +94 -27
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +104 -619
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -41
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +635 -34
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +39 -77
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +34 -117
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +75 -318
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +139 -0
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +340 -0
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +55 -468
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +443 -97
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +24 -21
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +32 -2
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +205 -84
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +161 -3
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +12 -20
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +23 -40
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +2 -17
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +90 -68
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +3 -20
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +20 -12
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +40 -30
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +14 -7
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +15 -301
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +73 -1
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +17 -45
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +12 -68
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +26 -490
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +294 -95
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +1 -0
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +48 -2
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +72 -4
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +496 -1
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +121 -27
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +97 -91
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +2 -236
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +3 -2
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +1 -249
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +89 -82
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +23 -54
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +223 -340
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +3 -0
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +249 -0
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +100 -216
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +93 -0
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +59 -0
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +353 -0
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +35 -29
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +2 -216
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +9 -159
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +27 -14
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +216 -23
  82. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  83. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +12 -12
  84. package/package.json +1 -1
  85. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +0 -28
@@ -1,73 +1,95 @@
1
- import { AccordionContent as e, AccordionItem as t, AccordionTrigger as n, Badge as r, Typography as i } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
- import { Check as s } from "lucide-react";
1
+ import { Field as e, FieldContent as t, FieldDescription as n, FieldError as r, FieldLabel as i, Popover as a, PopoverAnchor as o, PopoverContent as s, Select as c, SelectContent as l, SelectItem as u, SelectSeparator as d, SelectTrigger as f, SelectValue as p, Skeleton as m, Typography as h } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_BILLING_SECTION_LABELS_EN as g } from "./index7.js";
3
+ import { RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as _ } from "./index15.js";
4
+ import { OptionRow as v } from "./index13.js";
5
+ import { SelectionValue as y } from "./index14.js";
6
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
4
7
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js
5
- var c = "attachments";
6
- function l({ attachments: l, labels: u }) {
7
- return /* @__PURE__ */ o(t, {
8
- value: c,
9
- children: [/* @__PURE__ */ a(n, { children: /* @__PURE__ */ o("span", {
10
- className: "ttw:flex ttw:items-center ttw:gap-2",
11
- children: [/* @__PURE__ */ a("span", {
12
- className: "ttw:group-hover:underline",
13
- children: u.attachmentsHeading
14
- }), /* @__PURE__ */ a(r, {
15
- variant: "secondary",
16
- className: "ttw:rounded-full",
17
- children: l.countLabel
8
+ function S({ idPrefix: S, paymentTerms: C, paymentTermsError: w, disabled: T, onPaymentTermsChange: E, onCustomDatePickerOpenChange: D, customDateCalendar: O, recurrenceSection: k, labels: A }) {
9
+ let j = {
10
+ ...g,
11
+ ...A
12
+ }, M = `${S}-payment-terms`, N = () => {
13
+ window.setTimeout(() => D(!0), 0);
14
+ };
15
+ return /* @__PURE__ */ x("div", {
16
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
17
+ children: [/* @__PURE__ */ x("div", {
18
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
19
+ children: [/* @__PURE__ */ b(h, {
20
+ variant: "h4",
21
+ children: j.billingHeading
22
+ }), /* @__PURE__ */ b(h, {
23
+ variant: "body2",
24
+ color: "muted",
25
+ className: "ttw:font-medium",
26
+ children: j.billingDescription
18
27
  })]
19
- }) }), /* @__PURE__ */ a(e, { children: l.rows.length === 0 ? /* @__PURE__ */ a(i, {
20
- variant: "body2",
21
- color: "muted",
22
- children: u.attachmentsEmpty
23
- }) : /* @__PURE__ */ o("table", {
24
- className: "ttw:w-full ttw:border-collapse",
25
- children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", {
26
- className: "ttw:border-b ttw:border-border",
27
- children: [/* @__PURE__ */ a("th", {
28
- scope: "col",
29
- className: "ttw:py-2 ttw:text-left",
30
- children: /* @__PURE__ */ a(i, {
31
- component: "span",
32
- variant: "caption",
33
- color: "muted",
34
- children: u.attachmentsFileColumn
35
- })
36
- }), /* @__PURE__ */ a("th", {
37
- scope: "col",
38
- className: "ttw:py-2 ttw:text-right",
39
- children: /* @__PURE__ */ a(i, {
40
- component: "span",
41
- variant: "caption",
42
- color: "muted",
43
- children: u.attachmentsEmailedColumn
44
- })
45
- })]
46
- }) }), /* @__PURE__ */ a("tbody", { children: l.rows.map((e) => /* @__PURE__ */ o("tr", {
47
- className: "ttw:border-b ttw:border-border ttw:last:border-b-0",
48
- children: [/* @__PURE__ */ a("td", {
49
- className: "ttw:py-3",
50
- children: /* @__PURE__ */ a("a", {
51
- href: e.url,
52
- target: "_blank",
53
- rel: "noreferrer",
54
- className: "ttw:text-primary ttw:hover:underline",
55
- children: e.name
56
- })
57
- }), /* @__PURE__ */ a("td", {
58
- className: "ttw:py-3 ttw:text-right ttw:align-middle",
59
- children: e.includeInEmail ? /* @__PURE__ */ a(s, {
60
- role: "img",
61
- "aria-label": e.emailedLabel,
62
- className: "ttw:inline-block ttw:size-4 ttw:text-emerald-600"
63
- }) : /* @__PURE__ */ a("span", {
64
- className: "ttw:sr-only",
65
- children: e.emailedLabel
66
- })
67
- })]
68
- }, e.id)) })]
69
- }) })]
28
+ }), /* @__PURE__ */ x("div", {
29
+ className: "ttw:flex ttw:flex-col ttw:gap-6",
30
+ children: [k, /* @__PURE__ */ b("div", {
31
+ className: "ttw:flex ttw:w-full ttw:items-start ttw:gap-2.5",
32
+ children: C.kind === "loading" ? /* @__PURE__ */ b(m, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ b(e, { children: /* @__PURE__ */ x(t, { children: [
33
+ /* @__PURE__ */ b(i, {
34
+ htmlFor: M,
35
+ children: j.paymentTermsLabel
36
+ }),
37
+ /* @__PURE__ */ x(a, {
38
+ open: C.customDatePicker.open,
39
+ onOpenChange: D,
40
+ children: [/* @__PURE__ */ x(c, {
41
+ disabled: T,
42
+ value: C.value,
43
+ onValueChange: (e) => {
44
+ E(e), e === "custom" && N();
45
+ },
46
+ children: [/* @__PURE__ */ b(o, {
47
+ className: "ttw:w-full",
48
+ children: /* @__PURE__ */ b(f, {
49
+ id: M,
50
+ className: "ttw:w-full",
51
+ "aria-invalid": !!w,
52
+ children: /* @__PURE__ */ b(p, {
53
+ placeholder: j.paymentTermsPlaceholder,
54
+ children: /* @__PURE__ */ b(y, {
55
+ selection: C.selection,
56
+ labels: j
57
+ })
58
+ })
59
+ })
60
+ }), /* @__PURE__ */ x(l, { children: [
61
+ /* @__PURE__ */ b(u, {
62
+ value: _,
63
+ children: j.paymentTermsReceiptDue
64
+ }),
65
+ C.showCustomDate && /* @__PURE__ */ b(u, {
66
+ value: "custom",
67
+ onPointerUp: N,
68
+ onClick: N,
69
+ onKeyDown: (e) => {
70
+ (e.key === "Enter" || e.key === " ") && N();
71
+ },
72
+ children: j.paymentTermsCustomDate
73
+ }),
74
+ /* @__PURE__ */ b(d, {}),
75
+ C.options.map((e) => /* @__PURE__ */ b(u, {
76
+ value: e.value,
77
+ children: /* @__PURE__ */ b(v, { option: e })
78
+ }, e.value))
79
+ ] })]
80
+ }), /* @__PURE__ */ b(s, {
81
+ className: "ttw:w-auto ttw:overflow-hidden ttw:p-0",
82
+ align: "start",
83
+ onFocusOutside: (e) => e.preventDefault(),
84
+ children: O
85
+ })]
86
+ }),
87
+ C.description && /* @__PURE__ */ b(n, { children: C.description }),
88
+ /* @__PURE__ */ b(r, { errors: w ? [{ message: w }] : [] })
89
+ ] }) })
90
+ })]
91
+ })]
70
92
  });
71
93
  }
72
94
  //#endregion
73
- export { c as ATTACHMENTS_ITEM_VALUE, l as AttachmentsItem };
95
+ export { S as ReceivableBillingSection, S as default };
@@ -1,20 +1,3 @@
1
- import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { forwardRef as t } from "react";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { XIcon as r } from "lucide-react";
5
- //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js
6
- var i = t(function({ label: t, onClose: i, variant: a = "ghost", size: o = "icon", onClick: s, ...c }, l) {
7
- return /* @__PURE__ */ n(e, {
8
- ref: l,
9
- variant: a,
10
- size: o,
11
- ...c,
12
- "aria-label": t,
13
- onClick: (e) => {
14
- s?.(e), i();
15
- },
16
- children: /* @__PURE__ */ n(r, { className: "ttw:size-4" })
17
- });
18
- });
19
- //#endregion
20
- export { i as CloseButton };
1
+ import "./index7.js";
2
+ import "./index15.js";
3
+ import "./index16.js";
@@ -1,16 +1,24 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
1
+ import { Badge as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as n } from "./index9.js";
3
+ import { jsxs as r } from "react/jsx-runtime";
2
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js
3
- function n({ label: n, value: r }) {
4
- return /* @__PURE__ */ t("div", {
5
- className: "ttw:flex ttw:gap-4 ttw:border-b ttw:border-border ttw:py-3 ttw:text-sm ttw:last:border-b-0",
6
- children: [/* @__PURE__ */ e("span", {
7
- className: "ttw:w-40 ttw:shrink-0 ttw:text-muted-foreground",
8
- children: n
9
- }), /* @__PURE__ */ e("span", {
10
- className: "ttw:whitespace-pre-line ttw:text-foreground",
11
- children: r
12
- })]
5
+ var i = {
6
+ danger: "ttw:border-red-200 ttw:bg-red-50 ttw:text-red-700 ttw:hover:bg-red-50",
7
+ info: "ttw:border-blue-200 ttw:bg-blue-50 ttw:text-blue-700 ttw:hover:bg-blue-50",
8
+ neutral: "ttw:border-border ttw:bg-muted ttw:text-foreground ttw:hover:bg-muted",
9
+ success: "ttw:border-emerald-200 ttw:bg-emerald-50 ttw:text-emerald-700 ttw:hover:bg-emerald-50",
10
+ warning: "ttw:border-amber-200 ttw:bg-amber-50 ttw:text-amber-800 ttw:hover:bg-amber-50"
11
+ };
12
+ function a({ status: a, label: o, tone: s, labels: c, icon: l }) {
13
+ let u = {
14
+ ...n,
15
+ ...c
16
+ }, d = o ?? u[a] ?? u.unknown;
17
+ return /* @__PURE__ */ r(e, {
18
+ variant: "outline",
19
+ className: t(l && "ttw:gap-1", i[s]),
20
+ children: [l, d]
13
21
  });
14
22
  }
15
23
  //#endregion
16
- export { n as InfoRow };
24
+ export { a as ReceivableStatusBadge, a as default };
@@ -1,32 +1,42 @@
1
- import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuItem as r, DropdownMenuTrigger as i, Tooltip as a, TooltipContent as o, TooltipTrigger as s } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { ACTION_ICON as c } from "./index14.js";
3
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
- import { MoreVerticalIcon as d } from "lucide-react";
1
+ import { Ban as e, Check as t, CircleCheck as n, CircleSlash as r, CircleX as i, ClipboardCheck as a, Clock as o, CopyPlus as s, Mail as c, PenTool as l, Pencil as u, Trash2 as d } from "lucide-react";
5
2
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js
6
- function f({ actions: f, triggerLabel: p, getActionLabel: m, onSelect: h, className: g }) {
7
- return /* @__PURE__ */ u(t, { children: [/* @__PURE__ */ u(a, { children: [/* @__PURE__ */ l(s, {
8
- asChild: !0,
9
- children: /* @__PURE__ */ l(i, {
10
- asChild: !0,
11
- children: /* @__PURE__ */ l(e, {
12
- variant: "ghost",
13
- size: "icon",
14
- className: g,
15
- "aria-label": p,
16
- children: /* @__PURE__ */ l(d, { className: "ttw:size-4" })
17
- })
18
- })
19
- }), /* @__PURE__ */ l(o, { children: p })] }), /* @__PURE__ */ l(n, {
20
- align: "end",
21
- children: f.map((e) => {
22
- let t = c[e];
23
- return /* @__PURE__ */ u(r, {
24
- variant: e === "delete" ? "destructive" : "default",
25
- onClick: () => h(e),
26
- children: [/* @__PURE__ */ l(t, { className: "ttw:size-4" }), m(e)]
27
- }, e);
28
- })
29
- })] });
30
- }
3
+ var f = {
4
+ edit: "editButton",
5
+ issue: "issueButton",
6
+ recordPayment: "recordPaymentButton",
7
+ send: "sendButton",
8
+ accept: "acceptButton",
9
+ decline: "declineButton",
10
+ markPaid: "markPaidButton",
11
+ markUncollectible: "markUncollectibleButton",
12
+ cancel: "cancelButton",
13
+ clone: "cloneButton",
14
+ delete: "deleteButton"
15
+ }, p = {
16
+ edit: u,
17
+ issue: c,
18
+ recordPayment: a,
19
+ send: c,
20
+ accept: n,
21
+ decline: i,
22
+ markPaid: n,
23
+ markUncollectible: r,
24
+ cancel: e,
25
+ clone: s,
26
+ delete: d
27
+ }, m = {
28
+ draft: l,
29
+ issuing: o,
30
+ issued: o,
31
+ partially_paid: o,
32
+ paid: t,
33
+ overdue: o,
34
+ canceled: e
35
+ }, h = {
36
+ default: "ttw:text-foreground",
37
+ danger: "ttw:text-red-600",
38
+ success: "ttw:text-emerald-600",
39
+ muted: "ttw:text-muted-foreground"
40
+ }, g = "ttw:bg-muted ttw:text-muted-foreground ttw:hover:bg-accent";
31
41
  //#endregion
32
- export { f as OverflowMenu };
42
+ export { p as ACTION_ICON, f as ACTION_LABEL_KEY, m as STATUS_ICON, h as amountValueToneClass, g as headerIconButtonClass };
@@ -1,11 +1,18 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js
2
2
  var e = {
3
- billingHeading: "Billing details",
4
- billingDescription: "What are the billing terms?",
5
- paymentTermsLabel: "Payment terms",
6
- paymentTermsPlaceholder: "Select payment terms",
7
- paymentTermsReceiptDue: "Due on receipt",
8
- paymentTermsCustomDate: "Custom date"
3
+ issueDescription: "The customer will be emailed a copy of the invoice with payment instructions.",
4
+ toLabel: "To",
5
+ subjectLabel: "Subject",
6
+ messageLabel: "Message",
7
+ messagePlaceholder: "e.g., Thank you for your business",
8
+ attachmentsLabel: "Attachments",
9
+ attachmentsCaption: "To change what files are attached to the email, you will need to update the invoice.",
10
+ skipButton: "Skip",
11
+ sendButton: "Send invoice",
12
+ productsQuestion: "Do you want to also save these items?",
13
+ productsCaption: "Saved items can be quickly added to future invoices.",
14
+ productsAllLabel: "Products and services",
15
+ saveItemsButton: "Save selected items"
9
16
  };
10
17
  //#endregion
11
- export { e as RECEIVABLE_BILLING_SECTION_LABELS_EN };
18
+ export { e as RECEIVABLE_ACTIONS_MODAL_LABELS_EN };
@@ -1,305 +1,19 @@
1
- import { Accordion as e, AccordionContent as t, AccordionItem as n, AccordionTrigger as r, Badge as i, Button as a, Sheet as o, SheetContent as s, SheetDescription as c, SheetHeader as l, SheetTitle as u, Tooltip as d, TooltipContent as f, TooltipProvider as p, TooltipTrigger as m, cn as h } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { ErrorState as g } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
3
- import "../../../shared/ui/dist/index.js";
4
- import { RECEIVABLE_DETAILS_PANEL_LABELS_EN as _ } from "./index4.js";
5
- import { ReceivableStatusBadge as v } from "./index13.js";
6
- import { ACTION_ICON as y, ACTION_LABEL_KEY as b, STATUS_ICON as x, headerIconButtonClass as S } from "./index14.js";
7
- import { AmountCell as C } from "./index15.js";
8
- import { ATTACHMENTS_ITEM_VALUE as w, AttachmentsItem as T } from "./index16.js";
9
- import { CloseButton as E } from "./index17.js";
10
- import { InfoRow as D } from "./index18.js";
11
- import { OverflowMenu as O } from "./index19.js";
12
- import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
13
- import { CircleAlert as M, EyeIcon as N, Repeat as P } from "lucide-react";
1
+ import { cn as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { amountValueToneClass as t } from "./index19.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
14
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js
15
- function F({ open: F, onOpenChange: I, details: L, unsupported: R, isLoading: z, isError: B, onActionClick: V, onClose: H, labels: U }) {
16
- let W = {
17
- ..._,
18
- ...U
19
- }, G = L?.panel, K = B ? {
20
- title: W.errorTitle,
21
- description: W.errorDescription
22
- } : R, q = G?.amountTone === "danger", J = (e) => W[b[e]], Y = L ? x[L.status] : void 0;
23
- return /* @__PURE__ */ A(o, {
24
- open: F,
25
- onOpenChange: I,
26
- children: /* @__PURE__ */ j(s, {
27
- showCloseButton: !1,
28
- className: "ttw:w-180 ttw:overflow-y-auto ttw:p-0 ttw:sm:max-w-180",
29
- children: [K || z || !L ? /* @__PURE__ */ A(E, {
30
- label: W.closeButton,
31
- onClose: H,
32
- className: h(S, "ttw:absolute ttw:right-4 ttw:top-4 ttw:z-10")
33
- }) : null, K ? /* @__PURE__ */ j("div", {
34
- className: "ttw:p-6",
35
- children: [/* @__PURE__ */ j(l, {
36
- className: "ttw:sr-only",
37
- children: [/* @__PURE__ */ A(u, { children: K.title }), /* @__PURE__ */ A(c, { children: W.hiddenDescription })]
38
- }), /* @__PURE__ */ A(g, {
39
- title: K.title,
40
- description: K.description
41
- })]
42
- }) : z || !L || !G ? /* @__PURE__ */ j(l, {
43
- className: "ttw:p-6",
44
- children: [/* @__PURE__ */ A(u, { children: W.loadingTitle }), /* @__PURE__ */ A(c, {
45
- className: "ttw:sr-only",
46
- children: W.hiddenDescription
47
- })]
48
- }) : /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ j(l, {
49
- className: "ttw:flex ttw:flex-row ttw:items-start ttw:justify-between ttw:gap-2 ttw:space-y-0 ttw:px-6 ttw:py-4",
50
- children: [/* @__PURE__ */ j("div", {
51
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
52
- children: [
53
- /* @__PURE__ */ A(u, {
54
- className: "ttw:text-xl ttw:font-semibold ttw:text-foreground",
55
- children: L.title
56
- }),
57
- G.subtitle ? /* @__PURE__ */ A("p", {
58
- className: "ttw:text-sm ttw:text-muted-foreground",
59
- children: G.subtitle
60
- }) : null,
61
- /* @__PURE__ */ A(c, {
62
- className: "ttw:sr-only",
63
- children: W.hiddenDescription
64
- })
65
- ]
66
- }), /* @__PURE__ */ A(p, {
67
- delayDuration: 500,
68
- children: /* @__PURE__ */ j("div", {
69
- className: "ttw:flex ttw:items-center ttw:gap-1.5",
70
- children: [
71
- L.pdfUrl ? /* @__PURE__ */ j(d, { children: [/* @__PURE__ */ A(m, {
72
- asChild: !0,
73
- children: /* @__PURE__ */ A(a, {
74
- asChild: !0,
75
- variant: "ghost",
76
- size: "icon",
77
- className: S,
78
- children: /* @__PURE__ */ A("a", {
79
- href: L.pdfUrl,
80
- target: "_blank",
81
- rel: "noreferrer",
82
- "aria-label": W.viewPdfButton,
83
- children: /* @__PURE__ */ A(N, { className: "ttw:size-4" })
84
- })
85
- })
86
- }), /* @__PURE__ */ A(f, { children: W.viewPdfButton })] }) : null,
87
- G.overflowActions.length > 0 ? /* @__PURE__ */ A(O, {
88
- actions: G.overflowActions,
89
- triggerLabel: W.moreActionsLabel,
90
- getActionLabel: J,
91
- onSelect: (e) => V(e, L),
92
- className: S
93
- }) : null,
94
- /* @__PURE__ */ j(d, { children: [/* @__PURE__ */ A(m, {
95
- asChild: !0,
96
- children: /* @__PURE__ */ A(E, {
97
- label: W.closeButton,
98
- onClose: H,
99
- className: S
100
- })
101
- }), /* @__PURE__ */ A(f, { children: W.closeButton })] })
102
- ]
103
- })
104
- })]
105
- }), /* @__PURE__ */ j("div", {
106
- className: "ttw:flex ttw:flex-col",
107
- children: [/* @__PURE__ */ A("div", {
108
- className: "ttw:px-6",
109
- children: /* @__PURE__ */ j("div", {
110
- className: h("ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:bg-muted ttw:p-4", q && "ttw:border ttw:border-red-200"),
111
- children: [
112
- /* @__PURE__ */ A("div", {
113
- className: "ttw:flex ttw:flex-row ttw:flex-wrap ttw:gap-x-12 ttw:gap-y-2",
114
- children: G.amountRows.map((e) => /* @__PURE__ */ A(C, {
115
- row: e,
116
- defaultTone: G.amountTone
117
- }, e.label))
118
- }),
119
- /* @__PURE__ */ j("div", {
120
- className: "ttw:flex ttw:items-center ttw:gap-2",
121
- children: [G.overdueLabel ? /* @__PURE__ */ j("span", {
122
- className: "ttw:inline-flex ttw:items-center ttw:gap-1 ttw:rounded-full ttw:bg-red-100 ttw:px-2.5 ttw:py-0.5 ttw:text-xs ttw:font-medium ttw:text-red-700",
123
- children: [/* @__PURE__ */ A(M, { className: "ttw:size-3" }), G.overdueLabel]
124
- }) : /* @__PURE__ */ A(v, {
125
- label: G.statusLabel,
126
- tone: L.statusTone,
127
- icon: Y ? /* @__PURE__ */ A(Y, { className: "ttw:size-3" }) : void 0
128
- }), G.recurring ? /* @__PURE__ */ j(i, {
129
- variant: "outline",
130
- className: "ttw:gap-1 ttw:border-violet-200 ttw:bg-violet-50 ttw:text-violet-700",
131
- children: [/* @__PURE__ */ A(P, { className: "ttw:size-3" }), W.recurringBadge]
132
- }) : null]
133
- }),
134
- /* @__PURE__ */ j("div", {
135
- className: "ttw:flex ttw:gap-12 ttw:text-sm",
136
- children: [/* @__PURE__ */ j("div", {
137
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
138
- children: [/* @__PURE__ */ A("span", {
139
- className: "ttw:text-xs ttw:text-muted-foreground",
140
- children: W.invoiceDateCaption
141
- }), /* @__PURE__ */ A("span", {
142
- className: "ttw:text-foreground",
143
- children: G.issueDateLabel
144
- })]
145
- }), /* @__PURE__ */ j("div", {
146
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
147
- children: [/* @__PURE__ */ A("span", {
148
- className: "ttw:text-xs ttw:text-muted-foreground",
149
- children: G.dueDateCaption
150
- }), /* @__PURE__ */ A("span", {
151
- className: "ttw:text-foreground",
152
- children: G.dueDateLabel
153
- })]
154
- })]
155
- }),
156
- G.primaryActions.length > 0 ? /* @__PURE__ */ A("div", {
157
- className: "ttw:flex ttw:items-center ttw:gap-2 ttw:border-t ttw:border-border ttw:pt-3",
158
- children: G.primaryActions.map((e, t) => {
159
- let n = y[e], r = t === G.primaryActions.length - 1;
160
- return /* @__PURE__ */ j(a, {
161
- size: "sm",
162
- variant: r ? "default" : "outline",
163
- onClick: () => V(e, L),
164
- children: [/* @__PURE__ */ A(n, { className: "ttw:size-4" }), J(e)]
165
- }, e);
166
- })
167
- }) : null
168
- ]
169
- })
170
- }), /* @__PURE__ */ j("div", {
171
- className: "ttw:px-6",
172
- children: [
173
- G.paymentHistory ? /* @__PURE__ */ j("section", {
174
- "aria-label": W.paymentHistoryHeading,
175
- className: "ttw:border-b ttw:py-4",
176
- children: [/* @__PURE__ */ A("h3", {
177
- className: "ttw:mb-3 ttw:text-sm ttw:font-medium",
178
- children: W.paymentHistoryHeading
179
- }), G.paymentHistory.rows.length === 0 ? /* @__PURE__ */ A("p", {
180
- className: h("ttw:text-sm", G.paymentHistory.emptyTone === "danger" ? "ttw:text-red-600" : "ttw:text-muted-foreground"),
181
- children: W.paymentHistoryEmpty
182
- }) : /* @__PURE__ */ j("div", {
183
- className: "ttw:flex ttw:flex-col",
184
- children: [G.paymentHistory.rows.map((e) => /* @__PURE__ */ j("div", {
185
- className: "ttw:flex ttw:justify-between ttw:border-b ttw:border-border ttw:py-2 ttw:text-sm",
186
- children: [/* @__PURE__ */ A("span", { children: e.dateLabel }), /* @__PURE__ */ A("span", { children: e.amountLabel })]
187
- }, e.id)), /* @__PURE__ */ j("div", {
188
- className: "ttw:flex ttw:justify-between ttw:py-2 ttw:text-sm ttw:font-medium",
189
- children: [/* @__PURE__ */ A("span", { children: W.paymentHistoryTotalLabel }), /* @__PURE__ */ A("span", { children: G.paymentHistory.totalLabel })]
190
- })]
191
- })]
192
- }) : null,
193
- G.customerContact.length > 0 ? /* @__PURE__ */ j("section", {
194
- "aria-label": W.customerDetailsHeading,
195
- className: "ttw:border-b ttw:py-4",
196
- children: [/* @__PURE__ */ A("h3", {
197
- className: "ttw:mb-3 ttw:text-sm ttw:font-medium",
198
- children: W.customerDetailsHeading
199
- }), /* @__PURE__ */ A("div", {
200
- className: "ttw:flex ttw:flex-col",
201
- children: G.customerContact.map((e) => /* @__PURE__ */ A(D, { ...e }, e.label))
202
- })]
203
- }) : null,
204
- /* @__PURE__ */ j(e, {
205
- type: "multiple",
206
- defaultValue: [w],
207
- className: "ttw:w-full",
208
- children: [
209
- G.recurrenceItems ? /* @__PURE__ */ j(n, {
210
- value: "recurrence",
211
- children: [/* @__PURE__ */ A(r, { children: W.recurrenceHeading }), /* @__PURE__ */ A(t, { children: /* @__PURE__ */ A("div", {
212
- className: "ttw:flex ttw:flex-col",
213
- children: G.recurrenceItems.map((e) => /* @__PURE__ */ A(D, { ...e }, e.label))
214
- }) })]
215
- }) : null,
216
- /* @__PURE__ */ j(n, {
217
- value: "billing",
218
- children: [/* @__PURE__ */ A(r, { children: W.billingHeading }), /* @__PURE__ */ A(t, { children: /* @__PURE__ */ A("div", {
219
- className: "ttw:flex ttw:flex-col",
220
- children: G.billingItems.map((e) => /* @__PURE__ */ A(D, { ...e }, e.label))
221
- }) })]
222
- }),
223
- /* @__PURE__ */ j(n, {
224
- value: "line-items",
225
- children: [/* @__PURE__ */ A(r, { children: /* @__PURE__ */ j("span", {
226
- className: "ttw:flex ttw:items-center ttw:gap-2",
227
- children: [W.lineItemsHeading, /* @__PURE__ */ A(i, {
228
- variant: "secondary",
229
- className: "ttw:rounded-full",
230
- children: G.lineItemsCountLabel
231
- })]
232
- }) }), /* @__PURE__ */ A(t, { children: /* @__PURE__ */ j("div", {
233
- className: "ttw:flex ttw:flex-col ttw:text-sm",
234
- children: [L.lineItems.length === 0 ? /* @__PURE__ */ A("p", {
235
- className: "ttw:py-3 ttw:text-muted-foreground",
236
- children: W.noLineItems
237
- }) : L.lineItems.map((e) => /* @__PURE__ */ j("div", {
238
- className: "ttw:flex ttw:items-start ttw:justify-between ttw:border-b ttw:border-border ttw:py-3",
239
- children: [/* @__PURE__ */ j("div", {
240
- className: "ttw:flex ttw:flex-col",
241
- children: [/* @__PURE__ */ A("span", {
242
- className: "ttw:font-medium",
243
- children: e.name
244
- }), /* @__PURE__ */ j("span", {
245
- className: "ttw:text-muted-foreground",
246
- children: [
247
- e.quantityLabel,
248
- " ",
249
- W.lineItemMultiplier,
250
- " ",
251
- e.unitPriceLabel,
252
- " ",
253
- W.lineItemEaLabel
254
- ]
255
- })]
256
- }), /* @__PURE__ */ A("span", { children: e.totalLabel })]
257
- }, e.id)), G.lineItemTotals.length > 0 ? /* @__PURE__ */ A("div", {
258
- className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:py-3",
259
- children: G.lineItemTotals.map((e) => /* @__PURE__ */ j("div", {
260
- className: h("ttw:flex ttw:justify-between", e.emphasis && "ttw:font-medium"),
261
- children: [/* @__PURE__ */ A("span", { children: e.label }), /* @__PURE__ */ A("span", { children: e.value })]
262
- }, e.label))
263
- }) : null]
264
- }) })]
265
- }),
266
- G.notes ? /* @__PURE__ */ j(n, {
267
- value: "notes",
268
- children: [/* @__PURE__ */ A(r, { children: /* @__PURE__ */ j("span", {
269
- className: "ttw:flex ttw:items-center ttw:gap-2",
270
- children: [W.notesHeading, /* @__PURE__ */ A(i, {
271
- variant: "secondary",
272
- className: "ttw:rounded-full",
273
- children: G.notes.countLabel
274
- })]
275
- }) }), /* @__PURE__ */ A(t, { children: /* @__PURE__ */ j("div", {
276
- className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:text-sm",
277
- children: [G.notes.opening ? /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
278
- className: "ttw:mb-1 ttw:font-medium",
279
- children: W.notesOpeningLabel
280
- }), /* @__PURE__ */ A("p", {
281
- className: "ttw:text-muted-foreground",
282
- children: G.notes.opening
283
- })] }) : null, G.notes.closing ? /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
284
- className: "ttw:mb-1 ttw:font-medium",
285
- children: W.notesClosingLabel
286
- }), /* @__PURE__ */ A("p", {
287
- className: "ttw:text-muted-foreground",
288
- children: G.notes.closing
289
- })] }) : null]
290
- }) })]
291
- }) : null,
292
- /* @__PURE__ */ A(T, {
293
- attachments: G.attachments,
294
- labels: W
295
- })
296
- ]
297
- })
298
- ]
299
- })]
300
- })] })]
301
- })
5
+ function i({ row: i, defaultTone: a }) {
6
+ let o = i.tone ?? (i.emphasis ? a : "default");
7
+ return /* @__PURE__ */ r("div", {
8
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
9
+ children: [/* @__PURE__ */ n("span", {
10
+ className: "ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
11
+ children: i.label
12
+ }), /* @__PURE__ */ n("span", {
13
+ className: e(i.emphasis ? "ttw:text-2xl ttw:font-semibold" : "ttw:text-base ttw:font-medium", t[o]),
14
+ children: i.value
15
+ })]
302
16
  });
303
17
  }
304
18
  //#endregion
305
- export { F as ReceivableDetailsPanel, F as default };
19
+ export { i as AmountCell };