@tesouro/embedded-components-react 0.3.58 → 0.3.60

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 (79) hide show
  1. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +1 -1
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +2 -2
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +2 -2
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +6 -2
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +4 -3
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +105 -93
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +2 -2
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +220 -82
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +8 -6
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +4 -4
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +2 -2
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +37 -37
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +112 -90
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +1 -0
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +10 -152
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +160 -2
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +2 -4
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +2 -39
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +41 -2
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +2 -7
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +5 -90
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +92 -2
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +2 -4
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -14
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +16 -2
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +1 -83
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +79 -261
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +262 -9
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +13 -1
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -8
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +6 -37
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +39 -2
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +2 -39
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +36 -9
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +10 -199
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +201 -3
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +3 -17
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +15 -345
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +345 -8
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +6 -4
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +6 -91
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +93 -0
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +2 -121
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +118 -23
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +24 -87
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +89 -2
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +2 -7
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +5 -28
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +30 -2
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +2 -7
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +5 -32
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +34 -2
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +2 -12
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +10 -104
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +105 -1
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +2 -17
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +15 -123
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +125 -2
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +2 -18
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +14 -6
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +7 -167
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +170 -2
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +2 -14
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +11 -105
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +108 -2
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +2 -10
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +8 -45
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +47 -2
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +2 -0
  77. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  78. package/package.json +1 -1
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +0 -2
@@ -4,32 +4,39 @@ import { useId as v } from "react";
4
4
  import { jsx as y, jsxs as b } from "react/jsx-runtime";
5
5
  import { CircleAlert as x, Minus as S, Plus as C, Trash2 as w, X as T } from "lucide-react";
