@tesouro/embedded-components-react 0.11.100 → 0.11.102

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 (71) hide show
  1. package/dist/experimental/QuickViewWidget.d.ts +62 -2
  2. package/dist/experimental/index.d.ts +62 -2
  3. package/dist/index.css +21 -17
  4. package/dist/index.d.ts +10 -6
  5. package/dist/lib/CardDetailsWidget.d.ts +6 -4
  6. package/dist/lib/CreditCardsWidget.d.ts +6 -4
  7. package/dist/lib/DebitCardsWidget.d.ts +6 -4
  8. package/dist/lib/SettingsWidget.d.ts +2 -1
  9. package/dist/lib/WidgetSuite.d.ts +8 -5
  10. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +199 -168
  11. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +1 -0
  12. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +44 -43
  13. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index3.js +9 -9
  15. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index4.js +2 -2
  16. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index6.js +25 -284
  17. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index7.js +291 -0
  18. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index.js +3 -3
  19. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index3.js +28 -17
  20. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index5.js +21 -34
  21. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index6.js +71 -78
  22. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index7.js +71 -77
  23. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index8.js +43 -49
  24. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index2.js +8 -1
  26. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/accounts/ui/dist/index2.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/bills/ui/dist/index2.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index.js +1 -0
  29. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index2.js +98 -0
  30. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/index.js +3 -0
  31. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/CardsQuickViewWidgetFeature.js +80 -0
  32. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/labels.js +27 -0
  33. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/summarizeCardSpend.js +17 -0
  34. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/testIds.js +7 -0
  35. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/useCardSpendSummary.js +29 -0
  36. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/analytics/events.js +4 -0
  37. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index.js +3 -0
  38. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index2.js +8 -0
  39. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index3.js +31 -0
  40. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/QuickViewWidget.js +57 -44
  41. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/labels.js +6 -3
  42. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/invoices/ui/dist/index2.js +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index3.js +98 -91
  44. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/ExpenseSettingsTabs/ExpenseSettingsTabs.js +24 -21
  45. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/SettingsWidget/SettingsWidget.js +14 -8
  46. package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +2 -2
  47. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +87 -81
  48. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index3.js +63 -44
  49. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index6.js +9 -6
  50. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +302 -276
  51. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index.js +10 -10
  52. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index12.js +36 -36
  53. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index17.js +27 -13
  54. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsSectionContent.js +22 -0
  55. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +6 -7
  56. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +39 -37
  57. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index.js +9 -9
  58. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +39 -35
  59. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +59 -61
  60. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index4.js +2 -2
  61. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index6.js +2 -2
  62. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +3 -3
  63. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -103
  64. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +43 -43
  65. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/debit-card/useAllDebitCardsQuery.js +22 -18
  66. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +97 -97
  67. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +166 -154
  68. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  69. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +12 -12
  70. package/dist/packages/shared-ui-shadcn/dist/index.js +18 -15
  71. package/package.json +1 -1
@@ -1,15 +1,15 @@
1
1
  import "./index2.js";
2
2
  import "./index4.js";
3
- import "./index5.js";
3
+ import { DEFAULT_LABELS as e } from "./index5.js";
4
4
  import "./index6.js";
5
- import { InviteTeamMemberForm as e } from "./index7.js";
6
- import { EditTeamMemberPanel as t } from "./index8.js";
5
+ import { InviteTeamMemberForm as t } from "./index7.js";
6
+ import { EditTeamMemberPanel as n } from "./index8.js";
7
7
  import "./index9.js";
8
- import { GroupAdminDrawer as n } from "./index10.js";
8
+ import { GroupAdminDrawer as r } from "./index10.js";
9
9
  import "./index11.js";
