@tesouro/embedded-components-react 0.11.65 → 0.11.68

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 (48) hide show
  1. package/README.md +28 -28
  2. package/dist/index.css +6 -27
  3. package/dist/index.d.ts +29 -41
  4. package/dist/lib/CardDetailsWidget.d.ts +1 -1
  5. package/dist/lib/CounterpartsWidget.d.ts +26 -39
  6. package/dist/lib/CounterpartsWidgetPublic.d.ts +26 -39
  7. package/dist/lib/CreditCardsWidget.d.ts +2 -2
  8. package/dist/lib/CustomersWidget.d.ts +26 -39
  9. package/dist/lib/DebitCardsWidget.d.ts +2 -2
  10. package/dist/lib/ReceivablesWidget.d.ts +14 -4
  11. package/dist/lib/WidgetSuite.d.ts +2 -2
  12. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +0 -4
  13. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +7 -8
  14. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +37 -39
  15. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +72 -73
  16. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +16 -22
  17. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +8 -12
  18. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +93 -110
  19. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +52 -52
  20. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +72 -107
  21. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +27 -27
  22. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +112 -145
  23. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +13 -16
  24. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +3 -122
  25. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +5 -5
  26. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +44 -65
  28. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +157 -134
  29. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +18 -14
  30. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +362 -55
  31. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +7 -7
  33. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +16 -9
  34. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +2 -66
  35. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +48 -46
  36. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +5 -5
  37. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +138 -149
  38. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +19 -20
  39. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +1 -0
  40. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +21 -27
  41. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -1
  42. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index3.js +0 -1
  43. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +2 -2
  44. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +30 -63
  45. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +0 -211
  48. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +0 -509
@@ -5,44 +5,43 @@ import { FormSheet as r } from "./index9.js";
5
5
  import { useId as i } from "react";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  // ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js