6
6
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js
7
- function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMessage: k, discount: A, onDiscountChange: j, tax: M, onTaxChange: N, total: P, onTotalChange: F, onAddLineItem: I, errors: L, disabled: R, testId: z, labels: B }) {
8
- let V = {
7
+ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMessage: k, discount: A, onDiscountChange: j, tax: M, onTaxChange: N, total: P, onTotalChange: F, onAddLineItem: I, errors: L, totalsErrors: R, disabled: z, testId: B, labels: V }) {
8
+ let H = {
9
9
  ..._,
10
- ...B
11
- }, H = v(), U = E.length > 1, W = k ? `${H}-gl-code-unavailable` : void 0;
10
+ ...V
11
+ }, U = v(), W = E.length > 1, G = k ? `${U}-gl-code-unavailable` : void 0, K = (e) => `${U}-${e}-error`, q = (e) => {
12
+ let t = R?.[e];
13
+ return t ? /* @__PURE__ */ y("p", {
14
+ id: K(e),
15
+ className: "ttw:text-sm ttw:text-destructive ttw:text-right",
16
+ children: t
17
+ }) : null;
18
+ };
12
19
  return /* @__PURE__ */ b("section", {
13
20
  className: "ttw:flex ttw:flex-col ttw:gap-3",
14
- "data-testid": z,
21
+ "data-testid": B,
15
22
  children: [
16
23
  /* @__PURE__ */ y(h, {
17
24
  component: "h2",
18
25
  variant: "h6",
19
26
  className: "ttw:font-semibold",
20
- children: V.heading
27
+ children: H.heading
21
28
  }),
22
29
  /* @__PURE__ */ y("p", {
23
30
  className: "ttw:text-sm ttw:text-muted-foreground",
24
- children: V.helpText
31
+ children: H.helpText
25
32
  }),
26
33
  k ? /* @__PURE__ */ y("span", {
27
- id: W,
34
+ id: G,
28
35
  className: "ttw:sr-only",
29
36
  children: k
30
37
  }) : null,
31
38
  E.map((h, _) => {
32
- let v = `${H}-${h.id}`, E = L?.[h.id], A = (e) => `${v}-${e}-error`, j = (e) => E?.[e], M = (e) => {
39
+ let v = `${U}-${h.id}`, E = L?.[h.id], A = (e) => `${v}-${e}-error`, j = (e) => E?.[e], M = (e) => {
33
40
  let t = j(e);
34
41
  return t ? /* @__PURE__ */ y("p", {
35
42
  id: A(e),
@@ -46,19 +53,19 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
46
53
  className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
47
54
  children: [/* @__PURE__ */ b("div", {
48
55
  className: "ttw:flex ttw:items-center ttw:gap-2",
49
- children: [U ? /* @__PURE__ */ b("span", {
56
+ children: [W ? /* @__PURE__ */ b("span", {
50
57
  className: "ttw:text-sm ttw:text-muted-foreground",
51
58
  children: [_ + 1, "."]
52
59
  }) : null, /* @__PURE__ */ y(a, {
53
60
  htmlFor: `${v}-description`,
54
- children: V.description
61
+ children: H.description
55
62
  })]
56
- }), U ? /* @__PURE__ */ y(e, {
63
+ }), W ? /* @__PURE__ */ y(e, {
57
64
  type: "button",
58
65
  variant: "ghost",
59
66
  size: "icon",
60
- disabled: R,
61
- "aria-label": V.removeLineItem(_ + 1),
67
+ disabled: z,
68
+ "aria-label": H.removeLineItem(_ + 1),
62
69
  onClick: h.onRemove,
63
70
  children: /* @__PURE__ */ y(w, { className: "ttw:size-4" })
64
71
  }) : null]
@@ -67,9 +74,9 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
67
74
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
68
75
  children: [/* @__PURE__ */ y(t, {
69
76
  id: `${v}-description`,
70
- placeholder: V.descriptionPlaceholder,
77
+ placeholder: H.descriptionPlaceholder,
71
78
  value: h.description,
72
- disabled: R,
79
+ disabled: z,
73
80
  "aria-invalid": j("description") ? !0 : void 0,
74
81
  "aria-describedby": j("description") ? A("description") : void 0,
75
82
  onChange: (e) => h.onChange({ description: e.target.value })
@@ -85,7 +92,7 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
85
92
  className: "ttw:flex ttw:items-center ttw:gap-1",
86
93
  children: [/* @__PURE__ */ y(a, {
87
94
  htmlFor: `${v}-gl-code`,
88
- children: V.glCode
95
+ children: H.glCode
89
96
  }), k ? /* @__PURE__ */ y(p, { children: /* @__PURE__ */ b(d, { children: [/* @__PURE__ */ y(m, {
90
97
  type: "button",
91
98
  className: "ttw:inline-flex ttw:shrink-0 ttw:cursor-help ttw:text-muted-foreground",
@@ -97,23 +104,23 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
97
104
  className: "ttw:relative",
98
105
  children: [/* @__PURE__ */ b(o, {
99
106
  value: h.glCode,
100
- disabled: R || O,
107
+ disabled: z || O,
101
108
  onValueChange: (e) => h.onChange({ glCode: e }),
102
109
  children: [/* @__PURE__ */ y(l, {
103
110
  id: `${v}-gl-code`,
104
111
  className: g("ttw:w-full", h.glCode && "ttw:[&>svg:last-child]:hidden!"),
105
112
  "aria-invalid": j("glCode") ? !0 : void 0,
106
- "aria-describedby": [j("glCode") ? A("glCode") : null, W].filter(Boolean).join(" ") || void 0,
107
- children: /* @__PURE__ */ y(u, { placeholder: V.glCodePlaceholder })
113
+ "aria-describedby": [j("glCode") ? A("glCode") : null, G].filter(Boolean).join(" ") || void 0,
114
+ children: /* @__PURE__ */ y(u, { placeholder: H.glCodePlaceholder })
108
115
  }), /* @__PURE__ */ y(s, { children: D.map((e) => /* @__PURE__ */ y(c, {
109
116
  value: e.value,
110
117
  children: e.label
111
118
  }, e.value)) })]
112
- }), h.glCode && !(R || O) ? /* @__PURE__ */ y(e, {
119
+ }), h.glCode && !(z || O) ? /* @__PURE__ */ y(e, {
113
120
  type: "button",
114
121
  variant: "ghost",
115
122
  size: "icon-sm",
116
- "aria-label": V.glCodeClear,
123
+ "aria-label": H.glCodeClear,
117
124
  className: "ttw:absolute ttw:top-1/2 ttw:right-1 ttw:-translate-y-1/2",
118
125
  onPointerDown: (e) => {
119
126
  e.preventDefault(), e.stopPropagation();
@@ -135,7 +142,7 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
135
142
  children: [
136
143
  /* @__PURE__ */ y(a, {
137
144
  htmlFor: `${v}-quantity`,
138
- children: V.quantity
145
+ children: H.quantity
139
146
  }),
140
147
  /* @__PURE__ */ b(n, {
141
148
  className: "ttw:h-9 ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs ttw:has-[:focus-visible]:border-ring ttw:has-[:focus-visible]:ring-[3px] ttw:has-[:focus-visible]:ring-ring/50 ttw:has-[[aria-invalid=true]]:border-destructive ttw:has-[[aria-invalid=true]]:ring-destructive/20",
@@ -145,8 +152,8 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
145
152
  variant: "ghost",
146
153
  size: "icon",
147
154
  className: "ttw:h-full ttw:shrink-0 ttw:rounded-r-none",
148
- disabled: R,
149
- "aria-label": V.decreaseQuantity(_ + 1),
155
+ disabled: z,
156
+ "aria-label": H.decreaseQuantity(_ + 1),
150
157
  onClick: () => h.onQuantityStep(-1),
151
158
  children: /* @__PURE__ */ y(S, { className: "ttw:size-3.5" })
152
159
  }),
@@ -155,7 +162,7 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
155
162
  inputMode: "decimal",
156
163
  className: "ttw:min-w-0 ttw:flex-1 ttw:rounded-none ttw:border-0 ttw:text-center ttw:shadow-none ttw:focus-visible:ring-0",
157
164
  value: h.quantity,
158
- disabled: R,
165
+ disabled: z,
159
166
  "aria-invalid": j("quantity") ? !0 : void 0,
160
167
  "aria-describedby": j("quantity") ? A("quantity") : void 0,
161
168
  onChange: (e) => h.onChange({ quantity: e.target.value })
@@ -165,8 +172,8 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
165
172
  variant: "ghost",
166
173
  size: "icon",
167
174
  className: "ttw:h-full ttw:shrink-0 ttw:rounded-l-none",
168
- disabled: R,
169
- "aria-label": V.increaseQuantity(_ + 1),
175
+ disabled: z,
176
+ "aria-label": H.increaseQuantity(_ + 1),
170
177
  onClick: () => h.onQuantityStep(1),
171
178
  children: /* @__PURE__ */ y(C, { className: "ttw:size-3.5" })
172
179
  })
@@ -180,19 +187,19 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
180
187
  children: [
181
188
  /* @__PURE__ */ y(a, {
182
189
  htmlFor: `${v}-price`,
183
- children: V.price
190
+ children: H.price
184
191
  }),
185
192
  /* @__PURE__ */ b(n, { children: [/* @__PURE__ */ y(r, {
186
193
  align: "inline-start",
187
194
  "aria-hidden": !0,
188
- children: V.currencySymbol
195
+ children: H.currencySymbol
189
196
  }), /* @__PURE__ */ y(i, {
190
197
  id: `${v}-price`,
191
198
  "data-has-start-addon": !0,
192
199
  inputMode: "decimal",
193
200
  className: "ttw:text-right ttw:aria-invalid:border-destructive ttw:aria-invalid:ring-destructive/20",
194
201
  value: h.price,
195
- disabled: R,
202
+ disabled: z,
196
203
  "aria-invalid": j("price") ? !0 : void 0,
197
204
  "aria-describedby": j("price") ? A("price") : void 0,
198
205
  onChange: (e) => h.onChange({ price: e.target.value })
@@ -205,19 +212,19 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
205
212
  children: [
206
213
  /* @__PURE__ */ y(a, {
207
214
  htmlFor: `${v}-amount`,
208
- children: V.amount
215
+ children: H.amount
209
216
  }),
210
217
  /* @__PURE__ */ b(n, { children: [/* @__PURE__ */ y(r, {
211
218
  align: "inline-start",
212
219
  "aria-hidden": !0,
213
- children: V.currencySymbol
220
+ children: H.currencySymbol
214
221
  }), /* @__PURE__ */ y(i, {
215
222
  id: `${v}-amount`,
216
223
  "data-has-start-addon": !0,
217
224
  inputMode: "decimal",
218
225
  className: "ttw:text-right ttw:aria-invalid:border-destructive ttw:aria-invalid:ring-destructive/20",
219
226
  value: h.amount,
220
- disabled: R,
227
+ disabled: z,
221
228
  "aria-invalid": j("amount") ? !0 : void 0,
222
229
  "aria-describedby": j("amount") ? A("amount") : void 0,
223
230
  onChange: (e) => h.onChange({ amount: e.target.value })
@@ -234,79 +241,94 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
234
241
  /* @__PURE__ */ y(e, {
235
242
  type: "button",
236
243
  variant: "link",
237
- disabled: R,
244
+ disabled: z,
238
245
  className: "ttw:self-start",
239
246
  onClick: I,
240
- children: V.addLineItem
247
+ children: H.addLineItem
241
248
  }),
242
249
  /* @__PURE__ */ b("div", {
243
250
  className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:border-t ttw:border-border ttw:pt-3",
244
251
  children: [
245
252
  /* @__PURE__ */ b("div", {
246
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
253
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
247
254
  children: [/* @__PURE__ */ y(a, {
248
- htmlFor: `${H}-discount`,
249
- children: V.discount
250
- }), /* @__PURE__ */ b(n, {
251
- className: "ttw:w-36",
252
- children: [/* @__PURE__ */ y(r, {
253
- align: "inline-start",
254
- "aria-hidden": !0,
255
- children: V.currencySymbol
256
- }), /* @__PURE__ */ y(i, {
257
- id: `${H}-discount`,
258
- "data-has-start-addon": !0,
259
- inputMode: "decimal",
260
- className: "ttw:text-right",
261
- value: A,
262
- disabled: R,
263
- onChange: (e) => j(e.target.value)
264
- })]
255
+ htmlFor: `${U}-discount`,
256
+ children: H.discount
257
+ }), /* @__PURE__ */ b("div", {
258
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
259
+ children: [/* @__PURE__ */ b(n, {
260
+ className: "ttw:w-36",
261
+ children: [/* @__PURE__ */ y(r, {
262
+ align: "inline-start",
263
+ "aria-hidden": !0,
264
+ children: H.currencySymbol
265
+ }), /* @__PURE__ */ y(i, {
266
+ id: `${U}-discount`,
267
+ "data-has-start-addon": !0,
268
+ inputMode: "decimal",
269
+ className: "ttw:text-right ttw:aria-invalid:border-destructive ttw:aria-invalid:ring-destructive/20",
270
+ value: A,
271
+ disabled: z,
272
+ "aria-invalid": R?.discount ? !0 : void 0,
273
+ "aria-describedby": R?.discount ? K("discount") : void 0,
274
+ onChange: (e) => j(e.target.value)
275
+ })]
276
+ }), q("discount")]
265
277
  })]
266
278
  }),
267
279
  /* @__PURE__ */ b("div", {
268
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
280
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
269
281
  children: [/* @__PURE__ */ y(a, {
270
- htmlFor: `${H}-tax`,
271
- children: V.tax
272
- }), /* @__PURE__ */ b(n, {
273
- className: "ttw:w-36",
274
- children: [/* @__PURE__ */ y(r, {
275
- align: "inline-start",
276
- "aria-hidden": !0,
277
- children: V.currencySymbol
278
- }), /* @__PURE__ */ y(i, {
279
- id: `${H}-tax`,
280
- "data-has-start-addon": !0,
281
- inputMode: "decimal",
282
- className: "ttw:text-right",
283
- value: M,
284
- disabled: R,
285
- onChange: (e) => N(e.target.value)
286
- })]
282
+ htmlFor: `${U}-tax`,
283
+ children: H.tax
284
+ }), /* @__PURE__ */ b("div", {
285
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
286
+ children: [/* @__PURE__ */ b(n, {
287
+ className: "ttw:w-36",
288
+ children: [/* @__PURE__ */ y(r, {
289
+ align: "inline-start",
290
+ "aria-hidden": !0,
291
+ children: H.currencySymbol
292
+ }), /* @__PURE__ */ y(i, {
293
+ id: `${U}-tax`,
294
+ "data-has-start-addon": !0,
295
+ inputMode: "decimal",
296
+ className: "ttw:text-right ttw:aria-invalid:border-destructive ttw:aria-invalid:ring-destructive/20",
297
+ value: M,
298
+ disabled: z,
299
+ "aria-invalid": R?.tax ? !0 : void 0,
300
+ "aria-describedby": R?.tax ? K("tax") : void 0,
301
+ onChange: (e) => N(e.target.value)
302
+ })]
303
+ }), q("tax")]
287
304
  })]
288
305
  }),
289
306
  /* @__PURE__ */ b("div", {
290
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
307
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
291
308
  children: [/* @__PURE__ */ y(a, {
292
- htmlFor: `${H}-total`,
309
+ htmlFor: `${U}-total`,
293
310
  className: "ttw:font-semibold",
294
- children: V.totalAmount
295
- }), /* @__PURE__ */ b(n, {
296
- className: "ttw:w-36",
297
- children: [/* @__PURE__ */ y(r, {
298
- align: "inline-start",
299
- "aria-hidden": !0,
300
- children: V.currencySymbol
301
- }), /* @__PURE__ */ y(i, {
302
- id: `${H}-total`,
303
- "data-has-start-addon": !0,
304
- inputMode: "decimal",
305
- className: "ttw:text-right ttw:font-semibold",
306
- value: P,
307
- disabled: R,
308
- onChange: (e) => F(e.target.value)
309
- })]
311
+ children: H.totalAmount
312
+ }), /* @__PURE__ */ b("div", {
313
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
314
+ children: [/* @__PURE__ */ b(n, {
315
+ className: "ttw:w-36",
316
+ children: [/* @__PURE__ */ y(r, {
317
+ align: "inline-start",
318
+ "aria-hidden": !0,
319
+ children: H.currencySymbol
320
+ }), /* @__PURE__ */ y(i, {
321
+ id: `${U}-total`,
322
+ "data-has-start-addon": !0,
323
+ inputMode: "decimal",
324
+ className: "ttw:text-right ttw:font-semibold ttw:aria-invalid:border-destructive ttw:aria-invalid:ring-destructive/20",
325
+ value: P,
326
+ disabled: z,
327
+ "aria-invalid": R?.total ? !0 : void 0,
328
+ "aria-describedby": R?.total ? K("total") : void 0,
329
+ onChange: (e) => F(e.target.value)
330
+ })]
331
+ }), q("total")]
310
332
  })]
311
333
  })
312
334
  ]
@@ -25,6 +25,7 @@ function o(o) {
25
25
  };
26
26
  return /* @__PURE__ */ a("section", {
27
27
  className: "ttw:flex ttw:flex-col ttw:gap-3",
28
+ "data-invalid": l ? !0 : void 0,
28
29
  "data-testid": u,
29
30
  children: [
30
31
  /* @__PURE__ */ i(e, {
@@ -1,155 +1,13 @@
1
- import { Button as e, Dialog as t, DialogContent as n, DialogDescription as r, DialogHeader as i, DialogTitle as a, DropdownMenu as o, DropdownMenuContent as s, DropdownMenuItem as c, DropdownMenuTrigger as l } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { InlineErrorAlert as u } from "../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
3
- import "../../../shared/ui/dist/index.js";
4
- import { BillDetailBody as d } from "./index26.js";
5
- import "./index27.js";
6
- import { BillFormFields as f } from "./index29.js";
7
- import "./index30.js";
8
- import { LineItemsSection as p } from "./index32.js";
9
- import "./index33.js";
10
- import { VendorSection as m } from "./index41.js";
11
- import "./index42.js";
12
- import { mergeBillCreateScreenLabels as h } from "./index43.js";
13
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
14
- import { Minimize2 as y, MoreVertical as b, X as x } from "lucide-react";
1
+ import { useEffect as e, useRef as t } from "react";
15
2
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js
16
- function S({ open: S, onOpenChange: C, title: w, subtitle: T, notice: E, vendor: D, values: O, errors: k, onChange: A, lineItems: j, documentPanel: M, menuItems: N, readOnly: P, detail: F, isLineItemsLoading: I, isSaving: L, isSavingDraft: R, isFinalizing: z, showFinalize: B = !0, onCancel: V, onCollapse: H, onSaveDraft: U, onFinalize: W, testId: G, labels: K }) {
17
- let q = h(K), J = !!(P && F);
18
- return /* @__PURE__ */ _(t, {
19
- open: S,
20
- onOpenChange: C,
21
- children: /* @__PURE__ */ v(n, {
22
- showCloseButton: !1,
23
- className: "ttw:flex ttw:h-[calc(100vh-3rem)] ttw:w-[calc(100vw-3rem)] ttw:max-w-[calc(100vw-3rem)] ttw:flex-col ttw:gap-0 ttw:p-0",
24
- "data-testid": G,
25
- children: [
26
- /* @__PURE__ */ v(i, {
27
- className: "ttw:flex ttw:flex-row ttw:items-start ttw:justify-between ttw:border-b ttw:border-border ttw:px-6 ttw:py-4",
28
- children: [/* @__PURE__ */ v("div", {
29
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
30
- children: [
31
- /* @__PURE__ */ _(a, {
32
- className: "ttw:text-xl ttw:font-semibold",
33
- children: w
34
- }),
35
- T ? /* @__PURE__ */ _("p", {
36
- className: "ttw:text-sm ttw:text-muted-foreground",
37
- children: T
38
- }) : null,
39
- /* @__PURE__ */ _(r, {
40
- className: "ttw:sr-only",
41
- children: q.hiddenDescription
42
- })
43
- ]
44
- }), /* @__PURE__ */ v("div", {
45
- className: "ttw:flex ttw:items-center ttw:gap-1",
46
- children: [
47
- H ? /* @__PURE__ */ _(e, {
48
- type: "button",
49
- variant: "ghost",
50
- size: "icon",
51
- "aria-label": q.collapseButton,
52
- disabled: L,
53
- onClick: H,
54
- children: /* @__PURE__ */ _(y, { className: "ttw:size-4" })
55
- }) : null,
56
- N && N.length > 0 ? /* @__PURE__ */ v(o, { children: [/* @__PURE__ */ _(l, {
57
- asChild: !0,
58
- children: /* @__PURE__ */ _(e, {
59
- type: "button",
60
- variant: "ghost",
61
- size: "icon",
62
- "aria-label": q.menuTrigger,
63
- disabled: L,
64
- children: /* @__PURE__ */ _(b, { className: "ttw:size-4" })
65
- })
66
- }), /* @__PURE__ */ _(s, {
67
- align: "end",
68
- children: N.map((e) => /* @__PURE__ */ _(c, {
69
- variant: e.destructive ? "destructive" : void 0,
70
- disabled: e.disabled,
71
- onSelect: e.onSelect,
72
- children: e.label
73
- }, e.id))
74
- })] }) : null,
75
- /* @__PURE__ */ _(e, {
76
- type: "button",
77
- variant: "ghost",
78
- size: "icon",
79
- "aria-label": q.closeButton,
80
- disabled: L,
81
- onClick: V,
82
- children: /* @__PURE__ */ _(x, { className: "ttw:size-4" })
83
- })
84
- ]
85
- })]
86
- }),
87
- /* @__PURE__ */ v("div", {
88
- className: "ttw:grid ttw:flex-1 ttw:grid-cols-2 ttw:overflow-hidden",
89
- children: [/* @__PURE__ */ v("div", {
90
- className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:overflow-y-auto ttw:px-6 ttw:py-6",
91
- children: [
92
- k?.form ? /* @__PURE__ */ _(u, { children: k.form }) : null,
93
- E ? /* @__PURE__ */ _("div", {
94
- className: "ttw:flex ttw:flex-col ttw:gap-3",
95
- children: E
96
- }) : null,
97
- J ? /* @__PURE__ */ _(d, {
98
- ...F,
99
- labels: q.detailBody
100
- }) : /* @__PURE__ */ v(g, { children: [
101
- /* @__PURE__ */ _(m, {
102
- ...D,
103
- onEdit: P ? void 0 : D.onEdit,
104
- onClear: P ? void 0 : D.onClear,
105
- disabled: P,
106
- labels: q.vendorSection
107
- }),
108
- /* @__PURE__ */ _(f, {
109
- values: O,
110
- errors: k,
111
- onChange: A,
112
- disabled: P,
113
- labels: q.detailsFields
114
- }),
115
- /* @__PURE__ */ _(p, {
116
- ...j,
117
- disabled: j.disabled || I || P,
118
- labels: q.lineItems
119
- })
120
- ] })
121
- ]
122
- }), /* @__PURE__ */ _("div", {
123
- className: "ttw:overflow-y-auto ttw:bg-muted/30 ttw:px-6 ttw:py-6",
124
- children: M
125
- })]
126
- }),
127
- J ? null : /* @__PURE__ */ v("div", {
128
- className: "ttw:flex ttw:justify-end ttw:gap-2 ttw:border-t ttw:border-border ttw:px-6 ttw:py-4",
129
- children: [/* @__PURE__ */ _(e, {
130
- type: "button",
131
- variant: "ghost",
132
- disabled: L,
133
- onClick: V,
134
- children: P ? q.closeButton : q.cancelButton
135
- }), P ? null : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(e, {
136
- type: "button",
137
- variant: B ? "secondary" : "default",
138
- onClick: U,
139
- loading: R,
140
- disabled: L || z || I || D.mode === "creating",
141
- children: q.saveDraftButton
142
- }), B ? /* @__PURE__ */ _(e, {
143
- type: "button",
144
- onClick: W,
145
- loading: z,
146
- disabled: L || R || I || D.mode === "creating",
147
- children: q.finalizeButton
148
- }) : null] })]
149
- })
150
- ]
151
- })
152
- });
3
+ function n(n) {
4
+ let r = t(null), i = t(n);
5
+ return e(() => {
6
+ if (n === i.current) return;
7
+ i.current = n;
8
+ let e = r.current?.querySelector("[aria-invalid=\"true\"], [data-invalid=\"true\"]");
9
+ e?.scrollIntoView({ block: "center" }), e?.focus({ preventScroll: !0 });
10
+ }, [n]), r;
153
11
  }
154
12
  //#endregion
155
- export { S as BillCreateScreen, S as default };
13
+ export { n as useFocusFirstInvalidField };