10
- import { GroupAdminPanel as r } from "./index12.js";
11
- import { TeamActionDialog as i } from "./index13.js";
12
- import { TeamMembersTable as a } from "./index15.js";
13
- import { TeamMemberDetails as o } from "./index16.js";
14
- import { TeamTabs as s } from "./index17.js";
15
- export { t as EditTeamMemberPanel, n as GroupAdminDrawer, r as GroupAdminPanel, e as InviteTeamMemberForm, i as TeamActionDialog, o as TeamMemberDetails, a as TeamMembersTable, s as TeamTabs };
10
+ import { GroupAdminPanel as i } from "./index12.js";
11
+ import { TeamActionDialog as a } from "./index13.js";
12
+ import { TeamMembersTable as o } from "./index15.js";
13
+ import { TeamMemberDetails as s } from "./index16.js";
14
+ import { TeamTabs as c } from "./index17.js";
15
+ export { e as DEFAULT_LABELS, n as EditTeamMemberPanel, r as GroupAdminDrawer, i as GroupAdminPanel, t as InviteTeamMemberForm, a as TeamActionDialog, s as TeamMemberDetails, o as TeamMembersTable, c as TeamTabs };
@@ -10,39 +10,39 @@ import { DEFAULT_GROUP_ADMIN_PANEL_LABELS as g } from "./index11.js";
10
10
  import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
11
11
  import { MoreVertical as b, Pencil as x, Trash2 as S } from "lucide-react";
12
12
  // ../../libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index12.js
