@tesouro/embedded-components-react 0.2.298 → 0.2.299

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 (39) hide show
  1. package/dist/index.css +6 -0
  2. package/dist/index.d.ts +107 -87
  3. package/dist/lib/CounterpartsWidget.d.ts +24 -4
  4. package/dist/lib/ReceivablesWidget.d.ts +20 -3
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +31 -27
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +2 -0
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +122 -149
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +163 -72
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +3 -3
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +52 -46
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +8 -2
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +98 -67
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +6 -1
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +7 -3
  15. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js +4 -1
  16. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +12 -7
  17. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +17 -16
  20. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +103 -50
  22. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +2 -1
  23. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +2 -0
  24. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +126 -76
  25. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +12 -11
  26. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +6 -173
  27. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +173 -5
  28. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +5 -57
  29. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +51 -22
  30. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js +24 -72
  31. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +76 -0
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +13 -7
  33. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js +53 -110
  34. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index6.js +115 -51
  35. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index7.js +53 -47
  36. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +44 -504
  37. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +480 -6
  38. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  39. package/package.json +1 -1
@@ -1,173 +1,6 @@
1
- import { Checkbox as e, Input as t, Label as n, Select as r, SelectContent as i, SelectItem as a, SelectTrigger as o, SelectValue as s } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { BANK_ACCOUNT_FORM_SHEET_LABELS_EN as c } from "./index2.js";
3
- import { FieldError as l } from "./index4.js";
4
- import { FormSheet as u } from "./index7.js";
5
- import { useId as d } from "react";
6
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
- //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js
8
- function m({ open: m, onOpenChange: h, mode: g, values: _, errors: v, currencyOptions: y, inProgress: b, onChange: x, onSubmit: S, onCancel: C, labels: w }) {
9
- let T = {
10
- ...c,
11
- ...w
12
- }, E = d(), D = g === "edit" ? T.editTitle : T.createTitle;
13
- return /* @__PURE__ */ p(u, {
14
- open: m,
15
- onOpenChange: h,
16
- title: D,
17
- formError: v?.form,
18
- inProgress: b,
19
- submitLabel: g === "edit" ? T.saveButton : T.createButton,
20
- cancelLabel: T.cancelButton,
21
- onSubmit: S,
22
- onCancel: C,
23
- children: [
24
- /* @__PURE__ */ p("div", {
25
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
26
- children: [
27
- /* @__PURE__ */ f(n, {
28
- htmlFor: `${E}-name`,
29
- children: T.nameLabel
30
- }),
31
- /* @__PURE__ */ f(t, {
32
- id: `${E}-name`,
33
- autoFocus: !0,
34
- value: _.name,
35
- "aria-invalid": !!v?.name,
36
- onChange: (e) => x({ name: e.target.value })
37
- }),
38
- /* @__PURE__ */ f(l, { message: v?.name })
39
- ]
40
- }),
41
- /* @__PURE__ */ p("div", {
42
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
43
- children: [/* @__PURE__ */ f(n, {
44
- htmlFor: `${E}-holder`,
45
- children: T.accountHolderNameLabel
46
- }), /* @__PURE__ */ f(t, {
47
- id: `${E}-holder`,
48
- value: _.accountHolderName,
49
- onChange: (e) => x({ accountHolderName: e.target.value })
50
- })]
51
- }),
52
- /* @__PURE__ */ p("div", {
53
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
54
- children: [/* @__PURE__ */ p("div", {
55
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
56
- children: [
57
- /* @__PURE__ */ f(n, {
58
- htmlFor: `${E}-account-number`,
59
- children: T.accountNumberLabel
60
- }),
61
- /* @__PURE__ */ f(t, {
62
- id: `${E}-account-number`,
63
- value: _.accountNumber,
64
- "aria-invalid": !!v?.accountNumber,
65
- onChange: (e) => x({ accountNumber: e.target.value })
66
- }),
67
- /* @__PURE__ */ f(l, { message: v?.accountNumber })
68
- ]
69
- }), /* @__PURE__ */ p("div", {
70
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
71
- children: [
72
- /* @__PURE__ */ f(n, {
73
- htmlFor: `${E}-routing`,
74
- children: T.routingNumberLabel
75
- }),
76
- /* @__PURE__ */ f(t, {
77
- id: `${E}-routing`,
78
- value: _.routingNumber,
79
- "aria-invalid": !!v?.routingNumber,
80
- onChange: (e) => x({ routingNumber: e.target.value })
81
- }),
82
- /* @__PURE__ */ f(l, { message: v?.routingNumber })
83
- ]
84
- })]
85
- }),
86
- /* @__PURE__ */ p("div", {
87
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
88
- children: [/* @__PURE__ */ p("div", {
89
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
90
- children: [/* @__PURE__ */ f(n, {
91
- htmlFor: `${E}-iban`,
92
- children: T.ibanLabel
93
- }), /* @__PURE__ */ f(t, {
94
- id: `${E}-iban`,
95
- value: _.iban,
96
- onChange: (e) => x({ iban: e.target.value })
97
- })]
98
- }), /* @__PURE__ */ p("div", {
99
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
100
- children: [/* @__PURE__ */ f(n, {
101
- htmlFor: `${E}-bic`,
102
- children: T.bicLabel
103
- }), /* @__PURE__ */ f(t, {
104
- id: `${E}-bic`,
105
- value: _.bic,
106
- onChange: (e) => x({ bic: e.target.value })
107
- })]
108
- })]
109
- }),
110
- /* @__PURE__ */ p("div", {
111
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
112
- children: [/* @__PURE__ */ p("div", {
113
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
114
- children: [/* @__PURE__ */ f(n, {
115
- htmlFor: `${E}-sort-code`,
116
- children: T.sortCodeLabel
117
- }), /* @__PURE__ */ f(t, {
118
- id: `${E}-sort-code`,
119
- value: _.sortCode,
120
- onChange: (e) => x({ sortCode: e.target.value })
121
- })]
122
- }), /* @__PURE__ */ p("div", {
123
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
124
- children: [
125
- /* @__PURE__ */ f(n, {
126
- htmlFor: `${E}-currency`,
127
- children: T.currencyLabel
128
- }),
129
- /* @__PURE__ */ p(r, {
130
- value: _.currency === "" ? void 0 : _.currency,
131
- onValueChange: (e) => x({ currency: e }),
132
- children: [/* @__PURE__ */ f(o, {
133
- id: `${E}-currency`,
134
- className: "ttw:w-full",
135
- "aria-invalid": !!v?.currency,
136
- children: /* @__PURE__ */ f(s, { placeholder: T.currencyPlaceholder })
137
- }), /* @__PURE__ */ f(i, { children: y.map((e) => /* @__PURE__ */ f(a, {
138
- value: e.value,
139
- children: e.label
140
- }, e.value)) })]
141
- }),
142
- /* @__PURE__ */ f(l, { message: v?.currency })
143
- ]
144
- })]
145
- }),
146
- /* @__PURE__ */ p("div", {
147
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
148
- children: [/* @__PURE__ */ f(n, {
149
- htmlFor: `${E}-country`,
150
- children: T.countryLabel
151
- }), /* @__PURE__ */ f(t, {
152
- id: `${E}-country`,
153
- value: T.countryValue,
154
- disabled: !0,
155
- readOnly: !0
156
- })]
157
- }),
158
- /* @__PURE__ */ p("div", {
159
- className: "ttw:flex ttw:items-center ttw:gap-2",
160
- children: [/* @__PURE__ */ f(e, {
161
- id: `${E}-default`,
162
- checked: _.isDefault,
163
- onCheckedChange: (e) => x({ isDefault: e === !0 })
164
- }), /* @__PURE__ */ f(n, {
165
- htmlFor: `${E}-default`,
166
- children: T.isDefaultLabel
167
- })]
168
- })
169
- ]
170
- });
171
- }
172
- //#endregion
173
- export { m as BankAccountFormSheet, m as default };
1
+ import "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import "./index4.js";
3
+ import "./index6.js";
4
+ import "./index8.js";
5
+ import "react";
6
+ import "react/jsx-runtime";
@@ -1,5 +1,173 @@
1
- import "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import "./index4.js";
3
- import "./index7.js";
4
- import "react";
5
- import "react/jsx-runtime";
1
+ import { Checkbox as e, Input as t, Label as n, Select as r, SelectContent as i, SelectItem as a, SelectTrigger as o, SelectValue as s } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { BANK_ACCOUNT_FORM_SHEET_LABELS_EN as c } from "./index2.js";
3
+ import { FieldError as l } from "./index4.js";
4
+ import { FormSheet as u } from "./index8.js";
5
+ import { useId as d } from "react";
6
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
+ //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js
8
+ function m({ open: m, onOpenChange: h, mode: g, values: _, errors: v, currencyOptions: y, inProgress: b, onChange: x, onSubmit: S, onCancel: C, labels: w }) {
9
+ let T = {
10
+ ...c,
11
+ ...w
12
+ }, E = d(), D = g === "edit" ? T.editTitle : T.createTitle;
13
+ return /* @__PURE__ */ p(u, {
14
+ open: m,
15
+ onOpenChange: h,
16
+ title: D,
17
+ formError: v?.form,
18
+ inProgress: b,
19
+ submitLabel: g === "edit" ? T.saveButton : T.createButton,
20
+ cancelLabel: T.cancelButton,
21
+ onSubmit: S,
22
+ onCancel: C,
23
+ children: [
24
+ /* @__PURE__ */ p("div", {
25
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
26
+ children: [
27
+ /* @__PURE__ */ f(n, {
28
+ htmlFor: `${E}-name`,
29
+ children: T.nameLabel
30
+ }),
31
+ /* @__PURE__ */ f(t, {
32
+ id: `${E}-name`,
33
+ autoFocus: !0,
34
+ value: _.name,
35
+ "aria-invalid": !!v?.name,
36
+ onChange: (e) => x({ name: e.target.value })
37
+ }),
38
+ /* @__PURE__ */ f(l, { message: v?.name })
39
+ ]
40
+ }),
41
+ /* @__PURE__ */ p("div", {
42
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
43
+ children: [/* @__PURE__ */ f(n, {
44
+ htmlFor: `${E}-holder`,
45
+ children: T.accountHolderNameLabel
46
+ }), /* @__PURE__ */ f(t, {
47
+ id: `${E}-holder`,
48
+ value: _.accountHolderName,
49
+ onChange: (e) => x({ accountHolderName: e.target.value })
50
+ })]
51
+ }),
52
+ /* @__PURE__ */ p("div", {
53
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
54
+ children: [/* @__PURE__ */ p("div", {
55
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
56
+ children: [
57
+ /* @__PURE__ */ f(n, {
58
+ htmlFor: `${E}-account-number`,
59
+ children: T.accountNumberLabel
60
+ }),
61
+ /* @__PURE__ */ f(t, {
62
+ id: `${E}-account-number`,
63
+ value: _.accountNumber,
64
+ "aria-invalid": !!v?.accountNumber,
65
+ onChange: (e) => x({ accountNumber: e.target.value })
66
+ }),
67
+ /* @__PURE__ */ f(l, { message: v?.accountNumber })
68
+ ]
69
+ }), /* @__PURE__ */ p("div", {
70
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
71
+ children: [
72
+ /* @__PURE__ */ f(n, {
73
+ htmlFor: `${E}-routing`,
74
+ children: T.routingNumberLabel
75
+ }),
76
+ /* @__PURE__ */ f(t, {
77
+ id: `${E}-routing`,
78
+ value: _.routingNumber,
79
+ "aria-invalid": !!v?.routingNumber,
80
+ onChange: (e) => x({ routingNumber: e.target.value })
81
+ }),
82
+ /* @__PURE__ */ f(l, { message: v?.routingNumber })
83
+ ]
84
+ })]
85
+ }),
86
+ /* @__PURE__ */ p("div", {
87
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
88
+ children: [/* @__PURE__ */ p("div", {
89
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
90
+ children: [/* @__PURE__ */ f(n, {
91
+ htmlFor: `${E}-iban`,
92
+ children: T.ibanLabel
93
+ }), /* @__PURE__ */ f(t, {
94
+ id: `${E}-iban`,
95
+ value: _.iban,
96
+ onChange: (e) => x({ iban: e.target.value })
97
+ })]
98
+ }), /* @__PURE__ */ p("div", {
99
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
100
+ children: [/* @__PURE__ */ f(n, {
101
+ htmlFor: `${E}-bic`,
102
+ children: T.bicLabel
103
+ }), /* @__PURE__ */ f(t, {
104
+ id: `${E}-bic`,
105
+ value: _.bic,
106
+ onChange: (e) => x({ bic: e.target.value })
107
+ })]
108
+ })]
109
+ }),
110
+ /* @__PURE__ */ p("div", {
111
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
112
+ children: [/* @__PURE__ */ p("div", {
113
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
114
+ children: [/* @__PURE__ */ f(n, {
115
+ htmlFor: `${E}-sort-code`,
116
+ children: T.sortCodeLabel
117
+ }), /* @__PURE__ */ f(t, {
118
+ id: `${E}-sort-code`,
119
+ value: _.sortCode,
120
+ onChange: (e) => x({ sortCode: e.target.value })
121
+ })]
122
+ }), /* @__PURE__ */ p("div", {
123
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
124
+ children: [
125
+ /* @__PURE__ */ f(n, {
126
+ htmlFor: `${E}-currency`,
127
+ children: T.currencyLabel
128
+ }),
129
+ /* @__PURE__ */ p(r, {
130
+ value: _.currency === "" ? void 0 : _.currency,
131
+ onValueChange: (e) => x({ currency: e }),
132
+ children: [/* @__PURE__ */ f(o, {
133
+ id: `${E}-currency`,
134
+ className: "ttw:w-full",
135
+ "aria-invalid": !!v?.currency,
136
+ children: /* @__PURE__ */ f(s, { placeholder: T.currencyPlaceholder })
137
+ }), /* @__PURE__ */ f(i, { children: y.map((e) => /* @__PURE__ */ f(a, {
138
+ value: e.value,
139
+ children: e.label
140
+ }, e.value)) })]
141
+ }),
142
+ /* @__PURE__ */ f(l, { message: v?.currency })
143
+ ]
144
+ })]
145
+ }),
146
+ /* @__PURE__ */ p("div", {
147
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
148
+ children: [/* @__PURE__ */ f(n, {
149
+ htmlFor: `${E}-country`,
150
+ children: T.countryLabel
151
+ }), /* @__PURE__ */ f(t, {
152
+ id: `${E}-country`,
153
+ value: T.countryValue,
154
+ disabled: !0,
155
+ readOnly: !0
156
+ })]
157
+ }),
158
+ /* @__PURE__ */ p("div", {
159
+ className: "ttw:flex ttw:items-center ttw:gap-2",
160
+ children: [/* @__PURE__ */ f(e, {
161
+ id: `${E}-default`,
162
+ checked: _.isDefault,
163
+ onCheckedChange: (e) => x({ isDefault: e === !0 })
164
+ }), /* @__PURE__ */ f(n, {
165
+ htmlFor: `${E}-default`,
166
+ children: T.isDefaultLabel
167
+ })]
168
+ })
169
+ ]
170
+ });
171
+ }
172
+ //#endregion
173
+ export { m as BankAccountFormSheet, m as default };
@@ -1,57 +1,5 @@
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 { ADDRESS_FORM_SHEET_LABELS_EN as s } from "./index2.js";
3
- import { AddressFieldGroup as c } from "./index5.js";
4
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
5
- //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js
6
- function d({ open: d, onOpenChange: f, values: p, errors: m, stateOptions: h, inProgress: g, formError: _, onChange: v, onSubmit: y, onCancel: b, labels: x }) {
7
- let S = {
8
- ...s,
9
- ...x
10
- };
11
- return /* @__PURE__ */ l(t, {
12
- open: d,
13
- onOpenChange: f,
14
- children: /* @__PURE__ */ u(n, {
15
- className: "ttw:w-[600px] ttw:sm:max-w-[600px] ttw:overflow-y-auto",
16
- children: [/* @__PURE__ */ u(a, { children: [/* @__PURE__ */ l(o, { children: S.title }), /* @__PURE__ */ l(r, {
17
- className: "ttw:sr-only",
18
- children: S.title
19
- })] }), /* @__PURE__ */ u("form", {
20
- onSubmit: (e) => {
21
- e.preventDefault(), e.stopPropagation(), y();
22
- },
23
- children: [/* @__PURE__ */ u("div", {
24
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pt-8 ttw:pb-6",
25
- children: [_ && /* @__PURE__ */ l("p", {
26
- role: "alert",
27
- className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
28
- children: _
29
- }), /* @__PURE__ */ l(c, {
30
- idPrefix: "address-edit",
31
- values: p,
32
- errors: m,
33
- stateOptions: h,
34
- onChange: v,
35
- labels: S.address
36
- })]
37
- }), /* @__PURE__ */ u(i, {
38
- className: "ttw:flex ttw:flex-row ttw:justify-end ttw:gap-2",
39
- children: [/* @__PURE__ */ l(e, {
40
- type: "button",
41
- variant: "ghost",
42
- size: "lg",
43
- onClick: b,
44
- children: S.cancelButton
45
- }), /* @__PURE__ */ l(e, {
46
- type: "submit",
47
- size: "lg",
48
- disabled: g,
49
- children: S.saveButton
50
- })]
51
- })]
52
- })]
53
- })
54
- });
55
- }
56
- //#endregion
57
- export { d as AddressFormSheet, d as default };
1
+ import "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import "./index4.js";
3
+ import "./index8.js";
4
+ import "react";
5
+ import "react/jsx-runtime";
@@ -1,28 +1,57 @@
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 { 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 { ADDRESS_FORM_SHEET_LABELS_EN as s } from "./index2.js";
3
+ import { AddressFieldGroup as c } from "./index6.js";
4
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
5
  //#region ../../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 = {
6
+ function d({ open: d, onOpenChange: f, values: p, errors: m, stateOptions: h, inProgress: g, formError: _, onChange: v, onSubmit: y, onCancel: b, labels: x }) {
7
+ let S = {
7
8
  ...s,
8
- ..._
9
+ ...x
9
10
  };
10
- return /* @__PURE__ */ c(e, {
11
- open: u,
12
- onOpenChange: d,
13
- children: /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ l(i, { children: [/* @__PURE__ */ c(a, { children: f }), /* @__PURE__ */ c(n, { children: p })] }), /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ c(o, {
14
- variant: "ghost",
15
- onClick: g,
16
- disabled: m,
17
- children: v.cancelButton
18
- }), /* @__PURE__ */ c(o, {
19
- variant: "destructive",
20
- onClick: h,
21
- disabled: m,
22
- loading: m,
23
- children: v.confirmButton
24
- })] })] })
11
+ return /* @__PURE__ */ l(t, {
12
+ open: d,
13
+ onOpenChange: f,
14
+ children: /* @__PURE__ */ u(n, {
15
+ className: "ttw:w-[600px] ttw:sm:max-w-[600px] ttw:overflow-y-auto",
16
+ children: [/* @__PURE__ */ u(a, { children: [/* @__PURE__ */ l(o, { children: S.title }), /* @__PURE__ */ l(r, {
17
+ className: "ttw:sr-only",
18
+ children: S.title
19
+ })] }), /* @__PURE__ */ u("form", {
20
+ onSubmit: (e) => {
21
+ e.preventDefault(), e.stopPropagation(), y();
22
+ },
23
+ children: [/* @__PURE__ */ u("div", {
24
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pt-8 ttw:pb-6",
25
+ children: [_ && /* @__PURE__ */ l("p", {
26
+ role: "alert",
27
+ className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
28
+ children: _
29
+ }), /* @__PURE__ */ l(c, {
30
+ idPrefix: "address-edit",
31
+ values: p,
32
+ errors: m,
33
+ stateOptions: h,
34
+ onChange: v,
35
+ labels: S.address
36
+ })]
37
+ }), /* @__PURE__ */ u(i, {
38
+ className: "ttw:flex ttw:flex-row ttw:justify-end ttw:gap-2",
39
+ children: [/* @__PURE__ */ l(e, {
40
+ type: "button",
41
+ variant: "ghost",
42
+ size: "lg",
43
+ onClick: b,
44
+ children: S.cancelButton
45
+ }), /* @__PURE__ */ l(e, {
46
+ type: "submit",
47
+ size: "lg",
48
+ disabled: g,
49
+ children: S.saveButton
50
+ })]
51
+ })]
52
+ })]
53
+ })
25
54
  });
