@tesouro/embedded-components-react 0.11.71 → 0.11.72

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 +2301 -2283
  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
@@ -2,392 +2,321 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Button as e, Command as t, CommandEmpty as n, CommandInput as r, CommandItem as i, CommandList as a, Input as o, Label as s, Popover as c, PopoverContent as l, PopoverTrigger as u, Select as d, SelectContent as f, SelectItem as p, SelectTrigger as m, SelectValue as h, cn as g } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { InlineErrorAlert as _ } from "../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
5
+ import { Badge as e, Button as t, DescriptionList as n, FieldError as r, FieldRequirement as i, Heading as a, Input as o, Label as ee, RequiredFieldsLegend as s, Skeleton as c } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { ErrorState as l } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
7
+ import { LoadingRegion as u } from "../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
8
+ import { InlineErrorAlert as d } from "../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
7
9
  import "../../../../shared/ui/dist/index.js";
8
- import { AccountAccessTable as v } from "./index4.js";
9
- import { DEFAULT_LABELS as y } from "./index6.js";
10
- import { RoleCardGroup as b } from "./index7.js";
11
- import { useEffect as x, useId as S, useMemo as C, useRef as w, useState as T } from "react";
12
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
13
- import { ArrowLeftIcon as O, CheckIcon as k, ChevronDownIcon as A, SendIcon as j } from "lucide-react";
10
+ import { AccountAccessTable as f } from "./index4.js";
11
+ import { DEFAULT_LABELS as p } from "./index5.js";
12
+ import { RoleCardGroup as m } from "./index6.js";
13
+ import { OptionalSelect as h } from "./index7.js";
14
+ import { useEffect as g, useRef as _, useState as v } from "react";
15
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
16
+ import { ArrowLeftIcon as S } from "lucide-react";
14
17
  // ../../libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index8.js
