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