@tesouro/embedded-components-react 0.5.56 → 0.5.59

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 (27) hide show
  1. package/README.md +9 -9
  2. package/dist/index.d.ts +5 -3
  3. package/dist/lib/CounterpartsWidget.d.ts +5 -3
  4. package/dist/lib/ReceivablesWidget.d.ts +3 -2
  5. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +39 -45
  6. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index4.js +9 -15
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +53 -53
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +42 -65
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +288 -226
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +104 -101
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +313 -285
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +12 -4
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +2 -0
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +41 -31
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +8 -1
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +9 -0
  17. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +54 -60
  19. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +2 -2
  21. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +4 -4
  22. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +121 -115
  23. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +2 -1
  24. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index6.js +1 -0
  25. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/parseCalendarDate.js +17 -0
  27. package/package.json +1 -1
@@ -1,173 +1,179 @@
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";
1
+ import { Checkbox as e, FieldRequirement as t, Input as n, Label as r, Select as i, SelectContent as a, SelectItem as o, SelectTrigger as s, SelectValue as c } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { BANK_ACCOUNT_FORM_SHEET_LABELS_EN as l } from "./index2.js";
3
+ import { FieldError as u } from "./index4.js";
4
+ import { FormSheet as d } from "./index8.js";
5
+ import { useId as f } from "react";
6
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
7
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,
8
+ function h({ open: h, onOpenChange: g, mode: _, values: v, errors: y, currencyOptions: b, inProgress: x, onChange: S, onSubmit: C, onCancel: w, labels: T }) {
9
+ let E = {
10
+ ...l,
11
+ ...T,
12
+ fieldMarkers: {
13
+ ...l.fieldMarkers,
14
+ ...T?.fieldMarkers
15
+ }
16
+ }, D = f(), O = _ === "edit" ? E.editTitle : E.createTitle;
17
+ return /* @__PURE__ */ m(d, {
18
+ open: h,
19
+ onOpenChange: g,
20
+ title: O,
21
+ formError: y?.form,
22
+ inProgress: x,
23
+ submitLabel: _ === "edit" ? E.saveButton : E.createButton,
24
+ cancelLabel: E.cancelButton,
25
+ onSubmit: C,
26
+ onCancel: w,
23
27
  children: [
24
- /* @__PURE__ */ p("div", {
28
+ /* @__PURE__ */ m("div", {
25
29
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
26
30
  children: [
27
- /* @__PURE__ */ f(n, {
28
- htmlFor: `${E}-name`,
29
- children: T.nameLabel
31
+ /* @__PURE__ */ p(r, {
32
+ htmlFor: `${D}-name`,
33
+ requirement: t.Optional,
34
+ labels: E.fieldMarkers,
35
+ children: E.nameLabel
30
36
  }),
31
- /* @__PURE__ */ f(t, {
32
- id: `${E}-name`,
37
+ /* @__PURE__ */ p(n, {
38
+ id: `${D}-name`,
33
39
  autoFocus: !0,
34
- value: _.name,
35
- "aria-invalid": !!v?.name,
36
- onChange: (e) => x({ name: e.target.value })
40
+ value: v.name,
41
+ "aria-invalid": !!y?.name,
42
+ onChange: (e) => S({ name: e.target.value })
37
43
  }),
38
- /* @__PURE__ */ f(l, { message: v?.name })
44
+ /* @__PURE__ */ p(u, { message: y?.name })
39
45
  ]
40
46
  }),
41
- /* @__PURE__ */ p("div", {
47
+ /* @__PURE__ */ m("div", {
42
48
  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 })
49
+ children: [/* @__PURE__ */ p(r, {
50
+ htmlFor: `${D}-holder`,
51
+ children: E.accountHolderNameLabel
52
+ }), /* @__PURE__ */ p(n, {
53
+ id: `${D}-holder`,
54
+ value: v.accountHolderName,
55
+ onChange: (e) => S({ accountHolderName: e.target.value })
50
56
  })]
51
57
  }),
52
- /* @__PURE__ */ p("div", {
58
+ /* @__PURE__ */ m("div", {
53
59
  className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
54
- children: [/* @__PURE__ */ p("div", {
60
+ children: [/* @__PURE__ */ m("div", {
55
61
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
56
62
  children: [
57
- /* @__PURE__ */ f(n, {
58
- htmlFor: `${E}-account-number`,
59
- children: T.accountNumberLabel
63
+ /* @__PURE__ */ p(r, {
64
+ htmlFor: `${D}-account-number`,
65
+ children: E.accountNumberLabel
60
66
  }),
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 })
67
+ /* @__PURE__ */ p(n, {
68
+ id: `${D}-account-number`,
69
+ value: v.accountNumber,
70
+ "aria-invalid": !!y?.accountNumber,
71
+ onChange: (e) => S({ accountNumber: e.target.value })
66
72
  }),
67
- /* @__PURE__ */ f(l, { message: v?.accountNumber })
73
+ /* @__PURE__ */ p(u, { message: y?.accountNumber })
68
74
  ]
69
- }), /* @__PURE__ */ p("div", {
75
+ }), /* @__PURE__ */ m("div", {
70
76
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
71
77
  children: [
72
- /* @__PURE__ */ f(n, {
73
- htmlFor: `${E}-routing`,
74
- children: T.routingNumberLabel
78
+ /* @__PURE__ */ p(r, {
79
+ htmlFor: `${D}-routing`,
80
+ children: E.routingNumberLabel
75
81
  }),
76
- /* @__PURE__ */ f(t, {
77
- id: `${E}-routing`,
78
- value: _.routingNumber,
79
- "aria-invalid": !!v?.routingNumber,
80
- onChange: (e) => x({ routingNumber: e.target.value })
82
+ /* @__PURE__ */ p(n, {
83
+ id: `${D}-routing`,
84
+ value: v.routingNumber,
85
+ "aria-invalid": !!y?.routingNumber,
86
+ onChange: (e) => S({ routingNumber: e.target.value })
81
87
  }),
82
- /* @__PURE__ */ f(l, { message: v?.routingNumber })
88
+ /* @__PURE__ */ p(u, { message: y?.routingNumber })
83
89
  ]
84
90
  })]
85
91
  }),
86
- /* @__PURE__ */ p("div", {
92
+ /* @__PURE__ */ m("div", {
87
93
  className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
88
- children: [/* @__PURE__ */ p("div", {
94
+ children: [/* @__PURE__ */ m("div", {
89
95
  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 })
96
+ children: [/* @__PURE__ */ p(r, {
97
+ htmlFor: `${D}-iban`,
98
+ children: E.ibanLabel
99
+ }), /* @__PURE__ */ p(n, {
100
+ id: `${D}-iban`,
101
+ value: v.iban,
102
+ onChange: (e) => S({ iban: e.target.value })
97
103
  })]
98
- }), /* @__PURE__ */ p("div", {
104
+ }), /* @__PURE__ */ m("div", {
99
105
  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 })
106
+ children: [/* @__PURE__ */ p(r, {
107
+ htmlFor: `${D}-bic`,
108
+ children: E.bicLabel
109
+ }), /* @__PURE__ */ p(n, {
110
+ id: `${D}-bic`,
111
+ value: v.bic,
112
+ onChange: (e) => S({ bic: e.target.value })
107
113
  })]
108
114
  })]
109
115
  }),
110
- /* @__PURE__ */ p("div", {
116
+ /* @__PURE__ */ m("div", {
111
117
  className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
112
- children: [/* @__PURE__ */ p("div", {
118
+ children: [/* @__PURE__ */ m("div", {
113
119
  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 })
120
+ children: [/* @__PURE__ */ p(r, {
121
+ htmlFor: `${D}-sort-code`,
122
+ children: E.sortCodeLabel
123
+ }), /* @__PURE__ */ p(n, {
124
+ id: `${D}-sort-code`,
125
+ value: v.sortCode,
126
+ onChange: (e) => S({ sortCode: e.target.value })
121
127
  })]
122
- }), /* @__PURE__ */ p("div", {
128
+ }), /* @__PURE__ */ m("div", {
123
129
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
124
130
  children: [
125
- /* @__PURE__ */ f(n, {
126
- htmlFor: `${E}-currency`,
127
- children: T.currencyLabel
128
- }),
129
131
  /* @__PURE__ */ p(r, {
130
- value: _.currency === "" ? void 0 : _.currency,
131
- onValueChange: (e) => x({ currency: e }),
132
- children: [/* @__PURE__ */ f(o, {
133
- id: `${E}-currency`,
132
+ htmlFor: `${D}-currency`,
133
+ children: E.currencyLabel
134
+ }),
135
+ /* @__PURE__ */ m(i, {
136
+ value: v.currency === "" ? void 0 : v.currency,
137
+ onValueChange: (e) => S({ currency: e }),
138
+ children: [/* @__PURE__ */ p(s, {
139
+ id: `${D}-currency`,
134
140
  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, {
141
+ "aria-invalid": !!y?.currency,
142
+ children: /* @__PURE__ */ p(c, { placeholder: E.currencyPlaceholder })
143
+ }), /* @__PURE__ */ p(a, { children: b.map((e) => /* @__PURE__ */ p(o, {
138
144
  value: e.value,
139
145
  children: e.label
140
146
  }, e.value)) })]
141
147
  }),
142
- /* @__PURE__ */ f(l, { message: v?.currency })
148
+ /* @__PURE__ */ p(u, { message: y?.currency })
143
149
  ]
144
150
  })]
145
151
  }),
146
- /* @__PURE__ */ p("div", {
152
+ /* @__PURE__ */ m("div", {
147
153
  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
+ children: [/* @__PURE__ */ p(r, {
155
+ htmlFor: `${D}-country`,
156
+ children: E.countryLabel
157
+ }), /* @__PURE__ */ p(n, {
158
+ id: `${D}-country`,
159
+ value: E.countryValue,
154
160
  disabled: !0,
155
161
  readOnly: !0
156
162
  })]
157
163
  }),
158
- /* @__PURE__ */ p("div", {
164
+ /* @__PURE__ */ m("div", {
159
165
  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
166
+ children: [/* @__PURE__ */ p(e, {
167
+ id: `${D}-default`,
168
+ checked: v.isDefault,
169
+ onCheckedChange: (e) => S({ isDefault: e === !0 })
170
+ }), /* @__PURE__ */ p(r, {
171
+ htmlFor: `${D}-default`,
172
+ children: E.isDefaultLabel
167
173
  })]
168
174
  })
169
175
  ]
170
176
  });
171
177
  }
172
178
  //#endregion
173
- export { m as BankAccountFormSheet, m as default };
179
+ export { h as BankAccountFormSheet, h as default };
@@ -86,7 +86,8 @@ var n = {
86
86
  isDefaultLabel: "Set as default for this currency",
87
87
  cancelButton: "Cancel",
88
88
  createButton: "Add",
89
- saveButton: "Save"
89
+ saveButton: "Save",
90
+ fieldMarkers: e
90
91
  }, c = {
91
92
  title: "Edit address",
92
93
  cancelButton: "Cancel",
@@ -89,6 +89,7 @@ function p({ idPrefix: f, values: p, errors: m, stateOptions: h, onChange: g, la
89
89
  children: [/* @__PURE__ */ u(o, {
90
90
  id: `${f}-state`,
91
91
  "aria-required": !0,
92
+ "aria-invalid": !!m?.state,
92
93
  className: "ttw:w-full",
93
94
  children: /* @__PURE__ */ u(s, { placeholder: v.statePlaceholder })
94
95
  }), /* @__PURE__ */ u(i, { children: h.map((e) => /* @__PURE__ */ u(a, {
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.5.56", n = "a38dec9e868e238fed2e7599b00b71fd6c5c2313", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.59", n = "cdb1defe4a957ae12e2679514e5d847916c687d9", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -0,0 +1,17 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/shared/util/dist/lib/parseCalendarDate.js
2
+ var e = /^(\d{4})-(\d{2})-(\d{2})$/;
3
+ function t(t) {
4
+ if (!t) return;
5
+ let n = e.exec(t);
6
+ if (!n) return;
7
+ let r = Number(n[1]), i = Number(n[2]) - 1, a = Number(n[3]), o = new Date(r, i, a);
8
+ if (o.getFullYear() === r && o.getMonth() === i && o.getDate() === a) return o;
9
+ }
10
+ function n(n) {
11
+ if (!n) return;
12
+ if (e.test(n)) return t(n);
13
+ let r = new Date(n);
14
+ return Number.isNaN(r.getTime()) ? void 0 : r;
15
+ }
16
+ //#endregion
17
+ export { t as parseCalendarDate, n as parseDateOrTimestamp };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.56",
3
+ "version": "0.5.59",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {