@tesouro/embedded-components-react 0.11.101 → 0.11.104

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 (50) hide show
  1. package/dist/index.css +21 -17
  2. package/dist/index.d.ts +10 -6
  3. package/dist/lib/CardDetailsWidget.d.ts +6 -4
  4. package/dist/lib/CreditCardsWidget.d.ts +6 -4
  5. package/dist/lib/DebitCardsWidget.d.ts +6 -4
  6. package/dist/lib/SettingsWidget.d.ts +2 -1
  7. package/dist/lib/WidgetSuite.d.ts +8 -5
  8. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +199 -168
  9. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +1 -0
  10. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +44 -43
  11. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +56 -52
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +68 -63
  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/settings-widget/chart-of-accounts/ui/dist/index3.js +98 -91
  27. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/ExpenseSettingsTabs/ExpenseSettingsTabs.js +24 -21
  28. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/SettingsWidget/SettingsWidget.js +14 -8
  29. package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +2 -2
  30. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +87 -81
  31. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index3.js +63 -44
  32. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index6.js +9 -6
  33. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +302 -276
  34. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index.js +10 -10
  35. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index12.js +36 -36
  36. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index17.js +27 -13
  37. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsSectionContent.js +22 -0
  38. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +6 -7
  39. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +39 -37
  40. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index.js +9 -9
  41. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +39 -35
  42. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +59 -61
  43. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index4.js +2 -2
  44. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index6.js +2 -2
  45. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +3 -3
  46. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -103
  47. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  48. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +12 -12
  49. package/dist/packages/shared-ui-shadcn/dist/index.js +18 -15
  50. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index3.js
