@tesouro/embedded-components-react 0.7.22 → 0.7.25

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 (41) hide show
  1. package/dist/index.css +0 -3
  2. package/dist/index.d.ts +20 -20
  3. package/dist/lib/CounterpartsWidget.d.ts +10 -2
  4. package/dist/lib/CounterpartsWidgetPublic.d.ts +10 -2
  5. package/dist/lib/CustomersWidget.d.ts +19 -19
  6. package/dist/lib/ExpenseManagementWidget.d.ts +1 -1
  7. package/dist/lib/ReceivablesWidget.d.ts +9 -1
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +50 -51
  11. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +4 -2
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +72 -128
  15. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +183 -38
  16. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +503 -193
  17. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/CustomersWidget/CustomersWidget.js +33 -18
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +57 -55
  19. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +14 -14
  20. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -102
  21. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +12 -11
  22. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +534 -7
  23. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +7 -179
  24. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +179 -6
  25. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +3 -1
  26. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js +4 -28
  27. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +28 -4
  28. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index16.js +4 -0
  29. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +10 -2
  30. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index7.js +140 -55
  31. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +53 -47
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +51 -539
  33. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  34. package/package.json +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +0 -520
  36. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/CustomersWidgetMonite/CustomersWidgetMonite.js +0 -45
  37. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/lib/CustomersWidgetNative/CustomersWidgetNative.js +0 -42
  38. package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/index.js +0 -4
  39. package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js +0 -21
  40. package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js +0 -134
  41. package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/RefreshingMoniteWidgetProvider.js +0 -7
