@tesouro/embedded-components-react 0.5.91 → 0.5.92

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 (51) hide show
  1. package/dist/experimental/InvoiceSettings.d.ts +263 -21
  2. package/dist/experimental/InvoiceSettings.js +1 -1
  3. package/dist/experimental/index.d.ts +263 -21
  4. package/dist/experimental/index.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index.js +8 -0
  7. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index2.js +23 -0
  8. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index3.js +24 -0
  9. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index4.js +24 -0
  10. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index5.js +18 -0
  11. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index6.js +40 -0
  12. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index7.js +35 -0
  13. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/data-access/dist/index8.js +34 -0
  14. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index.js +4 -3
  15. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +145 -0
  16. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index11.js +2 -0
  17. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index2.js +8 -3
  18. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index3.js +20 -25
  19. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index4.js +16 -2
  20. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index5.js +20 -0
  21. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index6.js +36 -0
  22. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index7.js +155 -0
  23. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index8.js +103 -0
  24. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index9.js +5 -0
  25. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index.js +20 -0
  26. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index10.js +2 -0
  27. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index11.js +10 -0
  28. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index12.js +41 -0
  29. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index13.js +2 -0
  30. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index14.js +12 -0
  31. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index15.js +9 -0
  32. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index16.js +21 -0
  33. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index17.js +75 -0
  34. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index18.js +3 -0
  35. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index19.js +13 -0
  36. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index2.js +10 -0
  37. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index20.js +93 -0
  38. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index21.js +2 -0
  39. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index3.js +40 -0
  40. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index4.js +2 -0
  41. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index5.js +12 -0
  42. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index6.js +131 -0
  43. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index7.js +2 -0
  44. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index8.js +14 -0
  45. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index9.js +74 -0
  46. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +27 -27
  47. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +185 -174
  48. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +125 -96
  49. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  50. package/dist/packages/shared-ui-shadcn/dist/index.js +2411 -2354
  51. package/package.json +1 -1