2
2
  var e = {
3
3
  Title: "Expense approvals",
4
- Description: "Configure who needs to approve expenses and under what conditions. A company admin can always approve a transaction even if the manager hasn't yet got to it.",
4
+ Description: "Set who needs to approve expenses.",
5
5
  TabApprovals: "Approvals",
6
6
  TabRequirements: "Requirements",
7
7
  AllExpensesCoveredTitle: "All expense amounts are covered",
@@ -11,22 +11,32 @@ var e = {
11
11
  LoadingRules: "Loading approval rules"
12
12
  }, t = {
13
13
  Outcome: "Approval outcome",
14
- ForExpenses: "For",
15
- ExpensesBold: "expenses",
16
- GreaterThanOrEqualTo: "greater than or equal to",
17
- AndLessThan: "and less than",
18
- MinimumPlaceholder: "0",
14
+ ForExpenses: "If the",
15
+ ExpensesBold: "amount is",
16
+ GreaterThanOrEqualTo: "between",
17
+ AndLessThan: "and",
18
+ MinimumPlaceholder: "0.00",
19
19
  MaximumPlaceholder: "No limit",
20
20
  AutoApprove: "Auto-approve",
21
21
  RequireApproval: "Require approval",
22
- RequireApprovalCaption: "Company admins can always approve, even if no manager has acted yet.",
23
- RequireApprovalFrom: "Require approval from",
24
- ChooseApprovers: "Choose approvers...",
22
+ ThenRequireApproval: "Then require approval…",
23
+ RequireApprovalCaption: "A company admin can approve before the manager has acted.",
24
+ RequireApprovalFrom: "From",
25
+ ChooseApprovers: "Select approvers",
25
26
  ApproverSeparator: "or",
26
27
  DeleteRule: "Delete rule",
27
28
  Cancel: "Cancel",
28
29
  Save: "Save"
29
30
  }, n = {
31
+ TitleAll: "All expenses",
32
+ TitleUpTo: "Expenses up to {upper}",
33
+ TitleFrom: "Expenses {lower} and above",
34
+ TitleRange: "Expenses between {lower} and {upper}",
35
+ SentenceAll: "For any amount, require approval from…",
36
+ SentenceUpTo: "If the amount is up to {upper}, then require approval from…",
37
+ SentenceFrom: "If the amount is {lower} or more, then require approval from…",
38
+ SentenceRange: "If the amount is between {lower} and {upper}, then require approval from…",
39
+ SentenceAutoApprove: "Automatically approve expenses in this range.",
30
40
  For: "For",
31
41
  All: "all",
32
42
  Expenses: "expenses",
@@ -36,11 +46,10 @@ var e = {
36
46
  RequireApprovalFrom: "Require approval from",
37
47
  AutoApprove: "Auto-approve",
38
48
  ApproverSeparator: "or",
39
- DeleteRuleAriaLabel: "Delete rule",
40
49
  EditRuleAriaLabel: "Edit rule"
41
50
  }, r = {
42
51
  Title: "No approval rules configured",
43
- Body: "The system default currently applies to all expenses requiring approval from a company admin.",
52
+ Body: "Company admin approval is required when no rule covers an expense amount.",
44
53
  AddRule: "Add rule",
45
54
  LearnMore: "Learn more about expense approvals ↗"
46
55
  }, i = {
@@ -48,11 +57,13 @@ var e = {
48
57
  FailedToSave: "Failed to save.",
49
58
  ConflictsWithAnotherRule: "This conflicts with another rule."
50
59
  }, a = {
51
- Prefix: "The",
52
- Default: "system default",
53
- AfterDefault: "will apply to transactions",
54
- Suffix: ", requiring approval from a company admin.",
55
- Above: "above",
56
- RangeSeparator: "–"
60
+ Title: "No rules cover the following expense amount ranges",
61
+ Footer: "When no rule covers an expense amount, company admin approval is required.",
62
+ Prefix: "Company admin approval",
63
+ Default: "is required",
64
+ AfterDefault: "for expenses",
65
+ Suffix: ".",
66
+ Above: "at or above",
67
+ RangeSeparator: "to"
57
68
  };
58
69
  export { n as ApprovalRuleCardLabels, t as ApprovalRuleFormLabels, i as ApprovalRuleToastLabels, r as EmptyApprovalRulesLabels, e as ExpenseApprovalsPageLabels, a as GapCalloutLabels };
@@ -1,42 +1,29 @@
1
- import { Button as e, Typography as t } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
1
+ import { Button as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { NoPolicyBanner as t } from "../../../../shared/approval-policy/ui/dist/index5.js";
3
+ import "../../../../shared/approval-policy/ui/dist/index.js";
2
4
  import { EmptyApprovalRulesLabels as n } from "./index3.js";
3
5
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { ShieldCheck as a } from "lucide-react";
5
6
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index5.js
6
- var o = ({ onAddRule: o, labels: s, onLearnMore: c }) => {
7
- let l = {
7
+ var a = ({ onAddRule: a, labels: o, onLearnMore: s }) => {
8
+ let c = {
8
9
  ...n,
9
- ...s
10
+ ...o
10
11
  };
11
12
  return /* @__PURE__ */ i("div", {
12
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:py-12 ttw:gap-4 ttw:w-full ttw:max-w-[600px] ttw:mx-auto",
13
- children: [
14
- /* @__PURE__ */ r("div", {
15
- className: "ttw:w-12 ttw:h-12 ttw:rounded-full ttw:bg-muted ttw:flex ttw:items-center ttw:justify-center ttw:text-muted-foreground",
16
- children: /* @__PURE__ */ r(a, { size: 20 })
17
- }),
18
- /* @__PURE__ */ r(t, {
19
- variant: "h6",
20
- children: l.Title
21
- }),
22
- /* @__PURE__ */ r(t, {
23
- variant: "body2",
24
- color: "muted",
25
- className: "ttw:text-center",
26
- children: l.Body
27
- }),
28
- /* @__PURE__ */ r(e, {
29
- onClick: o,
30
- className: "ttw:mt-1",
31
- children: l.AddRule
32
- }),
33
- c && /* @__PURE__ */ r(e, {
34
- variant: "link",
35
- className: "ttw:text-muted-foreground",
36
- onClick: c,
37
- children: l.LearnMore
38
- })
39
- ]
13
+ className: "ttw:flex ttw:w-full ttw:flex-col ttw:items-center ttw:gap-4",
14
+ children: [/* @__PURE__ */ r(t, {
15
+ onCreateRule: a,
16
+ labels: {
17
+ Title: c.Title,
18
+ Body: c.Body,
19
+ CreateRule: c.AddRule
20
+ }
21
+ }), s && /* @__PURE__ */ r(e, {
22
+ variant: "link",
23
+ className: "ttw:text-muted-foreground",
24
+ onClick: s,
25
+ children: c.LearnMore
26
+ })]
40
27
  });
41
28
  };
42
- export { o as EmptyApprovalRules };
29
+ export { a as EmptyApprovalRules };
@@ -1,116 +1,109 @@
1
- import { Badge as e, Button as t, Tooltip as n, TooltipContent as r, TooltipProvider as i, TooltipTrigger as a } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { PolicyCardFrame as o } from "../../../../shared/approval-policy/ui/dist/index17.js";
1
+ import { Badge as e, Button as t, Typography as n } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { PolicyCardFrame as r } from "../../../../shared/approval-policy/ui/dist/index17.js";
3
3
  import "../../../../shared/approval-policy/ui/dist/index.js";
4
- import { AmountConditionType as s, ApprovalOutcomeType as c } from "./index2.js";
5
- import { ApprovalRuleCardLabels as l } from "./index3.js";
6
- import { formatAmount as u } from "./index4.js";
7
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
8
- import { Trash2 as m } from "lucide-react";
4
+ import { AmountConditionType as i, ApprovalOutcomeType as a } from "./index2.js";
5
+ import { ApprovalRuleCardLabels as o } from "./index3.js";
6
+ import { formatAmount as s } from "./index4.js";
7
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
9
8
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index6.js
10
- function h({ conditionType: e, minAmount: t, maxAmount: n, labels: r }) {
11
- let i = (e) => /* @__PURE__ */ f("strong", { children: u(e) });
9
+ function d({ conditionType: e, minAmount: t, maxAmount: n, labels: r }) {
10
+ let a = (e) => /* @__PURE__ */ l("strong", { children: s(e) });
12
11
  switch (e) {
13
- case s.LessThan: return /* @__PURE__ */ p(d, { children: [
12
+ case i.LessThan: return /* @__PURE__ */ u(c, { children: [
14
13
  r.For,
15
14
  " ",
16
- /* @__PURE__ */ f("strong", { children: r.Expenses }),
15
+ /* @__PURE__ */ l("strong", { children: r.Expenses }),
17
16
  " ",
18
17
  r.LessThan,
19
18
  " ",
20
- i(n ?? 0)
19
+ a(n ?? 0)
21
20
  ] });
22
- case s.InRange: return /* @__PURE__ */ p(d, { children: [
21
+ case i.InRange: return /* @__PURE__ */ u(c, { children: [
23
22
  r.For,
24
23
  " ",
25
- /* @__PURE__ */ f("strong", { children: r.Expenses }),
24
+ /* @__PURE__ */ l("strong", { children: r.Expenses }),
26
25
  " ",
27
26
  r.GreaterThanOrEqual,
28
27
  " ",
29
- i(t ?? 0),
28
+ a(t ?? 0),
30
29
  " ",
31
30
  r.AndLessThan,
32
31
  " ",
33
- i(n ?? 0)
32
+ a(n ?? 0)
34
33
  ] });
35
- case s.GreaterThanOrEqual: return /* @__PURE__ */ p(d, { children: [
34
+ case i.GreaterThanOrEqual: return /* @__PURE__ */ u(c, { children: [
36
35
  r.For,
37
36
  " ",
38
- /* @__PURE__ */ f("strong", { children: r.Expenses }),
37
+ /* @__PURE__ */ l("strong", { children: r.Expenses }),
39
38
  " ",
40
39
  r.GreaterThanOrEqual,
41
40
  " ",
42
- i(t ?? 0)
41
+ a(t ?? 0)
43
42
  ] });
44
- default: return /* @__PURE__ */ p(d, { children: [
43
+ default: return /* @__PURE__ */ u(c, { children: [
45
44
  r.For,
46
45
  " ",
47
46
  r.All,
48
47
  " ",
49
- /* @__PURE__ */ f("strong", { children: r.Expenses })
48
+ /* @__PURE__ */ l("strong", { children: r.Expenses })
50
49
  ] });
51
50
  }
52
51
  }
53
- var g = ({ rule: s, labels: u, onEdit: d, onDelete: g, disabled: _, testIds: v }) => {
54
- let y = {
55
- ...l,
56
- ...u
52
+ var f = ({ rule: i, labels: s, onEdit: c, disabled: f, testIds: p }) => {
53
+ let m = {
54
+ ...o,
55
+ ...s
57
56
  };
58
- return /* @__PURE__ */ p(o, {
59
- "data-testid": v?.root,
60
- children: [/* @__PURE__ */ p("div", {
61
- className: "ttw:flex ttw:items-center ttw:justify-between",
62
- children: [/* @__PURE__ */ f("span", {
63
- className: "ttw:text-sm",
64
- children: /* @__PURE__ */ f(h, {
65
- labels: y,
66
- conditionType: s.conditionType,
67
- minAmount: s.minAmount,
68
- maxAmount: s.maxAmount
69
- })
70
- }), /* @__PURE__ */ p("div", {
71
- className: "ttw:flex ttw:gap-1",
72
- children: [/* @__PURE__ */ f(i, { children: /* @__PURE__ */ p(n, { children: [/* @__PURE__ */ f(a, {
73
- asChild: !0,
74
- children: /* @__PURE__ */ f(t, {
75
- variant: "ghost",
76
- size: "icon-sm",
77
- onClick: () => g(s.id),
78
- "aria-label": y.DeleteRuleAriaLabel,
79
- className: "ttw:text-destructive ttw:hover:text-destructive",
80
- disabled: _,
81
- children: /* @__PURE__ */ f(m, {})
57
+ return /* @__PURE__ */ u(r, {
58
+ "data-testid": p?.root,
59
+ children: [
60
+ /* @__PURE__ */ u("div", {
61
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
62
+ children: [/* @__PURE__ */ l(n, {
63
+ variant: "body1",
64
+ children: i.title ?? /* @__PURE__ */ l(d, {
65
+ labels: m,
66
+ conditionType: i.conditionType,
67
+ minAmount: i.minAmount,
68
+ maxAmount: i.maxAmount
82
69
  })
83
- }), /* @__PURE__ */ f(r, { children: y.DeleteRuleAriaLabel })] }) }), /* @__PURE__ */ f(t, {
70
+ }), /* @__PURE__ */ l(t, {
84
71
  variant: "ghost",
85
- onClick: () => d(s.id),
72
+ onClick: () => c(i.id),
86
73
  className: "ttw:text-muted-foreground ttw:hover:text-foreground",
87
- disabled: _,
88
- children: y.EditRuleAriaLabel
74
+ disabled: f,
75
+ children: m.EditRuleAriaLabel
89
76
  })]
90
- })]
91
- }), s.outcome === c.AutoApprove ? /* @__PURE__ */ f(e, {
92
- tone: "success",
93
- className: "ttw:self-start",
94
- children: y.AutoApprove
95
- }) : /* @__PURE__ */ p("div", {
96
- className: "ttw:flex ttw:items-center ttw:gap-1",
97
- children: [/* @__PURE__ */ f("span", {
98
- className: "ttw:text-sm ttw:text-muted-foreground",
99
- children: y.RequireApprovalFrom
100
- }), /* @__PURE__ */ f("div", {
101
- className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-1",
102
- children: s.approvers.map((t, n) => /* @__PURE__ */ p("div", {
103
- className: "ttw:flex ttw:items-center ttw:gap-1",
104
- children: [n > 0 ? /* @__PURE__ */ f("span", {
105
- className: "ttw:text-sm ttw:text-muted-foreground",
106
- children: y.ApproverSeparator
107
- }) : null, /* @__PURE__ */ f(e, {
108
- variant: "secondary",
109
- children: t.label
110
- })]
111
- }, t.id))
112
- })]
113
- })]
77
+ }),
78
+ i.sentence ? /* @__PURE__ */ l(n, {
79
+ variant: "body2",
80
+ color: "muted",
81
+ children: i.sentence
82
+ }) : null,
83
+ i.outcome === a.AutoApprove ? /* @__PURE__ */ l(e, {
84
+ tone: "success",
85
+ className: "ttw:self-start",
86
+ children: m.AutoApprove
87
+ }) : /* @__PURE__ */ u("div", {
88
+ className: "ttw:flex ttw:items-center ttw:gap-1",
89
+ children: [i.sentence ? null : /* @__PURE__ */ l("span", {
90
+ className: "ttw:text-sm ttw:text-muted-foreground",
91
+ children: m.RequireApprovalFrom
92
+ }), /* @__PURE__ */ l("div", {
93
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-1",
94
+ children: i.approvers.map((t, n) => /* @__PURE__ */ u("div", {
95
+ className: "ttw:flex ttw:items-center ttw:gap-1",
96
+ children: [n > 0 ? /* @__PURE__ */ l("span", {
97
+ className: "ttw:text-sm ttw:text-muted-foreground",
98
+ children: m.ApproverSeparator
99
+ }) : null, /* @__PURE__ */ l(e, {
100
+ variant: "secondary",
101
+ children: t.label
102
+ })]
103
+ }, t.id))
104
+ })]
105
+ })
106
+ ]
114
107
  });
115
108
  };
116
- export { g as ApprovalRuleCard };
109
+ export { f as ApprovalRuleCard };
@@ -1,38 +1,39 @@
1
- import { Button as e, Combobox as t, FieldError as n, Label as r, RadioGroup as i, RadioGroupItem as a } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { AmountConditionBuilder as o } from "../../../../shared/approval-policy/ui/dist/index3.js";
1
+ import { Button as e, Combobox as t, FieldError as n, Label as r, RadioGroup as i, RadioGroupItem as a, Typography as o } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { AmountConditionBuilder as s } from "../../../../shared/approval-policy/ui/dist/index3.js";
3
+ import { PolicyCardFrame as c } from "../../../../shared/approval-policy/ui/dist/index17.js";
3
4
  import "../../../../shared/approval-policy/ui/dist/index.js";
4
- import { ApprovalOutcomeType as s } from "./index2.js";
5
- import { ApprovalRuleFormLabels as c } from "./index3.js";
6
- import { useEffect as l, useId as u, useRef as d, useState as f } from "react";
7
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
8
- import { FilePenLine as h, RefreshCw as g, Trash2 as _ } from "lucide-react";
5
+ import { ApprovalOutcomeType as l } from "./index2.js";
6
+ import { ApprovalRuleFormLabels as u } from "./index3.js";
7
+ import { useEffect as d, useId as f, useRef as p, useState as m } from "react";
8
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
9
+ import { Trash2 as _ } from "lucide-react";
9
10
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index7.js
10
11
  var v = ({ values: v, approverOptions: y, validationErrors: b, labels: x, isEditing: S, disabled: C, onValuesChange: w, onSave: T, onCancel: E, onDelete: D, testIds: O }) => {
11
12
  let k = {
12
- ...c,
13
+ ...u,
13
14
  ...x
14
15
  }, A = (e) => w({
15
16
  ...v,
16
17
  ...e
17
- }), j = d(null), [M, N] = f(0);
18
- l(() => {
18
+ }), j = p(null), [M, N] = m(0);
19
+ d(() => {
19
20
  M && j.current?.querySelector("[aria-invalid=\"true\"]")?.focus();
20
21
  }, [M]);
21
22
  let P = () => {
22
23
  T(), N((e) => e + 1);
23
- }, F = u(), I = u(), L = u(), R = y.map((e) => ({
24
+ }, F = f(), I = f(), L = f(), R = y.map((e) => ({
24
25
  value: e.id,
25
26
  label: e.label
26
27
  })), z = new Set(R.map((e) => e.value)), B = [...R, ...v.approvers.filter((e) => !z.has(e.id)).map((e) => ({
27
28
  value: e.id,
28
29
  label: e.label
29
30
  }))], V = new Map([...v.approvers.map((e) => [e.id, e]), ...y.map((e) => [e.id, e])]);
30
- return /* @__PURE__ */ m("div", {
31
+ return /* @__PURE__ */ g(c, {
31
32
  ref: j,
32
33
  "data-testid": O?.root,
33
- className: "ttw:border ttw:border-border ttw:rounded-lg ttw:p-5 ttw:flex ttw:flex-col ttw:gap-4",
34
+ className: "ttw:border-primary",
34
35
  children: [
35
- /* @__PURE__ */ p(o, {
36
+ /* @__PURE__ */ h(s, {
36
37
  value: {
37
38
  lower: v.minAmount,
38
39
  upper: v.maxAmount
@@ -46,16 +47,6 @@ var v = ({ values: v, approverOptions: y, validationErrors: b, labels: x, isEdit
46
47
  upper: b.maxAmount
47
48
  },
48
49
  disabled: C,
49
- lead: /* @__PURE__ */ m("span", {
50
- className: "ttw:font-normal",
51
- children: [
52
- k.ForExpenses,
53
- " ",
54
- /* @__PURE__ */ p("strong", { children: k.ExpensesBold }),
55
- " ",
56
- k.GreaterThanOrEqualTo
57
- ]
58
- }),
59
50
  labels: {
60
51
  IfAmountIsBetween: `${k.ForExpenses} ${k.ExpensesBold} ${k.GreaterThanOrEqualTo}`,
61
52
  And: k.AndLessThan,
@@ -67,103 +58,106 @@ var v = ({ values: v, approverOptions: y, validationErrors: b, labels: x, isEdit
67
58
  upperInput: O?.maxAmountInput
68
59
  }
69
60
  }),
70
- /* @__PURE__ */ m(i, {
61
+ /* @__PURE__ */ g(i, {
71
62
  "aria-label": k.Outcome,
72
63
  "aria-required": "true",
73
64
  className: "ttw:gap-2",
74
65
  value: v.outcome,
75
66
  disabled: C,
76
67
  onValueChange: (e) => {
77
- e === s.AutoApprove ? A({
68
+ e === l.AutoApprove ? A({
78
69
  outcome: e,
79
70
  approvers: []
80
- }) : e === s.RequireApproval && A({ outcome: e });
71
+ }) : e === l.RequireApproval && A({ outcome: e });
81
72
  },
82
- children: [/* @__PURE__ */ m("div", {
73
+ children: [/* @__PURE__ */ g("div", {
83
74
  className: "ttw:flex ttw:items-center ttw:gap-2",
84
- children: [/* @__PURE__ */ p(a, {
75
+ children: [/* @__PURE__ */ h(a, {
85
76
  id: `${F}-auto`,
86
- value: s.AutoApprove
87
- }), /* @__PURE__ */ m(r, {
77
+ value: l.AutoApprove
78
+ }), /* @__PURE__ */ h(r, {
88
79
  htmlFor: `${F}-auto`,
89
- className: "ttw:cursor-pointer ttw:text-success-foreground",
90
- children: [/* @__PURE__ */ p(g, {
91
- "aria-hidden": "true",
92
- className: "ttw:size-4 ttw:shrink-0"
93
- }), k.AutoApprove]
80
+ className: "ttw:cursor-pointer",
81
+ children: k.AutoApprove
94
82
  })]
95
- }), /* @__PURE__ */ m("div", {
83
+ }), /* @__PURE__ */ g("div", {
96
84
  className: "ttw:flex ttw:items-start ttw:gap-2",
97
- children: [/* @__PURE__ */ p(a, {
85
+ children: [/* @__PURE__ */ h(a, {
98
86
  id: `${F}-required`,
99
- value: s.RequireApproval,
87
+ value: l.RequireApproval,
100
88
  className: "ttw:mt-0.5"
101
- }), /* @__PURE__ */ m("div", {
89
+ }), /* @__PURE__ */ g("div", {
102
90
  className: "ttw:flex ttw:flex-col ttw:gap-1",
103
- children: [/* @__PURE__ */ m(r, {
91
+ children: [/* @__PURE__ */ h(r, {
104
92
  htmlFor: `${F}-required`,
105
93
  className: "ttw:cursor-pointer",
106
- children: [/* @__PURE__ */ p(h, {
107
- "aria-hidden": "true",
108
- className: "ttw:size-4 ttw:shrink-0"
109
- }), k.RequireApproval]
110
- }), /* @__PURE__ */ p("span", {
111
- className: "ttw:pl-6 ttw:text-xs ttw:text-muted-foreground",
94
+ children: k.RequireApproval
95
+ }), /* @__PURE__ */ h("span", {
96
+ className: "ttw:text-xs ttw:text-muted-foreground",
112
97
  children: k.RequireApprovalCaption
113
98
  })]
114
99
  })]
115
100
  })]
116
101
  }),
117
- v.outcome === s.RequireApproval ? /* @__PURE__ */ m("div", {
118
- className: "ttw:flex ttw:flex-col ttw:gap-1",
102
+ v.outcome === l.RequireApproval ? /* @__PURE__ */ g("div", {
103
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
119
104
  children: [
120
- /* @__PURE__ */ p("label", {
121
- htmlFor: I,
122
- className: "ttw:text-xs ttw:font-medium",
123
- children: k.RequireApprovalFrom
105
+ /* @__PURE__ */ h(o, {
106
+ variant: "body2",
107
+ color: "muted",
108
+ children: k.ThenRequireApproval
124
109
  }),
125
- /* @__PURE__ */ p(t, {
126
- items: B,
127
- value: v.approvers.map((e) => e.id),
128
- onValueChange: (e) => {
129
- A({ approvers: (Array.isArray(e) ? e : [e]).flatMap((e) => {
130
- let t = V.get(e);
131
- return t ? [t] : [];
132
- }) });
133
- },
134
- multiple: !0,
135
- multipleSeparator: k.ApproverSeparator,
136
- labels: { placeholder: k.ChooseApprovers },
137
- disabled: C,
138
- inputId: I,
139
- required: !0,
140
- invalid: !!b.approvers,
141
- describedBy: b.approvers ? L : void 0
110
+ /* @__PURE__ */ g("div", {
111
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-4",
112
+ children: [/* @__PURE__ */ h(r, {
113
+ htmlFor: I,
114
+ children: k.RequireApprovalFrom
115
+ }), /* @__PURE__ */ h("div", {
116
+ className: "ttw:min-w-0 ttw:flex-1",
117
+ children: /* @__PURE__ */ h(t, {
118
+ items: B,
119
+ value: v.approvers.map((e) => e.id),
120
+ onValueChange: (e) => {
121
+ A({ approvers: (Array.isArray(e) ? e : [e]).flatMap((e) => {
122
+ let t = V.get(e);
123
+ return t ? [t] : [];
124
+ }) });
125
+ },
126
+ multiple: !0,
127
+ multipleSeparator: k.ApproverSeparator,
128
+ labels: { placeholder: k.ChooseApprovers },
129
+ disabled: C,
130
+ inputId: I,
131
+ required: !0,
132
+ invalid: !!b.approvers,
133
+ describedBy: b.approvers ? L : void 0
134
+ })
135
+ })]
142
136
  }),
143
- b.approvers ? /* @__PURE__ */ p(n, {
137
+ b.approvers ? /* @__PURE__ */ h(n, {
144
138
  id: L,
145
139
  children: b.approvers
146
140
  }) : null
147
141
  ]
148
142
  }) : null,
149
- /* @__PURE__ */ m("div", {
143
+ /* @__PURE__ */ g("div", {
150
144
  className: "ttw:mt-2 ttw:flex ttw:items-center ttw:justify-between",
151
- children: [/* @__PURE__ */ p("div", { children: S && D ? /* @__PURE__ */ m(e, {
145
+ children: [/* @__PURE__ */ h("div", { children: S && D ? /* @__PURE__ */ g(e, {
152
146
  variant: "ghost",
153
147
  size: "sm",
154
148
  className: "ttw:text-destructive ttw:hover:text-destructive",
155
149
  onClick: D,
156
150
  disabled: C,
157
- children: [/* @__PURE__ */ p(_, {}), k.DeleteRule]
158
- }) : null }), /* @__PURE__ */ m("div", {
151
+ children: [/* @__PURE__ */ h(_, {}), k.DeleteRule]
152
+ }) : null }), /* @__PURE__ */ g("div", {
159
153
  className: "ttw:flex ttw:gap-2",
160
- children: [/* @__PURE__ */ p(e, {
154
+ children: [/* @__PURE__ */ h(e, {
161
155
  variant: "ghost",
162
156
  size: "sm",
163
157
  onClick: E,
164
158
  disabled: C,
165
159
  children: k.Cancel
166
- }), /* @__PURE__ */ p(e, {
160
+ }), /* @__PURE__ */ h(e, {
167
161
  size: "sm",
168
162
  onClick: P,
169
163
  disabled: C,