@@ -1,58 +1,143 @@
1
- import { Label as e, RadioGroup as t, RadioGroupItem as n } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { COUNTERPART_TYPE_CHOOSER_LABELS_EN as r } from "./index2.js";
3
- import { useId as i } from "react";
4
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
1
+ import { Field as e, FieldContent as t, FieldError as n, FieldLabel as r, Input as i, Select as a, SelectContent as o, SelectItem as s, SelectTrigger as c, SelectValue as l } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { ADDRESS_FIELD_GROUP_LABELS_EN as u } from "./index2.js";
3
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
5
4
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index7.js
6
- function s({ value: s, onChange: c, disabled: l, variant: u = "cards", labels: d }) {
7
- let f = {
8
- ...r,
9
- ...d
10
- }, p = i(), m = u === "pills";
11
- return /* @__PURE__ */ o("fieldset", {
12
- className: "ttw:flex ttw:flex-col ttw:gap-2",
13
- disabled: l,
14
- children: [/* @__PURE__ */ a("legend", {
15
- className: "ttw:mb-1 ttw:text-sm ttw:font-medium",
16
- children: f.heading
17
- }), /* @__PURE__ */ o(t, {
18
- className: m ? "ttw:flex ttw:flex-wrap ttw:gap-2" : "ttw:grid ttw:grid-cols-2 ttw:gap-3",
19
- value: s,
20
- onValueChange: (e) => c(e),
21
- children: [/* @__PURE__ */ o(e, {
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",
24
- children: [/* @__PURE__ */ a(n, {
25
- value: "organization",
26
- id: `${p}-organization`
27
- }), /* @__PURE__ */ o("span", {
28
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
29
- children: [/* @__PURE__ */ a("span", {
30
- className: "ttw:font-medium",
31
- children: f.organization
32
- }), m ? null : /* @__PURE__ */ a("span", {
33
- className: "ttw:text-sm ttw:text-muted-foreground",
34
- children: f.organizationHint
35
- })]
36
- })]
37
- }), /* @__PURE__ */ o(e, {
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",
40
- children: [/* @__PURE__ */ a(n, {
41
- value: "individual",
42
- id: `${p}-individual`
43
- }), /* @__PURE__ */ o("span", {
44
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
45
- children: [/* @__PURE__ */ a("span", {
46
- className: "ttw:font-medium",
47
- children: f.individual
48
- }), m ? null : /* @__PURE__ */ a("span", {
49
- className: "ttw:text-sm ttw:text-muted-foreground",
50
- children: f.individualHint
51
- })]
52
- })]
53
- })]
54
- })]
55
- });
5
+ var m = "US";
6
+ function h(e) {
7
+ return e ? [{ message: e }] : void 0;
8
+ }
9
+ function g({ idPrefix: g, values: _, errors: v, stateOptions: y, disabled: b, onChange: x, labels: S }) {
10
+ let C = {
11
+ ...u,
12
+ ...S,
13
+ fieldMarkers: {
14
+ ...u.fieldMarkers,
15
+ ...S?.fieldMarkers
16
+ }
17
+ }, { fieldMarkers: w } = C, T = {
18
+ line1: `${g}-line1`,
19
+ line2: `${g}-line2`,
20
+ city: `${g}-city`,
21
+ state: `${g}-state`,
22
+ postalCode: `${g}-postal-code`,
23
+ country: `${g}-country`
24
+ };
25
+ return /* @__PURE__ */ p(d, { children: [
26
+ /* @__PURE__ */ p("div", {
27
+ className: "ttw:flex ttw:gap-4",
28
+ children: [/* @__PURE__ */ f(e, { children: /* @__PURE__ */ p(t, { children: [
29
+ /* @__PURE__ */ f(r, {
30
+ htmlFor: T.line1,
31
+ requirement: "required",
32
+ labels: w,
33
+ children: C.line1
34
+ }),
35
+ /* @__PURE__ */ f(i, {
36
+ id: T.line1,
37
+ "aria-required": !0,
38
+ className: "ttw:bg-background",
39
+ value: _.line1,
40
+ disabled: b,
41
+ "aria-invalid": !!v?.line1 || void 0,
42
+ onChange: (e) => x({ line1: e.target.value })
43
+ }),
44
+ /* @__PURE__ */ f(n, { errors: h(v?.line1) })
45
+ ] }) }), /* @__PURE__ */ f(e, { children: /* @__PURE__ */ p(t, { children: [/* @__PURE__ */ f(r, {
46
+ htmlFor: T.line2,
47
+ requirement: "optional",
48
+ labels: w,
49
+ children: C.line2
50
+ }), /* @__PURE__ */ f(i, {
51
+ id: T.line2,
52
+ className: "ttw:bg-background",
53
+ value: _.line2,
54
+ disabled: b,
55
+ onChange: (e) => x({ line2: e.target.value })
56
+ })] }) })]
57
+ }),
58
+ /* @__PURE__ */ p("div", {
59
+ className: "ttw:flex ttw:gap-4",
60
+ children: [/* @__PURE__ */ f(e, { children: /* @__PURE__ */ p(t, { children: [
61
+ /* @__PURE__ */ f(r, {
62
+ htmlFor: T.city,
63
+ requirement: "required",
64
+ labels: w,
65
+ children: C.city
66
+ }),
67
+ /* @__PURE__ */ f(i, {
68
+ id: T.city,
69
+ "aria-required": !0,
70
+ className: "ttw:bg-background",
71
+ value: _.city,
72
+ disabled: b,
73
+ "aria-invalid": !!v?.city || void 0,
74
+ onChange: (e) => x({ city: e.target.value })
75
+ }),
76
+ /* @__PURE__ */ f(n, { errors: h(v?.city) })
77
+ ] }) }), /* @__PURE__ */ f(e, { children: /* @__PURE__ */ p(t, { children: [
78
+ /* @__PURE__ */ f(r, {
79
+ htmlFor: T.state,
80
+ requirement: "required",
81
+ labels: w,
82
+ children: C.state
83
+ }),
84
+ /* @__PURE__ */ p(a, {
85
+ value: _.state || void 0,
86
+ disabled: b,
87
+ onValueChange: (e) => x({ state: e }),
88
+ children: [/* @__PURE__ */ f(c, {
89
+ id: T.state,
90
+ "aria-required": !0,
91
+ className: "ttw:w-full ttw:bg-background",
92
+ "aria-invalid": !!v?.state || void 0,
93
+ children: /* @__PURE__ */ f(l, { placeholder: C.statePlaceholder })
94
+ }), /* @__PURE__ */ f(o, { children: y.map((e) => /* @__PURE__ */ f(s, {
95
+ value: e.value,
96
+ children: e.label
97
+ }, e.value)) })]
98
+ }),
99
+ /* @__PURE__ */ f(n, { errors: h(v?.state) })
100
+ ] }) })]
101
+ }),
102
+ /* @__PURE__ */ p("div", {
103
+ className: "ttw:flex ttw:gap-4",
104
+ children: [/* @__PURE__ */ f(e, { children: /* @__PURE__ */ p(t, { children: [
105
+ /* @__PURE__ */ f(r, {
106
+ htmlFor: T.postalCode,
107
+ requirement: "required",
108
+ labels: w,
109
+ children: C.postalCode
110
+ }),
111
+ /* @__PURE__ */ f(i, {
112
+ id: T.postalCode,
113
+ "aria-required": !0,
114
+ className: "ttw:bg-background",
115
+ value: _.postalCode,
116
+ disabled: b,
117
+ "aria-invalid": !!v?.postalCode || void 0,
118
+ onChange: (e) => x({ postalCode: e.target.value })
119
+ }),
120
+ /* @__PURE__ */ f(n, { errors: h(v?.postalCode) })
121
+ ] }) }), /* @__PURE__ */ f(e, { children: /* @__PURE__ */ p(t, { children: [/* @__PURE__ */ f(r, {
122
+ htmlFor: T.country,
123
+ requirement: "required",
124
+ labels: w,
125
+ children: C.country
126
+ }), /* @__PURE__ */ p(a, {
127
+ value: m,
128
+ disabled: !0,
129
+ children: [/* @__PURE__ */ f(c, {
130
+ id: T.country,
131
+ "aria-required": !0,
132
+ className: "ttw:w-full ttw:bg-background",
133
+ children: /* @__PURE__ */ f(l, {})
134
+ }), /* @__PURE__ */ f(o, { children: /* @__PURE__ */ f(s, {
135
+ value: m,
136
+ children: C.countryValue
137
+ }) })]
138
+ })] }) })]
139
+ })
140
+ ] });
56
141
  }
57
142
  //#endregion
58
- export { s as CounterpartTypeChooser, s as default };
143
+ export { g as CounterpartAddressFields };
@@ -1,52 +1,58 @@
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 { useId as s } from "react";
3
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
1
+ import { Label as e, RadioGroup as t, RadioGroupItem as n } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { COUNTERPART_TYPE_CHOOSER_LABELS_EN as r } from "./index2.js";
3
+ import { useId as i } from "react";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
5
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js
5
- function u({ open: u, onOpenChange: d, title: f, description: p, formError: m, inProgress: h, submitDisabled: g, submitLabel: _, cancelLabel: v, onSubmit: y, onCancel: b, children: x }) {
6
- let S = s();
7
- return /* @__PURE__ */ c(t, {
8
- open: u,
9
- onOpenChange: d,
10
- children: /* @__PURE__ */ l(n, {
11
- className: "ttw:w-[600px] ttw:sm:max-w-[600px] ttw:overflow-y-auto",
12
- children: [
13
- /* @__PURE__ */ l(a, { children: [/* @__PURE__ */ c(o, { children: f }), /* @__PURE__ */ c(r, {
14
- className: p ? void 0 : "ttw:sr-only",
15
- children: p ?? f
16
- })] }),
17
- /* @__PURE__ */ c("form", {
18
- id: S,
19
- onSubmit: (e) => {
20
- e.preventDefault(), e.stopPropagation(), y();
21
- },
22
- children: /* @__PURE__ */ l("div", {
23
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pt-8 ttw:pb-6",
24
- children: [m && /* @__PURE__ */ c("p", {
25
- role: "alert",
26
- className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
27
- children: m
28
- }), x]
29
- })
30
- }),
31
- /* @__PURE__ */ l(i, {
32
- className: "ttw:flex ttw:flex-row ttw:justify-end ttw:gap-2",
33
- children: [/* @__PURE__ */ c(e, {
34
- type: "button",
35
- variant: "ghost",
36
- size: "lg",
37
- onClick: b,
38
- children: v
39
- }), /* @__PURE__ */ c(e, {
40
- type: "submit",
41
- form: S,
42
- size: "lg",
43
- disabled: h || g,
44
- children: _
6
+ function s({ value: s, onChange: c, disabled: l, variant: u = "cards", labels: d }) {
7
+ let f = {
8
+ ...r,
9
+ ...d
10
+ }, p = i(), m = u === "pills";
11
+ return /* @__PURE__ */ o("fieldset", {
12
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
13
+ disabled: l,
14
+ children: [/* @__PURE__ */ a("legend", {
15
+ className: "ttw:mb-1 ttw:text-sm ttw:font-medium",
16
+ children: f.heading
17
+ }), /* @__PURE__ */ o(t, {
18
+ className: m ? "ttw:flex ttw:flex-wrap ttw:gap-2" : "ttw:grid ttw:grid-cols-2 ttw:gap-3",
19
+ value: s,
20
+ onValueChange: (e) => c(e),
21
+ children: [/* @__PURE__ */ o(e, {
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",
24
+ children: [/* @__PURE__ */ a(n, {
25
+ value: "organization",
26
+ id: `${p}-organization`
27
+ }), /* @__PURE__ */ o("span", {
28
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
29
+ children: [/* @__PURE__ */ a("span", {
30
+ className: "ttw:font-medium",
31
+ children: f.organization
32
+ }), m ? null : /* @__PURE__ */ a("span", {
33
+ className: "ttw:text-sm ttw:text-muted-foreground",
34
+ children: f.organizationHint
45
35
  })]
46
- })
47
- ]
48
- })
36
+ })]
37
+ }), /* @__PURE__ */ o(e, {
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",
40
+ children: [/* @__PURE__ */ a(n, {
41
+ value: "individual",
42
+ id: `${p}-individual`
43
+ }), /* @__PURE__ */ o("span", {
44
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
45
+ children: [/* @__PURE__ */ a("span", {
46
+ className: "ttw:font-medium",
47
+ children: f.individual
48
+ }), m ? null : /* @__PURE__ */ a("span", {
49
+ className: "ttw:text-sm ttw:text-muted-foreground",
50
+ children: f.individualHint
51
+ })]
52
+ })]
53
+ })]
54
+ })]
49
55
  });
50
56
  }
51
57
  //#endregion
52
- export { u as FormSheet, u as default };
58
+ export { s as CounterpartTypeChooser, s as default };