@tesouro/embedded-components-react 0.5.279 → 0.5.280

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 (104) hide show
  1. package/dist/index.d.ts +21 -6
  2. package/dist/lib/ReceivablesWidget.d.ts +21 -6
  3. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +14 -13
  4. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +24 -168
  5. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +173 -44
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +42 -94
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +91 -76
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +67 -173
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index15.js +186 -17
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +27 -0
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +11 -13
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +42 -27
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +28 -132
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +137 -16
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +16 -62
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +66 -28
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +28 -34
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableAttachmentsSection.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableCustomerSection.js +38 -0
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +304 -287
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/customer.js +58 -0
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +15 -15
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +14 -6
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/permissions.js +2 -1
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +62 -62
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +41 -35
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/totals.js +21 -13
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +124 -124
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +11 -11
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +13 -13
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableCustomerPicker.js +109 -0
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +6 -6
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +520 -476
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +10 -10
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +6 -6
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentTerms.js +1 -1
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePreview.js +1 -1
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +92 -77
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +11 -11
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +4 -4
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +79 -75
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useSendReceivableWithPaymentLink.js +3 -3
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +26 -23
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +9 -25
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +26 -228
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +227 -52
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +50 -212
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +193 -138
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +157 -12
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +10 -19
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +23 -2
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +2 -116
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +118 -3
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +3 -39
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +209 -53
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +2 -23
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +36 -7
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +53 -77
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +17 -35
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +8 -18
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +73 -37
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +36 -26
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +17 -19
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +39 -8
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +26 -33
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +20 -14
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +8 -24
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +34 -84
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +14 -492
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +28 -2
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +79 -39
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +490 -68
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +2 -487
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +41 -217
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +70 -21
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +440 -5
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +224 -0
  83. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +21 -263
  84. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +8 -2
  85. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +261 -24
  86. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +2 -237
  87. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +100 -3
  88. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +21 -242
  89. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +226 -82
  90. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +3 -60
  91. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +233 -178
  92. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +85 -37
  93. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +60 -0
  94. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +194 -0
  95. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +45 -0
  96. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +9 -9
  97. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +2 -23
  98. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +2 -51
  99. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +8 -8
  100. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +4 -80
  101. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +10 -22
  102. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  103. package/package.json +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +0 -100