@@ -0,0 +1,103 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../../shared/ui/dist/index.js";
7
+ import { INVOICE_SETTINGS_MESSAGE_LABELS_EN as t } from "./index5.js";
8
+ import { useUploadEntityLogoMutation as n } from "../../data-access/dist/index7.js";
9
+ import { useDeleteEntityLogoMutation as r } from "../../data-access/dist/index8.js";
10
+ import "../../data-access/dist/index.js";
11
+ import { LogoUploadStatus as i } from "../../ui/dist/index15.js";
12
+ import "../../ui/dist/index.js";
13
+ import { useCallback as a, useMemo as o, useRef as s, useState as c } from "react";
14
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index8.js
15
+ var l = [
16
+ "image/png",
17
+ "image/jpeg",
18
+ "image/gif"
19
+ ], u = 1048576;
20
+ function d({ entityId: d, labels: f }) {
21
+ let p = o(() => ({
22
+ ...t,
23
+ ...f
24
+ }), [f]), m = s(null), h = s(!1), [g, _] = c(i.Idle), [v, y] = c(), [b, x] = c(), [S, C] = c(!1), [w, T] = c(), { mutateAsync: E } = n(), { mutateAsync: D, isPending: O } = r(), k = a((e) => {
25
+ if (!l.includes(e.type)) return p.logoWrongFormat;
26
+ if (e.size > 10 * u) return p.logoTooLarge(10);
27
+ }, [p]), A = a(async (e) => {
28
+ if (h.current || !d) return;
29
+ let t = k(e);
30
+ if (y(e.name), t) {
31
+ x(t), _(i.Error);
32
+ return;
33
+ }
34
+ x(void 0), _(i.Uploading), h.current = !0;
35
+ try {
36
+ let t = await E({
37
+ entityId: d,
38
+ file: e
39
+ });
40
+ T(t?.url), _(i.Success);
41
+ } catch {
42
+ x(p.logoUploadFailed), _(i.Error);
43
+ } finally {
44
+ h.current = !1;
45
+ }
46
+ }, [
47
+ d,
48
+ k,
49
+ p.logoUploadFailed,
50
+ E
51
+ ]), j = a(() => {
52
+ _(i.Idle), x(void 0), y(void 0), T(void 0);
53
+ }, []), M = a((e) => {
54
+ e.preventDefault(), C(!1);
55
+ let t = e.dataTransfer?.files?.[0];
56
+ t && A(t);
57
+ }, [A]);
58
+ return {
59
+ status: g,
60
+ fileName: v,
61
+ errorMessage: b,
62
+ isDraggingOver: S,
63
+ isDeleting: O,
64
+ uploadedLogoUrl: w,
65
+ fileTypesHint: p.logoFileTypesHint(10),
66
+ onBrowse: a(() => m.current?.click(), []),
67
+ onDelete: a(async () => {
68
+ if (d) try {
69
+ await D({ entityId: d }), j(), e.success(p.logoDeleted);
70
+ } catch {
71
+ e.error(p.logoDeleteFailed);
72
+ }
73
+ }, [
74
+ D,
75
+ d,
76
+ j,
77
+ p.logoDeleted,
78
+ p.logoDeleteFailed
79
+ ]),
80
+ onDismissError: j,
81
+ onDragOver: a((e) => {
82
+ e.preventDefault(), C(!0);
83
+ }, []),
84
+ onDragLeave: a((e) => {
85
+ e.preventDefault(), C(!1);
86
+ }, []),
87
+ onDrop: M,
88
+ fileInputProps: {
89
+ ref: m,
90
+ type: "file",
91
+ accept: l.join(","),
92
+ className: "ttw:hidden",
93
+ "aria-hidden": !0,
94
+ tabIndex: -1,
95
+ onChange: (e) => {
96
+ let t = e.target.files?.[0];
97
+ t && A(t), e.target.value = "";
98
+ }
99
+ }
100
+ };
101
+ }
102
+ //#endregion
103
+ export { l as LOGO_ACCEPTED_TYPES, d as useLogoUpload };
@@ -0,0 +1,5 @@
1
+ import { SETTINGS_WIDGET_NAME as e } from "../../../shared/util/dist/lib/widgetName.js";
2
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index9.js
3
+ var t = `${e}.invoice_settings`, n = { Mounted: `${t}.mounted` };
4
+ //#endregion
5
+ export { n as InvoiceSettingsAnalyticsEvent, t as WIDGET_NAME };
@@ -0,0 +1,20 @@
1
+ import "./index2.js";
2
+ import { InvoiceSettingsPanel as e } from "./index3.js";
3
+ import "./index4.js";
4
+ import "./index5.js";
5
+ import { InvoiceNumberingSection as t } from "./index6.js";
6
+ import "./index7.js";
7
+ import "./index8.js";
8
+ import { PdfSettingsSection as n } from "./index9.js";
9
+ import "./index10.js";
10
+ import "./index11.js";
11
+ import { DiscardChangesDialog as r } from "./index12.js";
12
+ import "./index13.js";
13
+ import "./index14.js";
14
+ import { LogoUploadStatus as i } from "./index15.js";
15
+ import "./index17.js";
16
+ import "./index18.js";
17
+ import "./index19.js";
18
+ import { LogoSection as a } from "./index20.js";
19
+ import "./index21.js";
20
+ export { r as DiscardChangesDialog, t as InvoiceNumberingSection, e as InvoiceSettingsPanel, a as LogoSection, i as LogoUploadStatus, n as PdfSettingsSection };
@@ -0,0 +1,2 @@
1
+ import "./index8.js";
2
+ import "./index9.js";
@@ -0,0 +1,10 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index11.js
2
+ var e = {
3
+ title: "You have unsaved changes",
4
+ message: "Any unsaved changes will be lost.",
5
+ question: "Are you sure you want to quit without saving?",
6
+ confirmButton: "Quit without saving",
7
+ cancelButton: "Cancel"
8
+ };
9
+ //#endregion
10
+ export { e as DISCARD_CHANGES_DIALOG_LABELS_EN };
@@ -0,0 +1,41 @@
1
+ import { Button as e, Dialog as t, DialogContent as n, DialogDescription as r, DialogFooter as i, DialogHeader as a, DialogTitle as o, Typography as s } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { DISCARD_CHANGES_DIALOG_LABELS_EN as c } from "./index11.js";
3
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index12.js
5
+ function d({ open: d, onCancel: f, onConfirm: p, labels: m }) {
6
+ let h = {
7
+ ...c,
8
+ ...m
9
+ };
10
+ return /* @__PURE__ */ l(t, {
11
+ open: d,
12
+ onOpenChange: (e) => !e && f(),
13
+ children: /* @__PURE__ */ u(n, {
14
+ showCloseButton: !1,
15
+ children: [
16
+ /* @__PURE__ */ l(a, { children: /* @__PURE__ */ l(o, { children: h.title }) }),
17
+ /* @__PURE__ */ l(r, {
18
+ asChild: !0,
19
+ children: /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l(s, {
20
+ variant: "body1",
21
+ children: h.message
22
+ }), /* @__PURE__ */ l(s, {
23
+ variant: "body1",
24
+ children: h.question
25
+ })] })
26
+ }),
27
+ /* @__PURE__ */ u(i, { children: [/* @__PURE__ */ l(e, {
28
+ variant: "outline",
29
+ onClick: f,
30
+ children: h.cancelButton
31
+ }), /* @__PURE__ */ l(e, {
32
+ variant: "destructive",
33
+ onClick: p,
34
+ children: h.confirmButton
35
+ })] })
36
+ ]
37
+ })
38
+ });
39
+ }
40
+ //#endregion
41
+ export { d as DiscardChangesDialog, d as default };
@@ -0,0 +1,2 @@
1
+ import "./index11.js";
2
+ import "./index12.js";
@@ -0,0 +1,12 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index14.js
2
+ var e = {
3
+ dropPrefix: "Drop your files here, or",
4
+ browseAction: "click to browse",
5
+ fileTypesHint: "PNG, JPG or GIF (max. 10MB)",
6
+ genericError: "Wrong file format. Please, upload the file in JPEG, PNG or GIF format.",
7
+ uploadProgress: "Uploading logo",
8
+ uploadComplete: "Logo uploaded",
9
+ dismissError: "Dismiss upload error"
10
+ };
11
+ //#endregion
12
+ export { e as LOGO_DROPZONE_LABELS_EN };
@@ -0,0 +1,9 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index15.js
2
+ var e = {
3
+ Idle: "idle",
4
+ Uploading: "uploading",
5
+ Success: "success",
6
+ Error: "error"
7
+ };
8
+ //#endregion
9
+ export { e as LogoUploadStatus };
@@ -0,0 +1,21 @@
1
+ import { cn as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { LogoUploadStatus as t } from "./index15.js";
3
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index16.js
5
+ function a({ status: a, progressLabel: o, completeLabel: s }) {
6
+ let c = a === t.Uploading, l = a === t.Success, u = a === t.Error ? "ttw:bg-destructive" : l ? "ttw:bg-emerald-600" : "ttw:bg-primary";
7
+ return /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("div", {
8
+ ...c ? {
9
+ role: "progressbar",
10
+ "aria-label": o
11
+ } : { "aria-hidden": !0 },
12
+ className: "ttw:w-65.5 ttw:h-1.5 ttw:bg-muted ttw:rounded-md ttw:overflow-hidden",
13
+ children: /* @__PURE__ */ r("div", { className: e("ttw:h-full ttw:w-full ttw:rounded-md", u, c && "ttw:animate-pulse") })
14
+ }), /* @__PURE__ */ r("span", {
15
+ role: "status",
16
+ className: "ttw:sr-only",
17
+ children: l ? s : ""
18
+ })] });
19
+ }
20
+ //#endregion
21
+ export { a as LogoUploadProgress, a as default };
@@ -0,0 +1,75 @@
1
+ import { Spinner as e, Typography as t, cn as n } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { LOGO_DROPZONE_LABELS_EN as r } from "./index14.js";
3
+ import { LogoUploadStatus as i } from "./index15.js";
4
+ import { LogoUploadProgress as a } from "./index16.js";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { AlertCircle as c, CheckCircle2 as l, CloudUpload as u, X as d } from "lucide-react";
7
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index17.js
8
+ function f({ status: f = i.Idle, fileName: p, errorMessage: m, isDraggingOver: h, onBrowse: g, onDismissError: _, labels: v }) {
9
+ let y = {
10
+ ...r,
11
+ ...v
12
+ }, b = f === i.Uploading, x = f === i.Success, S = f === i.Error, C = b || x || S, w = n("ttw:w-full ttw:h-38 ttw:bg-background ttw:box-border ttw:transition-all ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:text-center ttw:gap-2 ttw:rounded-lg ttw:border ttw:px-4 ttw:py-6", h ? "ttw:border-solid ttw:border-primary" : "ttw:border-dashed ttw:border-border");
13
+ return C ? /* @__PURE__ */ s("div", {
14
+ className: w,
15
+ children: [/* @__PURE__ */ s("div", {
16
+ className: "ttw:flex ttw:gap-4 ttw:justify-center ttw:w-full",
17
+ children: [/* @__PURE__ */ s("div", {
18
+ className: "ttw:flex ttw:gap-2 ttw:w-1/2 ttw:items-center",
19
+ children: [S ? /* @__PURE__ */ o(c, { className: "ttw:size-5 ttw:text-destructive" }) : x ? /* @__PURE__ */ o(l, { className: "ttw:size-5 ttw:text-emerald-600" }) : /* @__PURE__ */ o(e, { className: "ttw:size-5" }), /* @__PURE__ */ o("span", {
20
+ className: "ttw:w-full ttw:text-sm ttw:leading-5 ttw:font-medium ttw:text-muted-foreground ttw:truncate",
21
+ children: p
22
+ })]
23
+ }), /* @__PURE__ */ s("div", {
24
+ className: "ttw:flex ttw:gap-2 ttw:items-center",
25
+ children: [/* @__PURE__ */ o(a, {
26
+ status: f,
27
+ progressLabel: y.uploadProgress,
28
+ completeLabel: y.uploadComplete
29
+ }), S && /* @__PURE__ */ o("button", {
30
+ type: "button",
31
+ onClick: _,
32
+ "aria-label": y.dismissError,
33
+ className: "ttw:cursor-pointer ttw:border-none",
34
+ children: /* @__PURE__ */ o(d, { className: "ttw:size-4" })
35
+ })]
36
+ })]
37
+ }), S && /* @__PURE__ */ o(t, {
38
+ variant: "body2",
39
+ color: "destructive",
40
+ role: "alert",
41
+ className: "ttw:font-medium",
42
+ children: m ?? y.genericError
43
+ })]
44
+ }) : /* @__PURE__ */ s("button", {
45
+ type: "button",
46
+ className: w,
47
+ onClick: g,
48
+ children: [
49
+ /* @__PURE__ */ o("span", {
50
+ className: "ttw:p-3 ttw:bg-primary ttw:rounded-full",
51
+ children: /* @__PURE__ */ o(u, { className: "ttw:text-primary-foreground ttw:size-5" })
52
+ }),
53
+ /* @__PURE__ */ s(t, {
54
+ component: "span",
55
+ variant: "body2",
56
+ className: "ttw:font-medium",
57
+ children: [
58
+ y.dropPrefix,
59
+ " ",
60
+ /* @__PURE__ */ o("span", {
61
+ className: "ttw:text-primary ttw:underline",
62
+ children: y.browseAction
63
+ })
64
+ ]
65
+ }),
66
+ /* @__PURE__ */ o(t, {
67
+ variant: "caption",
68
+ color: "muted",
69
+ children: y.fileTypesHint
70
+ })
71
+ ]
72
+ });
73
+ }
74
+ //#endregion
75
+ export { f as LogoDropzone, f as default };
@@ -0,0 +1,3 @@
1
+ import "./index14.js";
2
+ import "./index15.js";
3
+ import "./index17.js";
@@ -0,0 +1,13 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index19.js
2
+ var e = {
3
+ title: "Branding",
4
+ description: "Control how your invoices will appear to your customers by adding your company's logo. Changes apply to new invoices only.",
5
+ uploadTitle: "Upload your company logo",
6
+ uploadDescription: "Proudly display your logo on all your invoices.",
7
+ logoAlt: "Organization logo",
8
+ dropToReplace: "Drop to replace your logo",
9
+ editLogo: "Edit logo",
10
+ deleteLogo: "Delete logo"
11
+ };
12
+ //#endregion
13
+ export { e as LOGO_SECTION_LABELS_EN };
@@ -0,0 +1,10 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index2.js
2
+ var e = {
3
+ submitButton: "Save changes",
4
+ errorTitle: "Couldn't load invoice settings",
5
+ errorDescription: "Something went wrong while loading your settings. Please try again.",
6
+ errorRetry: "Try again",
7
+ loading: "Loading invoice settings"
8
+ };
9
+ //#endregion
10
+ export { e as INVOICE_SETTINGS_PANEL_LABELS_EN };
@@ -0,0 +1,93 @@
1
+ import { Button as e, Skeleton as t, Typography as n } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { LogoUploadStatus as r } from "./index15.js";
3
+ import { LogoDropzone as i } from "./index17.js";
4
+ import "./index18.js";
5
+ import { LOGO_SECTION_LABELS_EN as a } from "./index19.js";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ import { SquarePen as c, Trash2 as l } from "lucide-react";
8
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index20.js
9
+ function u({ logoUrl: u, isLoading: d, isDeleting: f, status: p = r.Idle, fileName: m, errorMessage: h, isDraggingOver: g, onBrowse: _, onDelete: v, onDismissError: y, onDragOver: b, onDragLeave: x, onDrop: S, labels: C, dropzoneLabels: w }) {
10
+ let T = {
11
+ ...a,
12
+ ...C
13
+ }, E = !!u && !d && p !== r.Uploading && p !== r.Error;
14
+ return /* @__PURE__ */ s("div", {
15
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5",
16
+ children: [/* @__PURE__ */ s("div", {
17
+ className: "ttw:pt-5 ttw:pb-2.5 ttw:flex ttw:flex-col ttw:gap-1.5",
18
+ children: [/* @__PURE__ */ o(n, {
19
+ variant: "h3",
20
+ children: T.title
21
+ }), /* @__PURE__ */ o(n, {
22
+ variant: "body2",
23
+ color: "muted",
24
+ children: T.description
25
+ })]
26
+ }), /* @__PURE__ */ s("div", {
27
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
28
+ children: [/* @__PURE__ */ s("div", {
29
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
30
+ children: [/* @__PURE__ */ o(n, {
31
+ variant: "body1",
32
+ className: "ttw:font-medium",
33
+ children: T.uploadTitle
34
+ }), /* @__PURE__ */ o(n, {
35
+ variant: "body2",
36
+ className: "ttw:leading-5",
37
+ color: "muted",
38
+ children: T.uploadDescription
39
+ })]
40
+ }), /* @__PURE__ */ s("div", {
41
+ className: "ttw:flex ttw:flex-col ttw:items-end ttw:gap-2",
42
+ children: [/* @__PURE__ */ o("div", {
43
+ className: "ttw:w-full",
44
+ onDragOver: b,
45
+ onDragLeave: x,
46
+ onDrop: S,
47
+ children: d ? /* @__PURE__ */ o(t, { className: "ttw:w-full ttw:h-38" }) : E ? /* @__PURE__ */ s("div", {
48
+ className: "ttw:relative ttw:flex ttw:w-full ttw:h-38 ttw:box-border",
49
+ children: [/* @__PURE__ */ o("img", {
50
+ src: u,
51
+ alt: T.logoAlt,
52
+ className: "ttw:w-auto ttw:max-w-full ttw:object-contain ttw:max-h-38"
53
+ }), g && /* @__PURE__ */ o("div", {
54
+ className: "ttw:absolute ttw:inset-0 ttw:pointer-events-none ttw:flex ttw:items-center ttw:justify-center ttw:gap-2 ttw:rounded-lg ttw:border ttw:border-solid ttw:border-primary ttw:bg-background/80",
55
+ children: /* @__PURE__ */ o(n, {
56
+ variant: "body2",
57
+ color: "primary",
58
+ className: "ttw:font-medium",
59
+ children: T.dropToReplace
60
+ })
61
+ })]
62
+ }) : /* @__PURE__ */ o(i, {
63
+ status: p,
64
+ fileName: m,
65
+ errorMessage: h,
66
+ isDraggingOver: g,
67
+ onBrowse: _,
68
+ onDismissError: y,
69
+ labels: w
70
+ })
71
+ }), E && /* @__PURE__ */ s("div", {
72
+ className: "ttw:flex ttw:gap-4",
73
+ children: [/* @__PURE__ */ o(e, {
74
+ variant: "ghost",
75
+ size: "sm",
76
+ "aria-label": T.editLogo,
77
+ onClick: _,
78
+ children: /* @__PURE__ */ o(c, { className: "ttw:size-4" })
79
+ }), /* @__PURE__ */ o(e, {
80
+ variant: "ghost",
81
+ size: "sm",
82
+ disabled: f,
83
+ "aria-label": T.deleteLogo,
84
+ onClick: v,
85
+ children: /* @__PURE__ */ o(l, { className: "ttw:size-4" })
86
+ })]
87
+ })]
88
+ })]
89
+ })]
90
+ });
91
+ }
92
+ //#endregion
93
+ export { u as LogoSection, u as default };
@@ -0,0 +1,2 @@
1
+ import "./index19.js";
2
+ import "./index20.js";
@@ -0,0 +1,40 @@
1
+ import { Button as e, Spinner as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { ErrorState as n } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
3
+ import "../../../../shared/ui/dist/index.js";
4
+ import { INVOICE_SETTINGS_PANEL_LABELS_EN as r } from "./index2.js";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index3.js
7
+ function o({ isLoading: o, isError: s, onRetry: c, logo: l, children: u, submitDisabled: d, onSubmit: f, labels: p }) {
8
+ let m = {
9
+ ...r,
10
+ ...p
11
+ };
12
+ return /* @__PURE__ */ i("div", {
13
+ className: "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
14
+ children: /* @__PURE__ */ a("div", {
15
+ className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:w-full ttw:max-w-163",
16
+ children: [l, s ? /* @__PURE__ */ i(n, {
17
+ title: m.errorTitle,
18
+ description: m.errorDescription,
19
+ retryLabel: m.errorRetry,
20
+ onRetry: c
21
+ }) : o ? /* @__PURE__ */ i(t, {
22
+ className: "ttw:size-8 ttw:text-primary",
23
+ "aria-label": m.loading
24
+ }) : /* @__PURE__ */ a("form", {
25
+ className: "ttw:flex ttw:flex-col ttw:gap-6",
26
+ onSubmit: (e) => {
27
+ e.preventDefault(), f();
28
+ },
29
+ children: [u, /* @__PURE__ */ i(e, {
30
+ type: "submit",
31
+ className: "ttw:w-fit",
32
+ disabled: d,
33
+ children: m.submitButton
34
+ })]
35
+ })]
36
+ })
37
+ });
38
+ }
39
+ //#endregion
40
+ export { o as InvoiceSettingsPanel, o as default };
@@ -0,0 +1,2 @@
1
+ import "./index2.js";
2
+ import "./index3.js";
@@ -0,0 +1,12 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index5.js
2
+ var e = {
3
+ title: "Invoice numbering",
4
+ description: "Specify how you want your invoices to be numbered. Changes apply to new invoices only. Existing invoice numbers won't be updated.",
5
+ previewLabel: "Preview",
6
+ invoicePrefixLabel: "Invoice prefix",
7
+ startingNumberLabel: "Starting number",
8
+ digitCountLabel: "Digit count",
9
+ includeDateLabel: "Include the current year in the invoice number prefix"
10
+ };
11
+ //#endregion
12
+ export { e as INVOICE_NUMBERING_SECTION_LABELS_EN };
@@ -0,0 +1,131 @@
1
+ import { Checkbox as e, Field as t, FieldContent as n, FieldError as r, FieldLabel as i, Input as a, Typography as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { INVOICE_NUMBERING_SECTION_LABELS_EN as s } from "./index5.js";
3
+ import { useId as c } from "react";
4
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
5
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index6.js
6
+ function d({ previewValue: d, invoicePrefix: f, startingNumber: p, digitCount: m, includeDate: h, errors: g, onInvoicePrefixChange: _, onStartingNumberChange: v, onDigitCountChange: y, onIncludeDateChange: b, labels: x }) {
7
+ let S = {
8
+ ...s,
9
+ ...x
10
+ }, C = c(), w = (e) => `${C}-${e}`, T = (e) => `${C}-${e}-error`, E = (e, t) => t ? T(e) : void 0;
11
+ return /* @__PURE__ */ u("div", {
12
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5",
13
+ children: [
14
+ /* @__PURE__ */ u("div", {
15
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5 ttw:pt-5 ttw:pb-2.5",
16
+ children: [/* @__PURE__ */ l(o, {
17
+ variant: "h3",
18
+ children: S.title
19
+ }), /* @__PURE__ */ l(o, {
20
+ variant: "body2",
21
+ color: "muted",
22
+ children: S.description
23
+ })]
24
+ }),
25
+ /* @__PURE__ */ u("div", {
26
+ className: "ttw:flex ttw:flex-col ttw:w-94 ttw:gap-0.5 ttw:p-4 ttw:bg-muted ttw:rounded-xl",
27
+ children: [/* @__PURE__ */ l(o, {
28
+ variant: "body2",
29
+ color: "muted",
30
+ children: S.previewLabel
31
+ }), /* @__PURE__ */ l(o, {
32
+ variant: "h4",
33
+ className: "ttw:font-semibold ttw:truncate",
34
+ title: d,
35
+ children: d
36
+ })]
37
+ }),
38
+ /* @__PURE__ */ u("div", {
39
+ className: "ttw:flex ttw:w-min ttw:gap-2 ttw:p-2",
40
+ children: [
41
+ /* @__PURE__ */ l(t, { children: /* @__PURE__ */ u(n, {
42
+ className: "ttw:grow-0",
43
+ children: [
44
+ /* @__PURE__ */ l(i, {
45
+ htmlFor: w("invoice-prefix"),
46
+ children: S.invoicePrefixLabel
47
+ }),
48
+ /* @__PURE__ */ l(a, {
49
+ id: w("invoice-prefix"),
50
+ value: f,
51
+ "aria-invalid": !!g?.invoicePrefix || void 0,
52
+ "aria-describedby": E("invoice-prefix", g?.invoicePrefix),
53
+ onChange: (e) => _(e.target.value),
54
+ className: "ttw:w-29 ttw:min-w-29 ttw:bg-background"
55
+ }),
56
+ /* @__PURE__ */ l(r, {
57
+ id: T("invoice-prefix"),
58
+ children: g?.invoicePrefix
59
+ })
60
+ ]
61
+ }) }),
62
+ /* @__PURE__ */ l(t, { children: /* @__PURE__ */ u(n, {
63
+ className: "ttw:grow-0",
64
+ children: [
65
+ /* @__PURE__ */ l(i, {
66
+ htmlFor: w("starting-number"),
67
+ children: S.startingNumberLabel
68
+ }),
69
+ /* @__PURE__ */ l(a, {
70
+ id: w("starting-number"),
71
+ type: "number",
72
+ value: p,
73
+ "aria-invalid": !!g?.startingNumber || void 0,
74
+ "aria-describedby": E("starting-number", g?.startingNumber),
75
+ onChange: (e) => v(e.target.value),
76
+ className: "ttw:w-29 ttw:min-w-29 ttw:bg-background"
77
+ }),
78
+ /* @__PURE__ */ l(r, {
79
+ id: T("starting-number"),
80
+ children: g?.startingNumber
81
+ })
82
+ ]
83
+ }) }),
84
+ /* @__PURE__ */ l(t, { children: /* @__PURE__ */ u(n, {
85
+ className: "ttw:grow-0",
86
+ children: [
87
+ /* @__PURE__ */ l(i, {
88
+ htmlFor: w("digit-count"),
89
+ children: S.digitCountLabel
90
+ }),
91
+ /* @__PURE__ */ l(a, {
92
+ id: w("digit-count"),
93
+ type: "number",
94
+ value: m,
95
+ "aria-invalid": !!g?.digitCount || void 0,
96
+ "aria-describedby": E("digit-count", g?.digitCount),
97
+ onChange: (e) => y(e.target.value),
98
+ className: "ttw:bg-background ttw:w-29 ttw:max-w-29"
99
+ }),
100
+ /* @__PURE__ */ l(r, {
101
+ id: T("digit-count"),
102
+ children: g?.digitCount
103
+ })
104
+ ]
105
+ }) })
106
+ ]
107
+ }),
108
+ /* @__PURE__ */ l("div", {
109
+ className: "ttw:bg-transparent ttw:w-full ttw:p-2",
110
+ children: /* @__PURE__ */ l(t, {
111
+ orientation: "horizontal",
112
+ children: /* @__PURE__ */ u(n, {
113
+ className: "ttw:flex-row ttw:items-center",
114
+ children: [/* @__PURE__ */ l(e, {
115
+ id: w("include-date"),
116
+ checked: h,
117
+ onCheckedChange: (e) => b(e === !0),
118
+ className: "ttw:bg-background"
119
+ }), /* @__PURE__ */ l(i, {
120
+ htmlFor: w("include-date"),
121
+ className: "ttw:font-normal",
122
+ children: S.includeDateLabel
123
+ })]
124
+ })
125
+ })
126
+ })
127
+ ]
128
+ });
129
+ }
130
+ //#endregion
131
+ export { d as InvoiceNumberingSection, d as default };
@@ -0,0 +1,2 @@
1
+ import "./index5.js";
2
+ import "./index6.js";
@@ -0,0 +1,14 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index8.js
2
+ var e = {
3
+ title: "PDF settings",
4
+ description: "Invoices are generated as PDFs",
5
+ bankDetailsTitle: "Display your bank account details on the PDF",
6
+ bankDetailsDescription: "Shows your bank account number, routing number, and account holder name so that customers can pay using an ACH bank transfer. Should only be used with accounts that have a debit block.",
7
+ bankDetailsToggle: "Display bank display options",
8
+ paidInvoicesTitle: "Update PDF files for paid invoices",
9
+ paidInvoicesDescription: "PDF invoice files will be regenerated to reflect payments made and any remaining amount due. Once a PDF has been updated, you won't be able to revert it.",
10
+ paidInvoicesWarning: "Once updated, you won't be able to revert the PDFs.",
11
+ paidInvoicesToggle: "Enable update paid invoices pdf"
12
+ };
13
+ //#endregion
14
+ export { e as PDF_SETTINGS_SECTION_LABELS_EN };