@burdenoff/microfe-security 2026.830.1 → 2026.830.2
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/index.js +2 -1
- package/dist/security/SecurityAdminRoot.js +9 -8
- package/dist/security/SecurityAdminRoot.js.map +1 -1
- package/dist/security/SecurityRoot.js +9 -8
- package/dist/security/SecurityRoot.js.map +1 -1
- package/dist/security/SecurityRootBase.js +35 -33
- package/dist/security/SecurityRootBase.js.map +1 -1
- package/dist/security/SecurityUserRoot.js +9 -8
- package/dist/security/SecurityUserRoot.js.map +1 -1
- package/dist/security/components/ActivityTimeline.js +83 -66
- package/dist/security/components/ActivityTimeline.js.map +1 -1
- package/dist/security/components/BulkActionBar.js +40 -41
- package/dist/security/components/BulkActionBar.js.map +1 -1
- package/dist/security/components/ConfirmDialog.js +37 -33
- package/dist/security/components/ConfirmDialog.js.map +1 -1
- package/dist/security/components/CopyButton.js +29 -28
- package/dist/security/components/CopyButton.js.map +1 -1
- package/dist/security/components/ExportDialog.js +81 -80
- package/dist/security/components/ExportDialog.js.map +1 -1
- package/dist/security/components/ImportWizard.js +122 -125
- package/dist/security/components/ImportWizard.js.map +1 -1
- package/dist/security/components/PasswordGenerator.js +71 -66
- package/dist/security/components/PasswordGenerator.js.map +1 -1
- package/dist/security/components/RotationStatusBadge.js +18 -17
- package/dist/security/components/RotationStatusBadge.js.map +1 -1
- package/dist/security/components/SecretFormFields.js +143 -134
- package/dist/security/components/SecretFormFields.js.map +1 -1
- package/dist/security/components/SecretRow.js +30 -31
- package/dist/security/components/SecretRow.js.map +1 -1
- package/dist/security/components/SecretShareDialog.js +208 -195
- package/dist/security/components/SecretShareDialog.js.map +1 -1
- package/dist/security/components/SecretValueDisplay.js +45 -44
- package/dist/security/components/SecretValueDisplay.js.map +1 -1
- package/dist/security/components/SecurityPermissionGuard.js +8 -9
- package/dist/security/components/SecurityPermissionGuard.js.map +1 -1
- package/dist/security/components/SecurityScoreCard.js +42 -37
- package/dist/security/components/SecurityScoreCard.js.map +1 -1
- package/dist/security/components/VaultCard.js +32 -33
- package/dist/security/components/VaultCard.js.map +1 -1
- package/dist/security/components/VaultFormFields.js +101 -97
- package/dist/security/components/VaultFormFields.js.map +1 -1
- package/dist/security/components/VaultShareDialog.js +40 -42
- package/dist/security/components/VaultShareDialog.js.map +1 -1
- package/dist/security/config/navigation.js +20 -20
- package/dist/security/config/navigation.js.map +1 -1
- package/dist/security/constants/providers.js +10 -5
- package/dist/security/constants/providers.js.map +1 -1
- package/dist/security/constants/secretTypes.js +16 -8
- package/dist/security/constants/secretTypes.js.map +1 -1
- package/dist/security/hooks/useTr.js +14 -0
- package/dist/security/hooks/useTr.js.map +1 -0
- package/dist/security/index.js +1 -0
- package/dist/security/pages/AccessReviewPage.js +85 -84
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/AuditLogPage.js +98 -97
- package/dist/security/pages/AuditLogPage.js.map +1 -1
- package/dist/security/pages/ImportExportPage.js +21 -22
- package/dist/security/pages/ImportExportPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.js +164 -155
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.js +89 -92
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecretCreatePage.js +70 -71
- package/dist/security/pages/SecretCreatePage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.js +250 -251
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.js +53 -54
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/SharedWithMePage.js +27 -28
- package/dist/security/pages/SharedWithMePage.js.map +1 -1
- package/dist/security/pages/VaultCreatePage.js +49 -50
- package/dist/security/pages/VaultCreatePage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.js +130 -131
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultLandingPage.js +39 -38
- package/dist/security/pages/VaultLandingPage.js.map +1 -1
- package/dist/security/pages/VaultSettingsPage.js +198 -199
- package/dist/security/pages/VaultSettingsPage.js.map +1 -1
- package/dist/security/pages/VaultShareViewer.js +78 -80
- package/dist/security/pages/VaultShareViewer.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.js +97 -98
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/dist/security/translations/en.js +756 -0
- package/dist/security/translations/en.js.map +1 -0
- package/package.json +1 -1
- package/dist/security/utils/i18n.js +0 -9
- package/dist/security/utils/i18n.js.map +0 -1
|
@@ -1,327 +1,340 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
|
+
import { Badge as n, Button as r, Input as i, Select as a } from "./ui.js";
|
|
4
|
+
import { useCreateSecretShareLink as o, useRevokeSecretShare as ee, useSecretShares as te, useShareSecretWithAccount as ne } from "../hooks/useShareQueries.js";
|
|
5
|
+
import { useMemo as s, useState as c } from "react";
|
|
6
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import { Check as re, Clock as f, Copy as ie, Eye as ae, KeyRound as oe, Link2 as p, Loader2 as m, Trash2 as h, UserPlus as g, Users as se } from "lucide-react";
|
|
8
|
+
import { Dialog as ce, DialogContent as _, DialogHeader as le, DialogTitle as ue } from "@burdenoff/fe-libs/ui";
|
|
8
9
|
//#region src/security/components/SecretShareDialog.tsx
|
|
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
|
-
|
|
10
|
+
function de() {
|
|
11
|
+
let t = e();
|
|
12
|
+
return {
|
|
13
|
+
roleOptions: [{
|
|
14
|
+
value: "VIEWER",
|
|
15
|
+
label: t("security.secretShareDialog.roleViewer", "Viewer — can view the credential")
|
|
16
|
+
}, {
|
|
17
|
+
value: "EDITOR",
|
|
18
|
+
label: t("security.secretShareDialog.roleEditor", "Editor — can view and edit")
|
|
19
|
+
}],
|
|
20
|
+
expiryOptions: [
|
|
21
|
+
{
|
|
22
|
+
value: "",
|
|
23
|
+
label: t("security.secretShareDialog.neverExpires", "Never expires")
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: "3600000",
|
|
27
|
+
label: t("security.secretShareDialog.oneHour", "1 hour")
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "86400000",
|
|
31
|
+
label: t("security.secretShareDialog.oneDay", "24 hours")
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: "604800000",
|
|
35
|
+
label: t("security.secretShareDialog.sevenDays", "7 days")
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: "2592000000",
|
|
39
|
+
label: t("security.secretShareDialog.thirtyDays", "30 days")
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function v(e) {
|
|
38
45
|
if (!e) return null;
|
|
39
46
|
let t = Number(e);
|
|
40
47
|
return !Number.isFinite(t) || t <= 0 ? null : new Date(Date.now() + t).toISOString();
|
|
41
48
|
}
|
|
42
|
-
function
|
|
49
|
+
function fe(e) {
|
|
43
50
|
return `${typeof window < "u" ? window.location.origin : ""}/vault/share/${e}`;
|
|
44
51
|
}
|
|
45
|
-
var
|
|
46
|
-
let
|
|
47
|
-
e.preventDefault(),
|
|
48
|
-
let t =
|
|
52
|
+
var y = ({ isOpen: y, onClose: b, vaultId: x, secretId: S, name: C, className: pe }) => {
|
|
53
|
+
let w = e(), { roleOptions: me, expiryOptions: T } = de(), [E, D] = c("people"), [O, k] = c(""), [A, he] = c("VIEWER"), [j, M] = c(""), [N, P] = c("604800000"), [F, I] = c(""), [L, R] = c(""), [z, B] = c(null), [ge, V] = c(!1), [H, U] = c(null), { data: W, loading: G, refetch: K } = te(y ? x : null, S), [_e, { loading: q }] = ne(), [ve, { loading: J }] = o(), [ye] = ee(), Y = s(() => W?.secretShares?.items ?? [], [W]), X = s(() => Y.filter((e) => e.kind === "ACCOUNT"), [Y]), Z = s(() => Y.filter((e) => e.kind === "LINK"), [Y]), Q = O.includes("@"), be = async (e) => {
|
|
54
|
+
e.preventDefault(), U(null);
|
|
55
|
+
let t = O.trim();
|
|
49
56
|
if (t) try {
|
|
50
|
-
await
|
|
51
|
-
vaultId:
|
|
52
|
-
secretId:
|
|
53
|
-
accountId:
|
|
54
|
-
email:
|
|
55
|
-
role:
|
|
57
|
+
await _e({ variables: { input: {
|
|
58
|
+
vaultId: x,
|
|
59
|
+
secretId: S ?? null,
|
|
60
|
+
accountId: Q ? null : t,
|
|
61
|
+
email: Q ? t : null,
|
|
62
|
+
role: A,
|
|
56
63
|
label: t,
|
|
57
|
-
expiresAt:
|
|
58
|
-
} } }),
|
|
64
|
+
expiresAt: v(j)
|
|
65
|
+
} } }), k(""), M(""), await K();
|
|
59
66
|
} catch (e) {
|
|
60
|
-
|
|
67
|
+
U(e instanceof Error ? e.message : w("security.secretShareDialog.shareFailed", "Failed to share"));
|
|
61
68
|
}
|
|
62
|
-
},
|
|
63
|
-
e.preventDefault(),
|
|
69
|
+
}, xe = async (e) => {
|
|
70
|
+
e.preventDefault(), U(null), B(null);
|
|
64
71
|
try {
|
|
65
|
-
let e =
|
|
66
|
-
vaultId:
|
|
67
|
-
secretId:
|
|
72
|
+
let e = L.trim() ? Number(L.trim()) : null, t = (await ve({ variables: { input: {
|
|
73
|
+
vaultId: x,
|
|
74
|
+
secretId: S ?? null,
|
|
68
75
|
role: "VIEWER",
|
|
69
|
-
expiresAt:
|
|
70
|
-
password:
|
|
76
|
+
expiresAt: v(N),
|
|
77
|
+
password: F.trim() || null,
|
|
71
78
|
maxViews: e && e > 0 ? Math.floor(e) : null
|
|
72
79
|
} } })).data?.createSecretShareLink?.token;
|
|
73
|
-
t && (
|
|
80
|
+
t && (B(fe(t)), I(""), R("")), await K();
|
|
74
81
|
} catch (e) {
|
|
75
|
-
|
|
82
|
+
U(e instanceof Error ? e.message : w("security.secretShareDialog.createLinkFailed", "Failed to create link"));
|
|
76
83
|
}
|
|
77
84
|
}, $ = async (e) => {
|
|
78
85
|
try {
|
|
79
|
-
await
|
|
86
|
+
await ye({ variables: { id: e } }), await K();
|
|
80
87
|
} catch (e) {
|
|
81
|
-
|
|
88
|
+
U(e instanceof Error ? e.message : w("security.secretShareDialog.revokeFailed", "Failed to revoke"));
|
|
82
89
|
}
|
|
83
|
-
},
|
|
84
|
-
if (
|
|
85
|
-
await navigator.clipboard.writeText(
|
|
90
|
+
}, Se = async () => {
|
|
91
|
+
if (z) try {
|
|
92
|
+
await navigator.clipboard.writeText(z), V(!0), setTimeout(() => V(!1), 1500);
|
|
86
93
|
} catch {}
|
|
87
|
-
},
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
open:
|
|
94
|
+
}, Ce = S ? w("security.secretShareDialog.scopeCredential", "credential") : w("security.secretShareDialog.scopeVault", "vault");
|
|
95
|
+
return /* @__PURE__ */ u(ce, {
|
|
96
|
+
open: y,
|
|
90
97
|
onOpenChange: (e) => {
|
|
91
|
-
e ||
|
|
98
|
+
e || b();
|
|
92
99
|
},
|
|
93
|
-
children: /* @__PURE__ */
|
|
94
|
-
className:
|
|
100
|
+
children: /* @__PURE__ */ d(_, {
|
|
101
|
+
className: t("max-w-lg flex flex-col max-h-[90vh] gap-0 p-0", pe),
|
|
95
102
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ d(le, {
|
|
97
104
|
className: "p-6 pb-4 border-b border-border-subtle/60 text-left",
|
|
98
|
-
children: [/* @__PURE__ */ u(
|
|
105
|
+
children: [/* @__PURE__ */ u(ue, { children: w("security.secretShareDialog.title", "Share {{scope}}", { scope: Ce }) }), /* @__PURE__ */ u("p", {
|
|
99
106
|
className: "text-sm text-text-secondary mt-0.5",
|
|
100
|
-
children:
|
|
101
|
-
"Share ",
|
|
102
|
-
/* @__PURE__ */ l("span", {
|
|
103
|
-
className: "font-medium text-text-primary",
|
|
104
|
-
children: de
|
|
105
|
-
}),
|
|
106
|
-
" selectively"
|
|
107
|
-
]
|
|
107
|
+
children: w("security.secretShareDialog.description", "Share {{name}} selectively", { name: C })
|
|
108
108
|
})]
|
|
109
109
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ d("div", {
|
|
111
111
|
className: "flex gap-1 px-6 pt-4",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ d("button", {
|
|
113
113
|
type: "button",
|
|
114
|
-
onClick: () =>
|
|
115
|
-
className:
|
|
116
|
-
children: [
|
|
117
|
-
|
|
114
|
+
onClick: () => D("people"),
|
|
115
|
+
className: t("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors", E === "people" ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:bg-accent"),
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ u(se, { className: "size-4" }),
|
|
118
|
+
" ",
|
|
119
|
+
w("security.secretShareDialog.peopleTab", "People")
|
|
120
|
+
]
|
|
121
|
+
}), /* @__PURE__ */ d("button", {
|
|
118
122
|
type: "button",
|
|
119
|
-
onClick: () =>
|
|
120
|
-
className:
|
|
121
|
-
children: [
|
|
123
|
+
onClick: () => D("link"),
|
|
124
|
+
className: t("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors", E === "link" ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:bg-accent"),
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ u(p, { className: "size-4" }),
|
|
127
|
+
" ",
|
|
128
|
+
w("security.secretShareDialog.linkTab", "Get link")
|
|
129
|
+
]
|
|
122
130
|
})]
|
|
123
131
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ d("div", {
|
|
125
133
|
className: "overflow-y-auto p-6 pt-4 space-y-5",
|
|
126
|
-
children: [
|
|
134
|
+
children: [H && /* @__PURE__ */ u("div", {
|
|
127
135
|
className: "rounded-md border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
128
|
-
children:
|
|
129
|
-
}),
|
|
130
|
-
onSubmit:
|
|
136
|
+
children: H
|
|
137
|
+
}), E === "people" ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("form", {
|
|
138
|
+
onSubmit: be,
|
|
131
139
|
className: "space-y-3",
|
|
132
140
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ u(i, {
|
|
134
142
|
id: "share-account",
|
|
135
|
-
label: "Account email or VibeControls account id",
|
|
143
|
+
label: w("security.secretShareDialog.accountLabel", "Account email or VibeControls account id"),
|
|
136
144
|
type: "text",
|
|
137
|
-
value:
|
|
138
|
-
onChange: (e) =>
|
|
139
|
-
placeholder: "colleague@example.com or account id",
|
|
145
|
+
value: O,
|
|
146
|
+
onChange: (e) => k(e.target.value),
|
|
147
|
+
placeholder: w("security.secretShareDialog.accountPlaceholder", "colleague@example.com or account id"),
|
|
140
148
|
required: !0
|
|
141
149
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ d("div", {
|
|
143
151
|
className: "grid grid-cols-2 gap-3",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
145
|
-
label: "Access",
|
|
146
|
-
value: k,
|
|
147
|
-
onChange: pe,
|
|
148
|
-
options: v
|
|
149
|
-
}), /* @__PURE__ */ l(i, {
|
|
150
|
-
label: "Expires",
|
|
152
|
+
children: [/* @__PURE__ */ u(a, {
|
|
153
|
+
label: w("security.secretShareDialog.accessLabel", "Access"),
|
|
151
154
|
value: A,
|
|
152
|
-
onChange:
|
|
153
|
-
options:
|
|
155
|
+
onChange: he,
|
|
156
|
+
options: me
|
|
157
|
+
}), /* @__PURE__ */ u(a, {
|
|
158
|
+
label: w("security.secretShareDialog.expiresLabel", "Expires"),
|
|
159
|
+
value: j,
|
|
160
|
+
onChange: M,
|
|
161
|
+
options: T
|
|
154
162
|
})]
|
|
155
163
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ u("div", {
|
|
157
165
|
className: "flex justify-end",
|
|
158
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ d(r, {
|
|
159
167
|
type: "submit",
|
|
160
|
-
disabled: !
|
|
161
|
-
children: [
|
|
168
|
+
disabled: !O.trim() || q,
|
|
169
|
+
children: [q ? /* @__PURE__ */ u(m, { className: "size-4 animate-spin" }) : /* @__PURE__ */ u(g, { className: "size-4" }), w("security.secretShareDialog.share", "Share")]
|
|
162
170
|
})
|
|
163
171
|
})
|
|
164
172
|
]
|
|
165
|
-
}), /* @__PURE__ */
|
|
173
|
+
}), /* @__PURE__ */ d("div", {
|
|
166
174
|
className: "space-y-2",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
168
176
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
169
|
-
children: "People with access"
|
|
170
|
-
}),
|
|
177
|
+
children: w("security.secretShareDialog.peopleWithAccess", "People with access")
|
|
178
|
+
}), G ? /* @__PURE__ */ u("div", {
|
|
171
179
|
className: "flex justify-center py-4",
|
|
172
|
-
children: /* @__PURE__ */
|
|
173
|
-
}) :
|
|
180
|
+
children: /* @__PURE__ */ u(m, { className: "size-5 animate-spin text-text-secondary" })
|
|
181
|
+
}) : X.length === 0 ? /* @__PURE__ */ u("p", {
|
|
174
182
|
className: "text-sm text-text-secondary py-2",
|
|
175
|
-
children: "Not shared with anyone yet."
|
|
176
|
-
}) : /* @__PURE__ */
|
|
183
|
+
children: w("security.secretShareDialog.notShared", "Not shared with anyone yet.")
|
|
184
|
+
}) : /* @__PURE__ */ u("ul", {
|
|
177
185
|
className: "space-y-2",
|
|
178
|
-
children:
|
|
186
|
+
children: X.map((e) => /* @__PURE__ */ d("li", {
|
|
179
187
|
className: "flex items-center justify-between gap-2 rounded-md border border-border-subtle/60 px-3 py-2",
|
|
180
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ d("div", {
|
|
181
189
|
className: "min-w-0",
|
|
182
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ u("p", {
|
|
183
191
|
className: "text-sm text-text-primary truncate",
|
|
184
192
|
children: e.label || e.actorId
|
|
185
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ d("div", {
|
|
186
194
|
className: "flex items-center gap-2 mt-0.5",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ u(n, {
|
|
188
196
|
variant: "outline",
|
|
189
197
|
children: e.role
|
|
190
|
-
}), e.expiresAt && /* @__PURE__ */
|
|
198
|
+
}), e.expiresAt && /* @__PURE__ */ d("span", {
|
|
191
199
|
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ u(f, { className: "size-3" }), new Date(e.expiresAt).toLocaleDateString()]
|
|
193
201
|
})]
|
|
194
202
|
})]
|
|
195
|
-
}), /* @__PURE__ */
|
|
203
|
+
}), /* @__PURE__ */ u("button", {
|
|
196
204
|
type: "button",
|
|
197
205
|
onClick: () => void $(e.id),
|
|
198
206
|
className: "p-1.5 rounded hover:bg-status-error-bg/10 text-text-secondary hover:text-status-error-text",
|
|
199
|
-
"aria-label": "Revoke access",
|
|
200
|
-
children: /* @__PURE__ */
|
|
207
|
+
"aria-label": w("security.secretShareDialog.revokeAccess", "Revoke access"),
|
|
208
|
+
children: /* @__PURE__ */ u(h, { className: "size-4" })
|
|
201
209
|
})]
|
|
202
210
|
}, e.id))
|
|
203
211
|
})]
|
|
204
|
-
})] }) : /* @__PURE__ */
|
|
205
|
-
!
|
|
212
|
+
})] }) : /* @__PURE__ */ d(l, { children: [
|
|
213
|
+
!S && /* @__PURE__ */ u("div", {
|
|
206
214
|
className: "rounded-md border border-status-warning-border bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text",
|
|
207
|
-
children:
|
|
208
|
-
"Anyone with this link can view ",
|
|
209
|
-
/* @__PURE__ */ l("strong", { children: "all current and future" }),
|
|
210
|
-
" credentials in this vault until it expires or you revoke it."
|
|
211
|
-
]
|
|
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.")
|
|
212
216
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
onSubmit:
|
|
217
|
+
/* @__PURE__ */ d("form", {
|
|
218
|
+
onSubmit: xe,
|
|
215
219
|
className: "space-y-3",
|
|
216
220
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ d("div", {
|
|
218
222
|
className: "grid grid-cols-2 gap-3",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
220
|
-
label: "Expires",
|
|
221
|
-
value:
|
|
222
|
-
onChange:
|
|
223
|
-
options:
|
|
224
|
-
}), /* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ u(a, {
|
|
224
|
+
label: w("security.secretShareDialog.expiresLabel", "Expires"),
|
|
225
|
+
value: N,
|
|
226
|
+
onChange: P,
|
|
227
|
+
options: T
|
|
228
|
+
}), /* @__PURE__ */ u(i, {
|
|
225
229
|
id: "link-max-views",
|
|
226
|
-
label: "Max views (optional)",
|
|
230
|
+
label: w("security.secretShareDialog.maxViews", "Max views (optional)"),
|
|
227
231
|
type: "number",
|
|
228
232
|
min: 1,
|
|
229
|
-
value:
|
|
230
|
-
onChange: (e) =>
|
|
231
|
-
placeholder: "Unlimited"
|
|
233
|
+
value: L,
|
|
234
|
+
onChange: (e) => R(e.target.value),
|
|
235
|
+
placeholder: w("security.secretShareDialog.maxViewsPlaceholder", "Unlimited")
|
|
232
236
|
})]
|
|
233
237
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ u(i, {
|
|
235
239
|
id: "link-password",
|
|
236
|
-
label: "Password (optional)",
|
|
240
|
+
label: w("security.secretShareDialog.password", "Password (optional)"),
|
|
237
241
|
type: "password",
|
|
238
|
-
value:
|
|
239
|
-
onChange: (e) =>
|
|
240
|
-
placeholder: "Extra protection for the link"
|
|
242
|
+
value: F,
|
|
243
|
+
onChange: (e) => I(e.target.value),
|
|
244
|
+
placeholder: w("security.secretShareDialog.passwordPlaceholder", "Extra protection for the link")
|
|
241
245
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ u("div", {
|
|
243
247
|
className: "flex justify-end",
|
|
244
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ d(r, {
|
|
245
249
|
type: "submit",
|
|
246
|
-
disabled:
|
|
247
|
-
children: [
|
|
250
|
+
disabled: J,
|
|
251
|
+
children: [J ? /* @__PURE__ */ u(m, { className: "size-4 animate-spin" }) : /* @__PURE__ */ u(p, { className: "size-4" }), w("security.secretShareDialog.createLink", "Create link")]
|
|
248
252
|
})
|
|
249
253
|
})
|
|
250
254
|
]
|
|
251
255
|
}),
|
|
252
|
-
|
|
256
|
+
z && /* @__PURE__ */ d("div", {
|
|
253
257
|
className: "rounded-md border border-status-success-border bg-status-success-bg-subtle p-3 space-y-2",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ u("p", {
|
|
255
259
|
className: "text-xs font-medium text-status-success-text",
|
|
256
|
-
children: "Link created — copy it now, it won't be shown again."
|
|
257
|
-
}), /* @__PURE__ */
|
|
260
|
+
children: w("security.secretShareDialog.linkCreated", "Link created — copy it now, it won't be shown again.")
|
|
261
|
+
}), /* @__PURE__ */ d("div", {
|
|
258
262
|
className: "flex items-center gap-2",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ u("input", {
|
|
260
264
|
readOnly: !0,
|
|
261
|
-
value:
|
|
265
|
+
value: z,
|
|
262
266
|
onFocus: (e) => e.currentTarget.select(),
|
|
263
267
|
className: "flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm font-mono"
|
|
264
|
-
}), /* @__PURE__ */
|
|
268
|
+
}), /* @__PURE__ */ u(r, {
|
|
265
269
|
type: "button",
|
|
266
270
|
variant: "outline",
|
|
267
271
|
size: "sm",
|
|
268
|
-
onClick: () => void
|
|
269
|
-
children:
|
|
272
|
+
onClick: () => void Se(),
|
|
273
|
+
children: u(ge ? re : ie, { className: "size-4" })
|
|
270
274
|
})]
|
|
271
275
|
})]
|
|
272
276
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ d("div", {
|
|
274
278
|
className: "space-y-2",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
279
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
276
280
|
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
277
|
-
children: "Active links"
|
|
278
|
-
}),
|
|
281
|
+
children: w("security.secretShareDialog.activeLinks", "Active links")
|
|
282
|
+
}), G ? /* @__PURE__ */ u("div", {
|
|
279
283
|
className: "flex justify-center py-4",
|
|
280
|
-
children: /* @__PURE__ */
|
|
281
|
-
}) :
|
|
284
|
+
children: /* @__PURE__ */ u(m, { className: "size-5 animate-spin text-text-secondary" })
|
|
285
|
+
}) : Z.length === 0 ? /* @__PURE__ */ u("p", {
|
|
282
286
|
className: "text-sm text-text-secondary py-2",
|
|
283
|
-
children: "No active links."
|
|
284
|
-
}) : /* @__PURE__ */
|
|
287
|
+
children: w("security.secretShareDialog.noActiveLinks", "No active links.")
|
|
288
|
+
}) : /* @__PURE__ */ u("ul", {
|
|
285
289
|
className: "space-y-2",
|
|
286
|
-
children:
|
|
290
|
+
children: Z.map((e) => /* @__PURE__ */ d("li", {
|
|
287
291
|
className: "flex items-center justify-between gap-2 rounded-md border border-border-subtle/60 px-3 py-2",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ d("div", {
|
|
289
293
|
className: "min-w-0",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ d("div", {
|
|
291
295
|
className: "flex items-center gap-2 flex-wrap",
|
|
292
296
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ u(n, {
|
|
294
298
|
variant: e.status === "ACTIVE" ? "success" : "destructive",
|
|
295
|
-
children: e.status === "ACTIVE" ? "Active" : "Revoked"
|
|
299
|
+
children: e.status === "ACTIVE" ? w("security.secretShareDialog.statusActive", "Active") : w("security.secretShareDialog.statusRevoked", "Revoked")
|
|
296
300
|
}),
|
|
297
|
-
e.requiresPassword && /* @__PURE__ */
|
|
301
|
+
e.requiresPassword && /* @__PURE__ */ d("span", {
|
|
298
302
|
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
299
|
-
children: [
|
|
303
|
+
children: [
|
|
304
|
+
/* @__PURE__ */ u(oe, { className: "size-3" }),
|
|
305
|
+
" ",
|
|
306
|
+
w("security.secretShareDialog.passwordProtected", "Password")
|
|
307
|
+
]
|
|
300
308
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ d("span", {
|
|
302
310
|
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
303
311
|
children: [
|
|
304
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ u(ae, { className: "size-3" }),
|
|
305
313
|
e.viewCount,
|
|
306
314
|
e.maxViews ? `/${e.maxViews}` : "",
|
|
307
|
-
"
|
|
315
|
+
" ",
|
|
316
|
+
w("security.secretShareDialog.views", "views")
|
|
308
317
|
]
|
|
309
318
|
}),
|
|
310
|
-
e.expiresAt && /* @__PURE__ */
|
|
319
|
+
e.expiresAt && /* @__PURE__ */ d("span", {
|
|
311
320
|
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
312
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ u(f, { className: "size-3" }), new Date(e.expiresAt).toLocaleDateString()]
|
|
313
322
|
})
|
|
314
323
|
]
|
|
315
|
-
}), /* @__PURE__ */
|
|
324
|
+
}), /* @__PURE__ */ d("p", {
|
|
316
325
|
className: "text-xs text-text-secondary mt-0.5",
|
|
317
|
-
children: [
|
|
326
|
+
children: [
|
|
327
|
+
w("security.secretShareDialog.created", "Created"),
|
|
328
|
+
" ",
|
|
329
|
+
new Date(e.createdAt).toLocaleString()
|
|
330
|
+
]
|
|
318
331
|
})]
|
|
319
|
-
}), e.status === "ACTIVE" && /* @__PURE__ */
|
|
332
|
+
}), e.status === "ACTIVE" && /* @__PURE__ */ u("button", {
|
|
320
333
|
type: "button",
|
|
321
334
|
onClick: () => void $(e.id),
|
|
322
335
|
className: "p-1.5 rounded hover:bg-status-error-bg/10 text-text-secondary hover:text-status-error-text",
|
|
323
|
-
"aria-label": "Revoke link",
|
|
324
|
-
children: /* @__PURE__ */
|
|
336
|
+
"aria-label": w("security.secretShareDialog.revokeLink", "Revoke link"),
|
|
337
|
+
children: /* @__PURE__ */ u(h, { className: "size-4" })
|
|
325
338
|
})]
|
|
326
339
|
}, e.id))
|
|
327
340
|
})]
|
|
@@ -333,6 +346,6 @@ var S = ({ isOpen: S, onClose: ue, vaultId: C, secretId: w, name: de, className:
|
|
|
333
346
|
});
|
|
334
347
|
};
|
|
335
348
|
//#endregion
|
|
336
|
-
export {
|
|
349
|
+
export { y as SecretShareDialog };
|
|
337
350
|
|
|
338
351
|
//# sourceMappingURL=SecretShareDialog.js.map
|