@@ -1,118 +1,4 @@
1
- import { Field as e, FieldContent as t, FieldDescription as n, FieldError as r, FieldLabel as i, Input as a, Popover as o, PopoverAnchor as s, PopoverContent as c, Select as l, SelectContent as u, SelectItem as d, SelectSeparator as f, SelectTrigger as p, SelectValue as m, Skeleton as h, Typography as g } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { RECEIVABLE_BILLING_SECTION_LABELS_EN as _ } from "./index11.js";
3
- import { RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as v } from "./index19.js";
4
- import { OptionRow as y } from "./index17.js";
5
- import { SelectionValue as b } from "./index18.js";
6
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
7
1
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js
8
- function C({ idPrefix: C, paymentTerms: w, paymentTermsError: T, disabled: E, onPaymentTermsChange: D, onCustomDatePickerOpenChange: O, customDateCalendar: k, purchaseOrder: A, onPurchaseOrderChange: j, recurrenceSection: M, remindersSection: N, labels: P }) {
9
- let F = {
10
- ..._,
11
- ...P
12
- }, I = `${C}-payment-terms`, L = `${C}-purchase-order`, R = () => {
13
- window.setTimeout(() => O(!0), 0);
14
- };
15
- return /* @__PURE__ */ S("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__ */ S("div", {
18
- className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
19
- children: [/* @__PURE__ */ x(g, {
20
- variant: "h4",
21
- children: F.billingHeading
22
- }), /* @__PURE__ */ x(g, {
23
- variant: "body2",
24
- color: "muted",
25
- className: "ttw:font-medium",
26
- children: F.billingDescription
27
- })]
28
- }), /* @__PURE__ */ S("div", {
29
- className: "ttw:flex ttw:flex-col ttw:gap-6",
30
- children: [
31
- M,
32
- /* @__PURE__ */ S("div", {
33
- className: "ttw:flex ttw:w-full ttw:items-start ttw:gap-2.5",
34
- children: [w.kind === "loading" ? /* @__PURE__ */ x(h, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ x(e, { children: /* @__PURE__ */ S(t, { children: [
35
- /* @__PURE__ */ x(i, {
36
- htmlFor: I,
37
- children: F.paymentTermsLabel
38
- }),
39
- /* @__PURE__ */ S(o, {
40
- open: w.customDatePicker.open,
41
- onOpenChange: O,
42
- children: [/* @__PURE__ */ S(l, {
43
- disabled: E,
44
- value: w.value,
45
- onValueChange: (e) => {
46
- D(e), e === "custom" && R();
47
- },
48
- children: [/* @__PURE__ */ x(s, {
49
- className: "ttw:w-full",
50
- children: /* @__PURE__ */ x(p, {
51
- id: I,
52
- className: "ttw:w-full",
53
- "aria-invalid": !!T,
54
- children: /* @__PURE__ */ x(m, {
55
- placeholder: F.paymentTermsPlaceholder,
56
- children: /* @__PURE__ */ x(b, {
57
- selection: w.selection,
58
- labels: F
59
- })
60
- })
61
- })
62
- }), /* @__PURE__ */ S(u, { children: [
63
- /* @__PURE__ */ x(d, {
64
- value: v,
65
- children: F.paymentTermsReceiptDue
66
- }),
67
- w.showCustomDate && /* @__PURE__ */ x(d, {
68
- value: "custom",
69
- onPointerUp: R,
70
- onClick: R,
71
- onKeyDown: (e) => {
72
- (e.key === "Enter" || e.key === " ") && R();
73
- },
74
- children: F.paymentTermsCustomDate
75
- }),
76
- /* @__PURE__ */ x(f, {}),
77
- w.options.map((e) => /* @__PURE__ */ x(d, {
78
- value: e.value,
79
- children: /* @__PURE__ */ x(y, { option: e })
80
- }, e.value))
81
- ] })]
82
- }), /* @__PURE__ */ x(c, {
83
- className: "ttw:w-auto ttw:overflow-hidden ttw:p-0",
84
- align: "start",
85
- onFocusOutside: (e) => e.preventDefault(),
86
- children: k
87
- })]
88
- }),
89
- w.description && /* @__PURE__ */ x(n, { children: w.description }),
90
- /* @__PURE__ */ x(r, { errors: T ? [{ message: T }] : [] })
91
- ] }) }), A && /* @__PURE__ */ x(e, { children: /* @__PURE__ */ S(t, { children: [
92
- /* @__PURE__ */ S(i, {
93
- htmlFor: L,
94
- className: "ttw:text-nowrap",
95
- children: [F.purchaseOrderLabel, /* @__PURE__ */ x(g, {
96
- variant: "body2",
97
- color: "muted",
98
- className: "ttw:leading-snug",
99
- children: F.purchaseOrderOptional
100
- })]
101
- }),
102
- /* @__PURE__ */ x(a, {
103
- id: L,
104
- value: A.value,
105
- disabled: E,
106
- "aria-invalid": !!A.error,
107
- onChange: (e) => j?.(e.target.value)
108
- }),
109
- /* @__PURE__ */ x(r, { errors: A.error ? [{ message: A.error }] : [] })
110
- ] }) })]
111
- }),
112
- N
113
- ]
114
- })]
115
- });
116
- }
2
+ var e = "receipt_due", t = "custom";
117
3
  //#endregion
