@tesouro/embedded-components-react 0.11.71 → 0.11.73

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 (88) hide show
  1. package/README.md +1 -0
  2. package/dist/index.css +35 -192
  3. package/dist/index.d.ts +75 -71
  4. package/dist/lib/SettingsWidget.d.ts +5 -1
  5. package/dist/lib/WidgetSuite.d.ts +4 -0
  6. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index3.js +8 -7
  7. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index4.js +4 -1
  8. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index6.js +196 -131
  9. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index.js +4 -4
  10. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index3.js +11 -1
  11. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index4.js +5 -3
  12. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index5.js +38 -32
  13. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index6.js +103 -75
  14. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index7.js +140 -168
  15. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index8.js +97 -87
  16. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index7.js +11 -7
  17. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index8.js +0 -1
  18. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index2.js +3 -1
  19. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index3.js +134 -177
  20. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index4.js +110 -176
  21. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index5.js +28 -38
  22. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/ExpenseSettingsTabs/ExpenseSettingsTabs.js +13 -10
  23. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/SettingsWidget/SettingsWidget.js +28 -24
  24. package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +35 -31
  25. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +2 -0
  26. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index7.js +1 -5
  27. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index8.js +3 -0
  28. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index11.js +2 -1
  29. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index12.js +22 -36
  30. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index16.js +1 -1
  31. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index17.js +54 -60
  32. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index20.js +75 -60
  33. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index3.js +42 -27
  34. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index6.js +89 -82
  35. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index9.js +39 -38
  36. package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/feature/dist/index4.js +32 -32
  37. package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/ui/dist/index2.js +1 -1
  38. package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/ui/dist/index3.js +56 -71
  39. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index10.js +3 -0
  40. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index12.js +86 -66
  41. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index13.js +51 -51
  42. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index15.js +146 -132
  43. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +95 -99
  44. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index3.js +1 -0
  45. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index4.js +8 -27
  46. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index5.js +69 -72
  47. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index6.js +51 -51
  48. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index.js +9 -11
  49. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index10.js +83 -298
  50. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index11.js +13 -13
  51. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index12.js +122 -75
  52. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index13.js +41 -15
  53. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index14.js +7 -131
  54. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index15.js +147 -48
  55. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index16.js +240 -11
  56. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index17.js +15 -173
  57. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index2.js +38 -10
  58. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index3.js +5 -46
  59. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index4.js +52 -45
  60. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index5.js +101 -25
  61. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index6.js +40 -98
  62. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index7.js +415 -40
  63. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index8.js +261 -332
  64. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index9.js +15 -8
  65. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +2 -2
  66. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +9 -8
  67. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js +136 -122
  68. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index.js +9 -8
  69. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +16 -17
  70. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index12.js +99 -100
  71. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +1 -1
  72. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index17.js +8 -8
  73. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index18.js +10 -55
  74. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index19.js +34 -8
  75. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index20.js +8 -84
  76. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index21.js +86 -0
  77. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index3.js +13 -13
  78. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index5.js +17 -18
  79. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +33 -42
  80. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  81. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +24 -24
  82. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/FileDropZone/FileDropZone.js +62 -0
  83. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/LoadingRegion/LoadingRegion.js +1 -0
  84. package/dist/packages/shared-ui-shadcn/dist/index.js +2302 -2284
  85. package/package.json +1 -1
  86. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index18.js +0 -291
  87. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index19.js +0 -22
  88. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/avatarSwatch.js +0 -26