13
- function C({ rows: C, isLoading: w = !1, isError: T = !1, onAddClick: E, labels: D }) {
14
- let O = {
13
+ function C({ showHeader: C = !0, rows: w, isLoading: T = !1, isError: E = !1, onAddClick: D, labels: O }) {
14
+ let k = {
15
15
  ...g,
16
- ...D
17
- }, k = (t) => t.onEdit || t.onDelete ? /* @__PURE__ */ y(i, { children: [/* @__PURE__ */ v(f, { children: /* @__PURE__ */ y(u, { children: [/* @__PURE__ */ v(p, {
16
+ ...O
17
+ }, A = (t) => t.onEdit || t.onDelete ? /* @__PURE__ */ y(i, { children: [/* @__PURE__ */ v(f, { children: /* @__PURE__ */ y(u, { children: [/* @__PURE__ */ v(p, {
18
18
  asChild: !0,
19
19
  children: /* @__PURE__ */ v(c, {
20
20
  asChild: !0,
21
21
  children: /* @__PURE__ */ v(e, {
22
22
  variant: "ghost",
23
23
  size: "icon-sm",
24
- "aria-label": `${O.rowActionsAriaLabel} ${t.name}`,
24
+ "aria-label": `${k.rowActionsAriaLabel} ${t.name}`,
25
25
  children: /* @__PURE__ */ v(b, { className: "ttw:size-4" })
26
26
  })
27
27
  })
28
- }), /* @__PURE__ */ v(d, { children: `${O.rowActionsAriaLabel} ${t.name}` })] }) }), /* @__PURE__ */ y(a, {
28
+ }), /* @__PURE__ */ v(d, { children: `${k.rowActionsAriaLabel} ${t.name}` })] }) }), /* @__PURE__ */ y(a, {
29
29
  align: "end",
30
30
  children: [
31
31
  t.onEdit && /* @__PURE__ */ y(o, {
32
32
  onClick: t.onEdit,
33
- children: [/* @__PURE__ */ v(x, { className: "ttw:size-4" }), O.editAction]
33
+ children: [/* @__PURE__ */ v(x, { className: "ttw:size-4" }), k.editAction]
34
34
  }),
35
35
  t.onEdit && t.onDelete && /* @__PURE__ */ v(s, {}),
36
36
  t.onDelete && /* @__PURE__ */ y(o, {
37
37
  variant: "destructive",
38
38
  onClick: t.onDelete,
39
- children: [/* @__PURE__ */ v(S, { className: "ttw:size-4" }), O.deleteAction]
39
+ children: [/* @__PURE__ */ v(S, { className: "ttw:size-4" }), k.deleteAction]
40
40
  })
41
41
  ]
42
- })] }) : null, A = [
42
+ })] }) : null, j = [
43
43
  {
44
44
  id: "name",
45
- header: O.nameColumn,
45
+ header: k.nameColumn,
46
46
  cell: ({ row: e }) => /* @__PURE__ */ v("span", {
47
47
  className: "ttw:block ttw:max-w-50 ttw:truncate",
48
48
  title: e.original.name,
@@ -51,59 +51,59 @@ function C({ rows: C, isLoading: w = !1, isError: T = !1, onAddClick: E, labels:
51
51
  },
52
52
  {
53
53
  id: "members",
54
- header: O.assignedColumn,
54
+ header: k.assignedColumn,
55
55
  cell: ({ row: e }) => e.original.membersLabel
56
56
  },
57
57
  {
58
58
  id: "actions",
59
- header: O.actionsColumn,
60
- cell: ({ row: e }) => k(e.original),
59
+ header: k.actionsColumn,
60
+ cell: ({ row: e }) => A(e.original),
61
61
  meta: { fitContent: !0 }
62
62
  }
63
63
  ];
64
64
  return /* @__PURE__ */ y("section", {
65
- "aria-label": O.title,
66
- "aria-busy": w || void 0,
65
+ "aria-label": k.title,
66
+ "aria-busy": T || void 0,
67
67
  className: "ttw:overflow-hidden ttw:rounded-md",
68
- children: [/* @__PURE__ */ y("div", {
68
+ children: [C && /* @__PURE__ */ y("div", {
69
69
  className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:border-b ttw:border-border ttw:p-3",
70
70
  children: [/* @__PURE__ */ v(l, {
71
71
  variant: "section",
72
- children: O.title
73
- }), E && (C.length > 0 || w || T) && /* @__PURE__ */ v(e, {
72
+ children: k.title
73
+ }), D && (w.length > 0 || T || E) && /* @__PURE__ */ v(e, {
74
74
  size: "sm",
75
- disabled: w,
76
- onClick: E,
77
- children: O.addButton
75
+ disabled: T,
76
+ onClick: D,
77
+ children: k.addButton
78
78
  })]
79
79
  }), /* @__PURE__ */ v(r, {
80
- columns: A,
81
- data: T ? [] : C,
80
+ columns: j,
81
+ data: E ? [] : w,
82
82
  sorting: [],
83
83
  onSortingChange: () => void 0,
84
- pageSize: Math.max(C.length, 4),
84
+ pageSize: Math.max(w.length, 4),
85
85
  pageSizeOptions: [4],
86
86
  onPageSizeChange: () => void 0,
87
87
  onNextPage: () => void 0,
88
88
  onPrevPage: () => void 0,
89
89
  showPagination: !1,
90
- isLoading: w && !T,
91
- labels: { loading: O.loadingLabel },
90
+ isLoading: T && !E,
91
+ labels: { loading: k.loadingLabel },
92
92
  framed: !1,
93
93
  getRowId: (e) => e.key,
94
94
  rowContextMenu: (e) => e.onEdit || e.onDelete ? /* @__PURE__ */ y(_, { children: [
95
95
  e.onEdit && /* @__PURE__ */ v(t, {
96
96
  onClick: e.onEdit,
97
- children: O.editAction
97
+ children: k.editAction
98
98
  }),
99
99
  e.onEdit && e.onDelete && /* @__PURE__ */ v(n, {}),
100
100
  e.onDelete && /* @__PURE__ */ v(t, {
101
101
  variant: "destructive",
102
102
  onClick: e.onDelete,
103
- children: O.deleteAction
103
+ children: k.deleteAction
104
104
  })
105
105
  ] }) : void 0,
106
- renderCard: !T && C.length > 0 ? (e) => /* @__PURE__ */ y("div", {
106
+ renderCard: !E && w.length > 0 ? (e) => /* @__PURE__ */ y("div", {
107
107
  className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
108
108
  children: [/* @__PURE__ */ y("div", {
109
109
  className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-1",
@@ -115,15 +115,15 @@ function C({ rows: C, isLoading: w = !1, isError: T = !1, onAddClick: E, labels:
115
115
  className: "ttw:text-muted-foreground",
116
116
  children: e.membersLabel
117
117
  })]
118
- }), k(e)]
118
+ }), A(e)]
119
119
  }) : void 0,
120
- children: T ? /* @__PURE__ */ v(h, {
121
- title: O.errorTitle,
122
- description: O.errorDescription
120
+ children: E ? /* @__PURE__ */ v(h, {
121
+ title: k.errorTitle,
122
+ description: k.errorDescription
123
123
  }) : /* @__PURE__ */ v(m, {
124
- title: O.emptyMessage,
125
- actionLabel: O.addButton,
126
- onAction: E
124
+ title: k.emptyMessage,
125
+ actionLabel: k.addButton,
126
+ onAction: D
127
127
  })
128
128
  })]
129
129
  });
@@ -3,20 +3,34 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { Tabs as e, TabsContent as t, TabsList as n, TabsTrigger as r } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { createPortal as i } from "react-dom";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
8
  // ../../libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index17.js
8
- function o({ tabs: o, activeTabId: s, onTabChange: c, children: l }) {
9
- return /* @__PURE__ */ a(e, {
10
- value: s,
11
- onValueChange: c,
9
+ function s({ headerStart: s, headerActionContainer: c, headerAction: l, tabs: u, activeTabId: d, onTabChange: f, children: p }) {
10
+ return /* @__PURE__ */ o(e, {
11
+ value: d,
12
+ onValueChange: f,
12
13
  className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-4",
13
- children: [/* @__PURE__ */ i(n, { children: o.map((e) => /* @__PURE__ */ i(r, {
14
- value: e.id,
15
- children: e.label
16
- }, e.id)) }), /* @__PURE__ */ i(t, {
17
- value: s,
18
- children: l
19
- })]
14
+ children: [
15
+ c ? i(l, c) : null,
16
+ s ? /* @__PURE__ */ o("header", {
17
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-4",
18
+ children: [s, c === void 0 ? l : null]
19
+ }) : null,
20
+ /* @__PURE__ */ o("div", {
21
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
22
+ children: [/* @__PURE__ */ o("div", {
23
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-4",
24
+ children: [/* @__PURE__ */ a(n, { children: u.map((e) => /* @__PURE__ */ a(r, {
25
+ value: e.id,
26
+ children: e.label
27
+ }, e.id)) }), s || c !== void 0 ? null : l]
28
+ }), /* @__PURE__ */ a(t, {
29
+ value: d,
30
+ children: p
31
+ })]
32
+ })
33
+ ]
20
34
  });
21
35
  }
22
- export { o as TeamTabs, o as default };
36
+ export { s as TeamTabs, s as default };
@@ -0,0 +1,22 @@
1
+ import { Heading as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { useState as t } from "react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ // ../../libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsSectionContent.js
5
+ function i({ section: i }) {
6
+ let [a, o] = t(null), s = typeof i.content == "function";
7
+ return /* @__PURE__ */ r("div", {
8
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
9
+ children: [/* @__PURE__ */ r("header", {
10
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-4",
11
+ children: [/* @__PURE__ */ n(e, {
12
+ variant: "section",
13
+ level: 2,
14
+ children: i.label
15
+ }), s ? /* @__PURE__ */ n("div", {
16
+ ref: o,
17
+ className: "ttw:ml-auto ttw:shrink-0"
18
+ }) : null]
19
+ }), typeof i.content == "function" ? i.content(a) : i.content]
20
+ });
21
+ }
22
+ export { i as SettingsSectionContent };
@@ -3,14 +3,13 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { Tabs as e, TabsContent as t, TabsList as n, TabsTrigger as r } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { SectionHeading as i } from "../../../../../shared/ui/dist/lib/SectionHeading/SectionHeading.js";
7
- import "../../../../../shared/ui/dist/index.js";
8
- import { DEFAULT_LABELS as a } from "./labels.js";
6
+ import { DEFAULT_LABELS as i } from "./labels.js";
7
+ import { SettingsSectionContent as a } from "./SettingsSectionContent.js";
9
8
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
10
9
  // ../../libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js
11
10
  function c({ labels: c, sections: l, selectedSectionId: u, onSectionChange: d }) {
12
11
  let f = {
13
- ...a,
12
+ ...i,
14
13
  ...c
15
14
  };
16
15
  return /* @__PURE__ */ s("section", {
@@ -41,10 +40,10 @@ function c({ labels: c, sections: l, selectedSectionId: u, onSectionChange: d })
41
40
  })
42
41
  }), /* @__PURE__ */ o("div", {
43
42
  "data-slot": "settings-widget-content",
44
- className: "ttw:min-w-80 ttw:flex-1",
45
- children: l.map((e) => /* @__PURE__ */ s(t, {
43
+ className: "ttw:min-w-0 ttw:basis-80 ttw:grow",
44
+ children: l.map((e) => /* @__PURE__ */ o(t, {
46
45
  value: e.id,
47
- children: [/* @__PURE__ */ o(i, { children: e.label }), e.content]
46
+ children: /* @__PURE__ */ o(a, { section: e })
48
47
  }, e.id))
49
48
  })]
50
49
  })
@@ -15,47 +15,49 @@ import { useApprovalPolicyRules as s } from "./useApprovalPolicyRules.js";
15
15
  import { useMemo as c } from "react";
16
16
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
17
17
  // ../../libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js
18
- function d({ labels: d, componentLabels: f, headingComponent: p = "h3", showHeaderTitle: m = !0 } = {}) {
19
- let h = c(() => ({
18
+ function d({ headerStart: d, headerActionContainer: f, labels: p, componentLabels: m, headingComponent: h = "h3", showHeaderTitle: g = !0 } = {}) {
19
+ let _ = c(() => ({
20
20
  ...n,
21
- ...d
22
- }), [d]), g = s({
23
- labels: h,
24
- componentLabels: f
21
+ ...p
22
+ }), [p]), v = s({
23
+ labels: _,
24
+ componentLabels: m
25
25
  });
26
26
  return /* @__PURE__ */ u("div", {
27
27
  className: "ttw:flex ttw:flex-col ttw:gap-6",
28
28
  children: [
29
29
  /* @__PURE__ */ l(i, {
30
- labels: f?.header,
31
- headingComponent: p,
32
- showTitle: m,
33
- onAddRule: g.items.length > 0 && !g.isError ? g.onAddRule : void 0,
34
- addRuleDisabled: g.isBusy || g.editingId !== null || g.addRuleDisabledReason !== void 0,
35
- addRuleDisabledReason: g.addRuleDisabledReason,
30
+ headerStart: d,
31
+ headerActionContainer: f,
32
+ labels: m?.header,
33
+ headingComponent: h,
34
+ showTitle: g,
35
+ onAddRule: v.items.length > 0 && !v.isError ? v.onAddRule : void 0,
36
+ addRuleDisabled: v.isBusy || v.editingId !== null || v.addRuleDisabledReason !== void 0,
37
+ addRuleDisabledReason: v.addRuleDisabledReason,
36
38
  testIds: {
37
39
  addRuleButton: r.addRuleButton,
38
40
  addRuleBlocked: r.addRuleBlocked
39
41
  }
40
42
  }),
41
- g.isError ? /* @__PURE__ */ l(t, {
42
- title: h.loadErrorTitle,
43
- description: h.loadErrorDescription,
44
- retryLabel: h.loadErrorRetry,
45
- onRetry: g.onRetry
43
+ v.isError ? /* @__PURE__ */ l(t, {
44
+ title: _.loadErrorTitle,
45
+ description: _.loadErrorDescription,
46
+ retryLabel: _.loadErrorRetry,
47
+ onRetry: v.onRetry
46
48
  }) : /* @__PURE__ */ l(o, {
47
- items: g.items,
48
- editingId: g.editingId,
49
- onAddRule: g.onAddRule,
50
- gaps: g.gaps,
51
- onSelectGap: g.onSelectGap,
52
- unlistedPoliciesHeading: g.unlistedPoliciesHeading,
53
- unlistedPoliciesBlockAmounts: g.unlistedPoliciesBlockAmounts,
54
- unlistedPoliciesStillApply: g.unlistedPoliciesStillApply,
55
- createRuleDisabledReason: g.addRuleDisabledReason,
56
- isLoading: g.isLoading,
57
- disabled: g.isBusy,
58
- labels: f?.list,
49
+ items: v.items,
50
+ editingId: v.editingId,
51
+ onAddRule: v.onAddRule,
52
+ gaps: v.gaps,
53
+ onSelectGap: v.onSelectGap,
54
+ unlistedPoliciesHeading: v.unlistedPoliciesHeading,
55
+ unlistedPoliciesBlockAmounts: v.unlistedPoliciesBlockAmounts,
56
+ unlistedPoliciesStillApply: v.unlistedPoliciesStillApply,
57
+ createRuleDisabledReason: v.addRuleDisabledReason,
58
+ isLoading: v.isLoading,
59
+ disabled: v.isBusy,
60
+ labels: m?.list,
59
61
  testIds: {
60
62
  root: r.list,
61
63
  loading: r.listLoading,
@@ -69,14 +71,14 @@ function d({ labels: d, componentLabels: f, headingComponent: p = "h3", showHead
69
71
  }
70
72
  }),
71
73
  /* @__PURE__ */ l(a, {
72
- open: g.deleteDialog.open,
73
- details: g.deleteDialog.details,
74
- onOpenChange: g.deleteDialog.onOpenChange,
75
- onConfirm: g.deleteDialog.onConfirm,
76
- onCancel: g.deleteDialog.onCancel,
77
- isDeleting: g.deleteDialog.isDeleting,
78
- confirmDisabled: g.deleteDialog.confirmDisabled,
79
- labels: f?.deleteDialog,
74
+ open: v.deleteDialog.open,
75
+ details: v.deleteDialog.details,
76
+ onOpenChange: v.deleteDialog.onOpenChange,
77
+ onConfirm: v.deleteDialog.onConfirm,
78
+ onCancel: v.deleteDialog.onCancel,
79
+ isDeleting: v.deleteDialog.isDeleting,
80
+ confirmDisabled: v.deleteDialog.confirmDisabled,
81
+ labels: m?.deleteDialog,
80
82
  testIds: {
81
83
  root: r.deleteDialog,
82
84
  cancelButton: r.deleteDialogCancel,
@@ -1,20 +1,20 @@
1
1
  import "./index2.js";
2
2
  import { AmountConditionBuilder as e } from "./index3.js";
3
3
  import "./index4.js";
4
- import "./index5.js";
4
+ import { NoPolicyBanner as t } from "./index5.js";
5
5
  import "./index6.js";
6
- import "./index7.js";
6
+ import { GapCoverageAlert as n } from "./index7.js";
7
7
  import "./index8.js";
8
8
  import "./index9.js";
9
9
  import "./index10.js";
10
- import { ApprovalPoliciesHeader as t } from "./index11.js";
10
+ import { ApprovalPoliciesHeader as r } from "./index11.js";
11
11
  import "./index13.js";
12
12
  import "./index14.js";
13
- import { PolicyCardDefaultLabels as n } from "./index15.js";
13
+ import { PolicyCardDefaultLabels as i } from "./index15.js";
14
14
  import "./index16.js";
15
- import { PolicyCardFrame as r } from "./index17.js";
16
- import { DeleteRuleDialogDefaultLabels as i } from "./index18.js";
17
- import { DeleteRuleDialog as a } from "./index19.js";
15
+ import { PolicyCardFrame as a } from "./index17.js";
16
+ import { DeleteRuleDialogDefaultLabels as o } from "./index18.js";
17
+ import { DeleteRuleDialog as s } from "./index19.js";
18
18
  import "./index20.js";
19
- import { ApprovalPoliciesList as o } from "./index21.js";
20
- export { e as AmountConditionBuilder, t as ApprovalPoliciesHeader, o as ApprovalPoliciesList, a as DeleteRuleDialog, i as DeleteRuleDialogDefaultLabels, n as PolicyCardDefaultLabels, r as PolicyCardFrame };
19
+ import { ApprovalPoliciesList as c } from "./index21.js";
20
+ export { e as AmountConditionBuilder, r as ApprovalPoliciesHeader, c as ApprovalPoliciesList, s as DeleteRuleDialog, o as DeleteRuleDialogDefaultLabels, n as GapCoverageAlert, t as NoPolicyBanner, i as PolicyCardDefaultLabels, a as PolicyCardFrame };
@@ -1,47 +1,51 @@
1
1
  import { Button as e, Heading as t, Tooltip as n, TooltipContent as r, TooltipProvider as i, TooltipTrigger as a, Typography as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
2
  import { ApprovalPoliciesHeaderDefaultLabels as s } from "./index10.js";
3
3
  import { useMemo as c } from "react";
4
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
+ import { createPortal as l } from "react-dom";
5
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
5
6
  // ../../libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js
6
- var d = ({ onAddRule: d, addRuleDisabled: f, addRuleDisabledReason: p, labels: m, headingComponent: h = "h2", showTitle: g = !0, testIds: _ }) => {
7
- let v = c(() => ({
7
+ var f = ({ headerStart: f, headerActionContainer: p, onAddRule: m, addRuleDisabled: h, addRuleDisabledReason: g, labels: _, headingComponent: v = "h2", showTitle: y = !0, testIds: b }) => {
8
+ let x = c(() => ({
8
9
  ...s,
9
- ...m
10
- }), [m]), y = d ? /* @__PURE__ */ l(e, {
10
+ ..._
11
+ }), [_]), S = m ? /* @__PURE__ */ u(e, {
11
12
  type: "button",
12
- variant: "outline",
13
13
  size: "sm",
14
- onClick: d,
15
- disabled: f,
16
- "data-testid": _?.addRuleButton,
17
- className: "ttw:shrink-0",
18
- children: v.AddRule
19
- }) : null;
20
- return /* @__PURE__ */ u("div", {
21
- className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
22
- children: [/* @__PURE__ */ u("div", {
23
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
24
- children: [g ? /* @__PURE__ */ l(t, {
25
- variant: "section",
26
- level: Number(h.slice(1)),
27
- children: v.Title
28
- }) : null, /* @__PURE__ */ l(o, {
14
+ onClick: m,
15
+ disabled: h,
16
+ "data-testid": b?.addRuleButton,
17
+ className: "ttw:ml-auto ttw:shrink-0",
18
+ children: x.AddRule
19
+ }) : null, C = S && h && g ? /* @__PURE__ */ u(i, { children: /* @__PURE__ */ d(n, { children: [/* @__PURE__ */ u(a, {
20
+ asChild: !0,
21
+ children: /* @__PURE__ */ u("span", {
22
+ tabIndex: 0,
23
+ className: "ttw:ml-auto ttw:inline-flex ttw:shrink-0 ttw:cursor-not-allowed ttw:rounded-md",
24
+ "data-testid": b?.addRuleBlocked,
25
+ children: S
26
+ })
27
+ }), /* @__PURE__ */ u(r, {
28
+ side: "top",
29
+ children: g
30
+ })] }) }) : S;
31
+ return /* @__PURE__ */ d("div", {
32
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
33
+ children: [
34
+ p ? l(C, p) : null,
35
+ f || y || p === void 0 && C ? /* @__PURE__ */ d("div", {
36
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-4",
37
+ children: [f ?? (y ? /* @__PURE__ */ u(t, {
38
+ variant: "section",
39
+ level: Number(v.slice(1)),
40
+ children: x.Title
41
+ }) : null), p === void 0 ? C : null]
42
+ }) : null,
43
+ /* @__PURE__ */ u(o, {
29
44
  variant: "body2",
30
45
  color: "muted",
31
- children: v.Description
32
- })]
33
- }), y && f && p ? /* @__PURE__ */ l(i, { children: /* @__PURE__ */ u(n, { children: [/* @__PURE__ */ l(a, {
34
- asChild: !0,
35
- children: /* @__PURE__ */ l("span", {
36
- tabIndex: 0,
37
- className: "ttw:inline-flex ttw:shrink-0 ttw:cursor-not-allowed ttw:rounded-md",
38
- "data-testid": _?.addRuleBlocked,
39
- children: y
46
+ children: x.Description
40
47
  })
41
- }), /* @__PURE__ */ l(r, {
42
- side: "top",
43
- children: p
44
- })] }) }) : y]
48
+ ]
45
49
  });
46
50
  };
47
- export { d as ApprovalPoliciesHeader };
51
+ export { f as ApprovalPoliciesHeader };