118
- export { C as ReceivableBillingSection, C as default };
4
+ export { t as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, e as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE };
@@ -1,3 +1,118 @@
1
- import "./index11.js";
2
- import "./index19.js";
3
- import "./index20.js";
1
+ import { Field as e, FieldContent as t, FieldDescription as n, FieldError as r, FieldLabel as i, Input as a, Popover as o, PopoverAnchor as s, PopoverContent as c, Select as l, SelectContent as u, SelectItem as d, SelectSeparator as f, SelectTrigger as p, SelectValue as m, Skeleton as h, Typography as g } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_BILLING_SECTION_LABELS_EN as _ } from "./index11.js";
3
+ import { RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as v } from "./index20.js";
4
+ import { OptionRow as y } from "./index18.js";
5
+ import { SelectionValue as b } from "./index19.js";
6
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
7
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js
8
+ function C({ idPrefix: C, paymentTerms: w, paymentTermsError: T, disabled: E, onPaymentTermsChange: D, onCustomDatePickerOpenChange: O, customDateCalendar: k, purchaseOrder: A, onPurchaseOrderChange: j, recurrenceSection: M, remindersSection: N, labels: P }) {
9
+ let F = {
10
+ ..._,
11
+ ...P
12
+ }, I = `${C}-payment-terms`, L = `${C}-purchase-order`, R = () => {
13
+ window.setTimeout(() => O(!0), 0);
14
+ };
15
+ return /* @__PURE__ */ S("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__ */ S("div", {
18
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
19
+ children: [/* @__PURE__ */ x(g, {
20
+ variant: "h4",
21
+ children: F.billingHeading
22
+ }), /* @__PURE__ */ x(g, {
23
+ variant: "body2",
24
+ color: "muted",
25
+ className: "ttw:font-medium",
26
+ children: F.billingDescription
27
+ })]
28
+ }), /* @__PURE__ */ S("div", {
29
+ className: "ttw:flex ttw:flex-col ttw:gap-6",
30
+ children: [
31
+ M,
32
+ /* @__PURE__ */ S("div", {
33
+ className: "ttw:flex ttw:w-full ttw:items-start ttw:gap-2.5",
34
+ children: [w.kind === "loading" ? /* @__PURE__ */ x(h, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ x(e, { children: /* @__PURE__ */ S(t, { children: [
35
+ /* @__PURE__ */ x(i, {
36
+ htmlFor: I,
37
+ children: F.paymentTermsLabel
38
+ }),
39
+ /* @__PURE__ */ S(o, {
40
+ open: w.customDatePicker.open,
41
+ onOpenChange: O,
42
+ children: [/* @__PURE__ */ S(l, {
43
+ disabled: E,
44
+ value: w.value,
45
+ onValueChange: (e) => {
46
+ D(e), e === "custom" && R();
47
+ },
48
+ children: [/* @__PURE__ */ x(s, {
49
+ className: "ttw:w-full",
50
+ children: /* @__PURE__ */ x(p, {
51
+ id: I,
52
+ className: "ttw:w-full",
53
+ "aria-invalid": !!T,
54
+ children: /* @__PURE__ */ x(m, {
55
+ placeholder: F.paymentTermsPlaceholder,
56
+ children: /* @__PURE__ */ x(b, {
57
+ selection: w.selection,
58
+ labels: F
59
+ })
60
+ })
61
+ })
62
+ }), /* @__PURE__ */ S(u, { children: [
63
+ /* @__PURE__ */ x(d, {
64
+ value: v,
65
+ children: F.paymentTermsReceiptDue
66
+ }),
67
+ w.showCustomDate && /* @__PURE__ */ x(d, {
68
+ value: "custom",
69
+ onPointerUp: R,
70
+ onClick: R,
71
+ onKeyDown: (e) => {
72
+ (e.key === "Enter" || e.key === " ") && R();
73
+ },
74
+ children: F.paymentTermsCustomDate
75
+ }),
76
+ /* @__PURE__ */ x(f, {}),
77
+ w.options.map((e) => /* @__PURE__ */ x(d, {
78
+ value: e.value,
79
+ children: /* @__PURE__ */ x(y, { option: e })
80
+ }, e.value))
81
+ ] })]
82
+ }), /* @__PURE__ */ x(c, {
83
+ className: "ttw:w-auto ttw:overflow-hidden ttw:p-0",
84
+ align: "start",
85
+ onFocusOutside: (e) => e.preventDefault(),
86
+ children: k
87
+ })]
88
+ }),
89
+ w.description && /* @__PURE__ */ x(n, { children: w.description }),
90
+ /* @__PURE__ */ x(r, { errors: T ? [{ message: T }] : [] })
91
+ ] }) }), A && /* @__PURE__ */ x(e, { children: /* @__PURE__ */ S(t, { children: [
92
+ /* @__PURE__ */ S(i, {
93
+ htmlFor: L,
94
+ className: "ttw:text-nowrap",
95
+ children: [F.purchaseOrderLabel, /* @__PURE__ */ x(g, {
96
+ variant: "body2",
97
+ color: "muted",
98
+ className: "ttw:leading-snug",
99
+ children: F.purchaseOrderOptional
100
+ })]
101
+ }),
102
+ /* @__PURE__ */ x(a, {
103
+ id: L,
104
+ value: A.value,
105
+ disabled: E,
106
+ "aria-invalid": !!A.error,
107
+ onChange: (e) => j?.(e.target.value)
108
+ }),
109
+ /* @__PURE__ */ x(r, { errors: A.error ? [{ message: A.error }] : [] })
110
+ ] }) })]
111
+ }),
112
+ N
113
+ ]
114
+ })]
115
+ });
116
+ }
117
+ //#endregion
118
+ export { C as ReceivableBillingSection, C as default };
@@ -1,39 +1,3 @@
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 "./index13.js";
3
- import { jsxs as r } from "react/jsx-runtime";
4
- //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js
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
- }, a = "ttw:bg-muted ttw:text-muted-foreground", o = "ttw:bg-destructive/10 ttw:text-destructive", s = {
12
- draft: a,
13
- recurring: a,
14
- issuing: "ttw:bg-cyan-100 ttw:text-cyan-700",
15
- issued: "ttw:bg-cyan-100 ttw:text-cyan-700",
16
- accepted: "ttw:bg-green-100 ttw:text-green-700",
17
- paid: "ttw:bg-green-100 ttw:text-green-700",
18
- partially_paid: "ttw:bg-purple-100 ttw:text-purple-700",
19
- overdue: "ttw:bg-orange-100 ttw:text-orange-700",
20
- failed: o,
21
- expired: o,
22
- uncollectible: o,
23
- canceled: o,
24
- declined: o,
25
- deleted: o
26
- };
27
- function c({ status: o, label: c, tone: l = "neutral", variant: u = "outline", labels: d, icon: f }) {
28
- let p = {
29
- ...n,
30
- ...d
31
- }, m = c ?? p[o] ?? p.unknown;
32
- return /* @__PURE__ */ r(e, {
33
- variant: "outline",
34
- className: t(f && "ttw:gap-1", u === "filled" ? ["ttw:border-transparent", s[o ?? ""] ?? a] : i[l]),
35
- children: [f, m]
36
- });
37
- }
38
- //#endregion
39
- export { c as ReceivableStatusBadge, c as default };
1
+ import "./index11.js";
2
+ import "./index20.js";
3
+ import "./index21.js";
@@ -1,55 +1,211 @@
1
- import { Ban as e, CalendarX2 as t, Check as n, ChevronsRight as r, CircleCheck as i, CircleOff as a, CircleX as o, ClipboardCheck as s, Clock as c, CopyPlus as l, FileCheck as u, Mail as d, Pause as f, PenTool as p, Pencil as m, Play as h, Send as g, Trash2 as _ } from "lucide-react";
1
+ import { Avatar as e, AvatarFallback as t, Button as n, Field as r, FieldContent as i, FieldDescription as a, FieldError as o, FieldLabel as s, Input as c, Separator as l, Typography as u, cn as d } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_CUSTOMER_SECTION_LABELS_EN as f } from "./index12.js";
3
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
4
+ import { ChevronDownIcon as g, Loader2Icon as _, PlusIcon as v, SearchIcon as y } from "lucide-react";
2
5
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js
3
- var v = {
4
- edit: "editButton",
5
- issue: "issueButton",
6
- issueAndSend: "issueAndSendButton",
7
- recordPayment: "recordPaymentButton",
8
- send: "sendButton",
9
- accept: "acceptButton",
10
- decline: "declineButton",
11
- markPaid: "markPaidButton",
12
- markUncollectible: "markUncollectibleButton",
13
- cancel: "cancelButton",
14
- clone: "cloneButton",
15
- delete: "deleteButton",
16
- pauseRecurrence: "pauseRecurrenceButton",
17
- resumeRecurrence: "resumeRecurrenceButton",
18
- cancelRecurrence: "cancelRecurrenceButton"
19
- }, y = {
20
- edit: m,
21
- issue: u,
22
- issueAndSend: g,
23
- recordPayment: s,
24
- send: d,
25
- accept: i,
26
- decline: o,
27
- markPaid: i,
28
- markUncollectible: a,
29
- cancel: e,
30
- clone: l,
31
- delete: _,
32
- pauseRecurrence: f,
33
- resumeRecurrence: h,
34
- cancelRecurrence: t
35
- }, b = {
36
- draft: p,
37
- issuing: c,
38
- issued: c,
39
- partially_paid: c,
40
- paid: n,
41
- overdue: c,
42
- canceled: e
43
- }, x = {
44
- forward: r,
45
- pause: f,
46
- ban: e,
47
- check: n
48
- }, S = {
49
- default: "ttw:text-foreground",
50
- danger: "ttw:text-red-600",
51
- success: "ttw:text-emerald-600",
52
- muted: "ttw:text-muted-foreground"
53
- }, C = "ttw:group ttw:cursor-pointer ttw:hover:no-underline", w = "ttw:translate-y-0.5", T = "ttw:border-border", E = "ttw:rounded-full ttw:bg-muted ttw:text-muted-foreground", D = "ttw:bg-primary ttw:text-primary-foreground", O = "ttw:bg-primary ttw:fill-primary", k = "ttw:bg-muted ttw:text-muted-foreground ttw:hover:bg-accent", A = (e) => e.preventDefault();
6
+ function b({ idPrefix: b, card: x, picker: S, create: C, disabled: w, inputRef: T, onInputValueChange: E, onInputFocus: D, onInputBlur: O, onListToggle: k, onKey: A, onOptionHighlight: j, onOptionSelect: M, onEmailChange: N, onEmailBlur: P, onAddDetailsClick: F, onViewDetailsClick: I, onClearClick: L, labels: R }) {
7
+ let z = {
8
+ ...f,
9
+ ...R
10
+ }, B = `${b}-customer-name`, V = `${b}-customer-name-description`, H = `${b}-customer-name-error`, U = `${b}-customer-card-error`, W = `${b}-customer-email`, G = `${b}-customer-email-error`, K = S.open ? S.options.find((e) => e.value === S.highlightedValue) : void 0;
11
+ return /* @__PURE__ */ h("div", {
12
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
13
+ children: [/* @__PURE__ */ h("div", {
14
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
15
+ children: [/* @__PURE__ */ m(u, {
16
+ variant: "h4",
17
+ children: z.customerHeading
18
+ }), /* @__PURE__ */ m(u, {
19
+ variant: "body2",
20
+ color: "muted",
21
+ className: "ttw:font-medium",
22
+ children: z.customerDescription
23
+ })]
24
+ }), x ? /* @__PURE__ */ h("div", {
25
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
26
+ children: [/* @__PURE__ */ h("div", {
27
+ role: "group",
28
+ "aria-label": x.name,
29
+ "aria-describedby": x.error ? U : void 0,
30
+ className: d("ttw:flex ttw:items-center ttw:justify-between ttw:gap-2 ttw:rounded-xl ttw:border ttw:border-border ttw:p-3", x.error && "ttw:border-destructive"),
31
+ children: [/* @__PURE__ */ h("div", {
32
+ className: "ttw:flex ttw:min-w-0 ttw:items-center ttw:gap-5",
33
+ children: [/* @__PURE__ */ m(e, {
34
+ className: "ttw:size-16",
35
+ "aria-hidden": "true",
36
+ children: /* @__PURE__ */ m(t, {
37
+ className: "ttw:text-sm ttw:font-normal",
38
+ children: x.initial
39
+ })
40
+ }), /* @__PURE__ */ h("div", {
41
+ className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-1",
42
+ children: [/* @__PURE__ */ m(u, {
43
+ variant: "body1",
44
+ className: "ttw:font-medium",
45
+ children: x.name
46
+ }), /* @__PURE__ */ m(u, {
47
+ variant: "body2",
48
+ color: "muted",
49
+ children: x.email
50
+ })]
51
+ })]
52
+ }), /* @__PURE__ */ h("div", {
53
+ className: "ttw:flex ttw:items-center",
54
+ children: [I ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
55
+ type: "button",
56
+ variant: "ghost",
57
+ className: "ttw:text-primary ttw:hover:text-primary",
58
+ disabled: w,
59
+ onClick: I,
60
+ children: z.viewCustomerDetailsButton
61
+ }), /* @__PURE__ */ m(l, {
62
+ orientation: "vertical",
63
+ className: "ttw:h-6!"
64
+ })] }) : null, /* @__PURE__ */ m(n, {
65
+ type: "button",
66
+ variant: "ghost",
67
+ className: "ttw:text-primary ttw:hover:text-primary",
68
+ disabled: w,
69
+ onClick: L,
70
+ children: z.clearCustomerButton
71
+ })]
72
+ })]
73
+ }), x.error ? /* @__PURE__ */ m(o, {
74
+ id: U,
75
+ children: x.error
76
+ }) : null]
77
+ }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(r, { children: /* @__PURE__ */ h(i, { children: [
78
+ /* @__PURE__ */ m(s, {
79
+ htmlFor: B,
80
+ children: z.customerNameLabel
81
+ }),
82
+ /* @__PURE__ */ h("div", {
83
+ className: "ttw:relative ttw:w-full",
84
+ children: [/* @__PURE__ */ h("div", {
85
+ className: d("ttw:flex ttw:h-9 ttw:w-full ttw:min-w-0 ttw:items-center ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs ttw:transition-[color,box-shadow] ttw:has-[input:focus-visible]:border-ring ttw:has-[input:focus-visible]:ring-[3px] ttw:has-[input:focus-visible]:ring-ring/50 ttw:has-[[aria-invalid=true]]:border-destructive", w && "ttw:opacity-50"),
86
+ children: [
87
+ S.isLoading ? /* @__PURE__ */ m(_, { className: "ttw:pointer-events-none ttw:ml-3 ttw:size-4 ttw:shrink-0 ttw:animate-spin ttw:text-muted-foreground" }) : /* @__PURE__ */ m(y, { className: "ttw:pointer-events-none ttw:ml-3 ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground" }),
88
+ /* @__PURE__ */ m("input", {
89
+ id: B,
90
+ ref: T,
91
+ role: "combobox",
92
+ "aria-autocomplete": "list",
93
+ "aria-expanded": S.open,
94
+ "aria-controls": S.listId,
95
+ "aria-activedescendant": K?.id,
96
+ "aria-invalid": !!S.error || void 0,
97
+ "aria-describedby": S.error ? `${V} ${H}` : V,
98
+ autoComplete: "off",
99
+ disabled: w,
100
+ placeholder: S.placeholder,
101
+ className: "ttw:h-full ttw:min-w-0 ttw:flex-1 ttw:bg-transparent ttw:pr-2 ttw:pl-2 ttw:text-base ttw:outline-none ttw:placeholder:text-muted-foreground ttw:disabled:cursor-not-allowed ttw:md:text-sm",
102
+ value: S.inputValue,
103
+ onFocus: D,
104
+ onClick: D,
105
+ onBlur: O,
106
+ onChange: (e) => E(e.target.value),
107
+ onKeyDown: (e) => {
108
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
109
+ e.preventDefault(), A(e.key === "ArrowDown" ? "next" : "previous");
110
+ return;
111
+ }
112
+ if (e.key === "Enter") {
113
+ e.preventDefault(), A("enter");
114
+ return;
115
+ }
116
+ if (e.key === "Tab" && S.open) {
117
+ A("tab");
118
+ return;
119
+ }
120
+ e.key === "Escape" && S.open && (e.stopPropagation(), A("escape"));
121
+ }
122
+ }),
123
+ /* @__PURE__ */ m("button", {
124
+ type: "button",
125
+ tabIndex: -1,
126
+ "aria-label": z.customerListToggleButton,
127
+ "aria-controls": S.listId,
128
+ "aria-expanded": S.open,
129
+ disabled: w,
130
+ className: "ttw:mr-[0.3rem] ttw:flex ttw:size-6 ttw:shrink-0 ttw:cursor-pointer ttw:items-center ttw:justify-center ttw:rounded-[calc(var(--radius)-5px)] ttw:text-muted-foreground ttw:transition-all ttw:hover:bg-accent ttw:hover:text-accent-foreground ttw:disabled:pointer-events-none",
131
+ onMouseDown: (e) => e.preventDefault(),
132
+ onClick: k,
133
+ children: /* @__PURE__ */ m(g, { className: "ttw:pointer-events-none ttw:size-4" })
134
+ })
135
+ ]
136
+ }), S.open && !w ? /* @__PURE__ */ m("div", {
137
+ role: "presentation",
138
+ className: "ttw:absolute ttw:top-full ttw:left-0 ttw:z-50 ttw:mt-1.5 ttw:w-full ttw:overflow-hidden ttw:rounded-md ttw:bg-popover ttw:text-popover-foreground ttw:shadow-md ttw:ring-1 ttw:ring-foreground/10",
139
+ onMouseDown: (e) => e.preventDefault(),
140
+ children: /* @__PURE__ */ h("ul", {
141
+ id: S.listId,
142
+ role: "listbox",
143
+ "aria-labelledby": B,
144
+ className: "ttw:max-h-87 ttw:scroll-py-1 ttw:overflow-y-auto ttw:p-1",
145
+ children: [
146
+ S.options.map((e) => /* @__PURE__ */ h("li", {
147
+ id: e.id,
148
+ role: "option",
149
+ "aria-selected": e === K,
150
+ className: d("ttw:relative ttw:flex ttw:w-full ttw:cursor-default ttw:items-center ttw:justify-between ttw:gap-2 ttw:rounded-sm ttw:py-1.5 ttw:pr-8 ttw:pl-2 ttw:text-sm ttw:select-none", e === K && "ttw:bg-accent ttw:text-accent-foreground"),
151
+ onMouseEnter: () => j(e.value),
152
+ onMouseDown: () => M(e.value),
153
+ children: [/* @__PURE__ */ m("span", {
154
+ className: "ttw:min-w-0 ttw:truncate",
155
+ children: e.name
156
+ }), /* @__PURE__ */ m("span", {
157
+ className: "ttw:min-w-0 ttw:truncate ttw:text-muted-foreground",
158
+ children: e.email
159
+ })]
160
+ }, e.value)),
161
+ S.options.length ? null : /* @__PURE__ */ m("li", {
162
+ className: "ttw:py-2 ttw:text-center ttw:text-sm ttw:text-muted-foreground",
163
+ children: S.emptyText
164
+ }),
165
+ S.options.length && S.moreText ? /* @__PURE__ */ m("li", {
166
+ className: "ttw:py-2 ttw:text-center ttw:text-sm ttw:text-muted-foreground",
167
+ children: S.moreText
168
+ }) : null
169
+ ]
170
+ })
171
+ }) : null]
172
+ }),
173
+ /* @__PURE__ */ m(a, {
174
+ id: V,
175
+ children: S.description
176
+ }),
177
+ S.error ? /* @__PURE__ */ m(o, {
178
+ id: H,
179
+ children: S.error
180
+ }) : null
181
+ ] }) }), C ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(r, { children: /* @__PURE__ */ h(i, { children: [
182
+ /* @__PURE__ */ m(s, {
183
+ htmlFor: W,
184
+ children: z.customerEmailLabel
185
+ }),
186
+ /* @__PURE__ */ m(c, {
187
+ id: W,
188
+ type: "email",
189
+ disabled: w,
190
+ "aria-invalid": !!C.emailError || void 0,
191
+ "aria-describedby": C.emailError ? G : void 0,
192
+ value: C.email,
193
+ onChange: (e) => N(e.target.value),
194
+ onBlur: P
195
+ }),
196
+ C.emailError ? /* @__PURE__ */ m(o, {
197
+ id: G,
198
+ children: C.emailError
199
+ }) : null
200
+ ] }) }), /* @__PURE__ */ h(n, {
201
+ type: "button",
202
+ variant: "ghost",
203
+ disabled: w,
204
+ className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
205
+ onClick: F,
206
+ children: [/* @__PURE__ */ m(v, {}), z.addCustomerDetailsButton]
207
+ })] }) : null] })]
208
+ });
209
+ }
54
210
  //#endregion