15
- function M({ id: e, message: t }) {
16
- return /* @__PURE__ */ E("p", {
17
- id: e,
18
- className: "ttw:text-sm ttw:text-destructive",
19
- children: t
20
- });
21
- }
22
- var N = "__none__";
23
- function P({ id: e, value: o, options: s, placeholder: d, searchPlaceholder: f, noResultsLabel: p, noneLabel: m, disabled: h, onValueChange: _ }) {
24
- let [v, y] = T(!1), b = S(), x = s.find((e) => e.value === o), C = (e) => {
25
- _(e), y(!1);
26
- };
27
- return /* @__PURE__ */ D(c, {
28
- open: v,
29
- onOpenChange: y,
30
- children: [/* @__PURE__ */ E(u, {
31
- asChild: !0,
32
- children: /* @__PURE__ */ D("button", {
33
- type: "button",
34
- id: e,
35
- role: "combobox",
36
- "aria-expanded": v,
37
- "aria-controls": v ? b : void 0,
38
- disabled: h,
39
- className: "ttw:flex ttw:h-9 ttw:w-full ttw:items-center ttw:justify-between ttw:gap-2 ttw:rounded-md ttw:border ttw:border-input ttw:bg-transparent ttw:px-3 ttw:py-2 ttw:text-sm ttw:shadow-xs ttw:outline-none ttw:focus-visible:border-ring ttw:focus-visible:ring-[3px] ttw:focus-visible:ring-ring/50 ttw:disabled:cursor-not-allowed ttw:disabled:opacity-50",
40
- children: [/* @__PURE__ */ E("span", {
41
- className: g("ttw:truncate", !x && "ttw:text-muted-foreground"),
42
- children: x ? x.label : d
43
- }), /* @__PURE__ */ E(A, { className: "ttw:size-4 ttw:shrink-0 ttw:opacity-50" })]
44
- })
45
- }), /* @__PURE__ */ E(l, {
46
- id: b,
47
- align: "start",
48
- className: "ttw:w-[var(--radix-popover-trigger-width)] ttw:p-0",
49
- children: /* @__PURE__ */ D(t, {
50
- filter: (e, t) => +!!e.toLowerCase().includes(t.toLowerCase()),
51
- children: [/* @__PURE__ */ E(r, {
52
- placeholder: f,
53
- "aria-label": f
54
- }), /* @__PURE__ */ D(a, { children: [
55
- /* @__PURE__ */ E(n, { children: p }),
56
- o ? /* @__PURE__ */ E(i, {
57
- value: m,
58
- onSelect: () => C(""),
59
- children: m
60
- }) : null,
61
- s.map((e) => /* @__PURE__ */ D(i, {
62
- value: `${e.label} ${e.sublabel ?? ""} ${e.value}`,
63
- onSelect: () => C(e.value),
64
- children: [/* @__PURE__ */ D("span", {
65
- className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-0.5",
66
- children: [/* @__PURE__ */ E("span", {
67
- className: "ttw:truncate",
68
- children: e.label
69
- }), e.sublabel ? /* @__PURE__ */ E("span", {
70
- className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
71
- children: e.sublabel
72
- }) : null]
73
- }), e.value === o ? /* @__PURE__ */ E(k, { className: "ttw:ml-auto ttw:size-4 ttw:shrink-0" }) : null]
74
- }, e.value))
75
- ] })]
76
- })
77
- })]
78
- });
79
- }
80
- function F({ id: e, label: t, value: n, options: r, placeholder: i, emptyMessage: a, loadingMessage: o, noneLabel: c, isLoading: l = !1, isError: u = !1, errorMessage: g, errorHelper: _, emptyHelper: v, readyHelper: y, disabled: b, searchable: x = !1, searchPlaceholder: S, noResultsLabel: C, onValueChange: w }) {
81
- let T = r.length > 0, O = u ? g ?? a : l ? o : T ? i : a, k = u ? _ : !l && !T ? v : T ? y : void 0;
82
- return /* @__PURE__ */ D("div", {
83
- className: "ttw:space-y-2",
84
- children: [
85
- /* @__PURE__ */ E(s, {
86
- htmlFor: e,
87
- children: t
88
- }),
89
- x ? /* @__PURE__ */ E(P, {
90
- id: e,
91
- value: n,
92
- options: r,
93
- placeholder: O,
94
- searchPlaceholder: S ?? "",
95
- noResultsLabel: C ?? "",
96
- noneLabel: c,
97
- disabled: b || l || !T,
98
- onValueChange: w
99
- }) : /* @__PURE__ */ D(d, {
100
- value: n || void 0,
101
- disabled: b || l || !T,
102
- onValueChange: (e) => w(e === N ? "" : e),
103
- children: [/* @__PURE__ */ E(m, {
104
- id: e,
105
- className: "ttw:w-full",
106
- children: /* @__PURE__ */ E(h, { placeholder: O })
107
- }), /* @__PURE__ */ D(f, { children: [n ? /* @__PURE__ */ E(p, {
108
- value: N,
109
- children: c
110
- }) : null, r.map((e) => /* @__PURE__ */ E(p, {
111
- value: e.value,
112
- description: e.sublabel,
113
- children: e.label
114
- }, e.value))] })]
115
- }),
116
- k ? /* @__PURE__ */ E("p", {
117
- className: "ttw:text-xs ttw:text-muted-foreground",
118
- children: k
119
- }) : null
120
- ]
121
- });
122
- }
123
- function I({ form: t, roleOptions: n, departmentOptions: r, locationOptions: i, reportingManagerOptions: a, accountAccessOptions: c, departmentsLoading: l = !1, locationsLoading: u = !1, reportingManagersLoading: d = !1, departmentsError: f = !1, locationsError: p = !1, reportingManagersError: m = !1, accountAccessLoading: h = !1, accountAccessError: g = !1, accountAccessMode: S = "hidden", errors: T, submitErrorMessage: k, isSubmitting: A = !1, isSubmitBlocked: N = !1, onFormChange: P, onBackClick: I, onCancel: L, onSubmit: R, labels: z }) {
124
- let B = {
125
- ...y,
126
- ...z
127
- }, V = w(null), H = C(() => c.map((e) => ({
128
- ...e,
129
- checked: S === "admin" || t.accountAccess.includes(e.value)
130
- })), [
131
- c,
132
- S,
133
- t.accountAccess
134
- ]);
135
- return x(() => {
136
- V.current?.focus();
137
- }, []), /* @__PURE__ */ D("section", {
138
- "aria-label": B.inviteTitle,
18
+ function C({ open: C, memberName: w, memberEmail: T, roleBadgeLabel: E, statusLabel: D, statusTone: O = "neutral", lastSignInLabel: k, form: A, roleOptions: j, departmentOptions: te, locationOptions: ne, reportingManagerOptions: re, departmentsLoading: ie = !1, locationsLoading: ae = !1, reportingManagersLoading: oe = !1, departmentsError: M = !1, locationsError: N = !1, reportingManagersError: P = !1, accountAccessMode: F = "hidden", accountAccessRows: I = [], onAccountAccessToggle: L, isAccountAccessLoading: R = !1, accountAccessErrorMessage: z, onRetryAccountAccess: B, errors: V, submitErrorMessage: H, isSubmitting: U = !1, isNameDisabled: W = !1, isRoleDisabled: G = !1, isGroupDisabled: K = !1, isReportingManagerDisabled: q = !1, isSaveDisabled: se = !1, onOpenChange: J, onFormChange: Y, onSubmit: ce, labels: le }) {
19
+ let X = {
20
+ ...p,
21
+ ...le
22
+ }, Z = _(null), Q = _(null), [$, ue] = v(0);
23
+ return g(() => {
24
+ if ($) {
25
+ let e = Q.current?.querySelector("[aria-invalid=\"true\"]");
26
+ (e?.matches("[role=\"radiogroup\"]") ? e.querySelector("[role=\"radio\"]") : e)?.focus();
27
+ }
28
+ }, [$]), g(() => {
29
+ C && Z.current?.focus();
30
+ }, [C]), C ? /* @__PURE__ */ x("section", {
31
+ "aria-label": X.editTitle,
139
32
  className: "ttw:rounded-md ttw:border ttw:border-border ttw:bg-card ttw:p-4",
140
33
  children: [
141
- /* @__PURE__ */ D(e, {
142
- ref: V,
34
+ /* @__PURE__ */ x(t, {
35
+ ref: Z,
143
36
  variant: "ghost",
144
37
  size: "sm",
145
- disabled: A,
146
- onClick: I,
147
- children: [/* @__PURE__ */ E(O, {
38
+ disabled: U,
39
+ onClick: () => J(!1),
40
+ children: [/* @__PURE__ */ b(S, {
148
41
  "aria-hidden": !0,
149
42
  className: "ttw:size-4"
150
- }), B.inviteBackToTeamButton]
43
+ }), X.editBackButton]
151
44
  }),
152
- /* @__PURE__ */ E("h3", {
153
- className: "ttw:mt-4 ttw:text-lg ttw:font-semibold ttw:text-foreground",
154
- children: B.inviteTitle
45
+ /* @__PURE__ */ b("div", {
46
+ className: "ttw:mt-4 ttw:flex ttw:items-center ttw:gap-3",
47
+ children: /* @__PURE__ */ x("div", {
48
+ className: "ttw:min-w-0",
49
+ children: [/* @__PURE__ */ x("div", {
50
+ className: "ttw:flex ttw:items-center ttw:gap-2",
51
+ children: [/* @__PURE__ */ b(a, {
52
+ variant: "section",
53
+ level: 3,
54
+ children: w
55
+ }), E ? /* @__PURE__ */ b(e, {
56
+ variant: "secondary",
57
+ children: E
58
+ }) : null]
59
+ }), /* @__PURE__ */ x("div", {
60
+ className: "ttw:mt-1 ttw:flex ttw:items-center ttw:gap-2 ttw:text-sm ttw:text-muted-foreground",
61
+ children: [D ? /* @__PURE__ */ b(e, {
62
+ tone: O,
63
+ children: D
64
+ }) : null, k ? /* @__PURE__ */ x(y, { children: [
65
+ /* @__PURE__ */ b("span", {
66
+ "aria-hidden": !0,
67
+ children: "|"
68
+ }),
69
+ /* @__PURE__ */ b("span", { children: X.detailsLastSignInLabel }),
70
+ /* @__PURE__ */ b("span", { children: k })
71
+ ] }) : null]
72
+ })]
73
+ })
155
74
  }),
156
- /* @__PURE__ */ E("form", {
75
+ /* @__PURE__ */ b("form", {
76
+ ref: Q,
157
77
  noValidate: !0,
158
78
  className: "ttw:mt-4",
159
79
  onSubmit: (e) => {
160
- e.preventDefault(), R();
80
+ e.preventDefault(), ce(), ue((e) => e + 1);
161
81
  },
162
- children: /* @__PURE__ */ D("fieldset", {
163
- className: "ttw:space-y-6",
164
- disabled: A,
82
+ children: /* @__PURE__ */ x("fieldset", {
83
+ className: "ttw:space-y-8",
84
+ disabled: U,
165
85
  children: [
166
- /* @__PURE__ */ D("div", {
86
+ (!W || !G) && /* @__PURE__ */ b(s, {}),
87
+ /* @__PURE__ */ x("div", {
167
88
  className: "ttw:space-y-4",
168
89
  children: [
169
- /* @__PURE__ */ E("h4", {
170
- className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
171
- children: B.inviteDetailsSectionHeading
172
- }),
173
- /* @__PURE__ */ D("div", {
90
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(a, {
91
+ variant: "component",
92
+ level: 4,
93
+ children: X.inviteDetailsSectionHeading
94
+ }), /* @__PURE__ */ b("p", {
95
+ className: "ttw:mt-1 ttw:text-sm ttw:text-muted-foreground",
96
+ children: X.editDescription
97
+ })] }),
98
+ W && !U ? /* @__PURE__ */ b(n, { items: [{
99
+ label: X.editNameLabel,
100
+ value: A.name
101
+ }, {
102
+ label: X.editEmailLabel,
103
+ value: T
104
+ }] }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("div", {
174
105
  className: "ttw:space-y-2",
175
106
  children: [
176
- /* @__PURE__ */ E(s, {
177
- htmlFor: "team-invite-name",
178
- children: B.inviteNameLabel
107
+ /* @__PURE__ */ b(ee, {
108
+ htmlFor: "team-edit-name",
109
+ requirement: i.Required,
110
+ children: X.editNameLabel
179
111
  }),
180
- /* @__PURE__ */ E(o, {
181
- id: "team-invite-name",
112
+ /* @__PURE__ */ b(o, {
113
+ id: "team-edit-name",
182
114
  name: "name",
183
115
  autoComplete: "name",
184
116
  required: !0,
185
- value: t.name,
186
- "aria-invalid": T?.name ? !0 : void 0,
187
- "aria-describedby": T?.name ? "team-invite-name-error" : void 0,
188
- onChange: (e) => P({
189
- ...t,
117
+ value: A.name,
118
+ disabled: U || W,
119
+ "aria-invalid": V?.name ? !0 : void 0,
120
+ "aria-describedby": V?.name ? "team-edit-name-error" : void 0,
121
+ onChange: (e) => Y({
122
+ ...A,
190
123
  name: e.target.value
191
124
  })
192
125
  }),
193
- T?.name && /* @__PURE__ */ E(M, {
194
- id: "team-invite-name-error",
195
- message: T.name
196
- })
197
- ]
198
- }),
199
- /* @__PURE__ */ D("div", {
200
- className: "ttw:space-y-2",
201
- children: [
202
- /* @__PURE__ */ E(s, {
203
- htmlFor: "team-invite-email",
204
- children: B.inviteWorkEmailLabel
205
- }),
206
- /* @__PURE__ */ E(o, {
207
- id: "team-invite-email",
208
- name: "email",
209
- type: "email",
210
- autoComplete: "email",
211
- required: !0,
212
- value: t.email,
213
- "aria-invalid": T?.email ? !0 : void 0,
214
- "aria-describedby": T?.email ? "team-invite-email-error" : void 0,
215
- onChange: (e) => P({
216
- ...t,
217
- email: e.target.value
218
- })
219
- }),
220
- T?.email && /* @__PURE__ */ E(M, {
221
- id: "team-invite-email-error",
222
- message: T.email
126
+ V?.name && /* @__PURE__ */ b(r, {
127
+ id: "team-edit-name-error",
128
+ children: V.name
223
129
  })
224
130
  ]
131
+ }), /* @__PURE__ */ b(n, { items: [{
132
+ label: X.editEmailLabel,
133
+ value: T
134
+ }] })] }),
135
+ /* @__PURE__ */ b(h, {
136
+ id: "team-edit-department",
137
+ label: X.inviteDepartmentLabel,
138
+ value: A.department,
139
+ options: te,
140
+ placeholder: X.inviteDepartmentPlaceholder,
141
+ emptyMessage: X.inviteDepartmentEmpty,
142
+ loadingMessage: X.inviteOptionsLoading,
143
+ noneLabel: X.inviteOptionNone,
144
+ disabled: K,
145
+ readOnly: K && !U,
146
+ isLoading: ie,
147
+ isError: M,
148
+ errorMessage: X.inviteDepartmentLoadError,
149
+ errorHelper: X.inviteDepartmentLoadErrorHelper,
150
+ emptyHelper: X.inviteDepartmentEmptyHelper,
151
+ onValueChange: (e) => Y({
152
+ ...A,
153
+ department: e
154
+ })
225
155
  }),
226
- /* @__PURE__ */ D("div", {
227
- className: "ttw:grid ttw:grid-cols-1 ttw:gap-4 ttw:sm:grid-cols-2",
228
- children: [/* @__PURE__ */ E(F, {
229
- id: "team-invite-department",
230
- label: B.inviteDepartmentLabel,
231
- value: t.department,
232
- options: r,
233
- placeholder: B.inviteDepartmentPlaceholder,
234
- emptyMessage: B.inviteDepartmentEmpty,
235
- loadingMessage: B.inviteOptionsLoading,
236
- noneLabel: B.inviteOptionNone,
237
- isLoading: l,
238
- isError: f,
239
- errorMessage: B.inviteDepartmentLoadError,
240
- errorHelper: B.inviteDepartmentLoadErrorHelper,
241
- emptyHelper: B.inviteDepartmentEmptyHelper,
242
- onValueChange: (e) => P({
243
- ...t,
244
- department: e
245
- })
246
- }), /* @__PURE__ */ E(F, {
247
- id: "team-invite-location",
248
- label: B.inviteLocationLabel,
249
- value: t.location,
250
- options: i,
251
- placeholder: B.inviteLocationPlaceholder,
252
- emptyMessage: B.inviteLocationEmpty,
253
- loadingMessage: B.inviteOptionsLoading,
254
- noneLabel: B.inviteOptionNone,
255
- isLoading: u,
256
- isError: p,
257
- errorMessage: B.inviteLocationLoadError,
258
- errorHelper: B.inviteLocationLoadErrorHelper,
259
- emptyHelper: B.inviteLocationEmptyHelper,
260
- onValueChange: (e) => P({
261
- ...t,
262
- location: e
263
- })
264
- })]
156
+ /* @__PURE__ */ b(h, {
157
+ id: "team-edit-location",
158
+ label: X.inviteLocationLabel,
159
+ value: A.location,
160
+ options: ne,
161
+ placeholder: X.inviteLocationPlaceholder,
162
+ emptyMessage: X.inviteLocationEmpty,
163
+ loadingMessage: X.inviteOptionsLoading,
164
+ noneLabel: X.inviteOptionNone,
165
+ disabled: K,
166
+ readOnly: K && !U,
167
+ isLoading: ae,
168
+ isError: N,
169
+ errorMessage: X.inviteLocationLoadError,
170
+ errorHelper: X.inviteLocationLoadErrorHelper,
171
+ emptyHelper: X.inviteLocationEmptyHelper,
172
+ onValueChange: (e) => Y({
173
+ ...A,
174
+ location: e
175
+ })
265
176
  }),
266
- /* @__PURE__ */ E(F, {
267
- id: "team-invite-reporting-manager",
268
- label: B.inviteReportingManagerLabel,
269
- value: t.reportingManager,
270
- options: a,
271
- placeholder: B.inviteReportingManagerPlaceholder,
272
- emptyMessage: B.inviteReportingManagerEmpty,
273
- loadingMessage: B.inviteOptionsLoading,
274
- noneLabel: B.inviteOptionNone,
275
- isLoading: d,
276
- isError: m,
277
- errorMessage: B.inviteReportingManagerLoadError,
278
- errorHelper: B.inviteReportingManagerLoadErrorHelper,
279
- emptyHelper: B.inviteReportingManagerEmptyHelper,
280
- readyHelper: B.inviteReportingManagerHelper,
177
+ /* @__PURE__ */ b(h, {
178
+ id: "team-edit-reporting-manager",
179
+ label: X.inviteReportingManagerLabel,
180
+ value: A.reportingManager,
181
+ options: re,
182
+ placeholder: X.inviteReportingManagerPlaceholder,
183
+ emptyMessage: X.inviteReportingManagerEmpty,
184
+ loadingMessage: X.inviteOptionsLoading,
185
+ noneLabel: X.inviteOptionNone,
186
+ disabled: q,
187
+ readOnly: q && !U,
188
+ isLoading: oe,
189
+ isError: P,
190
+ errorMessage: X.inviteReportingManagerLoadError,
191
+ errorHelper: X.inviteReportingManagerLoadErrorHelper,
192
+ emptyHelper: X.inviteReportingManagerEmptyHelper,
193
+ readyHelper: X.inviteReportingManagerHelper,
281
194
  searchable: !0,
282
- searchPlaceholder: B.inviteReportingManagerSearchPlaceholder,
283
- noResultsLabel: B.inviteReportingManagerNoResults,
284
- onValueChange: (e) => P({
285
- ...t,
195
+ searchPlaceholder: X.inviteReportingManagerSearchPlaceholder,
196
+ noResultsLabel: X.inviteReportingManagerNoResults,
197
+ onValueChange: (e) => Y({
198
+ ...A,
286
199
  reportingManager: e
287
200
  })
288
201
  })
289
202
  ]
290
203
  }),
291
- /* @__PURE__ */ D("div", {
292
- className: "ttw:space-y-1",
204
+ /* @__PURE__ */ x("div", {
205
+ className: "ttw:space-y-2",
293
206
  children: [
294
- /* @__PURE__ */ E("div", {
295
- id: "team-invite-role-heading",
296
- className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
297
- children: B.inviteRoleSectionHeading
298
- }),
299
- /* @__PURE__ */ E("p", {
300
- className: "ttw:text-sm ttw:text-muted-foreground",
301
- children: B.inviteRoleSectionDescription
302
- }),
303
- /* @__PURE__ */ E("div", {
304
- className: "ttw:mt-3",
305
- children: /* @__PURE__ */ E(b, {
306
- idPrefix: "team-invite-role",
307
- options: n,
308
- value: t.role,
309
- onValueChange: (e) => P({
310
- ...t,
311
- role: e
312
- }),
313
- ariaLabelledBy: "team-invite-role-heading",
314
- ariaInvalid: !!T?.role,
315
- ariaDescribedBy: T?.role ? "team-invite-role-error" : void 0
316
- })
207
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x(a, {
208
+ variant: "component",
209
+ level: 4,
210
+ id: "team-edit-role-heading",
211
+ children: [
212
+ X.inviteRoleSectionHeading,
213
+ " ",
214
+ !G && /* @__PURE__ */ b("span", {
215
+ "aria-hidden": "true",
216
+ children: "*"
217
+ })
218
+ ]
219
+ }), /* @__PURE__ */ b("p", {
220
+ className: "ttw:mt-1 ttw:text-sm ttw:text-muted-foreground",
221
+ children: X.inviteRoleSectionDescription
222
+ })] }),
223
+ G && !U && (E || j.some((e) => e.value === A.role)) ? /* @__PURE__ */ b(n, { items: [{
224
+ label: X.inviteRoleSectionHeading,
225
+ value: E ?? j.find((e) => e.value === A.role)?.label
226
+ }] }) : /* @__PURE__ */ b(m, {
227
+ idPrefix: "team-edit-role",
228
+ options: j,
229
+ value: A.role,
230
+ disabled: G,
231
+ onValueChange: (e) => Y({
232
+ ...A,
233
+ role: e
234
+ }),
235
+ ariaLabelledBy: "team-edit-role-heading",
236
+ required: !G,
237
+ ariaInvalid: !!V?.role,
238
+ ariaDescribedBy: V?.role ? "team-edit-role-error" : void 0
317
239
  }),
318
- T?.role && /* @__PURE__ */ E(M, {
319
- id: "team-invite-role-error",
320
- message: T.role
240
+ V?.role && /* @__PURE__ */ b(r, {
241
+ id: "team-edit-role-error",
242
+ children: V.role
321
243
  })
322
244
  ]
323
245
  }),
324
- S === "employee" && /* @__PURE__ */ D("div", {
246
+ F === "employee" && /* @__PURE__ */ x("div", {
325
247
  className: "ttw:space-y-2",
326
- children: [/* @__PURE__ */ E("div", {
327
- id: "team-invite-account-access-heading",
328
- className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
329
- children: B.inviteAccountAccessSectionHeading
330
- }), /* @__PURE__ */ E("p", {
331
- className: "ttw:text-sm ttw:text-muted-foreground",
332
- children: B.manageAccessEmployeeNote
333
- })]
248
+ children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(a, {
249
+ variant: "component",
250
+ level: 4,
251
+ children: X.inviteAccountAccessSectionHeading
252
+ }), /* @__PURE__ */ b("p", {
253
+ className: "ttw:mt-1 ttw:text-sm ttw:text-muted-foreground",
254
+ children: X.manageAccessEmployeeNote
255
+ })] }), R ? /* @__PURE__ */ b(u, {
256
+ isLoading: !0,
257
+ loadingLabel: X.manageAccessLoadingLabel,
258
+ children: /* @__PURE__ */ b(c, {
259
+ "aria-hidden": !0,
260
+ className: "ttw:h-12 ttw:w-full"
261
+ })
262
+ }) : z ? /* @__PURE__ */ b(l, {
263
+ title: z,
264
+ retryLabel: X.accountAccessRetry,
265
+ onRetry: B
266
+ }) : null]
334
267
  }),
335
- (S === "picker" || S === "admin") && /* @__PURE__ */ D("div", {
268
+ (F === "picker" || F === "admin") && /* @__PURE__ */ x("div", {
336
269
  className: "ttw:space-y-2",
337
- children: [
338
- /* @__PURE__ */ E("div", {
339
- id: "team-invite-account-access-heading",
340
- className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
341
- children: B.inviteAccountAccessSectionHeading
342
- }),
343
- /* @__PURE__ */ E("p", {
344
- className: "ttw:text-sm ttw:text-muted-foreground",
345
- children: B.inviteAccountAccessSectionDescription
346
- }),
347
- g ? /* @__PURE__ */ E(_, { children: B.inviteAccountAccessLoadError }) : h ? /* @__PURE__ */ E("p", {
348
- className: "ttw:text-sm ttw:text-muted-foreground",
349
- children: B.inviteOptionsLoading
350
- }) : /* @__PURE__ */ E(v, {
351
- rows: H,
352
- onToggle: (e, n) => {
353
- P({
354
- ...t,
355
- accountAccess: n ? [...t.accountAccess, e] : t.accountAccess.filter((t) => t !== e)
356
- });
357
- },
358
- disabled: S === "admin",
359
- note: S === "admin" ? B.inviteAccountAccessAdminNote : void 0,
360
- emptyMessage: B.inviteAccountAccessEmpty,
361
- labels: {
362
- accountNameColumn: B.accountAccessNameColumn,
363
- accessColumn: B.accountAccessAccessColumn,
364
- toggleAriaLabel: B.accountAccessToggleLabel
365
- }
270
+ children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(a, {
271
+ variant: "component",
272
+ level: 4,
273
+ children: X.inviteAccountAccessSectionHeading
274
+ }), /* @__PURE__ */ b("p", {
275
+ className: "ttw:mt-1 ttw:text-sm ttw:text-muted-foreground",
276
+ children: X.inviteAccountAccessSectionDescription
277
+ })] }), R ? /* @__PURE__ */ b(u, {
278
+ isLoading: !0,
279
+ loadingLabel: X.manageAccessLoadingLabel,
280
+ children: /* @__PURE__ */ b(c, {
281
+ "aria-hidden": !0,
282
+ className: "ttw:h-12 ttw:w-full"
366
283
  })
367
- ]
284
+ }) : z ? /* @__PURE__ */ b(l, {
285
+ title: z,
286
+ retryLabel: X.accountAccessRetry,
287
+ onRetry: B
288
+ }) : /* @__PURE__ */ b(f, {
289
+ rows: I,
290
+ onToggle: (e, t) => L?.(e, t),
291
+ disabled: U || F === "admin",
292
+ note: F === "admin" ? X.manageAccessAdminNote : void 0,
293
+ emptyMessage: X.manageAccessAccountsEmpty,
294
+ labels: {
295
+ accountNameColumn: X.accountAccessNameColumn,
296
+ accessColumn: X.accountAccessAccessColumn,
297
+ toggleAriaLabel: X.accountAccessToggleLabel
298
+ }
299
+ })]
368
300
  }),
369
- k && /* @__PURE__ */ E(_, { children: k }),
370
- /* @__PURE__ */ D("div", {
301
+ H && /* @__PURE__ */ b(d, { children: H }),
302
+ /* @__PURE__ */ x("div", {
371
303
  className: "ttw:flex ttw:justify-end ttw:gap-2",
372
- children: [/* @__PURE__ */ E(e, {
304
+ children: [/* @__PURE__ */ b(t, {
373
305
  type: "button",
374
306
  variant: "ghost",
375
- onClick: L,
376
- children: B.inviteCancelButton
377
- }), /* @__PURE__ */ D(e, {
307
+ onClick: () => J(!1),
308
+ children: X.editCancelButton
309
+ }), /* @__PURE__ */ b(t, {
378
310
  type: "submit",
379
- loading: A,
380
- disabled: N || l || u || d || (S === "picker" || S === "admin") && (h || g),
381
- children: [B.inviteSubmitButton, /* @__PURE__ */ E(j, {
382
- "aria-hidden": !0,
383
- className: "ttw:size-4"
384
- })]
311
+ loading: U,
312
+ disabled: se,
313
+ children: X.editSaveButton
385
314
  })]
386
315
  })
387
316
  ]
388
317
  })
389
318
  })
390
319
  ]
391
- });
320
+ }) : null;
392
321
  }
393
- export { I as InviteTeamMemberForm, I as default, F as OptionalSelect };
322
+ export { C as EditTeamMemberPanel, C as default };