@tesouro/embedded-components-react 0.4.12 → 0.4.13

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 (104) 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/index39.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +127 -122
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +4 -4
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +2 -2
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +42 -41
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +2 -0
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +2 -5
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +12 -62
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +12 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +16 -12
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -12
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +2 -16
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +30 -2
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -4
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +46 -26
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +296 -1
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +1 -50
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +7 -300
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +49 -2
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +2 -9
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +14 -45
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +50 -2
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +2 -23
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +21 -338
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +340 -2
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -16
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +13 -117
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +120 -2
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +2 -12
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +10 -97
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +99 -2
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +1 -12
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +11 -57
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +58 -1
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +1 -54
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +52 -10
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +10 -157
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +181 -1
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +2 -4
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +2 -39
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +41 -2
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -7
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +5 -90
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +92 -2
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -4
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +2 -14
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +16 -2
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +1 -85
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +83 -284
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +283 -9
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +13 -1
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +1 -8
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +6 -37
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +39 -2
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +2 -39
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +36 -9
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +10 -199
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +201 -3
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +3 -17
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +15 -345
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +345 -8
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +6 -4
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +6 -91
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +93 -0
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +2 -127
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +125 -26
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +26 -87
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +89 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +2 -7
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +5 -28
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +30 -2
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +2 -7
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +5 -32
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +34 -2
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -12
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +10 -104
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +105 -1
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +2 -17
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +15 -123
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +125 -2
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +2 -18
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +14 -6
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +7 -167
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +170 -2
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +2 -14
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +11 -105
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +108 -2
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +2 -10
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +8 -50
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +52 -2
  102. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  103. package/package.json +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +0 -2