55
- export { y as ACTION_ICON, v as ACTION_LABEL_KEY, x as SERIES_STATUS_ICON, b as STATUS_ICON, S as amountValueToneClass, k as headerIconButtonClass, O as headerTooltipArrowClass, D as headerTooltipClass, A as preventTooltipFocusOpen, w as sectionChevronClass, E as sectionCountBadgeClass, T as sectionItemClass, C as sectionTriggerClass };
211
+ export { b as ReceivableCustomerSection, b as default };
@@ -1,23 +1,2 @@
1
- import { Typography as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { amountValueToneClass as n } from "./index23.js";
3
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
- //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js
5
- function a({ row: a, defaultTone: o }) {
6
- let s = a.tone ?? (a.emphasis ? o : "default");
7
- return /* @__PURE__ */ i("div", {
8
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
9
- children: [/* @__PURE__ */ r(e, {
10
- variant: "caption",
11
- color: "muted",
12
- className: "ttw:font-medium",
13
- children: a.label
14
- }), /* @__PURE__ */ r(e, {
15
- component: "span",
16
- variant: a.emphasis ? "h3" : "body1",
17
- className: t(!a.emphasis && "ttw:font-medium", n[s]),
18
- children: a.value
19
- })]
20
- });
21
- }
22
- //#endregion
23
- export { a as AmountCell };
1
+ import "./index12.js";
2
+ import "./index23.js";
@@ -1,10 +1,39 @@
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 "./index14.js";
3
+ import { jsxs as r } from "react/jsx-runtime";
1
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js
2
- var e = {
3
- billing: "billing",
4
- lineItems: "line-items",
5
- notes: "notes",
6
- attachments: "attachments",
7
- auditHistory: "audit-history"
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
+ }, a = "ttw:bg-muted ttw:text-muted-foreground", o = "ttw:bg-destructive/10 ttw:text-destructive", s = {
12
+ draft: a,
13
+ recurring: a,
14
+ issuing: "ttw:bg-cyan-100 ttw:text-cyan-700",
15
+ issued: "ttw:bg-cyan-100 ttw:text-cyan-700",
16
+ accepted: "ttw:bg-green-100 ttw:text-green-700",
17
+ paid: "ttw:bg-green-100 ttw:text-green-700",
18
+ partially_paid: "ttw:bg-purple-100 ttw:text-purple-700",
19
+ overdue: "ttw:bg-orange-100 ttw:text-orange-700",
20
+ failed: o,
21
+ expired: o,
22
+ uncollectible: o,
23
+ canceled: o,
24
+ declined: o,
25
+ deleted: o
8
26
  };
27
+ function c({ status: o, label: c, tone: l = "neutral", variant: u = "outline", labels: d, icon: f }) {
28
+ let p = {
29
+ ...n,
30
+ ...d
31
+ }, m = c ?? p[o] ?? p.unknown;
32
+ return /* @__PURE__ */ r(e, {
33
+ variant: "outline",
34
+ className: t(f && "ttw:gap-1", u === "filled" ? ["ttw:border-transparent", s[o ?? ""] ?? a] : i[l]),
35
+ children: [f, m]
36
+ });
37
+ }
9
38
  //#endregion
10
- export { e as RECEIVABLE_DETAILS_SECTION };
39
+ export { c as ReceivableStatusBadge, c as default };