@tesouro/embedded-components-react 0.5.124 → 0.5.126

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 (68) hide show
  1. package/dist/index.css +6 -0
  2. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +2 -2
  3. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index7.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/data-access/dist/index5.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index13.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +3 -3
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +3 -3
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index3.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index4.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js +2 -2
  23. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +3 -3
  28. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index223.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index396.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index465.js +1 -1
  31. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index547.js +2 -2
  32. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index90.js +6 -6
  33. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/remote-check-capture/ui/dist/index4.js +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index10.js +3 -2
  36. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index11.js +9 -9
  37. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index4.js +58 -7
  38. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index5.js +3 -98
  39. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index6.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index7.js +8 -8
  41. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index8.js +62 -62
  42. package/dist/libs/tesouro-embedded-components-react/settings-widget/tags/feature/dist/index9.js +7 -7
  43. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index16.js +1 -1
  44. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index5.js +1 -1
  45. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApproverOptions.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index12.js +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +1 -1
  48. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/widgetInitChannel.js +2 -2
  50. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  51. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/traceId.js +1 -1
  52. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index.js +4 -3
  53. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index3.js +5 -9
  54. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index4.js +7 -31
  55. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index5.js +7 -8
  56. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index6.js +7 -5
  57. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/data-access/dist/index7.js +33 -0
  58. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/index.js +5 -0
  59. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/TagSelectorField.js +11 -0
  60. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/helpers.js +38 -0
  61. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/labels.js +19 -0
  62. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/permissions.js +4 -0
  63. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/useTagCreateForm.js +6 -0
  64. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index.js +1 -0
  65. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index3.js +30 -30
  66. package/dist/libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index4.js +4 -0
  67. package/dist/packages/shared-ui-shadcn/dist/index.js +1304 -1219
  68. package/package.json +12 -12
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import "../../../../feature/dist/index.js";
6
+ import "./permissions.js";
7
+ import "../../../data-access/dist/index.js";
8
+ import "./useTagCreateForm.js";
9
+ import "../../../ui/dist/index.js";
10
+ import "react";
11
+ import "react/jsx-runtime";
@@ -0,0 +1,38 @@
1
+ import { extractApiErrorMessage as e } from "../../../../util/dist/lib/apiErrors.js";
2
+ import { TAG_CATEGORY_LABELS_EN as t, TAG_MESSAGE_LABELS_EN as n } from "./labels.js";
3
+ //#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/helpers.js
4
+ var r = [
5
+ "document_type",
6
+ "department",
7
+ "project",
8
+ "cost_center",
9
+ "vendor_type",
10
+ "payment_method",
11
+ "approval_status"
12
+ ];
13
+ function i(e, n) {
14
+ return e ? n?.[e] ?? t[e] ?? "" : "";
15
+ }
16
+ function a(e) {
17
+ return r.map((t) => ({
18
+ value: t,
19
+ label: i(t, e)
20
+ }));
21
+ }
22
+ function o(e, t = n) {
23
+ let r = {}, i = e.name.trim();
24
+ i.length === 0 ? r.name = t.nameRequired : i.length > 255 && (r.name = t.nameTooLong);
25
+ let a = e.keywords.some((e) => e.length < 2), o = e.keywords.some((e) => e.length > 25);
26
+ return a ? r.keywords = t.keywordTooShort : o && (r.keywords = t.keywordTooLong), r;
27
+ }
28
+ function s(e) {
29
+ return !!(e.name || e.keywords);
30
+ }
31
+ function c(e) {
32
+ return e === "This tag already exists.";
33
+ }
34
+ function l(t, r = n) {
35
+ return c(e(t)) ? { name: r.duplicateName } : { form: r.genericError };
36
+ }
37
+ //#endregion
38
+ export { r as TAG_CATEGORIES, a as getCategoryOptions, i as getTagCategoryLabel, s as hasFormErrors, c as isDuplicateTagNameError, l as resolveTagSubmitError, o as validateTagForm };
@@ -0,0 +1,19 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/feature/dist/lib/labels.js
2
+ var e = {
3
+ nameRequired: "Required",
4
+ nameTooLong: "Value must be at most '255' characters",
5
+ keywordTooShort: "Keyword should be at least 2 characters long",
6
+ keywordTooLong: "Keyword should be at most 25 characters long",
7
+ genericError: "Something went wrong. Please try again.",
8
+ duplicateName: "A tag with this name already exists."
9
+ }, t = {
10
+ document_type: "Document Type",
11
+ department: "Department",
12
+ project: "Project",
13
+ cost_center: "Cost Center",
14
+ vendor_type: "Vendor Type",
15
+ payment_method: "Payment Method",
16
+ approval_status: "Approval Status"
17
+ };
18
+ //#endregion
19
+ export { t as TAG_CATEGORY_LABELS_EN, e as TAG_MESSAGE_LABELS_EN };
@@ -0,0 +1,4 @@
1
+ import { Scope as e } from "../../../../data-access/dist/lib/scopes.js";
2
+ import "../../../../data-access/dist/index.js";
3
+ e.AccountingConfigReadOrg, e.AccountingConfigWriteOrg;
4
+ //#endregion
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import "../../../data-access/dist/index.js";
6
+ import "react";
@@ -1,3 +1,4 @@
1
1
  import "./index2.js";