8
- function s({ open: s, onOpenChange: c, mode: l, values: u, errors: d, highlightedFields: f, inProgress: p, submitDisabled: m, onChange: h, onSubmit: g, onCancel: _, labels: v }) {
9
- let y = {
8
+ function s({ open: s, onOpenChange: c, mode: l, values: u, errors: d, highlightedFields: f, inProgress: p, onChange: m, onSubmit: h, onCancel: g, labels: _ }) {
9
+ let v = {
10
10
  ...t,
11
- ...v,
11
+ ..._,
12
12
  fieldMarkers: {
13
13
  ...t.fieldMarkers,
14
- ...v?.fieldMarkers
14
+ ..._?.fieldMarkers
15
15
  }
16
- }, b = i();
16
+ }, y = i();
17
17
  return /* @__PURE__ */ o(r, {
18
18
  open: s,
19
19
  onOpenChange: c,
20
- title: l === "edit" ? y.editTitle : y.createTitle,
20
+ title: l === "edit" ? v.editTitle : v.createTitle,
21
21
  formError: d?.form,
22
22
  inProgress: p,
23
- submitDisabled: m,
24
- submitLabel: y.saveButton,
25
- cancelLabel: y.cancelButton,
26
- onSubmit: g,
27
- onCancel: _,
23
+ submitLabel: v.saveButton,
24
+ cancelLabel: v.cancelButton,
25
+ onSubmit: h,
26
+ onCancel: g,
28
27
  children: [/* @__PURE__ */ a(n, {
29
- idPrefix: b,
28
+ idPrefix: y,
30
29
  values: u,
31
30
  errors: d,
32
31
  highlighted: f,
33
- onChange: h,
32
+ onChange: m,
34
33
  labels: {
35
- accountHolderName: y.accountHolderNameLabel,
36
- routingNumber: y.routingNumberLabel,
37
- accountNumber: y.accountNumberLabel,
38
- routingNumberPlaceholder: y.routingNumberPlaceholder,
39
- accountNumberPlaceholder: y.accountNumberPlaceholder,
40
- fieldMarkers: y.fieldMarkers
34
+ accountHolderName: v.accountHolderNameLabel,
35
+ routingNumber: v.routingNumberLabel,
36
+ accountNumber: v.accountNumberLabel,
37
+ routingNumberPlaceholder: v.routingNumberPlaceholder,
38
+ accountNumberPlaceholder: v.accountNumberPlaceholder,
39
+ fieldMarkers: v.fieldMarkers
41
40
  }
42
41
  }), /* @__PURE__ */ a(e, {
43
42
  variant: "body2",
44
43
  color: "muted",
45
- children: y.helperText
44
+ children: v.helperText
46
45
  })]
47
46
  });
48
47
  }
@@ -1,4 +1,5 @@
1
1
  import "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
2
  import "./index2.js";
3
3
  import "./index6.js";
4
+ import "./index9.js";
4
5
  import "react/jsx-runtime";
@@ -1,31 +1,25 @@
1
- import { AlertDialog as e, AlertDialogContent as t, AlertDialogDescription as n, AlertDialogFooter as r, AlertDialogHeader as i, AlertDialogTitle as a, Button as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { CONFIRM_DELETE_DIALOG_LABELS_EN as s } from "./index2.js";
3
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
1
+ import { ConfirmDialog as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { CONFIRM_DELETE_DIALOG_LABELS_EN as t } from "./index2.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
4
  // ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js
5
- function u({ open: u, onOpenChange: d, title: f, message: p, isDeleting: m, onConfirm: h, onCancel: g, labels: _ }) {
6
- let v = {
7
- ...s,
8
- ..._
5
+ function r({ open: r, onOpenChange: i, title: a, message: o, confirmLabel: s, isDeleting: c, onConfirm: l, onCancel: u, labels: d }) {
6
+ let f = {
7
+ ...t,
8
+ ...d
9
9
  };
10
- return /* @__PURE__ */ c(e, {
11
- open: u,
12
- onOpenChange: d,
13
- children: /* @__PURE__ */ l(t, {
14
- closeDisabled: m,
15
- labels: { close: v.close },
16
- children: [/* @__PURE__ */ l(i, { children: [/* @__PURE__ */ c(a, { children: f }), /* @__PURE__ */ c(n, { children: p })] }), /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ c(o, {
17
- variant: "ghost",
18
- onClick: g,
19
- disabled: m,
20
- children: v.cancelButton
21
- }), /* @__PURE__ */ c(o, {
22
- variant: "destructive",
23
- onClick: h,
24
- disabled: m,
25
- loading: m,
26
- children: v.confirmButton
27
- })] })]
28
- })
10
+ return /* @__PURE__ */ n(e, {
11
+ open: r,
12
+ onOpenChange: (e) => e ? i(!0) : u(),
13
+ title: a,
14
+ description: o,
15
+ destructive: !0,
16
+ loading: c,
17
+ onConfirm: l,
18
+ labels: {
19
+ confirm: s ?? f.confirmButton,
20
+ cancel: f.cancelButton,
21
+ close: f.close
22
+ }
29
23
  });
30
24
  }
31
- export { u as ConfirmDeleteDialog, u as default };
25
+ export { r as ConfirmDeleteDialog, r as default };
@@ -82,7 +82,7 @@ var n = {
82
82
  routingNumberLabel: "Routing number",
83
83
  accountNumberPlaceholder: i.accountNumberPlaceholder,
84
84
  routingNumberPlaceholder: i.routingNumberPlaceholder,
85
- helperText: "Ask your vendor for this — it's usually on their invoice, W-9, or a payment instructions email they send you.",
85
+ helperText: "Ask your vendor for this. It's usually on their invoice or in a payment instructions email.",
86
86
  cancelButton: "Cancel",
87
87
  saveButton: "Save",
88
88
  fieldMarkers: e
@@ -1,4 +1,3 @@
1
1
  import "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
2
  import "./index2.js";
3
3
  import "react/jsx-runtime";
4
- import "lucide-react";
@@ -20,7 +20,7 @@ function s({ value: s, onChange: c, disabled: l, variant: u = "cards", labels: d
20
20
  onValueChange: (e) => c(e),
21
21
  children: [/* @__PURE__ */ o(e, {
22
22
  htmlFor: `${p}-organization`,
23
- className: m ? "ttw:flex ttw:cursor-pointer ttw:items-center ttw:gap-2 ttw:rounded-full ttw:border ttw:border-border ttw:bg-background ttw:px-3 ttw:py-1.5 ttw:text-sm ttw:has-[:checked]:border-primary ttw:has-[:checked]:bg-primary/10" : "ttw:flex ttw:cursor-pointer ttw:items-start ttw:gap-3 ttw:rounded-md ttw:border ttw:p-3 ttw:has-[:checked]:border-primary",
23
+ className: m ? "ttw:flex ttw:cursor-pointer ttw:items-center ttw:gap-2 ttw:rounded-full ttw:border ttw:border-border ttw:bg-background ttw:px-3 ttw:py-1.5 ttw:text-sm ttw:has-[:checked]:border-primary ttw:has-[:checked]:bg-primary/10" : "ttw:flex ttw:cursor-pointer ttw:items-start ttw:gap-3 ttw:rounded-md ttw:border ttw:border-border ttw:p-3 ttw:has-[:checked]:border-primary",
24
24
  children: [/* @__PURE__ */ a(n, {
25
25
  value: "organization",
26
26
  id: `${p}-organization`
@@ -36,7 +36,7 @@ function s({ value: s, onChange: c, disabled: l, variant: u = "cards", labels: d
36
36
  })]
37
37
  }), /* @__PURE__ */ o(e, {
38
38
  htmlFor: `${p}-individual`,
39
- className: m ? "ttw:flex ttw:cursor-pointer ttw:items-center ttw:gap-2 ttw:rounded-full ttw:border ttw:border-border ttw:bg-background ttw:px-3 ttw:py-1.5 ttw:text-sm ttw:has-[:checked]:border-primary ttw:has-[:checked]:bg-primary/10" : "ttw:flex ttw:cursor-pointer ttw:items-start ttw:gap-3 ttw:rounded-md ttw:border ttw:p-3 ttw:has-[:checked]:border-primary",
39
+ className: m ? "ttw:flex ttw:cursor-pointer ttw:items-center ttw:gap-2 ttw:rounded-full ttw:border ttw:border-border ttw:bg-background ttw:px-3 ttw:py-1.5 ttw:text-sm ttw:has-[:checked]:border-primary ttw:has-[:checked]:bg-primary/10" : "ttw:flex ttw:cursor-pointer ttw:items-start ttw:gap-3 ttw:rounded-md ttw:border ttw:border-border ttw:p-3 ttw:has-[:checked]:border-primary",
40
40
  children: [/* @__PURE__ */ a(n, {
41
41
  value: "individual",
42
42
  id: `${p}-individual`
@@ -1,67 +1,34 @@
1
- import { Button as e, Sheet as t, SheetContent as n, SheetDescription as r, SheetFooter as i, SheetHeader as a, SheetTitle as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { FORM_SHEET_LABELS_EN as s } from "./index2.js";
3
- import { useId as c } from "react";
4
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
1
+ import { Alert as e, AlertDescription as t, FormSheet as n } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { FORM_SHEET_LABELS_EN as r } from "./index2.js";
3
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
+ import { CircleAlertIcon as o } from "lucide-react";
5
5
  // ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js
6
- function d({ open: d, onOpenChange: f, title: p, description: m, formError: h, inProgress: g, submitDisabled: _, initialFocusId: v, submitLabel: y, cancelLabel: b, onSubmit: x, onCancel: S, children: C, labels: w }) {
7
- let T = {
8
- ...s,
9
- ...w
10
- }, E = c();
11
- return /* @__PURE__ */ l(t, {
12
- open: d,
13
- onOpenChange: f,
14
- children: /* @__PURE__ */ u(n, {
15
- className: "ttw:w-150 ttw:sm:max-w-150 ttw:overflow-y-auto",
16
- labels: { close: T.close },
17
- onOpenAutoFocus: (e) => {
18
- let t = v ? document.getElementById(v) : null;
19
- t && (e.preventDefault(), t.focus());
20
- },
21
- children: [
22
- /* @__PURE__ */ u(a, {
23
- className: "ttw:border-b ttw:border-border",
24
- children: [/* @__PURE__ */ l(o, {
25
- className: "ttw:text-2xl",
26
- children: p
27
- }), /* @__PURE__ */ l(r, {
28
- className: m ? void 0 : "ttw:sr-only",
29
- children: m ?? p
30
- })]
31
- }),
32
- /* @__PURE__ */ l("form", {
33
- id: E,
34
- noValidate: !0,
35
- onSubmit: (e) => {
36
- e.preventDefault(), e.stopPropagation(), x();
37
- },
38
- children: /* @__PURE__ */ u("div", {
39
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pt-8 ttw:pb-6",
40
- children: [h && /* @__PURE__ */ l("p", {
41
- role: "alert",
42
- className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
43
- children: h
44
- }), C]
45
- })
46
- }),
47
- /* @__PURE__ */ u(i, {
48
- className: "ttw:flex ttw:flex-row ttw:justify-end ttw:gap-2",
49
- children: [/* @__PURE__ */ l(e, {
50
- type: "button",
51
- variant: "ghost",
52
- size: "lg",
53
- onClick: S,
54
- children: b
55
- }), /* @__PURE__ */ l(e, {
56
- type: "submit",
57
- form: E,
58
- size: "lg",
59
- disabled: g || _,
60
- children: y
61
- })]
62
- })
63
- ]
6
+ function s({ open: s, onOpenChange: c, title: l, description: u, formError: d, inProgress: f, submitLabel: p, cancelLabel: m, onSubmit: h, onCancel: g, children: _, labels: v }) {
7
+ let y = {
8
+ ...r,
9
+ ...v
10
+ };
11
+ return /* @__PURE__ */ i(n, {
12
+ open: s,
13
+ onOpenChange: (e) => e ? c(!0) : g(),
14
+ title: l,
15
+ description: u,
16
+ onSubmit: (e) => {
17
+ e.stopPropagation(), h();
18
+ },
19
+ submitting: f,
20
+ labels: {
21
+ submit: p,
22
+ cancel: m,
23
+ close: y.close
24
+ },
25
+ children: /* @__PURE__ */ a("div", {
26
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:py-4",
27
+ children: [d && /* @__PURE__ */ a(e, {
28
+ variant: "destructive",
29
+ children: [/* @__PURE__ */ i(o, {}), /* @__PURE__ */ i(t, { children: d })]
30
+ }), _]
64
31
  })
65
32
  });
66
33
  }
67
- export { d as FormSheet, d as default };
34
+ export { s as FormSheet, s as default };
@@ -1,5 +1,5 @@
1
1
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.11.65", n = "03e89f32e1af1addc522537c8223e8d1d2d561e8", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.11.68", n = "1468a37a3e34161d7c068bff6667dddd9937ea52", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.11.65",
3
+ "version": "0.11.68",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -1,211 +0,0 @@
1
- import { Button as e, Checkbox as t, Field as n, FieldContent as r, FieldDescription as i, FieldError as a, FieldLabel as o, Input as s, LABEL_LABELS_EN as c, Label as l, RequiredFieldsLegend as u, Spinner as d, Typography as f, cn as p, mergeRequiredFieldsLegendLabels as m } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { CounterpartAddressFields as h } from "../../../shared/counterpart-management/ui/dist/index7.js";
3
- import "../../../shared/counterpart-management/ui/dist/index.js";
4
- import { addressFieldLabels as g } from "./index4.js";
5
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
6
- // ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js
7
- function y(e) {
8
- return e ? [{ message: e }] : void 0;
9
- }
10
- function b({ form: b, labels: x }) {
11
- let { name: S, email: C, phone: w, taxId: T, reminders: E, address: D, inProgress: O } = b, k = {
12
- ...x,
13
- ...b.labels
14
- }, A = {
15
- ...c,
16
- ...b.fieldMarkers
17
- };
18
- return /* @__PURE__ */ v("form", {
19
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-[10px] ttw:border ttw:border-border ttw:bg-muted ttw:p-4",
20
- noValidate: !0,
21
- onSubmit: (e) => {
22
- e.preventDefault(), b.onSubmit();
23
- },
24
- children: [/* @__PURE__ */ v("div", {
25
- className: "ttw:flex ttw:flex-col ttw:gap-4",
26
- children: [
27
- /* @__PURE__ */ _("div", {
28
- className: "ttw:flex ttw:flex-col ttw:gap-1.5 ttw:border-b ttw:border-border ttw:pt-6 ttw:pb-7",
29
- children: /* @__PURE__ */ _(f, {
30
- variant: "body1",
31
- className: "ttw:font-medium",
32
- children: b.heading
33
- })
34
- }),
35
- /* @__PURE__ */ _(u, { labels: m(A, b.requiredFieldsLegend) }),
36
- b.formError && /* @__PURE__ */ _(f, {
37
- variant: "body2",
38
- color: "destructive",
39
- role: "alert",
40
- children: b.formError
41
- }),
42
- S.kind === "person" ? /* @__PURE__ */ v("div", {
43
- className: "ttw:flex ttw:gap-4",
44
- children: [/* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
45
- /* @__PURE__ */ _(o, {
46
- htmlFor: "counterpart-edit-first-name",
47
- requirement: "required",
48
- labels: A,
49
- children: k.firstNameLabel
50
- }),
51
- /* @__PURE__ */ _(s, {
52
- id: "counterpart-edit-first-name",
53
- "aria-required": !0,
54
- className: "ttw:bg-background",
55
- value: S.firstName.value,
56
- disabled: O,
57
- "aria-invalid": !!S.firstName.error || void 0,
58
- onChange: (e) => b.onFieldChange("firstName", e.target.value)
59
- }),
60
- /* @__PURE__ */ _(a, { errors: y(S.firstName.error) })
61
- ] }) }), /* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
62
- /* @__PURE__ */ _(o, {
63
- htmlFor: "counterpart-edit-last-name",
64
- requirement: "required",
65
- labels: A,
66
- children: k.lastNameLabel
67
- }),
68
- /* @__PURE__ */ _(s, {
69
- id: "counterpart-edit-last-name",
70
- "aria-required": !0,
71
- className: "ttw:bg-background",
72
- value: S.lastName.value,
73
- disabled: O,
74
- "aria-invalid": !!S.lastName.error || void 0,
75
- onChange: (e) => b.onFieldChange("lastName", e.target.value)
76
- }),
77
- /* @__PURE__ */ _(a, { errors: y(S.lastName.error) })
78
- ] }) })]
79
- }) : /* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
80
- /* @__PURE__ */ _(o, {
81
- htmlFor: "counterpart-edit-business-name",
82
- requirement: "required",
83
- labels: A,
84
- children: k.businessNameLabel
85
- }),
86
- /* @__PURE__ */ _(s, {
87
- id: "counterpart-edit-business-name",
88
- "aria-required": !0,
89
- className: "ttw:bg-background",
90
- value: S.businessName.value,
91
- disabled: O,
92
- "aria-invalid": !!S.businessName.error || void 0,
93
- onChange: (e) => b.onFieldChange("businessName", e.target.value)
94
- }),
95
- /* @__PURE__ */ _(a, { errors: y(S.businessName.error) })
96
- ] }) }),
97
- /* @__PURE__ */ v("div", {
98
- className: p("ttw:flex ttw:gap-4", b.contactLayout === "inline" ? "ttw:flex-row" : "ttw:flex-col"),
99
- children: [
100
- /* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
101
- /* @__PURE__ */ _(o, {
102
- htmlFor: "counterpart-edit-email",
103
- requirement: "required",
104
- labels: A,
105
- children: k.rowEmail
106
- }),
107
- /* @__PURE__ */ _(s, {
108
- id: "counterpart-edit-email",
109
- "aria-required": !0,
110
- type: "email",
111
- className: "ttw:bg-background",
112
- value: C.value,
113
- disabled: O,
114
- "aria-invalid": !!C.error || void 0,
115
- onChange: (e) => b.onFieldChange("email", e.target.value)
116
- }),
117
- /* @__PURE__ */ _(a, { errors: y(C.error) })
118
- ] }) }),
119
- E && /* @__PURE__ */ v(l, {
120
- htmlFor: "counterpart-edit-reminders",
121
- className: "ttw:flex ttw:items-start ttw:gap-3 ttw:rounded-md ttw:border ttw:border-border ttw:bg-background ttw:p-3",
122
- children: [/* @__PURE__ */ _(t, {
123
- id: "counterpart-edit-reminders",
124
- checked: E.checked,
125
- disabled: O,
126
- onCheckedChange: (e) => b.onRemindersChange(e === !0)
127
- }), /* @__PURE__ */ v("span", {
128
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
129
- children: [/* @__PURE__ */ _("span", {
130
- className: "ttw:text-sm ttw:font-medium",
131
- children: k.remindersCheckboxLabel
132
- }), /* @__PURE__ */ _("span", {
133
- className: "ttw:text-sm ttw:text-muted-foreground",
134
- children: k.remindersCheckboxDescription
135
- })]
136
- })]
137
- }),
138
- /* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
139
- /* @__PURE__ */ _(o, {
140
- htmlFor: "counterpart-edit-phone",
141
- requirement: "optional",
142
- labels: A,
143
- children: k.rowPhone
144
- }),
145
- /* @__PURE__ */ _(s, {
146
- id: "counterpart-edit-phone",
147
- type: "tel",
148
- className: "ttw:bg-background",
149
- value: w.value,
150
- disabled: O,
151
- "aria-invalid": !!w.error || void 0,
152
- onChange: (e) => b.onFieldChange("phone", e.target.value)
153
- }),
154
- /* @__PURE__ */ _(a, { errors: y(w.error) })
155
- ] }) })
156
- ]
157
- }),
158
- /* @__PURE__ */ _(n, { children: /* @__PURE__ */ v(r, { children: [
159
- /* @__PURE__ */ _(o, {
160
- htmlFor: "counterpart-edit-tax-id",
161
- requirement: "optional",
162
- labels: A,
163
- children: T.label
164
- }),
165
- /* @__PURE__ */ _(s, {
166
- id: "counterpart-edit-tax-id",
167
- className: "ttw:bg-background",
168
- placeholder: T.placeholder,
169
- value: T.value,
170
- disabled: O,
171
- "aria-invalid": !!T.error || void 0,
172
- onChange: (e) => b.onFieldChange("taxId", e.target.value)
173
- }),
174
- /* @__PURE__ */ _(i, { children: T.description }),
175
- /* @__PURE__ */ _(a, { errors: y(T.error) })
176
- ] }) }),
177
- D && /* @__PURE__ */ _("div", {
178
- className: "ttw:flex ttw:flex-col ttw:gap-4",
179
- children: /* @__PURE__ */ _(h, {
180
- idPrefix: "counterpart-edit-address",
181
- values: D.values,
182
- errors: D.errors,
183
- stateOptions: b.stateOptions,
184
- disabled: O,
185
- onChange: b.onAddressChange,
186
- labels: g(k, {
187
- ...A,
188
- ...b.addressFieldMarkers
189
- })
190
- })
191
- })
192
- ]
193
- }), /* @__PURE__ */ v("div", {
194
- className: "ttw:flex ttw:justify-end ttw:gap-4 ttw:pt-6",
195
- children: [/* @__PURE__ */ _(e, {
196
- type: "button",
197
- variant: "outline",
198
- className: "ttw:w-fit ttw:border-border",
199
- disabled: O,
200
- onClick: b.onCancel,
201
- children: k.cancelButton
202
- }), /* @__PURE__ */ v(e, {
203
- type: "submit",
204
- className: "ttw:w-fit",
205
- disabled: O || b.submitDisabled,
206
- children: [O && /* @__PURE__ */ _(d, {}), k.saveButton]
207
- })]
208
- })]
209
- });
210
- }
211
- export { b as CounterpartEditForm };