26
55
  }
27
56
  //#endregion
28
- export { u as ConfirmDeleteDialog, u as default };
57
+ export { d as AddressFormSheet, d as default };
@@ -1,76 +1,28 @@
1
- import { Button as e, Input as t, Label as n, Select as r, SelectContent as i, SelectItem as a, SelectTrigger as o, SelectValue as s } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { COUNTERPART_SELECTOR_LABELS_EN as c } from "./index2.js";
3
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
- import { PlusIcon as d, RotateCwIcon as f, SearchIcon as p } from "lucide-react";
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";
5
4
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js
6
- function m({ value: m, options: h, searchValue: g, isLoading: _, isError: v, disabled: y, onSearchChange: b, onValueChange: x, onRetry: S, onCreateClick: C, labels: w }) {
7
- let T = {
8
- ...c,
9
- ...w
10
- }, E = h.length > 0;
11
- return /* @__PURE__ */ u("div", {
12
- className: "ttw:flex ttw:flex-col ttw:gap-2",
13
- children: [
14
- /* @__PURE__ */ u("div", {
15
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
16
- children: [/* @__PURE__ */ l(n, { children: T.fieldLabel }), C ? /* @__PURE__ */ u(e, {
17
- type: "button",
18
- variant: "ghost",
19
- size: "sm",
20
- onClick: C,
21
- disabled: y,
22
- children: [/* @__PURE__ */ l(d, { className: "ttw:size-4" }), T.createButton]
23
- }) : null]
24
- }),
25
- /* @__PURE__ */ u("div", {
26
- className: "ttw:relative",
27
- children: [/* @__PURE__ */ l(p, { className: "ttw:pointer-events-none ttw:absolute ttw:left-3 ttw:top-1/2 ttw:size-4 ttw:-translate-y-1/2 ttw:text-muted-foreground" }), /* @__PURE__ */ l(t, {
28
- className: "ttw:pl-9",
29
- value: g,
30
- placeholder: T.searchPlaceholder,
31
- disabled: y,
32
- onChange: (e) => b(e.target.value)
33
- })]
34
- }),
35
- /* @__PURE__ */ u(r, {
36
- value: m || void 0,
37
- onValueChange: x,
38
- disabled: y || _ || v || !E,
39
- children: [/* @__PURE__ */ l(o, {
40
- className: "ttw:w-full",
41
- children: /* @__PURE__ */ l(s, { placeholder: T.selectPlaceholder })
42
- }), /* @__PURE__ */ l(i, { children: h.map((e) => /* @__PURE__ */ l(a, {
43
- value: e.value,
44
- children: /* @__PURE__ */ u("span", {
45
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
46
- children: [/* @__PURE__ */ l("span", { children: e.label }), e.supportingLabel ? /* @__PURE__ */ l("span", {
47
- className: "ttw:text-xs ttw:text-muted-foreground",
48
- children: e.supportingLabel
49
- }) : null]
50
- })
51
- }, e.value)) })]
52
- }),
53
- _ ? /* @__PURE__ */ l("p", {
54
- className: "ttw:text-sm ttw:text-muted-foreground",
55
- children: T.loadingText
56
- }) : v ? /* @__PURE__ */ u("div", {
57
- className: "ttw:flex ttw:items-center ttw:gap-2",
58
- children: [/* @__PURE__ */ l("p", {
59
- className: "ttw:text-sm ttw:text-destructive",
60
- children: T.errorText
61
- }), S ? /* @__PURE__ */ u(e, {
62
- type: "button",
63
- variant: "outline",
64
- size: "sm",
65
- onClick: S,
66
- children: [/* @__PURE__ */ l(f, { className: "ttw:size-4" }), T.retryButton]
67
- }) : null]
68
- }) : E ? null : /* @__PURE__ */ l("p", {
69
- className: "ttw:text-sm ttw:text-muted-foreground",
70
- children: T.emptyText
71
- })
72
- ]
5
+ function u({ open: u, onOpenChange: d, title: f, message: p, isDeleting: m, onConfirm: h, onCancel: g, labels: _ }) {
6
+ let v = {
7
+ ...s,
8
+ ..._
9
+ };
10
+ return /* @__PURE__ */ c(e, {
11
+ open: u,
12
+ onOpenChange: d,
13
+ children: /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ l(i, { children: [/* @__PURE__ */ c(a, { children: f }), /* @__PURE__ */ c(n, { children: p })] }), /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ c(o, {
14
+ variant: "ghost",
15
+ onClick: g,
16
+ disabled: m,
17
+ children: v.cancelButton
18
+ }), /* @__PURE__ */ c(o, {
19
+ variant: "destructive",
20
+ onClick: h,
21
+ disabled: m,
22
+ loading: m,
23
+ children: v.confirmButton
24
+ })] })] })
73
25
  });
74
26
  }
75
27
  //#endregion
76
- export { m as CounterpartSelector, m as default };
28
+ export { u as ConfirmDeleteDialog, u as default };