@@ -1,188 +1,187 @@
1
- import { Badge as e, Checkbox as t, Popover as n, PopoverAnchor as r, PopoverContent as i, Tooltip as a, TooltipContent as o, TooltipProvider as s, TooltipTrigger as c, Typography as l } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { Fragment as u, useId as d, useMemo as f, useRef as p, useState as m } from "react";
3
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
4
- import { ChevronDown as v, CircleAlert as y, X as b } from "lucide-react";
1
+ import { Checkbox as e, Popover as t, PopoverAnchor as n, PopoverContent as r, Tooltip as i, TooltipContent as a, TooltipProvider as o, TooltipTrigger as s, Typography as c } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { Fragment as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
3
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
4
+ import { ChevronDown as _, CircleAlert as v, X as y } from "lucide-react";
5
5
  // ../../libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index12.js
6
- function x({ id: e, label: t }) {
6
+ function b({ id: e, label: t }) {
7
7
  return {
8
8
  id: e,
9
9
  label: t
10
10
  };
11
11
  }
12
- function S({ option: e, isSelected: n, isDisabled: r, reason: i, onToggle: s }) {
13
- let l = /* @__PURE__ */ _("label", {
14
- "data-testid": `approver-option-${e.id}`,
12
+ function x({ option: t, isSelected: n, isDisabled: r, reason: o, onToggle: c }) {
13
+ let l = /* @__PURE__ */ g("label", {
14
+ "data-testid": `approver-option-${t.id}`,
15
15
  "aria-selected": n,
16
16
  "aria-disabled": r,
17
- className: `ttw:flex ttw:w-full ttw:items-center ttw:gap-2 ttw:rounded-sm ttw:px-2 ttw:py-1.5 ttw:text-sm ${r ? "ttw:cursor-not-allowed ttw:opacity-50" : "ttw:cursor-pointer hover:ttw:bg-accent hover:ttw:text-accent-foreground"}`,
17
+ className: `ttw:flex ttw:w-full ttw:items-center ttw:gap-2 ttw:rounded-sm ttw:px-2 ttw:py-1.5 ttw:text-sm ${r ? "ttw:cursor-not-allowed ttw:opacity-50" : "ttw:cursor-pointer ttw:hover:bg-accent ttw:hover:text-accent-foreground"}`,
18
18
  children: [
19
- /* @__PURE__ */ g(t, {
19
+ /* @__PURE__ */ h(e, {
20
20
  checked: n,
21
21
  onCheckedChange: () => {
22
- (!r || n) && s();
22
+ (!r || n) && c();
23
23
  }
24
24
  }),
25
- /* @__PURE__ */ g("span", {
25
+ /* @__PURE__ */ h("span", {
26
26
  className: "ttw:min-w-0 ttw:flex-1 ttw:truncate",
27
- children: e.label
27
+ children: t.label
28
28
  }),
29
- e.sublabel ? /* @__PURE__ */ g("span", {
29
+ t.sublabel ? /* @__PURE__ */ h("span", {
30
30
  className: "ttw:shrink-0 ttw:text-xs ttw:text-muted-foreground",
31
- children: e.sublabel
31
+ children: t.sublabel
32
32
  }) : null
33
33
  ]
34
34
  });
35
- return i ? /* @__PURE__ */ _(a, { children: [/* @__PURE__ */ g(c, {
35
+ return o ? /* @__PURE__ */ g(i, { children: [/* @__PURE__ */ h(s, {
36
36
  asChild: !0,
37
37
  children: l
38
- }), /* @__PURE__ */ g(o, {
38
+ }), /* @__PURE__ */ h(a, {
39
39
  side: "right",
40
- children: i
40
+ children: o
41
41
  })] }) : l;
42
42
  }
43
- var C = ({ value: t, options: C, onChange: w, lockedSections: T, lockedOptions: E, disabled: D, error: O, labels: k, testId: A }) => {
44
- let [j, M] = m(!1), [N, P] = m(""), F = d(), I = d(), L = p(null), R = p(null), z = f(() => new Set(t.map((e) => e.id)), [t]), B = f(() => {
45
- let e = N.trim().toLowerCase();
46
- return e ? C.filter((t) => t.label.toLowerCase().includes(e) || t.sublabel?.toLowerCase().includes(e)) : C;
47
- }, [C, N]), V = B.filter((e) => e.section === "roles"), H = B.filter((e) => e.section === "teamMembers"), U = (e) => {
48
- let t = T?.[e.section], n = E?.[e.id];
49
- return /* @__PURE__ */ g(S, {
43
+ var S = ({ value: e, options: S, onChange: C, lockedSections: w, lockedOptions: T, disabled: E, error: D, labels: O, testId: k }) => {
44
+ let [A, j] = p(!1), [M, N] = p(""), P = u(), F = u(), I = f(null), L = f(null), R = d(() => new Set(e.map((e) => e.id)), [e]), z = d(() => {
45
+ let e = M.trim().toLowerCase();
46
+ return e ? S.filter((t) => t.label.toLowerCase().includes(e) || t.sublabel?.toLowerCase().includes(e)) : S;
47
+ }, [S, M]), B = z.filter((e) => e.section === "roles"), V = z.filter((e) => e.section === "teamMembers"), H = (e) => {
48
+ let t = w?.[e.section], n = T?.[e.id];
49
+ return /* @__PURE__ */ h(x, {
50
50
  option: e,
51
- isSelected: z.has(e.id),
51
+ isSelected: R.has(e.id),
52
52
  isDisabled: !!e.disabled || !!t || !!n,
53
53
  reason: e.disabledReason ?? n ?? t,
54
- onToggle: () => W(e)
54
+ onToggle: () => U(e)
55
55
  }, e.id);
56
- }, W = (e) => {
57
- z.has(e.id) ? w(t.filter((t) => t.id !== e.id)) : w([...t, x(e)]), P(""), L.current?.focus();
58
- }, G = (e) => {
59
- w(t.filter((t) => t.id !== e));
60
- }, K = V.length > 0 && H.length > 0;
61
- return /* @__PURE__ */ g(s, { children: /* @__PURE__ */ _(n, {
62
- open: j,
56
+ }, U = (t) => {
57
+ R.has(t.id) ? C(e.filter((e) => e.id !== t.id)) : C([...e, b(t)]), N(""), I.current?.focus();
58
+ }, W = (t) => {
59
+ C(e.filter((e) => e.id !== t));
60
+ }, G = B.length > 0 && V.length > 0;
61
+ return /* @__PURE__ */ h(o, { children: /* @__PURE__ */ g(t, {
62
+ open: A,
63
63
  onOpenChange: (e) => {
64
- M(e), e || P("");
64
+ j(e), e || N("");
65
65
  },
66
- children: [/* @__PURE__ */ g(r, {
66
+ children: [/* @__PURE__ */ h(n, {
67
67
  asChild: !0,
68
- children: /* @__PURE__ */ _("div", {
69
- ref: R,
70
- className: `ttw:flex ttw:min-h-9 ttw:w-full ttw:cursor-text ttw:flex-wrap ttw:items-center ttw:gap-1.5 ttw:rounded-md ttw:border ttw:bg-transparent ttw:px-2.5 ttw:py-1.5 ttw:has-[:disabled]:cursor-not-allowed ttw:has-[:disabled]:opacity-60 ${O ? "ttw:border-destructive" : "ttw:border-input"}`,
68
+ children: /* @__PURE__ */ g("div", {
69
+ ref: L,
70
+ className: `ttw:flex ttw:min-h-9 ttw:w-full ttw:cursor-text ttw:flex-wrap ttw:items-center ttw:gap-1.5 ttw:rounded-md ttw:border ttw:bg-transparent ttw:px-2.5 ttw:py-1.5 ttw:has-[:disabled]:cursor-not-allowed ttw:has-[:disabled]:opacity-60 ${D ? "ttw:border-destructive" : "ttw:border-input"}`,
71
71
  children: [
72
- t.map((t, n) => /* @__PURE__ */ _(u, { children: [n > 0 ? /* @__PURE__ */ g("span", {
72
+ e.map((e, t) => /* @__PURE__ */ g(l, { children: [t > 0 ? /* @__PURE__ */ h("span", {
73
73
  className: "ttw:text-xs ttw:text-muted-foreground",
74
- children: k.ApproverConnector
75
- }) : null, /* @__PURE__ */ _(e, {
76
- variant: "outline",
77
- className: "ttw:gap-1 ttw:pr-1",
78
- children: [t.label, /* @__PURE__ */ g("button", {
74
+ children: O.ApproverConnector
75
+ }) : null, /* @__PURE__ */ g("span", {
76
+ className: "ttw:inline-flex ttw:w-fit ttw:shrink-0 ttw:items-center ttw:gap-1 ttw:whitespace-nowrap ttw:rounded-md ttw:border ttw:border-border ttw:py-0.5 ttw:pl-2 ttw:pr-1 ttw:text-xs ttw:font-medium ttw:text-foreground",
77
+ children: [e.label, /* @__PURE__ */ h("button", {
79
78
  type: "button",
80
- "aria-label": k.RemoveApproverAriaLabel.replace("{name}", t.label),
81
- onClick: (e) => {
82
- e.stopPropagation(), G(t.id);
79
+ "aria-label": O.RemoveApproverAriaLabel.replace("{name}", e.label),
80
+ onClick: (t) => {
81
+ t.stopPropagation(), W(e.id);
83
82
  },
84
- disabled: D,
85
- className: "ttw:inline-flex ttw:size-3.5 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-sm ttw:opacity-70 ttw:disabled:cursor-not-allowed hover:ttw:opacity-100",
86
- children: /* @__PURE__ */ g(b, { className: "ttw:size-3" })
83
+ disabled: E,
84
+ className: "ttw:inline-flex ttw:size-3.5 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-sm ttw:opacity-70 ttw:disabled:cursor-not-allowed ttw:hover:opacity-100",
85
+ children: /* @__PURE__ */ h(y, { className: "ttw:size-3" })
87
86
  })]
88
- })] }, t.id)),
89
- /* @__PURE__ */ g("label", {
90
- htmlFor: I,
87
+ })] }, e.id)),
88
+ /* @__PURE__ */ h("label", {
89
+ htmlFor: F,
91
90
  className: "ttw:flex ttw:min-w-16 ttw:flex-1 ttw:cursor-text ttw:self-stretch ttw:items-center",
92
- children: /* @__PURE__ */ g("input", {
93
- id: I,
94
- ref: L,
91
+ children: /* @__PURE__ */ h("input", {
92
+ id: F,
93
+ ref: I,
95
94
  type: "text",
96
- value: N,
95
+ value: M,
97
96
  onChange: (e) => {
98
- P(e.target.value), M(!0);
97
+ N(e.target.value), j(!0);
99
98
  },
100
- onFocus: () => M(!0),
101
- onClick: () => M(!0),
102
- disabled: D,
103
- placeholder: t.length === 0 ? k.ChoosePlaceholder : "",
104
- "aria-label": k.ChoosePlaceholder,
105
- "aria-invalid": !!O,
106
- "aria-describedby": O ? F : void 0,
107
- "data-testid": A,
99
+ onFocus: () => j(!0),
100
+ onClick: () => j(!0),
101
+ disabled: E,
102
+ placeholder: e.length === 0 ? O.ChoosePlaceholder : "",
103
+ "aria-label": O.ChoosePlaceholder,
104
+ "aria-invalid": !!D,
105
+ "aria-describedby": D ? P : void 0,
106
+ "data-testid": k,
108
107
  className: "ttw:w-full ttw:bg-transparent ttw:text-sm ttw:outline-none ttw:placeholder:text-muted-foreground ttw:disabled:cursor-not-allowed"
109
108
  })
110
109
  }),
111
- O ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(a, { children: [/* @__PURE__ */ g(c, {
110
+ D ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g(i, { children: [/* @__PURE__ */ h(s, {
112
111
  asChild: !0,
113
- children: /* @__PURE__ */ g("button", {
112
+ children: /* @__PURE__ */ h("button", {
114
113
  type: "button",
115
- "aria-labelledby": F,
114
+ "aria-labelledby": P,
116
115
  onClick: (e) => e.stopPropagation(),
117
116
  className: "ttw:ml-auto ttw:inline-flex ttw:shrink-0 ttw:items-center ttw:rounded",
118
- children: /* @__PURE__ */ g(y, { className: "ttw:size-4 ttw:text-destructive" })
117
+ children: /* @__PURE__ */ h(v, { className: "ttw:size-4 ttw:text-destructive" })
119
118
  })
120
- }), /* @__PURE__ */ g(o, {
119
+ }), /* @__PURE__ */ h(a, {
121
120
  side: "top",
122
- children: O
123
- })] }), /* @__PURE__ */ g("span", {
124
- id: F,
121
+ children: D
122
+ })] }), /* @__PURE__ */ h("span", {
123
+ id: P,
125
124
  role: "alert",
126
125
  className: "ttw:sr-only",
127
- children: O
126
+ children: D
128
127
  })] }) : null,
129
- /* @__PURE__ */ g(v, {
128
+ /* @__PURE__ */ h(_, {
130
129
  "aria-hidden": "true",
131
- className: `ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground ${O ? "ttw:ml-1" : "ttw:ml-auto"}`
130
+ className: `ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground ${D ? "ttw:ml-1" : "ttw:ml-auto"}`
132
131
  })
133
132
  ]
134
133
  })
135
- }), /* @__PURE__ */ g(i, {
134
+ }), /* @__PURE__ */ h(r, {
136
135
  align: "start",
137
136
  sideOffset: 4,
138
137
  onOpenAutoFocus: (e) => e.preventDefault(),
139
138
  onInteractOutside: (e) => {
140
- e.target instanceof Node && R.current?.contains(e.target) && e.preventDefault();
139
+ e.target instanceof Node && L.current?.contains(e.target) && e.preventDefault();
141
140
  },
142
141
  className: "ttw:w-[var(--radix-popover-trigger-width)] ttw:min-w-80 ttw:p-2",
143
- children: /* @__PURE__ */ g("div", {
142
+ children: /* @__PURE__ */ h("div", {
144
143
  className: "ttw:max-h-64 ttw:overflow-y-auto",
145
- children: B.length === 0 ? /* @__PURE__ */ g(l, {
144
+ children: z.length === 0 ? /* @__PURE__ */ h(c, {
146
145
  variant: "body2",
147
146
  color: "muted",
148
147
  className: "ttw:px-2 ttw:py-1.5",
149
- children: C.length === 0 ? k.NoOptionsMessage : k.NoResultsMessage
150
- }) : /* @__PURE__ */ _(h, { children: [
151
- V.length > 0 ? /* @__PURE__ */ _("div", {
148
+ children: S.length === 0 ? O.NoOptionsMessage : O.NoResultsMessage
149
+ }) : /* @__PURE__ */ g(m, { children: [
150
+ B.length > 0 ? /* @__PURE__ */ g("div", {
152
151
  role: "group",
153
- "aria-label": k.RolesSectionHeading,
154
- children: [/* @__PURE__ */ g(l, {
152
+ "aria-label": O.RolesSectionHeading,
153
+ children: [/* @__PURE__ */ h(c, {
155
154
  variant: "body2",
156
155
  color: "muted",
157
156
  className: "ttw:block ttw:px-2 ttw:py-1",
158
- children: k.RolesSectionHeading
159
- }), V.map(U)]
157
+ children: O.RolesSectionHeading
158
+ }), B.map(H)]
160
159
  }) : null,
161
- K ? /* @__PURE__ */ _("div", {
160
+ G ? /* @__PURE__ */ g("div", {
162
161
  className: "ttw:my-1 ttw:flex ttw:items-center ttw:gap-2 ttw:px-2",
163
162
  children: [
164
- /* @__PURE__ */ g("div", { className: "ttw:h-px ttw:flex-1 ttw:bg-border" }),
165
- /* @__PURE__ */ g(l, {
163
+ /* @__PURE__ */ h("div", { className: "ttw:h-px ttw:flex-1 ttw:bg-border" }),
164
+ /* @__PURE__ */ h(c, {
166
165
  variant: "caption",
167
166
  color: "muted",
168
- children: k.OrDividerLabel
167
+ children: O.OrDividerLabel
169
168
  }),
170
- /* @__PURE__ */ g("div", { className: "ttw:h-px ttw:flex-1 ttw:bg-border" })
169
+ /* @__PURE__ */ h("div", { className: "ttw:h-px ttw:flex-1 ttw:bg-border" })
171
170
  ]
172
171
  }) : null,
173
- H.length > 0 ? /* @__PURE__ */ _("div", {
172
+ V.length > 0 ? /* @__PURE__ */ g("div", {
174
173
  role: "group",
175
- "aria-label": k.TeamMembersSectionHeading,
176
- children: [/* @__PURE__ */ g(l, {
174
+ "aria-label": O.TeamMembersSectionHeading,
175
+ children: [/* @__PURE__ */ h(c, {
177
176
  variant: "body2",
178
177
  color: "muted",
179
178
  className: "ttw:block ttw:px-2 ttw:py-1",
180
- children: k.TeamMembersSectionHeading
181
- }), H.map(U)]
179
+ children: O.TeamMembersSectionHeading
180
+ }), V.map(H)]
182
181
  }) : null
183
182
  ] })
184
183
  })
185
184
  })]
186
185
  }) });
187
186
  };
188
- export { C as ApproverPicker };
187
+ export { S as ApproverPicker };
@@ -124,7 +124,7 @@ var g = ({ id: g, title: _, sentence: v, approverSteps: y, approverOptions: b, a
124
124
  color: "muted",
125
125
  children: V.ApproverConnector
126
126
  }) : null, /* @__PURE__ */ f(e, {
127
- variant: "outline",
127
+ variant: "secondary",
128
128
  children: t.label
129
129
  })] }, t.id))
130
130
  })] }, t.id))]
@@ -1,9 +1,9 @@
1
+ import { jsx as e } from "react/jsx-runtime";
1
2
  // ../../libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index17.js
2
- var e = {
3
- Title: "Delete this rule?",
4
- Description: "You can't undo this action.",
5
- Cancel: "Cancel",
6
- Delete: "Delete",
7
- Close: "Close"
8
- };
9
- export { e as DeleteRuleDialogDefaultLabels };
3
+ function t({ className: t = "", ...n }) {
4
+ return /* @__PURE__ */ e("div", {
5
+ className: `ttw:flex ttw:w-full ttw:flex-col ttw:gap-4 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6 ${t}`,
6
+ ...n
7
+ });
8
+ }
9
+ export { t as PolicyCardFrame };
@@ -1,57 +1,12 @@
1
- import { AlertDialog as e, AlertDialogContent as t, AlertDialogDescription as n, AlertDialogFooter as r, AlertDialogHeader as i, AlertDialogTitle as a, Button as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { DeleteRuleDialogDefaultLabels as s } from "./index17.js";
3
- import { useMemo as c } from "react";
4
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
5
- import { Trash2 as d } from "lucide-react";
6
1
  // ../../libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index18.js
7
- var f = ({ open: f, onOpenChange: p, onConfirm: m, onCancel: h, isDeleting: g, confirmDisabled: _, labels: v, testIds: y }) => {
8
- let b = c(() => ({
9
- ...s,
10
- ...v
11
- }), [v]);
12
- return /* @__PURE__ */ l(e, {
13
- open: f,
14
- onOpenChange: p,
15
- children: /* @__PURE__ */ u(t, {
16
- closeDisabled: g,
17
- labels: { close: b.Close },
18
- "data-testid": y?.root,
19
- className: "ttw:sm:max-w-sm",
20
- children: [/* @__PURE__ */ u(i, {
21
- className: "ttw:items-center ttw:text-center",
22
- children: [
23
- /* @__PURE__ */ l("div", {
24
- className: "ttw:flex ttw:size-11 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-destructive",
25
- children: /* @__PURE__ */ l(d, {
26
- className: "ttw:size-4 ttw:text-white",
27
- "aria-hidden": "true"
28
- })
29
- }),
30
- /* @__PURE__ */ l(a, { children: b.Title }),
31
- /* @__PURE__ */ l(n, { children: b.Description })
32
- ]
33
- }), /* @__PURE__ */ u(r, {
34
- className: "ttw:sm:justify-center",
35
- children: [/* @__PURE__ */ l(o, {
36
- type: "button",
37
- variant: "outline",
38
- onClick: h,
39
- disabled: g,
40
- className: "ttw:flex-1",
41
- "data-testid": y?.cancelButton,
42
- children: b.Cancel
43
- }), /* @__PURE__ */ u(o, {
44
- type: "button",
45
- variant: "destructive",
46
- onClick: m,
47
- disabled: g || _,
48
- loading: g,
49
- className: "ttw:flex-1",
50
- "data-testid": y?.confirmButton,
51
- children: [/* @__PURE__ */ l(d, {}), b.Delete]
52
- })]
53
- })]
54
- })
55
- });
2
+ var e = {
3
+ Title: "Delete this rule?",
4
+ Description: "You can't undo this action.",
5
+ Cancel: "Cancel",
6
+ Delete: "Delete",
7
+ Close: "Close",
8
+ Range: "Range",
9
+ Approvers: "Approvers",
10
+ Outcome: "Outcome"
56
11
  };
57
- export { f as DeleteRuleDialog };
12
+ export { e as DeleteRuleDialogDefaultLabels };
@@ -1,10 +1,36 @@
1
- import { NoPolicyBannerDefaultLabels as e } from "./index4.js";
2
- import { GapCoverageAlertDefaultLabels as t } from "./index6.js";
3
- import { UnlistedPoliciesNoticeDefaultLabels as n } from "./index8.js";
1
+ import { ConfirmDialog as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { DeleteRuleDialogDefaultLabels as t } from "./index18.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import { Trash2 as r } from "lucide-react";
4
5
  // ../../libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index19.js
5
- var r = {
6
- GapCoverageAlert: t,
7
- NoPolicyBanner: e,
8
- UnlistedPoliciesNotice: n
6
+ var i = ({ open: i, onOpenChange: a, onConfirm: o, onCancel: s, isDeleting: c, confirmDisabled: l, labels: u, details: d, testIds: f }) => {
7
+ let p = {
8
+ ...t,
9
+ ...u
10
+ };
11
+ return /* @__PURE__ */ n(e, {
12
+ open: i,
13
+ onOpenChange: (e) => {
14
+ !e && !c && s(), c || a(e);
15
+ },
16
+ title: p.Title,
17
+ description: p.Description,
18
+ details: d,
19
+ icon: /* @__PURE__ */ n(r, { "aria-hidden": !0 }),
20
+ destructive: !0,
21
+ loading: c,
22
+ confirmDisabled: l,
23
+ onConfirm: o,
24
+ labels: {
25
+ confirm: p.Delete,
26
+ cancel: p.Cancel,
27
+ close: p.Close
28
+ },
29
+ testIds: {
30
+ content: f?.root,
31
+ cancel: f?.cancelButton,
32
+ confirm: f?.confirmButton
33
+ }
34
+ });
9
35
  };
10
- export { r as ApprovalPoliciesListDefaultLabels };
36
+ export { i as DeleteRuleDialog };
@@ -1,86 +1,10 @@
1
- import { Skeleton as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { NoPolicyBanner as t } from "./index5.js";
3
- import { GapCoverageAlert as n } from "./index7.js";
4
- import { UnlistedPoliciesNotice as r } from "./index9.js";
5
- import { PolicyCard as i } from "./index16.js";
6
- import { ApprovalPoliciesListDefaultLabels as a } from "./index19.js";
7
- import { useMemo as o } from "react";
8
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
1
+ import { NoPolicyBannerDefaultLabels as e } from "./index4.js";
2
+ import { GapCoverageAlertDefaultLabels as t } from "./index6.js";
3
+ import { UnlistedPoliciesNoticeDefaultLabels as n } from "./index8.js";
9
4
  // ../../libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index20.js
10
- var l = ({ items: l, editingId: u, onAddRule: d, gaps: f, onSelectGap: p, unlistedPoliciesHeading: m, unlistedPoliciesBlockAmounts: h, unlistedPoliciesStillApply: g, createRuleDisabledReason: _, isLoading: v, disabled: y, labels: b, testIds: x }) => {
11
- let S = o(() => ({
12
- ...a,
13
- ...b,
14
- GapCoverageAlert: {
15
- ...a.GapCoverageAlert,
16
- ...b?.GapCoverageAlert
17
- },
18
- NoPolicyBanner: {
19
- ...a.NoPolicyBanner,
20
- ...b?.NoPolicyBanner
21
- },
22
- UnlistedPoliciesNotice: {
23
- ...a.UnlistedPoliciesNotice,
24
- ...b?.UnlistedPoliciesNotice
25
- }
26
- }), [b]), C = m ? /* @__PURE__ */ s(r, {
27
- heading: m,
28
- showAmountsBlocked: h,
29
- showStillApply: g,
30
- labels: S.UnlistedPoliciesNotice,
31
- testIds: x?.unlistedPoliciesNotice
32
- }) : null;
33
- if (v && l.length === 0) return /* @__PURE__ */ s("div", {
34
- "data-testid": x?.loading,
35
- className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-4",
36
- children: Array.from({ length: 2 }).map((t, n) => /* @__PURE__ */ c("div", {
37
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
38
- children: [
39
- /* @__PURE__ */ c("div", {
40
- className: "ttw:flex ttw:items-center ttw:justify-between",
41
- children: [/* @__PURE__ */ s(e, { className: "ttw:h-5 ttw:w-64" }), /* @__PURE__ */ s(e, { className: "ttw:h-8 ttw:w-8" })]
42
- }),
43
- /* @__PURE__ */ s(e, { className: "ttw:h-4 ttw:w-80" }),
44
- /* @__PURE__ */ s(e, { className: "ttw:h-6 ttw:w-32" })
45
- ]
46
- }, n))
47
- });
48
- if (l.length === 0) return /* @__PURE__ */ c("div", {
49
- className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-4",
50
- children: [C, /* @__PURE__ */ s(t, {
51
- onCreateRule: d,
52
- disabled: y || _ !== void 0,
53
- createRuleDisabledReason: _,
54
- hasUnlistedRules: m !== void 0,
55
- labels: S.NoPolicyBanner,
56
- testIds: x?.noPolicyBanner
57
- })]
58
- });
59
- let w = u !== null;
60
- return /* @__PURE__ */ c("div", {
61
- "data-testid": x?.root,
62
- className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-4",
63
- children: [
64
- C,
65
- /* @__PURE__ */ s("div", {
66
- className: "ttw:flex ttw:flex-col ttw:gap-4",
67
- children: l.map((e) => {
68
- let t = e.id === u;
69
- return /* @__PURE__ */ s(i, {
70
- ...e,
71
- isEditing: t,
72
- disabled: y || w && !t
73
- }, e.id);
74
- })
75
- }),
76
- f.length > 0 ? /* @__PURE__ */ s(n, {
77
- gaps: f,
78
- onSelectGap: p,
79
- disabled: y || w,
80
- labels: S.GapCoverageAlert,
81
- testIds: x?.gapCoverageAlert
82
- }) : null
83
- ]
84
- });
5
+ var r = {
6
+ GapCoverageAlert: t,
7
+ NoPolicyBanner: e,
8
+ UnlistedPoliciesNotice: n
85
9
  };
86
- export { l as ApprovalPoliciesList };
10
+ export { r as ApprovalPoliciesListDefaultLabels };
@@ -0,0 +1,86 @@
1
+ import { Skeleton as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { NoPolicyBanner as t } from "./index5.js";
3
+ import { GapCoverageAlert as n } from "./index7.js";
4
+ import { UnlistedPoliciesNotice as r } from "./index9.js";
5
+ import { PolicyCard as i } from "./index16.js";
6
+ import { ApprovalPoliciesListDefaultLabels as a } from "./index20.js";
7
+ import { useMemo as o } from "react";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ // ../../libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index21.js
10
+ var l = ({ items: l, editingId: u, onAddRule: d, gaps: f, onSelectGap: p, unlistedPoliciesHeading: m, unlistedPoliciesBlockAmounts: h, unlistedPoliciesStillApply: g, createRuleDisabledReason: _, isLoading: v, disabled: y, labels: b, testIds: x }) => {
11
+ let S = o(() => ({
12
+ ...a,
13
+ ...b,
14
+ GapCoverageAlert: {
15
+ ...a.GapCoverageAlert,
16
+ ...b?.GapCoverageAlert
17
+ },
18
+ NoPolicyBanner: {
19
+ ...a.NoPolicyBanner,
20
+ ...b?.NoPolicyBanner
21
+ },
22
+ UnlistedPoliciesNotice: {
23
+ ...a.UnlistedPoliciesNotice,
24
+ ...b?.UnlistedPoliciesNotice
25
+ }
26
+ }), [b]), C = m ? /* @__PURE__ */ s(r, {
27
+ heading: m,
28
+ showAmountsBlocked: h,
29
+ showStillApply: g,
30
+ labels: S.UnlistedPoliciesNotice,
31
+ testIds: x?.unlistedPoliciesNotice
32
+ }) : null;
33
+ if (v && l.length === 0) return /* @__PURE__ */ s("div", {
34
+ "data-testid": x?.loading,
35
+ className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-4",
36
+ children: Array.from({ length: 2 }).map((t, n) => /* @__PURE__ */ c("div", {
37
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:p-6",
38
+ children: [
39
+ /* @__PURE__ */ c("div", {
40
+ className: "ttw:flex ttw:items-center ttw:justify-between",
41
+ children: [/* @__PURE__ */ s(e, { className: "ttw:h-5 ttw:w-64" }), /* @__PURE__ */ s(e, { className: "ttw:h-8 ttw:w-8" })]
42
+ }),
43
+ /* @__PURE__ */ s(e, { className: "ttw:h-4 ttw:w-80" }),
44
+ /* @__PURE__ */ s(e, { className: "ttw:h-6 ttw:w-32" })
45
+ ]
46
+ }, n))
47
+ });
48
+ if (l.length === 0) return /* @__PURE__ */ c("div", {
49
+ className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-4",
50
+ children: [C, /* @__PURE__ */ s(t, {
51
+ onCreateRule: d,
52
+ disabled: y || _ !== void 0,
53
+ createRuleDisabledReason: _,
54
+ hasUnlistedRules: m !== void 0,
55
+ labels: S.NoPolicyBanner,
56
+ testIds: x?.noPolicyBanner
57
+ })]
58
+ });
59
+ let w = u !== null;
60
+ return /* @__PURE__ */ c("div", {
61
+ "data-testid": x?.root,
62
+ className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-4",
63
+ children: [
64
+ C,
65
+ /* @__PURE__ */ s("div", {
66
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
67
+ children: l.map((e) => {
68
+ let t = e.id === u;
69
+ return /* @__PURE__ */ s(i, {
70
+ ...e,
71
+ isEditing: t,
72
+ disabled: y || w && !t
73
+ }, e.id);
74
+ })
75
+ }),
76
+ f.length > 0 ? /* @__PURE__ */ s(n, {
77
+ gaps: f,
78
+ onSelectGap: p,
79
+ disabled: y || w,
80
+ labels: S.GapCoverageAlert,
81
+ testIds: x?.gapCoverageAlert
82
+ }) : null
83
+ ]
84
+ });
85
+ };
86
+ export { l as ApprovalPoliciesList };