@burdenoff/microfe-security 2026.1120.1 → 2026.1120.3
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/dist/security/__tests__/support/dialogDom.d.ts +20 -0
- package/dist/security/components/SecretShareDialog.d.ts +6 -0
- package/dist/security/components/SecretShareDialog.js +150 -270
- package/dist/security/components/SecretShareDialog.js.map +1 -1
- package/dist/security/components/SecretShareLinkPanel.d.ts +33 -0
- package/dist/security/components/SecretShareLinkPanel.js +144 -0
- package/dist/security/components/SecretShareLinkPanel.js.map +1 -0
- package/dist/security/components/SecretSharePeoplePanel.d.ts +26 -0
- package/dist/security/components/SecretSharePeoplePanel.js +87 -0
- package/dist/security/components/SecretSharePeoplePanel.js.map +1 -0
- package/dist/security/components/secretShareTypes.d.ts +22 -0
- package/dist/security/pages/AccessReviewPage.js +2 -1
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/AuditLogPage.js +3 -1
- package/dist/security/pages/AuditLogPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.js +3 -1
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.js +2 -1
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.js +3 -1
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/SharedWithMePage.js +2 -1
- package/dist/security/pages/SharedWithMePage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.js +4 -2
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultSettingsPage.js +2 -1
- package/dist/security/pages/VaultSettingsPage.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.js +3 -1
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/dist/security/translations/en.d.ts +5 -0
- package/dist/security/translations/en.js +6 -1
- package/dist/security/translations/en.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ApolloClient } from '@apollo/client';
|
|
2
|
+
import { Window } from 'happy-dom';
|
|
3
|
+
export interface InstalledDom {
|
|
4
|
+
window: Window;
|
|
5
|
+
restore: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function installDom(url?: string): InstalledDom;
|
|
8
|
+
/** A client that answers each operation by name, or never (`undefined`). */
|
|
9
|
+
export declare function fakeClient(answer: (operationName: string, variables: Record<string, unknown>) => unknown): ApolloClient;
|
|
10
|
+
/**
|
|
11
|
+
* The markup, independent of what ran before it in this process: React's ids
|
|
12
|
+
* count across every root mounted (each distinct id becomes `_r_id<n>_`), and
|
|
13
|
+
* Radix adds `pointer-events` to a dialog's style on its first or second render
|
|
14
|
+
* depending on the layers other tests left (declarations are sorted).
|
|
15
|
+
*/
|
|
16
|
+
export declare function canonicalMarkup(html: string): string;
|
|
17
|
+
/** An element in a few words; failing on an element itself prints its whole window. */
|
|
18
|
+
export declare function describeElement(el: Element | null | undefined): string;
|
|
19
|
+
/** `actual` is the very same node as `expected`. */
|
|
20
|
+
export declare function expectSameElement(actual: Element | null | undefined, expected: Element | null | undefined): void;
|
|
@@ -14,6 +14,12 @@ interface SecretShareDialogProps {
|
|
|
14
14
|
* Selective credential sharing dialog. "People" grants a specific account
|
|
15
15
|
* in-app access; "Get link" mints a confidential signed URL an external person
|
|
16
16
|
* can open without an account.
|
|
17
|
+
*
|
|
18
|
+
* Under the stable tabbed-dialog opt-in (BOFF-15607, `useStableTabbedDialogs`)
|
|
19
|
+
* it is fe-libs' shared layout: a fixed-height box (a bottom sheet on phones),
|
|
20
|
+
* People and Get link as real tabs (tab roles, arrow keys, focus into the
|
|
21
|
+
* panel on a click) over cross-faded panels that each keep their scroll, and a
|
|
22
|
+
* pinned footer with Done. Without it the dialog is today's.
|
|
17
23
|
*/
|
|
18
24
|
export declare const SecretShareDialog: FC<SecretShareDialogProps>;
|
|
19
25
|
export {};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { Button as t } from "./ui.js";
|
|
3
|
+
import { SecretShareLinkPanel as n } from "./SecretShareLinkPanel.js";
|
|
4
|
+
import { SecretSharePeoplePanel as r } from "./SecretSharePeoplePanel.js";
|
|
5
|
+
import { useCreateSecretShareLink as ee, useRevokeSecretShare as te, useSecretShares as ne, useShareSecretWithAccount as re } from "../hooks/useShareQueries.js";
|
|
6
|
+
import { useTr as i } from "../hooks/useTr.js";
|
|
7
|
+
import { useMemo as a, useState as o } from "react";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import { Link2 as l, Users as u } from "lucide-react";
|
|
10
|
+
import { Dialog as d, DialogContent as f, DialogHeader as ie, DialogTitle as p, TabbedDialog as ae, TabbedDialogContent as oe, TabbedDialogFooter as m, TabbedDialogHeader as se, TabbedDialogTabs as ce, useStableTabbedDialogs as le } from "@burdenoff/fe-libs/ui";
|
|
9
11
|
// src/security/components/SecretShareDialog.tsx
|
|
10
|
-
function
|
|
11
|
-
let e =
|
|
12
|
+
function h() {
|
|
13
|
+
let e = i();
|
|
12
14
|
return {
|
|
13
15
|
roleOptions: [{
|
|
14
16
|
value: "VIEWER",
|
|
@@ -41,310 +43,188 @@ function ue() {
|
|
|
41
43
|
]
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
|
-
function
|
|
46
|
+
function g(e) {
|
|
45
47
|
if (!e) return null;
|
|
46
48
|
let t = Number(e);
|
|
47
49
|
return !Number.isFinite(t) || t <= 0 ? null : new Date(Date.now() + t).toISOString();
|
|
48
50
|
}
|
|
49
|
-
function
|
|
51
|
+
function ue(e) {
|
|
50
52
|
return `${typeof window < "u" ? window.location.origin : ""}/vault/share/${e}`;
|
|
51
53
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
function de(e) {
|
|
55
|
+
e.preventDefault(), e.target instanceof HTMLElement && e.target.focus({ preventScroll: !0 });
|
|
56
|
+
}
|
|
57
|
+
var _ = ({ isOpen: _, onClose: v, vaultId: y, secretId: b, name: x, className: S }) => {
|
|
58
|
+
let C = i(), { roleOptions: fe, expiryOptions: w } = h(), pe = le(), [T, E] = o("people"), [D, O] = o(""), [k, me] = o("VIEWER"), [A, j] = o(""), [M, N] = o("604800000"), [P, F] = o(""), [I, L] = o(""), [R, z] = o(null), [he, B] = o(!1), [V, H] = o(null), { data: U, loading: W, refetch: G } = ne(_ ? y : null, b), [ge, { loading: _e }] = re(), [ve, { loading: ye }] = ee(), [be] = te(), K = a(() => U?.secretShares?.items ?? [], [U]), xe = a(() => K.filter((e) => e.kind === "ACCOUNT"), [K]), Se = a(() => K.filter((e) => e.kind === "LINK"), [K]), q = D.includes("@"), Ce = async (e) => {
|
|
59
|
+
e.preventDefault(), H(null);
|
|
60
|
+
let t = D.trim();
|
|
56
61
|
if (t) try {
|
|
57
|
-
await
|
|
58
|
-
vaultId:
|
|
59
|
-
secretId:
|
|
60
|
-
accountId:
|
|
61
|
-
email:
|
|
62
|
-
role:
|
|
62
|
+
await ge({ variables: { input: {
|
|
63
|
+
vaultId: y,
|
|
64
|
+
secretId: b ?? null,
|
|
65
|
+
accountId: q ? null : t,
|
|
66
|
+
email: q ? t : null,
|
|
67
|
+
role: k,
|
|
63
68
|
label: t,
|
|
64
|
-
expiresAt:
|
|
65
|
-
} } }),
|
|
69
|
+
expiresAt: g(A)
|
|
70
|
+
} } }), O(""), j(""), await G();
|
|
66
71
|
} catch (e) {
|
|
67
|
-
|
|
72
|
+
H(e instanceof Error ? e.message : C("security.secretShareDialog.shareFailed", "Failed to share"));
|
|
68
73
|
}
|
|
69
|
-
},
|
|
70
|
-
e.preventDefault(),
|
|
74
|
+
}, we = async (e) => {
|
|
75
|
+
e.preventDefault(), H(null), z(null);
|
|
71
76
|
try {
|
|
72
|
-
let e =
|
|
73
|
-
vaultId:
|
|
74
|
-
secretId:
|
|
77
|
+
let e = I.trim() ? Number(I.trim()) : null, t = (await ve({ variables: { input: {
|
|
78
|
+
vaultId: y,
|
|
79
|
+
secretId: b ?? null,
|
|
75
80
|
role: "VIEWER",
|
|
76
|
-
expiresAt:
|
|
77
|
-
password:
|
|
81
|
+
expiresAt: g(M),
|
|
82
|
+
password: P.trim() || null,
|
|
78
83
|
maxViews: e && e > 0 ? Math.floor(e) : null
|
|
79
84
|
} } })).data?.createSecretShareLink?.token;
|
|
80
|
-
t && (
|
|
85
|
+
t && (z(ue(t)), F(""), L("")), await G();
|
|
81
86
|
} catch (e) {
|
|
82
|
-
|
|
87
|
+
H(e instanceof Error ? e.message : C("security.secretShareDialog.createLinkFailed", "Failed to create link"));
|
|
83
88
|
}
|
|
84
|
-
},
|
|
89
|
+
}, Te = async (e) => {
|
|
85
90
|
try {
|
|
86
|
-
await
|
|
91
|
+
await be({ variables: { id: e } }), await G();
|
|
87
92
|
} catch (e) {
|
|
88
|
-
|
|
93
|
+
H(e instanceof Error ? e.message : C("security.secretShareDialog.revokeFailed", "Failed to revoke"));
|
|
89
94
|
}
|
|
90
|
-
},
|
|
91
|
-
if (
|
|
92
|
-
await navigator.clipboard.writeText(
|
|
95
|
+
}, Ee = async () => {
|
|
96
|
+
if (R) try {
|
|
97
|
+
await navigator.clipboard.writeText(R), B(!0), setTimeout(() => B(!1), 1500);
|
|
93
98
|
} catch {}
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
}, J = C("security.secretShareDialog.title", "Share {{scope}}", { scope: b ? C("security.secretShareDialog.scopeCredential", "credential") : C("security.secretShareDialog.scopeVault", "vault") }), Y = C("security.secretShareDialog.description", "Share {{name}} selectively", { name: x }), X = V && /* @__PURE__ */ s("div", {
|
|
100
|
+
className: "rounded-md border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
101
|
+
children: V
|
|
102
|
+
}), Z = (e) => void Te(e), Q = /* @__PURE__ */ s(r, {
|
|
103
|
+
account: D,
|
|
104
|
+
onAccountChange: O,
|
|
105
|
+
role: k,
|
|
106
|
+
onRoleChange: me,
|
|
107
|
+
expiry: A,
|
|
108
|
+
onExpiryChange: j,
|
|
109
|
+
roleOptions: fe,
|
|
110
|
+
expiryOptions: w,
|
|
111
|
+
sharing: _e,
|
|
112
|
+
onShare: Ce,
|
|
113
|
+
loading: W,
|
|
114
|
+
shares: xe,
|
|
115
|
+
onRevoke: Z
|
|
116
|
+
}), $ = /* @__PURE__ */ s(n, {
|
|
117
|
+
wholeVault: !b,
|
|
118
|
+
expiry: M,
|
|
119
|
+
onExpiryChange: N,
|
|
120
|
+
maxViews: I,
|
|
121
|
+
onMaxViewsChange: L,
|
|
122
|
+
password: P,
|
|
123
|
+
onPasswordChange: F,
|
|
124
|
+
expiryOptions: w,
|
|
125
|
+
creating: ye,
|
|
126
|
+
onCreate: we,
|
|
127
|
+
createdUrl: R,
|
|
128
|
+
copied: he,
|
|
129
|
+
onCopy: () => void Ee(),
|
|
130
|
+
loading: W,
|
|
131
|
+
links: Se,
|
|
132
|
+
onRevoke: Z
|
|
133
|
+
});
|
|
134
|
+
if (pe) {
|
|
135
|
+
let e = [{
|
|
136
|
+
value: "people",
|
|
137
|
+
label: C("security.secretShareDialog.peopleTab", "People"),
|
|
138
|
+
icon: u,
|
|
139
|
+
testId: "secret-share-tab-people"
|
|
140
|
+
}, {
|
|
141
|
+
value: "link",
|
|
142
|
+
label: C("security.secretShareDialog.linkTab", "Get link"),
|
|
143
|
+
icon: l,
|
|
144
|
+
testId: "secret-share-tab-link"
|
|
145
|
+
}];
|
|
146
|
+
return /* @__PURE__ */ s(ae, {
|
|
147
|
+
open: _,
|
|
148
|
+
onOpenChange: (e) => {
|
|
149
|
+
e || v();
|
|
150
|
+
},
|
|
151
|
+
children: /* @__PURE__ */ c(oe, {
|
|
152
|
+
size: "form",
|
|
153
|
+
width: "narrow",
|
|
154
|
+
className: S,
|
|
155
|
+
onOpenAutoFocus: de,
|
|
156
|
+
"data-testid": "secret-share-dialog",
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ s(se, {
|
|
159
|
+
title: J,
|
|
160
|
+
description: Y,
|
|
161
|
+
closeLabel: C("security.secretShareDialog.close", "Close")
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ s(ce, {
|
|
164
|
+
tabs: e,
|
|
165
|
+
value: T,
|
|
166
|
+
onValueChange: E,
|
|
167
|
+
"aria-label": J,
|
|
168
|
+
renderPanel: (e) => /* @__PURE__ */ c("div", {
|
|
169
|
+
className: "space-y-5",
|
|
170
|
+
children: [X, e === "people" ? Q : $]
|
|
171
|
+
})
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ s(m, { children: /* @__PURE__ */ s(t, {
|
|
174
|
+
type: "button",
|
|
175
|
+
onClick: v,
|
|
176
|
+
"data-testid": "secret-share-done",
|
|
177
|
+
children: C("security.secretShareDialog.done", "Done")
|
|
178
|
+
}) })
|
|
179
|
+
]
|
|
180
|
+
})
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
return /* @__PURE__ */ s(d, {
|
|
184
|
+
open: _,
|
|
97
185
|
onOpenChange: (e) => {
|
|
98
|
-
e ||
|
|
186
|
+
e || v();
|
|
99
187
|
},
|
|
100
|
-
children: /* @__PURE__ */ f
|
|
101
|
-
className: e("max-w-lg flex flex-col max-h-[90vh] gap-0 p-0",
|
|
188
|
+
children: /* @__PURE__ */ c(f, {
|
|
189
|
+
className: e("max-w-lg flex flex-col max-h-[90vh] gap-0 p-0", S),
|
|
102
190
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ c(ie, {
|
|
104
192
|
className: "p-6 pb-4 border-b border-border-subtle/60 text-left",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ s(p, { children: J }), /* @__PURE__ */ s("p", {
|
|
106
194
|
className: "text-sm text-text-secondary mt-0.5",
|
|
107
|
-
children:
|
|
195
|
+
children: Y
|
|
108
196
|
})]
|
|
109
197
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ c("div", {
|
|
111
199
|
className: "flex gap-1 px-6 pt-4",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ c("button", {
|
|
113
201
|
type: "button",
|
|
114
|
-
onClick: () =>
|
|
115
|
-
className: e("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors",
|
|
202
|
+
onClick: () => E("people"),
|
|
203
|
+
className: e("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors", T === "people" ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:bg-accent"),
|
|
116
204
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ s(u, { className: "size-4" }),
|
|
118
206
|
" ",
|
|
119
|
-
|
|
207
|
+
C("security.secretShareDialog.peopleTab", "People")
|
|
120
208
|
]
|
|
121
|
-
}), /* @__PURE__ */
|
|
209
|
+
}), /* @__PURE__ */ c("button", {
|
|
122
210
|
type: "button",
|
|
123
|
-
onClick: () =>
|
|
124
|
-
className: e("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors",
|
|
211
|
+
onClick: () => E("link"),
|
|
212
|
+
className: e("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors", T === "link" ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:bg-accent"),
|
|
125
213
|
children: [
|
|
126
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ s(l, { className: "size-4" }),
|
|
127
215
|
" ",
|
|
128
|
-
|
|
216
|
+
C("security.secretShareDialog.linkTab", "Get link")
|
|
129
217
|
]
|
|
130
218
|
})]
|
|
131
219
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ c("div", {
|
|
133
221
|
className: "overflow-y-auto p-6 pt-4 space-y-5",
|
|
134
|
-
children: [
|
|
135
|
-
className: "rounded-md border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
136
|
-
children: H
|
|
137
|
-
}), E === "people" ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("form", {
|
|
138
|
-
onSubmit: be,
|
|
139
|
-
className: "space-y-3",
|
|
140
|
-
children: [
|
|
141
|
-
/* @__PURE__ */ d(r, {
|
|
142
|
-
id: "share-account",
|
|
143
|
-
label: w("security.secretShareDialog.accountLabel", "Account email or account id"),
|
|
144
|
-
type: "text",
|
|
145
|
-
value: O,
|
|
146
|
-
onChange: (e) => k(e.target.value),
|
|
147
|
-
placeholder: w("security.secretShareDialog.accountPlaceholder", "colleague@example.com or account id"),
|
|
148
|
-
required: !0
|
|
149
|
-
}),
|
|
150
|
-
/* @__PURE__ */ f("div", {
|
|
151
|
-
className: "grid grid-cols-2 gap-3",
|
|
152
|
-
children: [/* @__PURE__ */ d(i, {
|
|
153
|
-
label: w("security.secretShareDialog.accessLabel", "Access"),
|
|
154
|
-
value: A,
|
|
155
|
-
onChange: he,
|
|
156
|
-
options: me
|
|
157
|
-
}), /* @__PURE__ */ d(i, {
|
|
158
|
-
label: w("security.secretShareDialog.expiresLabel", "Expires"),
|
|
159
|
-
value: j,
|
|
160
|
-
onChange: M,
|
|
161
|
-
options: T
|
|
162
|
-
})]
|
|
163
|
-
}),
|
|
164
|
-
/* @__PURE__ */ d("div", {
|
|
165
|
-
className: "flex justify-end",
|
|
166
|
-
children: /* @__PURE__ */ f(n, {
|
|
167
|
-
type: "submit",
|
|
168
|
-
disabled: !O.trim() || q,
|
|
169
|
-
children: [q ? /* @__PURE__ */ d(h, { className: "size-4 animate-spin" }) : /* @__PURE__ */ d(_, { className: "size-4" }), w("security.secretShareDialog.share", "Share")]
|
|
170
|
-
})
|
|
171
|
-
})
|
|
172
|
-
]
|
|
173
|
-
}), /* @__PURE__ */ f("div", {
|
|
174
|
-
className: "space-y-2",
|
|
175
|
-
children: [/* @__PURE__ */ d("h3", {
|
|
176
|
-
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
177
|
-
children: w("security.secretShareDialog.peopleWithAccess", "People with access")
|
|
178
|
-
}), G ? /* @__PURE__ */ d("div", {
|
|
179
|
-
className: "flex justify-center py-4",
|
|
180
|
-
children: /* @__PURE__ */ d(h, { className: "size-5 animate-spin text-text-secondary" })
|
|
181
|
-
}) : X.length === 0 ? /* @__PURE__ */ d("p", {
|
|
182
|
-
className: "text-sm text-text-secondary py-2",
|
|
183
|
-
children: w("security.secretShareDialog.notShared", "Not shared with anyone yet.")
|
|
184
|
-
}) : /* @__PURE__ */ d("ul", {
|
|
185
|
-
className: "space-y-2",
|
|
186
|
-
children: X.map((e) => /* @__PURE__ */ f("li", {
|
|
187
|
-
className: "flex items-center justify-between gap-2 rounded-md border border-border-subtle/60 px-3 py-2",
|
|
188
|
-
children: [/* @__PURE__ */ f("div", {
|
|
189
|
-
className: "min-w-0",
|
|
190
|
-
children: [/* @__PURE__ */ d("p", {
|
|
191
|
-
className: "text-sm text-text-primary truncate",
|
|
192
|
-
children: e.label || e.actorId
|
|
193
|
-
}), /* @__PURE__ */ f("div", {
|
|
194
|
-
className: "flex items-center gap-2 mt-0.5",
|
|
195
|
-
children: [/* @__PURE__ */ d(t, {
|
|
196
|
-
variant: "outline",
|
|
197
|
-
children: e.role
|
|
198
|
-
}), e.expiresAt && /* @__PURE__ */ f("span", {
|
|
199
|
-
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
200
|
-
children: [/* @__PURE__ */ d(p, { className: "size-3" }), new Date(e.expiresAt).toLocaleDateString()]
|
|
201
|
-
})]
|
|
202
|
-
})]
|
|
203
|
-
}), /* @__PURE__ */ d("button", {
|
|
204
|
-
type: "button",
|
|
205
|
-
onClick: () => void $(e.id),
|
|
206
|
-
className: "p-1.5 rounded hover:bg-status-error-bg/10 text-text-secondary hover:text-status-error-text",
|
|
207
|
-
"aria-label": w("security.secretShareDialog.revokeAccess", "Revoke access"),
|
|
208
|
-
children: /* @__PURE__ */ d(g, { className: "size-4" })
|
|
209
|
-
})]
|
|
210
|
-
}, e.id))
|
|
211
|
-
})]
|
|
212
|
-
})] }) : /* @__PURE__ */ f(u, { children: [
|
|
213
|
-
!C && /* @__PURE__ */ d("div", {
|
|
214
|
-
className: "rounded-md border border-status-warning-border bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text",
|
|
215
|
-
children: w("security.secretShareDialog.linkWarning", "Anyone with this link can view all current and future credentials in this vault until it expires or you revoke it.")
|
|
216
|
-
}),
|
|
217
|
-
/* @__PURE__ */ f("form", {
|
|
218
|
-
onSubmit: xe,
|
|
219
|
-
className: "space-y-3",
|
|
220
|
-
children: [
|
|
221
|
-
/* @__PURE__ */ f("div", {
|
|
222
|
-
className: "grid grid-cols-2 gap-3",
|
|
223
|
-
children: [/* @__PURE__ */ d(i, {
|
|
224
|
-
label: w("security.secretShareDialog.expiresLabel", "Expires"),
|
|
225
|
-
value: N,
|
|
226
|
-
onChange: P,
|
|
227
|
-
options: T
|
|
228
|
-
}), /* @__PURE__ */ d(r, {
|
|
229
|
-
id: "link-max-views",
|
|
230
|
-
label: w("security.secretShareDialog.maxViews", "Max views (optional)"),
|
|
231
|
-
type: "number",
|
|
232
|
-
min: 1,
|
|
233
|
-
value: L,
|
|
234
|
-
onChange: (e) => R(e.target.value),
|
|
235
|
-
placeholder: w("security.secretShareDialog.maxViewsPlaceholder", "Unlimited")
|
|
236
|
-
})]
|
|
237
|
-
}),
|
|
238
|
-
/* @__PURE__ */ d(r, {
|
|
239
|
-
id: "link-password",
|
|
240
|
-
label: w("security.secretShareDialog.password", "Password (optional)"),
|
|
241
|
-
type: "password",
|
|
242
|
-
value: F,
|
|
243
|
-
onChange: (e) => I(e.target.value),
|
|
244
|
-
placeholder: w("security.secretShareDialog.passwordPlaceholder", "Extra protection for the link")
|
|
245
|
-
}),
|
|
246
|
-
/* @__PURE__ */ d("div", {
|
|
247
|
-
className: "flex justify-end",
|
|
248
|
-
children: /* @__PURE__ */ f(n, {
|
|
249
|
-
type: "submit",
|
|
250
|
-
disabled: J,
|
|
251
|
-
children: [J ? /* @__PURE__ */ d(h, { className: "size-4 animate-spin" }) : /* @__PURE__ */ d(m, { className: "size-4" }), w("security.secretShareDialog.createLink", "Create link")]
|
|
252
|
-
})
|
|
253
|
-
})
|
|
254
|
-
]
|
|
255
|
-
}),
|
|
256
|
-
z && /* @__PURE__ */ f("div", {
|
|
257
|
-
className: "rounded-md border border-status-success-border bg-status-success-bg-subtle p-3 space-y-2",
|
|
258
|
-
children: [/* @__PURE__ */ d("p", {
|
|
259
|
-
className: "text-xs font-medium text-status-success-text",
|
|
260
|
-
children: w("security.secretShareDialog.linkCreated", "Link created — copy it now, it won't be shown again.")
|
|
261
|
-
}), /* @__PURE__ */ f("div", {
|
|
262
|
-
className: "flex items-center gap-2",
|
|
263
|
-
children: [/* @__PURE__ */ d("input", {
|
|
264
|
-
readOnly: !0,
|
|
265
|
-
value: z,
|
|
266
|
-
onFocus: (e) => e.currentTarget.select(),
|
|
267
|
-
className: "flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm font-mono"
|
|
268
|
-
}), /* @__PURE__ */ d(n, {
|
|
269
|
-
type: "button",
|
|
270
|
-
variant: "outline",
|
|
271
|
-
size: "sm",
|
|
272
|
-
onClick: () => void Se(),
|
|
273
|
-
children: d(ge ? ne : re, { className: "size-4" })
|
|
274
|
-
})]
|
|
275
|
-
})]
|
|
276
|
-
}),
|
|
277
|
-
/* @__PURE__ */ f("div", {
|
|
278
|
-
className: "space-y-2",
|
|
279
|
-
children: [/* @__PURE__ */ d("h3", {
|
|
280
|
-
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
281
|
-
children: w("security.secretShareDialog.activeLinks", "Active links")
|
|
282
|
-
}), G ? /* @__PURE__ */ d("div", {
|
|
283
|
-
className: "flex justify-center py-4",
|
|
284
|
-
children: /* @__PURE__ */ d(h, { className: "size-5 animate-spin text-text-secondary" })
|
|
285
|
-
}) : Z.length === 0 ? /* @__PURE__ */ d("p", {
|
|
286
|
-
className: "text-sm text-text-secondary py-2",
|
|
287
|
-
children: w("security.secretShareDialog.noActiveLinks", "No active links.")
|
|
288
|
-
}) : /* @__PURE__ */ d("ul", {
|
|
289
|
-
className: "space-y-2",
|
|
290
|
-
children: Z.map((e) => /* @__PURE__ */ f("li", {
|
|
291
|
-
className: "flex items-center justify-between gap-2 rounded-md border border-border-subtle/60 px-3 py-2",
|
|
292
|
-
children: [/* @__PURE__ */ f("div", {
|
|
293
|
-
className: "min-w-0",
|
|
294
|
-
children: [/* @__PURE__ */ f("div", {
|
|
295
|
-
className: "flex items-center gap-2 flex-wrap",
|
|
296
|
-
children: [
|
|
297
|
-
/* @__PURE__ */ d(t, {
|
|
298
|
-
variant: e.status === "ACTIVE" ? "success" : "destructive",
|
|
299
|
-
children: e.status === "ACTIVE" ? w("security.secretShareDialog.statusActive", "Active") : w("security.secretShareDialog.statusRevoked", "Revoked")
|
|
300
|
-
}),
|
|
301
|
-
e.requiresPassword && /* @__PURE__ */ f("span", {
|
|
302
|
-
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
303
|
-
children: [
|
|
304
|
-
/* @__PURE__ */ d(ae, { className: "size-3" }),
|
|
305
|
-
" ",
|
|
306
|
-
w("security.secretShareDialog.passwordProtected", "Password")
|
|
307
|
-
]
|
|
308
|
-
}),
|
|
309
|
-
/* @__PURE__ */ f("span", {
|
|
310
|
-
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
311
|
-
children: [
|
|
312
|
-
/* @__PURE__ */ d(ie, { className: "size-3" }),
|
|
313
|
-
e.viewCount,
|
|
314
|
-
e.maxViews ? `/${e.maxViews}` : "",
|
|
315
|
-
" ",
|
|
316
|
-
w("security.secretShareDialog.views", "views")
|
|
317
|
-
]
|
|
318
|
-
}),
|
|
319
|
-
e.expiresAt && /* @__PURE__ */ f("span", {
|
|
320
|
-
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
321
|
-
children: [/* @__PURE__ */ d(p, { className: "size-3" }), new Date(e.expiresAt).toLocaleDateString()]
|
|
322
|
-
})
|
|
323
|
-
]
|
|
324
|
-
}), /* @__PURE__ */ f("p", {
|
|
325
|
-
className: "text-xs text-text-secondary mt-0.5",
|
|
326
|
-
children: [
|
|
327
|
-
w("security.secretShareDialog.created", "Created"),
|
|
328
|
-
" ",
|
|
329
|
-
new Date(e.createdAt).toLocaleString()
|
|
330
|
-
]
|
|
331
|
-
})]
|
|
332
|
-
}), e.status === "ACTIVE" && /* @__PURE__ */ d("button", {
|
|
333
|
-
type: "button",
|
|
334
|
-
onClick: () => void $(e.id),
|
|
335
|
-
className: "p-1.5 rounded hover:bg-status-error-bg/10 text-text-secondary hover:text-status-error-text",
|
|
336
|
-
"aria-label": w("security.secretShareDialog.revokeLink", "Revoke link"),
|
|
337
|
-
children: /* @__PURE__ */ d(g, { className: "size-4" })
|
|
338
|
-
})]
|
|
339
|
-
}, e.id))
|
|
340
|
-
})]
|
|
341
|
-
})
|
|
342
|
-
] })]
|
|
222
|
+
children: [X, T === "people" ? Q : $]
|
|
343
223
|
})
|
|
344
224
|
]
|
|
345
225
|
})
|
|
346
226
|
});
|
|
347
227
|
};
|
|
348
|
-
export {
|
|
228
|
+
export { _ as SecretShareDialog };
|
|
349
229
|
|
|
350
230
|
//# sourceMappingURL=SecretShareDialog.js.map
|