2
2
  import { TagFormSheet as e } from "./index3.js";
3
+ import "./index4.js";
3
4
  export { e as TagFormSheet };
@@ -3,25 +3,25 @@ import { TAG_FORM_SHEET_LABELS_EN as h } from "./index2.js";
3
3
  import { useId as g } from "react";
4
4
  import { jsx as _, jsxs as v } from "react/jsx-runtime";
5
5
  //#region ../../libs/tesouro-embedded-components-react/shared/tag-selection/ui/dist/index3.js
6
- function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOptions: w, tagName: T, inProgress: E, showDelete: D, onNameChange: O, onCategoryChange: k, onKeywordsChange: A, onKeywordsInputChange: j, onSubmit: M, onCancel: N, onDelete: P, labels: F }) {
7
- let I = {
6
+ function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOptions: w, tagName: T, inProgress: E, showDelete: D, showKeywords: O = !0, onNameChange: k, onCategoryChange: A, onKeywordsChange: j, onKeywordsInputChange: M, onSubmit: N, onCancel: P, onDelete: F, labels: I }) {
7
+ let L = {
8
8
  ...h,
9
- ...F
10
- }, L = g(), R = x === "edit" ? I.editTitle.replace("{name}", T ?? "") : I.createTitle;
9
+ ...I
10
+ }, R = g(), z = x === "edit" ? L.editTitle.replace("{name}", T ?? "") : L.createTitle;
11
11
  return /* @__PURE__ */ _(l, {
12
12
  open: y,
13
13
  onOpenChange: b,
14
14
  children: /* @__PURE__ */ v(u, {
15
15
  className: "ttw:w-[600px] ttw:sm:max-w-[600px]",
16
16
  children: [
17
- /* @__PURE__ */ v(p, { children: [/* @__PURE__ */ _(m, { children: R }), /* @__PURE__ */ _(d, {
17
+ /* @__PURE__ */ v(p, { children: [/* @__PURE__ */ _(m, { children: z }), /* @__PURE__ */ _(d, {
18
18
  className: "ttw:sr-only",
19
- children: R
19
+ children: z
20
20
  })] }),
21
21
  /* @__PURE__ */ _("form", {
22
- id: L,
22
+ id: R,
23
23
  onSubmit: (e) => {
24
- e.preventDefault(), e.stopPropagation(), M();
24
+ e.preventDefault(), e.stopPropagation(), N();
25
25
  },
26
26
  children: /* @__PURE__ */ v("div", {
27
27
  className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pt-8 ttw:pb-6",
@@ -35,15 +35,15 @@ function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOp
35
35
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
36
36
  children: [
37
37
  /* @__PURE__ */ _(r, {
38
- htmlFor: `${L}-name`,
39
- children: I.nameLabel
38
+ htmlFor: `${R}-name`,
39
+ children: L.nameLabel
40
40
  }),
41
41
  /* @__PURE__ */ _(t, {
42
- id: `${L}-name`,
42
+ id: `${R}-name`,
43
43
  autoFocus: !0,
44
44
  value: S.name,
45
45
  "aria-invalid": !!C?.name,
46
- onChange: (e) => O(e.target.value)
46
+ onChange: (e) => k(e.target.value)
47
47
  }),
48
48
  C?.name && /* @__PURE__ */ _("p", {
49
49
  className: "ttw:text-sm ttw:text-destructive",
@@ -54,33 +54,33 @@ function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOp
54
54
  /* @__PURE__ */ v("div", {
55
55
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
56
56
  children: [/* @__PURE__ */ _(r, {
57
- htmlFor: `${L}-category`,
58
- children: I.categoryLabel
57
+ htmlFor: `${R}-category`,
58
+ children: L.categoryLabel
59
59
  }), /* @__PURE__ */ v(i, {
60
60
  value: S.category === "" ? void 0 : S.category,
61
- onValueChange: k,
61
+ onValueChange: A,
62
62
  children: [/* @__PURE__ */ _(s, {
63
- id: `${L}-category`,
63
+ id: `${R}-category`,
64
64
  className: "ttw:w-full",
65
- children: /* @__PURE__ */ _(c, { placeholder: I.categoryPlaceholder })
65
+ children: /* @__PURE__ */ _(c, { placeholder: L.categoryPlaceholder })
66
66
  }), /* @__PURE__ */ _(a, { children: w.map((e) => /* @__PURE__ */ _(o, {
67
67
  value: e.value,
68
68
  children: e.label
69
69
  }, e.value)) })]
70
70
  })]
71
71
  }),
72
- /* @__PURE__ */ v("div", {
72
+ O && /* @__PURE__ */ v("div", {
73
73
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
74
74
  children: [
75
- /* @__PURE__ */ _(r, { children: I.keywordsLabel }),
75
+ /* @__PURE__ */ _(r, { children: L.keywordsLabel }),
76
76
  /* @__PURE__ */ _(n, {
77
77
  value: S.keywords,
78
- onChange: A,
78
+ onChange: j,
79
79
  inputValue: S.keywordsInput,
80
- onInputValueChange: j,
81
- placeholder: I.keywordsPlaceholder,
80
+ onInputValueChange: M,
81
+ placeholder: L.keywordsPlaceholder,
82
82
  "aria-invalid": !!C?.keywords,
83
- removeTagLabel: (e) => I.removeKeyword.replace("{keyword}", e)
83
+ removeTagLabel: (e) => L.removeKeyword.replace("{keyword}", e)
84
84
  }),
85
85
  C?.keywords && /* @__PURE__ */ _("p", {
86
86
  className: "ttw:text-sm ttw:text-destructive",
@@ -94,27 +94,27 @@ function y({ open: y, onOpenChange: b, mode: x, values: S, errors: C, categoryOp
94
94
  /* @__PURE__ */ v(f, {
95
95
  className: "ttw:flex ttw:flex-row ttw:justify-end ttw:gap-2",
96
96
  children: [
97
- x === "edit" && D && P && /* @__PURE__ */ _(e, {
97
+ x === "edit" && D && F && /* @__PURE__ */ _(e, {
98
98
  type: "button",
99
99
  className: "ttw:mr-auto",
100
100
  variant: "destructive",
101
101
  size: "lg",
102
- onClick: P,
103
- children: I.deleteButton
102
+ onClick: F,
103
+ children: L.deleteButton
104
104
  }),
105
105
  /* @__PURE__ */ _(e, {
106
106
  type: "button",
107
107
  variant: "ghost",
108
108
  size: "lg",
109
- onClick: N,
110
- children: I.cancelButton
109
+ onClick: P,
110
+ children: L.cancelButton
111
111
  }),
112
112
  /* @__PURE__ */ _(e, {
113
113
  type: "submit",
114
- form: L,
114
+ form: R,
115
115
  size: "lg",
116
116
  disabled: E,
117
- children: x === "edit" ? I.saveButton : I.createButton
117
+ children: x === "edit" ? L.saveButton : L.createButton
118
118
  })
119
119
  ]
120
120
  })
@@ -0,0 +1,4 @@
1
+ import "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import "react";
3
+ import "react/jsx-runtime";
4
+ import "lucide-react";