@tesouro/embedded-components-react 0.2.296 → 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.
- package/dist/index.css +6 -0
- package/dist/index.d.ts +107 -87
- package/dist/lib/CounterpartsWidget.d.ts +24 -4
- package/dist/lib/ReceivablesWidget.d.ts +20 -3
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/data-access/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +210 -199
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +31 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +122 -149
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +163 -72
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +52 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +8 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +98 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +6 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +7 -3
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +12 -7
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +17 -16
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +103 -50
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +126 -76
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +12 -11
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +6 -173
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +173 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +5 -57
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +51 -22
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index14.js +24 -72
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +76 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +13 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js +53 -110
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index6.js +115 -51
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index7.js +53 -47
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +44 -504
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +480 -6
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +21 -19
- package/dist/libs/tesouro-embedded-components-react/{accept-disclosures-widget/data-access/dist/index2.js → shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js} +3 -4
- package/dist/libs/tesouro-embedded-components-react/{accept-disclosures-widget/data-access/dist/index3.js → shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js} +4 -5
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
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";
|
|
5
|
+
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.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
|
+
]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { m as CounterpartSelector, m as default };
|
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js
CHANGED
|
@@ -18,6 +18,10 @@ var e = {
|
|
|
18
18
|
country: "Country",
|
|
19
19
|
countryValue: "United States"
|
|
20
20
|
}, r = {
|
|
21
|
+
accountHolderName: "Account holder name",
|
|
22
|
+
routingNumber: "Routing number",
|
|
23
|
+
accountNumber: "Account number"
|
|
24
|
+
}, i = {
|
|
21
25
|
createTitleOrganization: "Create organization",
|
|
22
26
|
createTitleIndividual: "Create individual",
|
|
23
27
|
editTitleOrganization: "Edit organization",
|
|
@@ -43,7 +47,7 @@ var e = {
|
|
|
43
47
|
lastNameLabel: "Last name",
|
|
44
48
|
titleLabel: "Title",
|
|
45
49
|
emailLabel: "Email",
|
|
46
|
-
phoneLabel: "Phone",
|
|
50
|
+
phoneLabel: "Phone (optional)",
|
|
47
51
|
taxIdLabel: "Tax ID",
|
|
48
52
|
customerTaxIdHelp: "Required only if you'll issue a 1099 IRS form at year-end.",
|
|
49
53
|
vendorTaxIdHelp: "Required only if you'll file a 1099 IRS form for this vendor at year-end.",
|
|
@@ -54,11 +58,13 @@ var e = {
|
|
|
54
58
|
accountHolderNameLabel: "Account holder name",
|
|
55
59
|
routingNumberLabel: "Routing number",
|
|
56
60
|
accountNumberLabel: "Account number",
|
|
61
|
+
addAddress: "Add address",
|
|
57
62
|
cancelButton: "Cancel",
|
|
58
63
|
createButton: "Create",
|
|
59
64
|
saveButton: "Save",
|
|
60
|
-
address: n
|
|
61
|
-
|
|
65
|
+
address: n,
|
|
66
|
+
ach: r
|
|
67
|
+
}, a = {
|
|
62
68
|
createTitle: "Add bank account",
|
|
63
69
|
editTitle: "Edit bank account",
|
|
64
70
|
nameLabel: "Account name",
|
|
@@ -76,15 +82,15 @@ var e = {
|
|
|
76
82
|
cancelButton: "Cancel",
|
|
77
83
|
createButton: "Add",
|
|
78
84
|
saveButton: "Save"
|
|
79
|
-
},
|
|
85
|
+
}, o = {
|
|
80
86
|
title: "Edit address",
|
|
81
87
|
cancelButton: "Cancel",
|
|
82
88
|
saveButton: "Save",
|
|
83
89
|
address: n
|
|
84
|
-
},
|
|
90
|
+
}, s = {
|
|
85
91
|
confirmButton: "Delete",
|
|
86
92
|
cancelButton: "Cancel"
|
|
87
|
-
},
|
|
93
|
+
}, c = {
|
|
88
94
|
fieldLabel: "Counterpart",
|
|
89
95
|
searchPlaceholder: "Search counterparts",
|
|
90
96
|
selectPlaceholder: "Select a counterpart",
|
|
@@ -95,4 +101,4 @@ var e = {
|
|
|
95
101
|
createButton: "Create counterpart"
|
|
96
102
|
};
|
|
97
103
|
//#endregion
|
|
98
|
-
export { n as ADDRESS_FIELD_GROUP_LABELS_EN,
|
|
104
|
+
export { r as ACH_FIELD_GROUP_LABELS_EN, n as ADDRESS_FIELD_GROUP_LABELS_EN, o as ADDRESS_FORM_SHEET_LABELS_EN, a as BANK_ACCOUNT_FORM_SHEET_LABELS_EN, s as CONFIRM_DELETE_DIALOG_LABELS_EN, i as COUNTERPART_FORM_SHEET_LABELS_EN, c as COUNTERPART_SELECTOR_LABELS_EN, e as COUNTERPART_TYPE_BADGE_LABELS_EN, t as COUNTERPART_TYPE_CHOOSER_LABELS_EN };
|
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js
CHANGED
|
@@ -1,122 +1,65 @@
|
|
|
1
|
-
import { Input as e, Label as t
|
|
2
|
-
import {
|
|
3
|
-
import { FieldError as
|
|
4
|
-
import { jsx as
|
|
1
|
+
import { Input as e, Label as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { ACH_FIELD_GROUP_LABELS_EN as n } from "./index2.js";
|
|
3
|
+
import { FieldError as r } from "./index4.js";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index5.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
state: "",
|
|
11
|
-
postalCode: ""
|
|
12
|
-
};
|
|
13
|
-
function f({ idPrefix: d, values: f, errors: p, stateOptions: m, onChange: h, labels: g }) {
|
|
14
|
-
let _ = {
|
|
15
|
-
...s,
|
|
16
|
-
...g
|
|
6
|
+
function o({ idPrefix: o, values: s, errors: c, onChange: l, labels: u }) {
|
|
7
|
+
let d = {
|
|
8
|
+
...n,
|
|
9
|
+
...u
|
|
17
10
|
};
|
|
18
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ a("div", {
|
|
19
12
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
20
|
-
children: [
|
|
21
|
-
|
|
13
|
+
children: [/* @__PURE__ */ a("div", {
|
|
14
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ i(t, {
|
|
17
|
+
htmlFor: `${o}-account-holder`,
|
|
18
|
+
children: d.accountHolderName
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ i(e, {
|
|
21
|
+
id: `${o}-account-holder`,
|
|
22
|
+
value: s.accountHolderName,
|
|
23
|
+
"aria-invalid": !!c?.accountHolderName,
|
|
24
|
+
onChange: (e) => l({ accountHolderName: e.target.value })
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ i(r, { message: c?.accountHolderName })
|
|
27
|
+
]
|
|
28
|
+
}), /* @__PURE__ */ a("div", {
|
|
29
|
+
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
30
|
+
children: [/* @__PURE__ */ a("div", {
|
|
22
31
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
23
32
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
htmlFor: `${
|
|
26
|
-
children:
|
|
33
|
+
/* @__PURE__ */ i(t, {
|
|
34
|
+
htmlFor: `${o}-routing-number`,
|
|
35
|
+
children: d.routingNumber
|
|
27
36
|
}),
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
id: `${
|
|
30
|
-
value:
|
|
31
|
-
"aria-invalid": !!
|
|
32
|
-
onChange: (e) =>
|
|
37
|
+
/* @__PURE__ */ i(e, {
|
|
38
|
+
id: `${o}-routing-number`,
|
|
39
|
+
value: s.routingNumber,
|
|
40
|
+
"aria-invalid": !!c?.routingNumber,
|
|
41
|
+
onChange: (e) => l({ routingNumber: e.target.value })
|
|
33
42
|
}),
|
|
34
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ i(r, { message: c?.routingNumber })
|
|
35
44
|
]
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */ u("div", {
|
|
45
|
+
}), /* @__PURE__ */ a("div", {
|
|
38
46
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
39
|
-
children: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
htmlFor: `${d}-city`,
|
|
55
|
-
children: _.city
|
|
56
|
-
}),
|
|
57
|
-
/* @__PURE__ */ l(e, {
|
|
58
|
-
id: `${d}-city`,
|
|
59
|
-
value: f.city,
|
|
60
|
-
"aria-invalid": !!p?.city,
|
|
61
|
-
onChange: (e) => h({ city: e.target.value })
|
|
62
|
-
}),
|
|
63
|
-
/* @__PURE__ */ l(c, { message: p?.city })
|
|
64
|
-
]
|
|
65
|
-
}), /* @__PURE__ */ u("div", {
|
|
66
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
67
|
-
children: [
|
|
68
|
-
/* @__PURE__ */ l(t, {
|
|
69
|
-
htmlFor: `${d}-state`,
|
|
70
|
-
children: _.state
|
|
71
|
-
}),
|
|
72
|
-
/* @__PURE__ */ u(n, {
|
|
73
|
-
value: f.state === "" ? void 0 : f.state,
|
|
74
|
-
onValueChange: (e) => h({ state: e }),
|
|
75
|
-
children: [/* @__PURE__ */ l(a, {
|
|
76
|
-
id: `${d}-state`,
|
|
77
|
-
className: "ttw:w-full",
|
|
78
|
-
children: /* @__PURE__ */ l(o, { placeholder: _.statePlaceholder })
|
|
79
|
-
}), /* @__PURE__ */ l(r, { children: m.map((e) => /* @__PURE__ */ l(i, {
|
|
80
|
-
value: e.value,
|
|
81
|
-
children: e.label
|
|
82
|
-
}, e.value)) })]
|
|
83
|
-
}),
|
|
84
|
-
/* @__PURE__ */ l(c, { message: p?.state })
|
|
85
|
-
]
|
|
86
|
-
})]
|
|
87
|
-
}),
|
|
88
|
-
/* @__PURE__ */ u("div", {
|
|
89
|
-
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
90
|
-
children: [/* @__PURE__ */ u("div", {
|
|
91
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
92
|
-
children: [
|
|
93
|
-
/* @__PURE__ */ l(t, {
|
|
94
|
-
htmlFor: `${d}-postal`,
|
|
95
|
-
children: _.postalCode
|
|
96
|
-
}),
|
|
97
|
-
/* @__PURE__ */ l(e, {
|
|
98
|
-
id: `${d}-postal`,
|
|
99
|
-
value: f.postalCode,
|
|
100
|
-
"aria-invalid": !!p?.postalCode,
|
|
101
|
-
onChange: (e) => h({ postalCode: e.target.value })
|
|
102
|
-
}),
|
|
103
|
-
/* @__PURE__ */ l(c, { message: p?.postalCode })
|
|
104
|
-
]
|
|
105
|
-
}), /* @__PURE__ */ u("div", {
|
|
106
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
107
|
-
children: [/* @__PURE__ */ l(t, {
|
|
108
|
-
htmlFor: `${d}-country`,
|
|
109
|
-
children: _.country
|
|
110
|
-
}), /* @__PURE__ */ l(e, {
|
|
111
|
-
id: `${d}-country`,
|
|
112
|
-
value: _.countryValue,
|
|
113
|
-
disabled: !0,
|
|
114
|
-
readOnly: !0
|
|
115
|
-
})]
|
|
116
|
-
})]
|
|
117
|
-
})
|
|
118
|
-
]
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ i(t, {
|
|
49
|
+
htmlFor: `${o}-account-number`,
|
|
50
|
+
children: d.accountNumber
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ i(e, {
|
|
53
|
+
id: `${o}-account-number`,
|
|
54
|
+
value: s.accountNumber,
|
|
55
|
+
"aria-invalid": !!c?.accountNumber,
|
|
56
|
+
onChange: (e) => l({ accountNumber: e.target.value })
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ i(r, { message: c?.accountNumber })
|
|
59
|
+
]
|
|
60
|
+
})]
|
|
61
|
+
})]
|
|
119
62
|
});
|
|
120
63
|
}
|
|
121
64
|
//#endregion
|
|
122
|
-
export {
|
|
65
|
+
export { o as AchFieldGroup, o as default };
|
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index6.js
CHANGED
|
@@ -1,58 +1,122 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as
|
|
1
|
+
import { Input as e, Label as t, Select as n, SelectContent as r, SelectItem as i, SelectTrigger as a, SelectValue as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { ADDRESS_FIELD_GROUP_LABELS_EN as s } from "./index2.js";
|
|
3
|
+
import { FieldError as c } from "./index4.js";
|
|
4
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
5
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index6.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
6
|
+
var d = {
|
|
7
|
+
line1: "",
|
|
8
|
+
line2: "",
|
|
9
|
+
city: "",
|
|
10
|
+
state: "",
|
|
11
|
+
postalCode: ""
|
|
12
|
+
};
|
|
13
|
+
function f({ idPrefix: d, values: f, errors: p, stateOptions: m, onChange: h, labels: g }) {
|
|
14
|
+
let _ = {
|
|
15
|
+
...s,
|
|
16
|
+
...g
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ u("div", {
|
|
19
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ u("div", {
|
|
22
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ l(t, {
|
|
25
|
+
htmlFor: `${d}-line1`,
|
|
26
|
+
children: _.line1
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ l(e, {
|
|
29
|
+
id: `${d}-line1`,
|
|
30
|
+
value: f.line1,
|
|
31
|
+
"aria-invalid": !!p?.line1,
|
|
32
|
+
onChange: (e) => h({ line1: e.target.value })
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ l(c, { message: p?.line1 })
|
|
35
|
+
]
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ u("div", {
|
|
38
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
39
|
+
children: [/* @__PURE__ */ l(t, {
|
|
40
|
+
htmlFor: `${d}-line2`,
|
|
41
|
+
children: _.line2
|
|
42
|
+
}), /* @__PURE__ */ l(e, {
|
|
43
|
+
id: `${d}-line2`,
|
|
44
|
+
value: f.line2,
|
|
45
|
+
onChange: (e) => h({ line2: e.target.value })
|
|
46
|
+
})]
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ u("div", {
|
|
49
|
+
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
50
|
+
children: [/* @__PURE__ */ u("div", {
|
|
51
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ l(t, {
|
|
54
|
+
htmlFor: `${d}-city`,
|
|
55
|
+
children: _.city
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ l(e, {
|
|
58
|
+
id: `${d}-city`,
|
|
59
|
+
value: f.city,
|
|
60
|
+
"aria-invalid": !!p?.city,
|
|
61
|
+
onChange: (e) => h({ city: e.target.value })
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ l(c, { message: p?.city })
|
|
64
|
+
]
|
|
65
|
+
}), /* @__PURE__ */ u("div", {
|
|
66
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ l(t, {
|
|
69
|
+
htmlFor: `${d}-state`,
|
|
70
|
+
children: _.state
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ u(n, {
|
|
73
|
+
value: f.state === "" ? void 0 : f.state,
|
|
74
|
+
onValueChange: (e) => h({ state: e }),
|
|
75
|
+
children: [/* @__PURE__ */ l(a, {
|
|
76
|
+
id: `${d}-state`,
|
|
77
|
+
className: "ttw:w-full",
|
|
78
|
+
children: /* @__PURE__ */ l(o, { placeholder: _.statePlaceholder })
|
|
79
|
+
}), /* @__PURE__ */ l(r, { children: m.map((e) => /* @__PURE__ */ l(i, {
|
|
80
|
+
value: e.value,
|
|
81
|
+
children: e.label
|
|
82
|
+
}, e.value)) })]
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ l(c, { message: p?.state })
|
|
85
|
+
]
|
|
36
86
|
})]
|
|
37
|
-
}),
|
|
38
|
-
|
|
39
|
-
className: "ttw:
|
|
40
|
-
children: [/* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ u("div", {
|
|
89
|
+
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
90
|
+
children: [/* @__PURE__ */ u("div", {
|
|
91
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ l(t, {
|
|
94
|
+
htmlFor: `${d}-postal`,
|
|
95
|
+
children: _.postalCode
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ l(e, {
|
|
98
|
+
id: `${d}-postal`,
|
|
99
|
+
value: f.postalCode,
|
|
100
|
+
"aria-invalid": !!p?.postalCode,
|
|
101
|
+
onChange: (e) => h({ postalCode: e.target.value })
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ l(c, { message: p?.postalCode })
|
|
104
|
+
]
|
|
105
|
+
}), /* @__PURE__ */ u("div", {
|
|
106
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
107
|
+
children: [/* @__PURE__ */ l(t, {
|
|
108
|
+
htmlFor: `${d}-country`,
|
|
109
|
+
children: _.country
|
|
110
|
+
}), /* @__PURE__ */ l(e, {
|
|
111
|
+
id: `${d}-country`,
|
|
112
|
+
value: _.countryValue,
|
|
113
|
+
disabled: !0,
|
|
114
|
+
readOnly: !0
|
|
51
115
|
})]
|
|
52
116
|
})]
|
|
53
|
-
})
|
|
54
|
-
|
|
117
|
+
})
|
|
118
|
+
]
|
|
55
119
|
});
|
|
56
120
|
}
|
|
57
121
|
//#endregion
|
|
58
|
-
export {
|
|
122
|
+
export { f as AddressFieldGroup, f as default, d as EMPTY_ADDRESS_FORM_VALUES };
|
package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index7.js
CHANGED
|
@@ -1,52 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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/index7.js
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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: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: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 {
|
|
58
|
+
export { s as CounterpartTypeChooser, s as default };
|