@@ -1,2 +1,49 @@
1
- import "./index25.js";
2
- import "./index26.js";
1
+ import { Input as e, Label as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { BILL_FORM_FIELDS_LABELS_EN as n } from "./index26.js";
3
+ import { useId as r } from "react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js
6
+ function o({ values: o, errors: s, onChange: c, disabled: l, testId: u, labels: d }) {
7
+ let f = {
8
+ ...n,
9
+ ...d
10
+ }, p = r(), m = (n, r, u) => {
11
+ let d = `${p}-${n}`, f = `${d}-error`, m = s?.[n];
12
+ return /* @__PURE__ */ a("div", {
13
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
14
+ children: [
15
+ /* @__PURE__ */ i(t, {
16
+ htmlFor: d,
17
+ children: r
18
+ }),
19
+ /* @__PURE__ */ i(e, {
20
+ id: d,
21
+ type: u,
22
+ value: o[n],
23
+ disabled: l,
24
+ "aria-invalid": m ? !0 : void 0,
25
+ "aria-describedby": m ? f : void 0,
26
+ onChange: (e) => c({ [n]: e.target.value })
27
+ }),
28
+ m ? /* @__PURE__ */ i("p", {
29
+ id: f,
30
+ className: "ttw:text-sm ttw:text-destructive",
31
+ children: m
32
+ }) : null
33
+ ]
34
+ });
35
+ };
36
+ return /* @__PURE__ */ a("div", {
37
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
38
+ "data-testid": u,
39
+ children: [/* @__PURE__ */ a("div", {
40
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
41
+ children: [m("invoiceDate", f.invoiceDate, "date"), m("dueDate", f.dueDate, "date")]
42
+ }), /* @__PURE__ */ a("div", {
43
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
44
+ children: [m("invoiceNumber", f.invoiceNumber), m("poNumber", f.poNumber)]
45
+ })]
46
+ });
47
+ }
48
+ //#endregion
49
+ export { o as BillFormFields, o as default };
@@ -1,9 +1,2 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js
2
- var e = {
3
- invoiceNumber: "Invoice number",
4
- invoiceDate: "Invoice date",
5
- dueDate: "Due date",
6
- poNumber: "PO number (optional)"
7
- };
8
- //#endregion
9
- export { e as BILL_FORM_FIELDS_LABELS_EN };
1
+ import "./index26.js";
2
+ import "./index27.js";
@@ -1,49 +1,18 @@
1
- import { Input as e, Label as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { BILL_FORM_FIELDS_LABELS_EN as n } from "./index28.js";
3
- import { useId as r } from "react";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js
6
- function o({ values: o, errors: s, onChange: c, disabled: l, testId: u, labels: d }) {
7
- let f = {
8
- ...n,
9
- ...d
10
- }, p = r(), m = (n, r, u) => {
11
- let d = `${p}-${n}`, f = `${d}-error`, m = s?.[n];
12
- return /* @__PURE__ */ a("div", {
13
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
14
- children: [
15
- /* @__PURE__ */ i(t, {
16
- htmlFor: d,
17
- children: r
18
- }),
19
- /* @__PURE__ */ i(e, {
20
- id: d,
21
- type: u,
22
- value: o[n],
23
- disabled: l,
24
- "aria-invalid": m ? !0 : void 0,
25
- "aria-describedby": m ? f : void 0,
26
- onChange: (e) => c({ [n]: e.target.value })
27
- }),
28
- m ? /* @__PURE__ */ i("p", {
29
- id: f,
30
- className: "ttw:text-sm ttw:text-destructive",
31
- children: m
32
- }) : null
33
- ]
2
+ function e(e) {
3
+ let t = [];
4
+ for (let n of e) {
5
+ let e = t.at(-1);
6
+ if (e && e.heading === n.sectionHeading) {
7
+ e.items = [...e.items, n];
8
+ continue;
9
+ }
10
+ t.push({
11
+ heading: n.sectionHeading,
12
+ items: [n]
34
13
  });
35
- };
36
- return /* @__PURE__ */ a("div", {
37
- className: "ttw:flex ttw:flex-col ttw:gap-4",
38
- "data-testid": u,
39
- children: [/* @__PURE__ */ a("div", {
40
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
41
- children: [m("invoiceDate", f.invoiceDate, "date"), m("dueDate", f.dueDate, "date")]
42
- }), /* @__PURE__ */ a("div", {
43
- className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
44
- children: [m("invoiceNumber", f.invoiceNumber), m("poNumber", f.poNumber)]
45
- })]
46
- });
14
+ }
15
+ return t;
47
16
  }
48
17
  //#endregion
49
- export { o as BillFormFields, o as default };
18
+ export { e as groupBySectionHeading };
@@ -1,2 +1,50 @@
1
- import "./index28.js";
2
- import "./index29.js";
1
+ import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuGroup as r, DropdownMenuItem as i, DropdownMenuLabel as a, DropdownMenuSeparator as o, DropdownMenuTrigger as s } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { groupBySectionHeading as c } from "./index29.js";
3
+ import { Fragment as l, useId as u } from "react";
4
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
+ import { MoreHorizontalIcon as p, MoreVerticalIcon as m } from "lucide-react";
6
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js
7
+ function h({ actions: h, triggerLabel: g, placement: _ = "row", testId: v }) {
8
+ let y = u();
9
+ if (!h.length) return null;
10
+ let b = _ === "header", x = b ? p : m, S = c(h);
11
+ return /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d(s, {
12
+ asChild: !0,
13
+ children: /* @__PURE__ */ d(e, {
14
+ type: "button",
15
+ variant: b ? "ghost" : "outline",
16
+ size: "icon",
17
+ "aria-label": g,
18
+ "data-testid": v,
19
+ children: /* @__PURE__ */ d(x, { className: "ttw:size-4" })
20
+ })
21
+ }), /* @__PURE__ */ d(n, {
22
+ align: "end",
23
+ children: S.map((e, t) => {
24
+ let n = e.items.map((e) => {
25
+ let t = e.icon;
26
+ return /* @__PURE__ */ f(i, {
27
+ disabled: e.disabled,
28
+ onClick: e.onSelect,
29
+ children: [t ? /* @__PURE__ */ d(t, { className: "ttw:size-4" }) : null, e.label]
30
+ }, e.id);
31
+ });
32
+ if (!e.heading) return /* @__PURE__ */ d(l, { children: n }, e.items[0]?.id);
33
+ let s = `${y}-${t}`;
34
+ return /* @__PURE__ */ f(l, { children: [
35
+ t > 0 ? /* @__PURE__ */ d(o, {}) : null,
36
+ /* @__PURE__ */ d(a, {
37
+ id: s,
38
+ className: "ttw:py-1 ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
39
+ children: e.heading
40
+ }),
41
+ /* @__PURE__ */ d(r, {
42
+ "aria-labelledby": s,
43
+ children: n
44
+ })
45
+ ] }, e.items[0]?.id);
46
+ })
47
+ })] });
48
+ }
49
+ //#endregion
50
+ export { h as BillOverflowMenu, h as default };
@@ -1,23 +1,2 @@
1
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js
2
- var e = {
3
- heading: "Line items",
4
- helpText: "Enter a single amount for this payment, or split it into line items to assign a GL code to each one.",
5
- description: "Description",
6
- descriptionPlaceholder: "e.g., Office supplies",
7
- glCode: "GL code (optional)",
8
- glCodePlaceholder: "Select",
9
- glCodeClear: "Clear GL code",
10
- quantity: "Quantity",
11
- price: "Price",
12
- amount: "Amount",
13
- currencySymbol: "$",
14
- discount: "Discounts",
15
- tax: "Tax",
16
- totalAmount: "Total amount",
17
- addLineItem: "+ Add line item",
18
- increaseQuantity: (e) => `Increase quantity — line item ${e}`,
19
- decreaseQuantity: (e) => `Decrease quantity — line item ${e}`,
20
- removeLineItem: (e) => `Remove line item ${e}`
21
- };
22
- //#endregion
23
- export { e as LINE_ITEMS_SECTION_LABELS_EN };
1
+ import "./index29.js";
2
+ import "./index30.js";
@@ -1,340 +1,23 @@
1
- import { Button as e, Input as t, InputGroup as n, InputGroupAddon as r, InputGroupInput as i, Label as a, Select as o, SelectContent as s, SelectItem as c, SelectTrigger as l, SelectValue as u, Tooltip as d, TooltipContent as f, TooltipProvider as p, TooltipTrigger as m, Typography as h, cn as g } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { LINE_ITEMS_SECTION_LABELS_EN as _ } from "./index31.js";
3
- import { useId as v } from "react";
4
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
5
- import { CircleAlert as x, Minus as S, Plus as C, Trash2 as w, X as T } from "lucide-react";
6
1
  //#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, totalsErrors: R, disabled: z, testId: B, labels: V }) {
8
- let H = {
9
- ..._,
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
- };
19
- return /* @__PURE__ */ b("section", {
20
- className: "ttw:flex ttw:flex-col ttw:gap-3",
21
- "data-testid": B,
22
- children: [
23
- /* @__PURE__ */ y(h, {
24
- component: "h2",
25
- variant: "h6",
26
- className: "ttw:font-semibold",
27
- children: H.heading
28
- }),
29
- /* @__PURE__ */ y("p", {
30
- className: "ttw:text-sm ttw:text-muted-foreground",
31
- children: H.helpText
32
- }),
33
- k ? /* @__PURE__ */ y("span", {
34
- id: G,
35
- className: "ttw:sr-only",
36
- children: k
37
- }) : null,
38
- E.map((h, _) => {
39
- let v = `${U}-${h.id}`, E = L?.[h.id], A = (e) => `${v}-${e}-error`, j = (e) => E?.[e], M = (e) => {
40
- let t = j(e);
41
- return t ? /* @__PURE__ */ y("p", {
42
- id: A(e),
43
- className: "ttw:text-sm ttw:text-destructive",
44
- children: t
45
- }) : null;
46
- };
47
- return /* @__PURE__ */ y("div", {
48
- className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-muted/30 ttw:p-4",
49
- children: /* @__PURE__ */ b("div", {
50
- className: "ttw:@container/line-item ttw:flex ttw:flex-col ttw:gap-3",
51
- children: [
52
- /* @__PURE__ */ b("div", {
53
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
54
- children: [/* @__PURE__ */ b("div", {
55
- className: "ttw:flex ttw:items-center ttw:gap-2",
56
- children: [W ? /* @__PURE__ */ b("span", {
57
- className: "ttw:text-sm ttw:text-muted-foreground",
58
- children: [_ + 1, "."]
59
- }) : null, /* @__PURE__ */ y(a, {
60
- htmlFor: `${v}-description`,
61
- children: H.description
62
- })]
63
- }), W ? /* @__PURE__ */ y(e, {
64
- type: "button",
65
- variant: "ghost",
66
- size: "icon",
67
- disabled: z,
68
- "aria-label": H.removeLineItem(_ + 1),
69
- onClick: h.onRemove,
70
- children: /* @__PURE__ */ y(w, { className: "ttw:size-4" })
71
- }) : null]
72
- }),
73
- /* @__PURE__ */ b("div", {
74
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
75
- children: [/* @__PURE__ */ y(t, {
76
- id: `${v}-description`,
77
- placeholder: H.descriptionPlaceholder,
78
- value: h.description,
79
- disabled: z,
80
- "aria-invalid": j("description") ? !0 : void 0,
81
- "aria-describedby": j("description") ? A("description") : void 0,
82
- onChange: (e) => h.onChange({ description: e.target.value })
83
- }), M("description")]
84
- }),
85
- /* @__PURE__ */ b("div", {
86
- className: "ttw:grid ttw:grid-cols-3 ttw:@lg/line-item:grid-cols-6 ttw:gap-3",
87
- children: [
88
- /* @__PURE__ */ b("div", {
89
- className: "ttw:col-span-3 ttw:flex ttw:flex-col ttw:gap-1.5",
90
- children: [
91
- /* @__PURE__ */ b("div", {
92
- className: "ttw:flex ttw:items-center ttw:gap-1",
93
- children: [/* @__PURE__ */ y(a, {
94
- htmlFor: `${v}-gl-code`,
95
- children: H.glCode
96
- }), k ? /* @__PURE__ */ y(p, { children: /* @__PURE__ */ b(d, { children: [/* @__PURE__ */ y(m, {
97
- type: "button",
98
- className: "ttw:inline-flex ttw:shrink-0 ttw:cursor-help ttw:text-muted-foreground",
99
- "aria-label": k,
100
- children: /* @__PURE__ */ y(x, { className: "ttw:size-3.5" })
101
- }), /* @__PURE__ */ y(f, { children: k })] }) }) : null]
102
- }),
103
- /* @__PURE__ */ b("div", {
104
- className: "ttw:relative",
105
- children: [/* @__PURE__ */ b(o, {
106
- value: h.glCode,
107
- disabled: z || O,
108
- onValueChange: (e) => h.onChange({ glCode: e }),
109
- children: [/* @__PURE__ */ y(l, {
110
- id: `${v}-gl-code`,
111
- className: g("ttw:w-full", h.glCode && "ttw:[&>svg:last-child]:hidden!"),
112
- "aria-invalid": j("glCode") ? !0 : void 0,
113
- "aria-describedby": [j("glCode") ? A("glCode") : null, G].filter(Boolean).join(" ") || void 0,
114
- children: /* @__PURE__ */ y(u, { placeholder: H.glCodePlaceholder })
115
- }), /* @__PURE__ */ y(s, { children: D.map((e) => /* @__PURE__ */ y(c, {
116
- value: e.value,
117
- children: e.label
118
- }, e.value)) })]
119
- }), h.glCode && !(z || O) ? /* @__PURE__ */ y(e, {
120
- type: "button",
121
- variant: "ghost",
122
- size: "icon-sm",
123
- "aria-label": H.glCodeClear,
124
- className: "ttw:absolute ttw:top-1/2 ttw:right-1 ttw:-translate-y-1/2",
125
- onPointerDown: (e) => {
126
- e.preventDefault(), e.stopPropagation();
127
- },
128
- onClick: (e) => {
129
- e.preventDefault(), e.stopPropagation(), h.onChange({ glCode: "" });
130
- },
131
- children: /* @__PURE__ */ y(T, {
132
- className: "ttw:size-4",
133
- "aria-hidden": !0
134
- })
135
- }) : null]
136
- }),
137
- M("glCode")
138
- ]
139
- }),
140
- /* @__PURE__ */ b("div", {
141
- className: "ttw:col-span-1 ttw:flex ttw:flex-col ttw:gap-1.5",
142
- children: [
143
- /* @__PURE__ */ y(a, {
144
- htmlFor: `${v}-quantity`,
145
- children: H.quantity
146
- }),
147
- /* @__PURE__ */ b(n, {
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",
149
- children: [
150
- /* @__PURE__ */ y(e, {
151
- type: "button",
152
- variant: "ghost",
153
- size: "icon",
154
- className: "ttw:h-full ttw:shrink-0 ttw:rounded-r-none",
155
- disabled: z,
156
- "aria-label": H.decreaseQuantity(_ + 1),
157
- onClick: () => h.onQuantityStep(-1),
158
- children: /* @__PURE__ */ y(S, { className: "ttw:size-3.5" })
159
- }),
160
- /* @__PURE__ */ y(i, {
161
- id: `${v}-quantity`,
162
- inputMode: "decimal",
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",
164
- value: h.quantity,
165
- disabled: z,
166
- "aria-invalid": j("quantity") ? !0 : void 0,
167
- "aria-describedby": j("quantity") ? A("quantity") : void 0,
168
- onChange: (e) => h.onChange({ quantity: e.target.value })
169
- }),
170
- /* @__PURE__ */ y(e, {
171
- type: "button",
172
- variant: "ghost",
173
- size: "icon",
174
- className: "ttw:h-full ttw:shrink-0 ttw:rounded-l-none",
175
- disabled: z,
176
- "aria-label": H.increaseQuantity(_ + 1),
177
- onClick: () => h.onQuantityStep(1),
178
- children: /* @__PURE__ */ y(C, { className: "ttw:size-3.5" })
179
- })
180
- ]
181
- }),
182
- M("quantity")
183
- ]
184
- }),
185
- /* @__PURE__ */ b("div", {
186
- className: "ttw:col-span-1 ttw:flex ttw:flex-col ttw:gap-1.5",
187
- children: [
188
- /* @__PURE__ */ y(a, {
189
- htmlFor: `${v}-price`,
190
- children: H.price
191
- }),
192
- /* @__PURE__ */ b(n, { children: [/* @__PURE__ */ y(r, {
193
- align: "inline-start",
194
- "aria-hidden": !0,
195
- children: H.currencySymbol
196
- }), /* @__PURE__ */ y(i, {
197
- id: `${v}-price`,
198
- "data-has-start-addon": !0,
199
- inputMode: "decimal",
200
- className: "ttw:text-right ttw:aria-invalid:border-destructive ttw:aria-invalid:ring-destructive/20",
201
- value: h.price,
202
- disabled: z,
203
- "aria-invalid": j("price") ? !0 : void 0,
204
- "aria-describedby": j("price") ? A("price") : void 0,
205
- onChange: (e) => h.onChange({ price: e.target.value })
206
- })] }),
207
- M("price")
208
- ]
209
- }),
210
- /* @__PURE__ */ b("div", {
211
- className: "ttw:col-span-1 ttw:flex ttw:flex-col ttw:gap-1.5",
212
- children: [
213
- /* @__PURE__ */ y(a, {
214
- htmlFor: `${v}-amount`,
215
- children: H.amount
216
- }),
217
- /* @__PURE__ */ b(n, { children: [/* @__PURE__ */ y(r, {
218
- align: "inline-start",
219
- "aria-hidden": !0,
220
- children: H.currencySymbol
221
- }), /* @__PURE__ */ y(i, {
222
- id: `${v}-amount`,
223
- "data-has-start-addon": !0,
224
- inputMode: "decimal",
225
- className: "ttw:text-right ttw:aria-invalid:border-destructive ttw:aria-invalid:ring-destructive/20",
226
- value: h.amount,
227
- disabled: z,
228
- "aria-invalid": j("amount") ? !0 : void 0,
229
- "aria-describedby": j("amount") ? A("amount") : void 0,
230
- onChange: (e) => h.onChange({ amount: e.target.value })
231
- })] }),
232
- M("amount")
233
- ]
234
- })
235
- ]
236
- })
237
- ]
238
- })
239
- }, h.id);
240
- }),
241
- /* @__PURE__ */ y(e, {
242
- type: "button",
243
- variant: "link",
244
- disabled: z,
245
- className: "ttw:self-start",
246
- onClick: I,
247
- children: H.addLineItem
248
- }),
249
- /* @__PURE__ */ b("div", {
250
- className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:border-t ttw:border-border ttw:pt-3",
251
- children: [
252
- /* @__PURE__ */ b("div", {
253
- className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
254
- children: [/* @__PURE__ */ y(a, {
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")]
277
- })]
278
- }),
279
- /* @__PURE__ */ b("div", {
280
- className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
281
- children: [/* @__PURE__ */ y(a, {
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")]
304
- })]
305
- }),
306
- /* @__PURE__ */ b("div", {
307
- className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
308
- children: [/* @__PURE__ */ y(a, {
309
- htmlFor: `${U}-total`,
310
- className: "ttw:font-semibold",
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")]
332
- })]
333
- })
334
- ]
335
- })
336
- ]
337
- });
338
- }
2
+ var e = {
3
+ heading: "Line items",
4
+ helpText: "Enter a single amount for this payment, or split it into line items to assign a GL code to each one.",
5
+ description: "Description",
6
+ descriptionPlaceholder: "e.g., Office supplies",
7
+ glCode: "GL code (optional)",
8
+ glCodePlaceholder: "Select",
9
+ glCodeClear: "Clear GL code",
10
+ quantity: "Quantity",
11
+ price: "Price",
12
+ amount: "Amount",
13
+ currencySymbol: "$",
14
+ discount: "Discounts",
15
+ tax: "Tax",
16
+ totalAmount: "Total amount",
17
+ addLineItem: "+ Add line item",
18
+ increaseQuantity: (e) => `Increase quantity — line item ${e}`,
19
+ decreaseQuantity: (e) => `Decrease quantity — line item ${e}`,
20
+ removeLineItem: (e) => `Remove line item ${e}`
21
+ };
339
22
  //#endregion
340
- export { E as LineItemsSection, E as default };
23
+ export { e as LINE_ITEMS_SECTION_LABELS_EN };