@burdenoff/microfe-security 2026.608.1 → 2026.624.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/security/components/ActivityTimeline.js +4 -4
- package/dist/security/components/ActivityTimeline.js.map +1 -1
- package/dist/security/components/BulkActionBar.js +3 -3
- package/dist/security/components/BulkActionBar.js.map +1 -1
- package/dist/security/components/ConfirmDialog.js +29 -38
- package/dist/security/components/ConfirmDialog.js.map +1 -1
- package/dist/security/components/CopyButton.js +2 -2
- package/dist/security/components/CopyButton.js.map +1 -1
- package/dist/security/components/ExportDialog.js +13 -13
- package/dist/security/components/ExportDialog.js.map +1 -1
- package/dist/security/components/ImportWizard.js +98 -105
- package/dist/security/components/ImportWizard.js.map +1 -1
- package/dist/security/components/PageLayout.js +2 -2
- package/dist/security/components/PageLayout.js.map +1 -1
- package/dist/security/components/PasswordGenerator.js +6 -6
- package/dist/security/components/PasswordGenerator.js.map +1 -1
- package/dist/security/components/SecretFormFields.js +12 -12
- package/dist/security/components/SecretFormFields.js.map +1 -1
- package/dist/security/components/SecretRow.js +4 -4
- package/dist/security/components/SecretRow.js.map +1 -1
- package/dist/security/components/SecretShareDialog.js +94 -105
- package/dist/security/components/SecretShareDialog.js.map +1 -1
- package/dist/security/components/SecretTypeBadge.js +1 -1
- package/dist/security/components/SecretTypeBadge.js.map +1 -1
- package/dist/security/components/SecretValueDisplay.js +5 -5
- package/dist/security/components/SecretValueDisplay.js.map +1 -1
- package/dist/security/components/SecurityScoreCard.js +2 -2
- package/dist/security/components/SecurityScoreCard.js.map +1 -1
- package/dist/security/components/VaultCard.js +5 -5
- package/dist/security/components/VaultCard.js.map +1 -1
- package/dist/security/components/VaultFormFields.js +6 -6
- package/dist/security/components/VaultFormFields.js.map +1 -1
- package/dist/security/components/VaultShareDialog.js +27 -41
- package/dist/security/components/VaultShareDialog.js.map +1 -1
- package/dist/security/components/ui.js +13 -13
- package/dist/security/components/ui.js.map +1 -1
- package/dist/security/pages/AccessReviewPage.js +59 -74
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/AuditLogPage.js +13 -13
- package/dist/security/pages/AuditLogPage.js.map +1 -1
- package/dist/security/pages/ImportExportPage.js +3 -3
- package/dist/security/pages/ImportExportPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.js +141 -156
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.js +12 -12
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecretCreatePage.js +9 -9
- package/dist/security/pages/SecretCreatePage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.js +222 -227
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.js +14 -14
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/SharedWithMePage.js +10 -10
- package/dist/security/pages/SharedWithMePage.js.map +1 -1
- package/dist/security/pages/VaultCreatePage.js +2 -2
- package/dist/security/pages/VaultCreatePage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.js +9 -9
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultSettingsPage.js +28 -28
- package/dist/security/pages/VaultSettingsPage.js.map +1 -1
- package/dist/security/pages/VaultShareViewer.js +21 -21
- package/dist/security/pages/VaultShareViewer.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.js +17 -17
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/dist/security/routes/routeUtils.js +5 -5
- package/dist/security/routes/routeUtils.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ var f = ({ type: n, value: r, onValueChange: i, showPasswordGen: o, setShowPassw
|
|
|
12
12
|
children: [
|
|
13
13
|
/* @__PURE__ */ s("label", {
|
|
14
14
|
htmlFor: "secret-value-password",
|
|
15
|
-
className: "text-sm font-medium text-
|
|
15
|
+
className: "text-sm font-medium text-text-primary",
|
|
16
16
|
children: "Password"
|
|
17
17
|
}),
|
|
18
18
|
/* @__PURE__ */ s("input", {
|
|
@@ -22,7 +22,7 @@ var f = ({ type: n, value: r, onValueChange: i, showPasswordGen: o, setShowPassw
|
|
|
22
22
|
value: r,
|
|
23
23
|
onChange: (e) => i(e.target.value),
|
|
24
24
|
placeholder: "Enter password",
|
|
25
|
-
className: e("flex h-9 w-full rounded-md border border-border bg-
|
|
25
|
+
className: e("flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-1 text-sm font-mono", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]")
|
|
26
26
|
}),
|
|
27
27
|
/* @__PURE__ */ s(t, {
|
|
28
28
|
variant: "outline",
|
|
@@ -39,7 +39,7 @@ var f = ({ type: n, value: r, onValueChange: i, showPasswordGen: o, setShowPassw
|
|
|
39
39
|
className: "space-y-1.5",
|
|
40
40
|
children: [/* @__PURE__ */ s("label", {
|
|
41
41
|
htmlFor: "secret-value-pem",
|
|
42
|
-
className: "text-sm font-medium text-
|
|
42
|
+
className: "text-sm font-medium text-text-primary",
|
|
43
43
|
children: n === "CERTIFICATE" ? "Certificate (PEM)" : "Private Key"
|
|
44
44
|
}), /* @__PURE__ */ s("textarea", {
|
|
45
45
|
id: "secret-value-pem",
|
|
@@ -48,13 +48,13 @@ var f = ({ type: n, value: r, onValueChange: i, showPasswordGen: o, setShowPassw
|
|
|
48
48
|
onChange: (e) => i(e.target.value),
|
|
49
49
|
placeholder: n === "CERTIFICATE" ? "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----" : "-----BEGIN OPENSSH PRIVATE KEY-----\n...\n-----END OPENSSH PRIVATE KEY-----",
|
|
50
50
|
rows: 8,
|
|
51
|
-
className: e("flex w-full rounded-md border border-border bg-
|
|
51
|
+
className: e("flex w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-mono", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", "resize-y min-h-[120px]")
|
|
52
52
|
})]
|
|
53
53
|
}) : n === "STRUCTURED_DATA" ? /* @__PURE__ */ c("div", {
|
|
54
54
|
className: "space-y-3",
|
|
55
55
|
children: [/* @__PURE__ */ s("label", {
|
|
56
56
|
htmlFor: "secret-value-json",
|
|
57
|
-
className: "text-sm font-medium text-
|
|
57
|
+
className: "text-sm font-medium text-text-primary",
|
|
58
58
|
children: "Structured Data (JSON format)"
|
|
59
59
|
}), /* @__PURE__ */ s("textarea", {
|
|
60
60
|
id: "secret-value-json",
|
|
@@ -63,13 +63,13 @@ var f = ({ type: n, value: r, onValueChange: i, showPasswordGen: o, setShowPassw
|
|
|
63
63
|
onChange: (e) => i(e.target.value),
|
|
64
64
|
placeholder: "{\n \"key\": \"value\",\n \"connection\": \"...\"\n}",
|
|
65
65
|
rows: 5,
|
|
66
|
-
className: e("flex w-full rounded-md border border-border bg-
|
|
66
|
+
className: e("flex w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-mono", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", "resize-y")
|
|
67
67
|
})]
|
|
68
68
|
}) : /* @__PURE__ */ c("div", {
|
|
69
69
|
className: "space-y-1.5",
|
|
70
70
|
children: [/* @__PURE__ */ s("label", {
|
|
71
71
|
htmlFor: "secret-value-text",
|
|
72
|
-
className: "text-sm font-medium text-
|
|
72
|
+
className: "text-sm font-medium text-text-primary",
|
|
73
73
|
children: "Value"
|
|
74
74
|
}), /* @__PURE__ */ s("textarea", {
|
|
75
75
|
id: "secret-value-text",
|
|
@@ -78,7 +78,7 @@ var f = ({ type: n, value: r, onValueChange: i, showPasswordGen: o, setShowPassw
|
|
|
78
78
|
onChange: (e) => i(e.target.value),
|
|
79
79
|
placeholder: "Enter secret value",
|
|
80
80
|
rows: 3,
|
|
81
|
-
className: e("flex w-full rounded-md border border-border bg-
|
|
81
|
+
className: e("flex w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-mono", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", "resize-y")
|
|
82
82
|
})]
|
|
83
83
|
}), p = ({ type: a, onTypeChange: p, name: m, onNameChange: h, value: g, onValueChange: _, description: v, onDescriptionChange: y, labels: b, onLabelsChange: x, className: S }) => {
|
|
84
84
|
let [C, w] = o(""), [T, E] = o(!1), D = i.map((e) => ({
|
|
@@ -129,7 +129,7 @@ var f = ({ type: n, value: r, onValueChange: i, showPasswordGen: o, setShowPassw
|
|
|
129
129
|
children: [
|
|
130
130
|
/* @__PURE__ */ s("label", {
|
|
131
131
|
htmlFor: "secret-new-label",
|
|
132
|
-
className: "text-sm font-medium text-
|
|
132
|
+
className: "text-sm font-medium text-text-primary",
|
|
133
133
|
children: "Labels"
|
|
134
134
|
}),
|
|
135
135
|
/* @__PURE__ */ c("div", {
|
|
@@ -141,7 +141,7 @@ var f = ({ type: n, value: r, onValueChange: i, showPasswordGen: o, setShowPassw
|
|
|
141
141
|
onChange: (e) => w(e.target.value),
|
|
142
142
|
onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(), O()),
|
|
143
143
|
placeholder: "Add label",
|
|
144
|
-
className: e("flex h-8 flex-1 rounded-md border border-border bg-
|
|
144
|
+
className: e("flex h-8 flex-1 rounded-md border border-border-subtle bg-bg-surface px-3 py-1 text-sm", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]")
|
|
145
145
|
}), /* @__PURE__ */ s(t, {
|
|
146
146
|
variant: "outline",
|
|
147
147
|
size: "sm",
|
|
@@ -153,11 +153,11 @@ var f = ({ type: n, value: r, onValueChange: i, showPasswordGen: o, setShowPassw
|
|
|
153
153
|
b.length > 0 && /* @__PURE__ */ s("div", {
|
|
154
154
|
className: "flex flex-wrap gap-1.5",
|
|
155
155
|
children: b.map((e) => /* @__PURE__ */ c("span", {
|
|
156
|
-
className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs bg-
|
|
156
|
+
className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs bg-bg-sunken border border-border-subtle",
|
|
157
157
|
children: [e, /* @__PURE__ */ s("button", {
|
|
158
158
|
type: "button",
|
|
159
159
|
onClick: () => k(e),
|
|
160
|
-
className: "p-0.5 rounded-full hover:bg-
|
|
160
|
+
className: "p-0.5 rounded-full hover:bg-status-error-bg/10 hover:text-status-error-text",
|
|
161
161
|
children: /* @__PURE__ */ s(l, { className: "size-2.5" })
|
|
162
162
|
})]
|
|
163
163
|
}, e))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretFormFields.js","names":[],"sources":["../../../src/security/components/SecretFormFields.tsx"],"sourcesContent":["import { type FC, useState } from 'react';\nimport { Plus, Minus } from 'lucide-react';\nimport { OptionalFields } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport { Input, Select, Button } from './ui';\nimport { SECRET_TYPES } from '../constants/secretTypes';\nimport { PasswordGenerator } from './PasswordGenerator';\nimport type { SecretType } from '../types';\n\ninterface SecretValueFieldProps {\n type: SecretType;\n value: string;\n onValueChange: (value: string) => void;\n showPasswordGen: boolean;\n setShowPasswordGen: (show: boolean) => void;\n}\n\nconst SecretValueField: FC<SecretValueFieldProps> = ({\n type,\n value,\n onValueChange,\n showPasswordGen,\n setShowPasswordGen,\n}) => {\n if (type === 'CREDENTIAL') {\n return (\n <div className=\"space-y-2\">\n <label htmlFor=\"secret-value-password\" className=\"text-sm font-medium text-foreground\">\n Password\n </label>\n <input\n id=\"secret-value-password\"\n aria-label=\"Password\"\n type=\"password\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n placeholder=\"Enter password\"\n className={cn(\n 'flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm font-mono',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring'\n )}\n />\n <Button\n variant=\"outline\"\n size=\"sm\"\n type=\"button\"\n onClick={() => setShowPasswordGen(!showPasswordGen)}\n >\n {showPasswordGen ? 'Hide Generator' : 'Generate Password'}\n </Button>\n {showPasswordGen && (\n <PasswordGenerator\n onAccept={(pw) => {\n onValueChange(pw);\n setShowPasswordGen(false);\n }}\n />\n )}\n </div>\n );\n }\n\n if (type === 'CERTIFICATE' || type === 'PRIVATE_KEY') {\n return (\n <div className=\"space-y-1.5\">\n <label htmlFor=\"secret-value-pem\" className=\"text-sm font-medium text-foreground\">\n {type === 'CERTIFICATE' ? 'Certificate (PEM)' : 'Private Key'}\n </label>\n <textarea\n id=\"secret-value-pem\"\n aria-label={type === 'CERTIFICATE' ? 'Certificate (PEM)' : 'Private Key'}\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n placeholder={\n type === 'CERTIFICATE'\n ? '-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----'\n : '-----BEGIN OPENSSH PRIVATE KEY-----\\n...\\n-----END OPENSSH PRIVATE KEY-----'\n }\n rows={8}\n className={cn(\n 'flex w-full rounded-md border border-border bg-background px-3 py-2 text-sm font-mono',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n 'resize-y min-h-[120px]'\n )}\n />\n </div>\n );\n }\n\n if (type === 'STRUCTURED_DATA') {\n return (\n <div className=\"space-y-3\">\n <label htmlFor=\"secret-value-json\" className=\"text-sm font-medium text-foreground\">\n Structured Data (JSON format)\n </label>\n <textarea\n id=\"secret-value-json\"\n aria-label=\"Structured Data JSON\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n placeholder={'{\\n \"key\": \"value\",\\n \"connection\": \"...\"\\n}'}\n rows={5}\n className={cn(\n 'flex w-full rounded-md border border-border bg-background px-3 py-2 text-sm font-mono',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n 'resize-y'\n )}\n />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-1.5\">\n <label htmlFor=\"secret-value-text\" className=\"text-sm font-medium text-foreground\">\n Value\n </label>\n <textarea\n id=\"secret-value-text\"\n aria-label=\"Value\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n placeholder=\"Enter secret value\"\n rows={3}\n className={cn(\n 'flex w-full rounded-md border border-border bg-background px-3 py-2 text-sm font-mono',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n 'resize-y'\n )}\n />\n </div>\n );\n};\n\ninterface SecretFormFieldsProps {\n type: SecretType;\n onTypeChange: (type: SecretType) => void;\n name: string;\n onNameChange: (name: string) => void;\n value: string;\n onValueChange: (value: string) => void;\n description: string;\n onDescriptionChange: (description: string) => void;\n labels: string[];\n onLabelsChange: (labels: string[]) => void;\n className?: string;\n}\n\n/**\n * Type-specific form fields for creating or editing secrets.\n * Renders appropriate input fields based on the selected secret type.\n */\nexport const SecretFormFields: FC<SecretFormFieldsProps> = ({\n type,\n onTypeChange,\n name,\n onNameChange,\n value,\n onValueChange,\n description,\n onDescriptionChange,\n labels,\n onLabelsChange,\n className,\n}) => {\n const [newLabel, setNewLabel] = useState('');\n const [showPasswordGen, setShowPasswordGen] = useState(false);\n\n const typeOptions = SECRET_TYPES.map((t) => ({ value: t.value, label: t.label }));\n\n const addLabel = () => {\n const trimmed = newLabel.trim();\n if (trimmed && !labels.includes(trimmed)) {\n onLabelsChange([...labels, trimmed]);\n setNewLabel('');\n }\n };\n\n const removeLabel = (label: string) => {\n onLabelsChange(labels.filter((l) => l !== label));\n };\n\n return (\n <div className={cn('space-y-4', className)}>\n {/* Secret type */}\n <Select\n label=\"Secret Type\"\n value={type}\n onChange={(v) => onTypeChange(v as SecretType)}\n options={typeOptions}\n />\n\n {/* Name */}\n <Input\n id=\"secret-name\"\n label=\"Name\"\n value={name}\n onChange={(e) => onNameChange(e.target.value)}\n placeholder=\"e.g., production-database-password\"\n required\n />\n\n {/* Description */}\n <Input\n id=\"secret-description\"\n label=\"Description (optional)\"\n value={description}\n onChange={(e) => onDescriptionChange(e.target.value)}\n placeholder=\"Brief description of this secret\"\n />\n\n {/* Type-specific value field */}\n <SecretValueField\n type={type}\n value={value}\n onValueChange={onValueChange}\n showPasswordGen={showPasswordGen}\n setShowPasswordGen={setShowPasswordGen}\n />\n\n {/* Labels — advanced classification, hidden by default */}\n <OptionalFields\n title=\"Advanced metadata\"\n description=\"Custom labels for filtering and grouping secrets.\"\n >\n <div className=\"space-y-2\">\n <label htmlFor=\"secret-new-label\" className=\"text-sm font-medium text-foreground\">\n Labels\n </label>\n <div className=\"flex items-center gap-2\">\n <input\n id=\"secret-new-label\"\n aria-label=\"Add label\"\n value={newLabel}\n onChange={(e) => setNewLabel(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && (e.preventDefault(), addLabel())}\n placeholder=\"Add label\"\n className={cn(\n 'flex h-8 flex-1 rounded-md border border-border bg-background px-3 py-1 text-sm',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring'\n )}\n />\n <Button variant=\"outline\" size=\"sm\" type=\"button\" onClick={addLabel}>\n <Plus className=\"size-3\" />\n </Button>\n </div>\n {labels.length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {labels.map((label) => (\n <span\n key={label}\n className=\"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs bg-muted border border-border\"\n >\n {label}\n <button\n type=\"button\"\n onClick={() => removeLabel(label)}\n className=\"p-0.5 rounded-full hover:bg-destructive/10 hover:text-destructive\"\n >\n <Minus className=\"size-2.5\" />\n </button>\n </span>\n ))}\n </div>\n )}\n </div>\n </OptionalFields>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAiBA,IAAM,KAA+C,EACnD,SACA,UACA,kBACA,oBACA,4BAEI,MAAS,eAET,kBAAC,OAAD;CAAK,WAAU;WAAf;EACE,kBAAC,SAAD;GAAO,SAAQ;GAAwB,WAAU;aAAsC;GAE/E,CAAA;EACR,kBAAC,SAAD;GACE,IAAG;GACH,cAAW;GACX,MAAK;GACE;GACP,WAAW,MAAM,EAAc,EAAE,OAAO,MAAM;GAC9C,aAAY;G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,EACF,kBAAC,GAAD;QAAQ,SAAQ;QAAU,MAAK;QAAK,MAAK;QAAS,SAAS;kBACzD,kBAAC,GAAD,EAAM,WAAU,UAAW,CAAA;QACpB,CAAA,CACL;;MACL,EAAO,SAAS,KACf,kBAAC,OAAD;OAAK,WAAU;iBACZ,EAAO,KAAK,MACX,kBAAC,QAAD;QAEE,WAAU;kBAFZ,CAIG,GACD,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,EAAY,EAAM;SACjC,WAAU;mBAEV,kBAAC,GAAD,EAAO,WAAU,YAAa,CAAA;SACvB,CAAA,CACJ;UAXA,EAWA,CACP;OACE,CAAA;MAEJ;;IACS,CAAA;GACb"}
|
|
1
|
+
{"version":3,"file":"SecretFormFields.js","names":[],"sources":["../../../src/security/components/SecretFormFields.tsx"],"sourcesContent":["import { type FC, useState } from 'react';\nimport { Plus, Minus } from 'lucide-react';\nimport { OptionalFields } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport { Input, Select, Button } from './ui';\nimport { SECRET_TYPES } from '../constants/secretTypes';\nimport { PasswordGenerator } from './PasswordGenerator';\nimport type { SecretType } from '../types';\n\ninterface SecretValueFieldProps {\n type: SecretType;\n value: string;\n onValueChange: (value: string) => void;\n showPasswordGen: boolean;\n setShowPasswordGen: (show: boolean) => void;\n}\n\nconst SecretValueField: FC<SecretValueFieldProps> = ({\n type,\n value,\n onValueChange,\n showPasswordGen,\n setShowPasswordGen,\n}) => {\n if (type === 'CREDENTIAL') {\n return (\n <div className=\"space-y-2\">\n <label htmlFor=\"secret-value-password\" className=\"text-sm font-medium text-text-primary\">\n Password\n </label>\n <input\n id=\"secret-value-password\"\n aria-label=\"Password\"\n type=\"password\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n placeholder=\"Enter password\"\n className={cn(\n 'flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-1 text-sm font-mono',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]'\n )}\n />\n <Button\n variant=\"outline\"\n size=\"sm\"\n type=\"button\"\n onClick={() => setShowPasswordGen(!showPasswordGen)}\n >\n {showPasswordGen ? 'Hide Generator' : 'Generate Password'}\n </Button>\n {showPasswordGen && (\n <PasswordGenerator\n onAccept={(pw) => {\n onValueChange(pw);\n setShowPasswordGen(false);\n }}\n />\n )}\n </div>\n );\n }\n\n if (type === 'CERTIFICATE' || type === 'PRIVATE_KEY') {\n return (\n <div className=\"space-y-1.5\">\n <label htmlFor=\"secret-value-pem\" className=\"text-sm font-medium text-text-primary\">\n {type === 'CERTIFICATE' ? 'Certificate (PEM)' : 'Private Key'}\n </label>\n <textarea\n id=\"secret-value-pem\"\n aria-label={type === 'CERTIFICATE' ? 'Certificate (PEM)' : 'Private Key'}\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n placeholder={\n type === 'CERTIFICATE'\n ? '-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----'\n : '-----BEGIN OPENSSH PRIVATE KEY-----\\n...\\n-----END OPENSSH PRIVATE KEY-----'\n }\n rows={8}\n className={cn(\n 'flex w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-mono',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'resize-y min-h-[120px]'\n )}\n />\n </div>\n );\n }\n\n if (type === 'STRUCTURED_DATA') {\n return (\n <div className=\"space-y-3\">\n <label htmlFor=\"secret-value-json\" className=\"text-sm font-medium text-text-primary\">\n Structured Data (JSON format)\n </label>\n <textarea\n id=\"secret-value-json\"\n aria-label=\"Structured Data JSON\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n placeholder={'{\\n \"key\": \"value\",\\n \"connection\": \"...\"\\n}'}\n rows={5}\n className={cn(\n 'flex w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-mono',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'resize-y'\n )}\n />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-1.5\">\n <label htmlFor=\"secret-value-text\" className=\"text-sm font-medium text-text-primary\">\n Value\n </label>\n <textarea\n id=\"secret-value-text\"\n aria-label=\"Value\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n placeholder=\"Enter secret value\"\n rows={3}\n className={cn(\n 'flex w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-mono',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'resize-y'\n )}\n />\n </div>\n );\n};\n\ninterface SecretFormFieldsProps {\n type: SecretType;\n onTypeChange: (type: SecretType) => void;\n name: string;\n onNameChange: (name: string) => void;\n value: string;\n onValueChange: (value: string) => void;\n description: string;\n onDescriptionChange: (description: string) => void;\n labels: string[];\n onLabelsChange: (labels: string[]) => void;\n className?: string;\n}\n\n/**\n * Type-specific form fields for creating or editing secrets.\n * Renders appropriate input fields based on the selected secret type.\n */\nexport const SecretFormFields: FC<SecretFormFieldsProps> = ({\n type,\n onTypeChange,\n name,\n onNameChange,\n value,\n onValueChange,\n description,\n onDescriptionChange,\n labels,\n onLabelsChange,\n className,\n}) => {\n const [newLabel, setNewLabel] = useState('');\n const [showPasswordGen, setShowPasswordGen] = useState(false);\n\n const typeOptions = SECRET_TYPES.map((t) => ({ value: t.value, label: t.label }));\n\n const addLabel = () => {\n const trimmed = newLabel.trim();\n if (trimmed && !labels.includes(trimmed)) {\n onLabelsChange([...labels, trimmed]);\n setNewLabel('');\n }\n };\n\n const removeLabel = (label: string) => {\n onLabelsChange(labels.filter((l) => l !== label));\n };\n\n return (\n <div className={cn('space-y-4', className)}>\n {/* Secret type */}\n <Select\n label=\"Secret Type\"\n value={type}\n onChange={(v) => onTypeChange(v as SecretType)}\n options={typeOptions}\n />\n\n {/* Name */}\n <Input\n id=\"secret-name\"\n label=\"Name\"\n value={name}\n onChange={(e) => onNameChange(e.target.value)}\n placeholder=\"e.g., production-database-password\"\n required\n />\n\n {/* Description */}\n <Input\n id=\"secret-description\"\n label=\"Description (optional)\"\n value={description}\n onChange={(e) => onDescriptionChange(e.target.value)}\n placeholder=\"Brief description of this secret\"\n />\n\n {/* Type-specific value field */}\n <SecretValueField\n type={type}\n value={value}\n onValueChange={onValueChange}\n showPasswordGen={showPasswordGen}\n setShowPasswordGen={setShowPasswordGen}\n />\n\n {/* Labels — advanced classification, hidden by default */}\n <OptionalFields\n title=\"Advanced metadata\"\n description=\"Custom labels for filtering and grouping secrets.\"\n >\n <div className=\"space-y-2\">\n <label htmlFor=\"secret-new-label\" className=\"text-sm font-medium text-text-primary\">\n Labels\n </label>\n <div className=\"flex items-center gap-2\">\n <input\n id=\"secret-new-label\"\n aria-label=\"Add label\"\n value={newLabel}\n onChange={(e) => setNewLabel(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && (e.preventDefault(), addLabel())}\n placeholder=\"Add label\"\n className={cn(\n 'flex h-8 flex-1 rounded-md border border-border-subtle bg-bg-surface px-3 py-1 text-sm',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]'\n )}\n />\n <Button variant=\"outline\" size=\"sm\" type=\"button\" onClick={addLabel}>\n <Plus className=\"size-3\" />\n </Button>\n </div>\n {labels.length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {labels.map((label) => (\n <span\n key={label}\n className=\"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs bg-bg-sunken border border-border-subtle\"\n >\n {label}\n <button\n type=\"button\"\n onClick={() => removeLabel(label)}\n className=\"p-0.5 rounded-full hover:bg-status-error-bg/10 hover:text-status-error-text\"\n >\n <Minus className=\"size-2.5\" />\n </button>\n </span>\n ))}\n </div>\n )}\n </div>\n </OptionalFields>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAiBA,IAAM,KAA+C,EACnD,SACA,UACA,kBACA,oBACA,4BAEI,MAAS,eAET,kBAAC,OAAD;CAAK,WA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,IAAG;QACH,cAAW;QACX,OAAO;QACP,WAAW,MAAM,EAAY,EAAE,OAAO,MAAM;QAC5C,YAAY,MAAM,EAAE,QAAQ,YAAY,EAAE,gBAAgB,EAAE,GAAU;QACtE,aAAY;QACZ,WAAW,EACT,0FACA,+FACD;QACD,CAAA,EACF,kBAAC,GAAD;QAAQ,SAAQ;QAAU,MAAK;QAAK,MAAK;QAAS,SAAS;kBACzD,kBAAC,GAAD,EAAM,WAAU,UAAW,CAAA;QACpB,CAAA,CACL;;MACL,EAAO,SAAS,KACf,kBAAC,OAAD;OAAK,WAAU;iBACZ,EAAO,KAAK,MACX,kBAAC,QAAD;QAEE,WAAU;kBAFZ,CAIG,GACD,kBAAC,UAAD;SACE,MAAK;SACL,eAAe,EAAY,EAAM;SACjC,WAAU;mBAEV,kBAAC,GAAD,EAAO,WAAU,YAAa,CAAA;SACvB,CAAA,CACJ;UAXA,EAWA,CACP;OACE,CAAA;MAEJ;;IACS,CAAA;GACb"}
|
|
@@ -18,7 +18,7 @@ var u = ({ secret: u, isSelected: d = !1, onSelect: f, onClick: p, className: m
|
|
|
18
18
|
tabIndex: 0
|
|
19
19
|
} : { role: "listitem" };
|
|
20
20
|
return /* @__PURE__ */ s("div", {
|
|
21
|
-
className: e("flex items-center gap-3 px-4 py-3 border-b border-border last:border-b-0", "hover:bg-
|
|
21
|
+
className: e("flex items-center gap-3 px-4 py-3 border-b border-border-subtle last:border-b-0", "hover:bg-bg-sunken/50 transition-colors", "focus-visible:bg-accent focus-visible:outline-none", d && "bg-action-primary-bg/5", v && "cursor-pointer", m),
|
|
22
22
|
"aria-selected": d,
|
|
23
23
|
...y,
|
|
24
24
|
children: [
|
|
@@ -44,11 +44,11 @@ var u = ({ secret: u, isSelected: d = !1, onSelect: f, onClick: p, className: m
|
|
|
44
44
|
children: [/* @__PURE__ */ s("div", {
|
|
45
45
|
className: "flex items-center gap-2",
|
|
46
46
|
children: [/* @__PURE__ */ o("span", {
|
|
47
|
-
className: "font-medium text-sm text-
|
|
47
|
+
className: "font-medium text-sm text-text-primary truncate",
|
|
48
48
|
children: u.name
|
|
49
49
|
}), /* @__PURE__ */ o(i, { type: u.type })]
|
|
50
50
|
}), u.description && /* @__PURE__ */ o("p", {
|
|
51
|
-
className: "text-xs text-
|
|
51
|
+
className: "text-xs text-text-secondary truncate mt-0.5",
|
|
52
52
|
children: u.description
|
|
53
53
|
})]
|
|
54
54
|
}),
|
|
@@ -67,7 +67,7 @@ var u = ({ secret: u, isSelected: d = !1, onSelect: f, onClick: p, className: m
|
|
|
67
67
|
children: /* @__PURE__ */ o(a, { status: "healthy" })
|
|
68
68
|
}),
|
|
69
69
|
/* @__PURE__ */ s("div", {
|
|
70
|
-
className: "flex items-center gap-1 text-xs text-
|
|
70
|
+
className: "flex items-center gap-1 text-xs text-text-secondary shrink-0",
|
|
71
71
|
"aria-label": g("security.secretRow.lastUpdated.aria", "Last updated {date}", { date: new Date(u.updatedAt).toLocaleDateString() }),
|
|
72
72
|
children: [
|
|
73
73
|
/* @__PURE__ */ o(c, { className: "size-3" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretRow.js","names":[],"sources":["../../../src/security/components/SecretRow.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Clock } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { SecretTypeIcon } from './SecretTypeIcon';\nimport { SecretTypeBadge } from './SecretTypeBadge';\nimport { RotationStatusBadge } from './RotationStatusBadge';\nimport { Badge } from './ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { translateWithFallback } from '../utils/i18n';\nimport type { Secret } from '../types';\n\ninterface SecretRowProps {\n secret: Secret;\n isSelected?: boolean;\n onSelect?: (secretId: string) => void;\n onClick?: () => void;\n className?: string;\n}\n\nexport const SecretRow: FC<SecretRowProps> = ({\n secret,\n isSelected = false,\n onSelect,\n onClick,\n className,\n}) => {\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) =>\n translateWithFallback(t, key, fallback, params);\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (onClick && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n onClick();\n }\n };\n\n const interactive = Boolean(onClick);\n const interactiveProps = interactive\n ? {\n onClick,\n onKeyDown: handleKeyDown,\n role: 'button' as const,\n tabIndex: 0,\n }\n : { role: 'listitem' as const };\n return (\n <div\n className={cn(\n 'flex items-center gap-3 px-4 py-3 border-b border-border last:border-b-0',\n 'hover:bg-
|
|
1
|
+
{"version":3,"file":"SecretRow.js","names":[],"sources":["../../../src/security/components/SecretRow.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Clock } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { SecretTypeIcon } from './SecretTypeIcon';\nimport { SecretTypeBadge } from './SecretTypeBadge';\nimport { RotationStatusBadge } from './RotationStatusBadge';\nimport { Badge } from './ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { translateWithFallback } from '../utils/i18n';\nimport type { Secret } from '../types';\n\ninterface SecretRowProps {\n secret: Secret;\n isSelected?: boolean;\n onSelect?: (secretId: string) => void;\n onClick?: () => void;\n className?: string;\n}\n\nexport const SecretRow: FC<SecretRowProps> = ({\n secret,\n isSelected = false,\n onSelect,\n onClick,\n className,\n}) => {\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) =>\n translateWithFallback(t, key, fallback, params);\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (onClick && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n onClick();\n }\n };\n\n const interactive = Boolean(onClick);\n const interactiveProps = interactive\n ? {\n onClick,\n onKeyDown: handleKeyDown,\n role: 'button' as const,\n tabIndex: 0,\n }\n : { role: 'listitem' as const };\n return (\n <div\n className={cn(\n 'flex items-center gap-3 px-4 py-3 border-b border-border-subtle last:border-b-0',\n 'hover:bg-bg-sunken/50 transition-colors',\n 'focus-visible:bg-accent focus-visible:outline-none',\n isSelected && 'bg-action-primary-bg/5',\n interactive && 'cursor-pointer',\n className\n )}\n aria-selected={isSelected}\n {...interactiveProps}\n >\n {onSelect && (\n <input\n type=\"checkbox\"\n checked={isSelected}\n onChange={(e) => {\n e.stopPropagation();\n onSelect(secret.id);\n }}\n className=\"rounded accent-primary shrink-0\"\n onClick={(e) => e.stopPropagation()}\n aria-label={tx('security.secretRow.checkbox.aria', 'Select secret {name}', {\n name: secret.name,\n })}\n />\n )}\n\n <div className=\"shrink-0\">\n <SecretTypeIcon type={secret.type} size={18} />\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <span className=\"font-medium text-sm text-text-primary truncate\">{secret.name}</span>\n <SecretTypeBadge type={secret.type} />\n </div>\n {secret.description && (\n <p className=\"text-xs text-text-secondary truncate mt-0.5\">{secret.description}</p>\n )}\n </div>\n\n {secret.labels && secret.labels.length > 0 && (\n <div className=\"flex items-center gap-1 shrink-0\">\n {secret.labels.slice(0, 2).map((l) => (\n <Badge key={l.id} variant=\"outline\">\n {l.label}\n </Badge>\n ))}\n {secret.labels.length > 2 && <Badge variant=\"outline\">+{secret.labels.length - 2}</Badge>}\n </div>\n )}\n\n {secret.lastRotatedAt && (\n <div className=\"shrink-0\">\n <RotationStatusBadge status=\"healthy\" />\n </div>\n )}\n\n <div\n className=\"flex items-center gap-1 text-xs text-text-secondary shrink-0\"\n aria-label={tx('security.secretRow.lastUpdated.aria', 'Last updated {date}', {\n date: new Date(secret.updatedAt).toLocaleDateString(),\n })}\n >\n <Clock className=\"size-3\" />\n <span className=\"sr-only\">\n {tx('security.secretRow.lastUpdated.srOnly', 'Last updated {date}', {\n date: new Date(secret.updatedAt).toLocaleDateString(),\n })}\n </span>\n <span aria-hidden=\"true\">{new Date(secret.updatedAt).toLocaleDateString()}</span>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;AAmBA,IAAa,KAAiC,EAC5C,WACA,g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AEN,CACR,EACD,EAAO,OAAO,SAAS,KAAK,kBAAC,GAAD;KAAO,SAAQ;eAAf,CAAyB,KAAE,EAAO,OAAO,SAAS,EAAU;OACrF;;GAGP,EAAO,iBACN,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD,EAAqB,QAAO,WAAY,CAAA;IACpC,CAAA;GAGR,kBAAC,OAAD;IACE,WAAU;IACV,cAAY,EAAG,uCAAuC,uBAAuB,EAC3E,MAAM,IAAI,KAAK,EAAO,UAAU,CAAC,oBAAoB,EACtD,CAAC;cAJJ;KAME,kBAAC,GAAD,EAAO,WAAU,UAAW,CAAA;KAC5B,kBAAC,QAAD;MAAM,WAAU;gBACb,EAAG,yCAAyC,uBAAuB,EAClE,MAAM,IAAI,KAAK,EAAO,UAAU,CAAC,oBAAoB,EACtD,CAAC;MACG,CAAA;KACP,kBAAC,QAAD;MAAM,eAAY;gBAAQ,IAAI,KAAK,EAAO,UAAU,CAAC,oBAAoB;MAAQ,CAAA;KAC7E;;GACF"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { Badge as t, Button as n, Input as r, Select as i } from "./ui.js";
|
|
3
|
-
import { useCreateSecretShareLink as ee, useRevokeSecretShare as
|
|
3
|
+
import { useCreateSecretShareLink as ee, useRevokeSecretShare as a, useSecretShares as te, useShareSecretWithAccount as ne } from "../hooks/useShareQueries.js";
|
|
4
4
|
import { useMemo as o, useState as s } from "react";
|
|
5
5
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
-
import { Check as d, Clock as f, Copy as
|
|
6
|
+
import { Check as d, Clock as f, Copy as p, Eye as re, KeyRound as ie, Link2 as m, Loader2 as h, Trash2 as g, UserPlus as ae, Users as oe } from "lucide-react";
|
|
7
|
+
import { Dialog as se, DialogContent as ce, DialogHeader as le, DialogTitle as _ } from "@burdenoff/fe-libs/ui";
|
|
7
8
|
//#region src/security/components/SecretShareDialog.tsx
|
|
8
|
-
var
|
|
9
|
+
var v = [{
|
|
9
10
|
value: "VIEWER",
|
|
10
11
|
label: "Viewer — can view the credential"
|
|
11
12
|
}, {
|
|
@@ -41,112 +42,100 @@ function b(e) {
|
|
|
41
42
|
function x(e) {
|
|
42
43
|
return `${typeof window < "u" ? window.location.origin : ""}/vault/share/${e}`;
|
|
43
44
|
}
|
|
44
|
-
var S = ({ isOpen: S, onClose:
|
|
45
|
-
let [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
e.preventDefault(), U(null);
|
|
49
|
-
let t = O.trim();
|
|
45
|
+
var S = ({ isOpen: S, onClose: ue, vaultId: C, secretId: w, name: de, className: fe }) => {
|
|
46
|
+
let [T, E] = s("people"), [D, O] = s(""), [k, pe] = s("VIEWER"), [A, j] = s(""), [M, N] = s("604800000"), [P, F] = s(""), [I, L] = s(""), [R, z] = s(null), [me, B] = s(!1), [V, H] = s(null), { data: U, loading: W, refetch: G } = te(S ? C : null, w), [he, { loading: K }] = ne(), [ge, { loading: q }] = ee(), [_e] = a(), J = o(() => U?.secretShares?.items ?? [], [U]), Y = o(() => J.filter((e) => e.kind === "ACCOUNT"), [J]), X = o(() => J.filter((e) => e.kind === "LINK"), [J]), Z = D.includes("@"), Q = async (e) => {
|
|
47
|
+
e.preventDefault(), H(null);
|
|
48
|
+
let t = D.trim();
|
|
50
49
|
if (t) try {
|
|
51
|
-
await
|
|
52
|
-
vaultId:
|
|
53
|
-
secretId:
|
|
54
|
-
accountId:
|
|
55
|
-
email:
|
|
56
|
-
role:
|
|
50
|
+
await he({ variables: { input: {
|
|
51
|
+
vaultId: C,
|
|
52
|
+
secretId: w ?? null,
|
|
53
|
+
accountId: Z ? null : t,
|
|
54
|
+
email: Z ? t : null,
|
|
55
|
+
role: k,
|
|
57
56
|
label: t,
|
|
58
|
-
expiresAt: b(
|
|
59
|
-
} } }),
|
|
57
|
+
expiresAt: b(A)
|
|
58
|
+
} } }), O(""), j(""), await G();
|
|
60
59
|
} catch (e) {
|
|
61
|
-
|
|
60
|
+
H(e instanceof Error ? e.message : "Failed to share");
|
|
62
61
|
}
|
|
63
|
-
},
|
|
64
|
-
e.preventDefault(),
|
|
62
|
+
}, ve = async (e) => {
|
|
63
|
+
e.preventDefault(), H(null), z(null);
|
|
65
64
|
try {
|
|
66
|
-
let e = I.trim() ? Number(I.trim()) : null, t = (await
|
|
67
|
-
vaultId:
|
|
68
|
-
secretId:
|
|
65
|
+
let e = I.trim() ? Number(I.trim()) : null, t = (await ge({ variables: { input: {
|
|
66
|
+
vaultId: C,
|
|
67
|
+
secretId: w ?? null,
|
|
69
68
|
role: "VIEWER",
|
|
70
|
-
expiresAt: b(
|
|
69
|
+
expiresAt: b(M),
|
|
71
70
|
password: P.trim() || null,
|
|
72
71
|
maxViews: e && e > 0 ? Math.floor(e) : null
|
|
73
72
|
} } })).data?.createSecretShareLink?.token;
|
|
74
|
-
t && (z(x(t)), F(""), L("")), await
|
|
73
|
+
t && (z(x(t)), F(""), L("")), await G();
|
|
75
74
|
} catch (e) {
|
|
76
|
-
|
|
75
|
+
H(e instanceof Error ? e.message : "Failed to create link");
|
|
77
76
|
}
|
|
78
77
|
}, $ = async (e) => {
|
|
79
78
|
try {
|
|
80
|
-
await
|
|
79
|
+
await _e({ variables: { id: e } }), await G();
|
|
81
80
|
} catch (e) {
|
|
82
|
-
|
|
81
|
+
H(e instanceof Error ? e.message : "Failed to revoke");
|
|
83
82
|
}
|
|
84
|
-
},
|
|
83
|
+
}, ye = async () => {
|
|
85
84
|
if (R) try {
|
|
86
|
-
await navigator.clipboard.writeText(R),
|
|
85
|
+
await navigator.clipboard.writeText(R), B(!0), setTimeout(() => B(!1), 1500);
|
|
87
86
|
} catch {}
|
|
88
|
-
},
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}), /* @__PURE__ */ u("div", {
|
|
97
|
-
className: e("relative z-10 w-full max-w-lg rounded-lg bg-card border border-border shadow-lg flex flex-col max-h-[90vh]", ce),
|
|
87
|
+
}, be = w ? "credential" : "vault";
|
|
88
|
+
return /* @__PURE__ */ l(se, {
|
|
89
|
+
open: S,
|
|
90
|
+
onOpenChange: (e) => {
|
|
91
|
+
e || ue();
|
|
92
|
+
},
|
|
93
|
+
children: /* @__PURE__ */ u(ce, {
|
|
94
|
+
className: e("max-w-lg flex flex-col max-h-[90vh] gap-0 p-0", fe),
|
|
98
95
|
children: [
|
|
99
|
-
/* @__PURE__ */ u(
|
|
100
|
-
className: "
|
|
101
|
-
children: [/* @__PURE__ */ u(
|
|
102
|
-
className: "text-
|
|
103
|
-
children: ["Share ", _e]
|
|
104
|
-
}), /* @__PURE__ */ u("p", {
|
|
105
|
-
className: "text-sm text-muted-foreground mt-0.5",
|
|
96
|
+
/* @__PURE__ */ u(le, {
|
|
97
|
+
className: "p-6 pb-4 border-b border-border-subtle/60 text-left",
|
|
98
|
+
children: [/* @__PURE__ */ u(_, { children: ["Share ", be] }), /* @__PURE__ */ u("p", {
|
|
99
|
+
className: "text-sm text-text-secondary mt-0.5",
|
|
106
100
|
children: [
|
|
107
101
|
"Share ",
|
|
108
102
|
/* @__PURE__ */ l("span", {
|
|
109
|
-
className: "font-medium text-
|
|
110
|
-
children:
|
|
103
|
+
className: "font-medium text-text-primary",
|
|
104
|
+
children: de
|
|
111
105
|
}),
|
|
112
106
|
" selectively"
|
|
113
107
|
]
|
|
114
|
-
})] }), /* @__PURE__ */ l("button", {
|
|
115
|
-
type: "button",
|
|
116
|
-
onClick: C,
|
|
117
|
-
className: "p-1 rounded hover:bg-accent text-muted-foreground",
|
|
118
|
-
children: /* @__PURE__ */ l(v, { className: "size-4" })
|
|
119
108
|
})]
|
|
120
109
|
}),
|
|
121
110
|
/* @__PURE__ */ u("div", {
|
|
122
111
|
className: "flex gap-1 px-6 pt-4",
|
|
123
112
|
children: [/* @__PURE__ */ u("button", {
|
|
124
113
|
type: "button",
|
|
125
|
-
onClick: () =>
|
|
126
|
-
className: e("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors",
|
|
127
|
-
children: [/* @__PURE__ */ l(
|
|
114
|
+
onClick: () => E("people"),
|
|
115
|
+
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
|
+
children: [/* @__PURE__ */ l(oe, { className: "size-4" }), " People"]
|
|
128
117
|
}), /* @__PURE__ */ u("button", {
|
|
129
118
|
type: "button",
|
|
130
|
-
onClick: () =>
|
|
131
|
-
className: e("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md transition-colors",
|
|
119
|
+
onClick: () => E("link"),
|
|
120
|
+
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"),
|
|
132
121
|
children: [/* @__PURE__ */ l(m, { className: "size-4" }), " Get link"]
|
|
133
122
|
})]
|
|
134
123
|
}),
|
|
135
124
|
/* @__PURE__ */ u("div", {
|
|
136
125
|
className: "overflow-y-auto p-6 pt-4 space-y-5",
|
|
137
|
-
children: [
|
|
126
|
+
children: [V && /* @__PURE__ */ l("div", {
|
|
138
127
|
className: "rounded-md border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
139
|
-
children:
|
|
140
|
-
}),
|
|
141
|
-
onSubmit:
|
|
128
|
+
children: V
|
|
129
|
+
}), T === "people" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("form", {
|
|
130
|
+
onSubmit: Q,
|
|
142
131
|
className: "space-y-3",
|
|
143
132
|
children: [
|
|
144
133
|
/* @__PURE__ */ l(r, {
|
|
145
134
|
id: "share-account",
|
|
146
135
|
label: "Account email or VibeControls account id",
|
|
147
136
|
type: "text",
|
|
148
|
-
value:
|
|
149
|
-
onChange: (e) =>
|
|
137
|
+
value: D,
|
|
138
|
+
onChange: (e) => O(e.target.value),
|
|
150
139
|
placeholder: "colleague@example.com or account id",
|
|
151
140
|
required: !0
|
|
152
141
|
}),
|
|
@@ -154,13 +143,13 @@ var S = ({ isOpen: S, onClose: C, vaultId: w, secretId: T, name: se, className:
|
|
|
154
143
|
className: "grid grid-cols-2 gap-3",
|
|
155
144
|
children: [/* @__PURE__ */ l(i, {
|
|
156
145
|
label: "Access",
|
|
157
|
-
value:
|
|
158
|
-
onChange:
|
|
159
|
-
options:
|
|
146
|
+
value: k,
|
|
147
|
+
onChange: pe,
|
|
148
|
+
options: v
|
|
160
149
|
}), /* @__PURE__ */ l(i, {
|
|
161
150
|
label: "Expires",
|
|
162
|
-
value:
|
|
163
|
-
onChange:
|
|
151
|
+
value: A,
|
|
152
|
+
onChange: j,
|
|
164
153
|
options: y
|
|
165
154
|
})]
|
|
166
155
|
}),
|
|
@@ -168,30 +157,30 @@ var S = ({ isOpen: S, onClose: C, vaultId: w, secretId: T, name: se, className:
|
|
|
168
157
|
className: "flex justify-end",
|
|
169
158
|
children: /* @__PURE__ */ u(n, {
|
|
170
159
|
type: "submit",
|
|
171
|
-
disabled: !
|
|
172
|
-
children: [
|
|
160
|
+
disabled: !D.trim() || K,
|
|
161
|
+
children: [K ? /* @__PURE__ */ l(h, { className: "size-4 animate-spin" }) : /* @__PURE__ */ l(ae, { className: "size-4" }), "Share"]
|
|
173
162
|
})
|
|
174
163
|
})
|
|
175
164
|
]
|
|
176
165
|
}), /* @__PURE__ */ u("div", {
|
|
177
166
|
className: "space-y-2",
|
|
178
167
|
children: [/* @__PURE__ */ l("h3", {
|
|
179
|
-
className: "text-xs font-semibold uppercase tracking-wide text-
|
|
168
|
+
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
180
169
|
children: "People with access"
|
|
181
|
-
}),
|
|
170
|
+
}), W ? /* @__PURE__ */ l("div", {
|
|
182
171
|
className: "flex justify-center py-4",
|
|
183
|
-
children: /* @__PURE__ */ l(h, { className: "size-5 animate-spin text-
|
|
184
|
-
}) :
|
|
185
|
-
className: "text-sm text-
|
|
172
|
+
children: /* @__PURE__ */ l(h, { className: "size-5 animate-spin text-text-secondary" })
|
|
173
|
+
}) : Y.length === 0 ? /* @__PURE__ */ l("p", {
|
|
174
|
+
className: "text-sm text-text-secondary py-2",
|
|
186
175
|
children: "Not shared with anyone yet."
|
|
187
176
|
}) : /* @__PURE__ */ l("ul", {
|
|
188
177
|
className: "space-y-2",
|
|
189
|
-
children:
|
|
190
|
-
className: "flex items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2",
|
|
178
|
+
children: Y.map((e) => /* @__PURE__ */ u("li", {
|
|
179
|
+
className: "flex items-center justify-between gap-2 rounded-md border border-border-subtle/60 px-3 py-2",
|
|
191
180
|
children: [/* @__PURE__ */ u("div", {
|
|
192
181
|
className: "min-w-0",
|
|
193
182
|
children: [/* @__PURE__ */ l("p", {
|
|
194
|
-
className: "text-sm text-
|
|
183
|
+
className: "text-sm text-text-primary truncate",
|
|
195
184
|
children: e.label || e.actorId
|
|
196
185
|
}), /* @__PURE__ */ u("div", {
|
|
197
186
|
className: "flex items-center gap-2 mt-0.5",
|
|
@@ -199,21 +188,21 @@ var S = ({ isOpen: S, onClose: C, vaultId: w, secretId: T, name: se, className:
|
|
|
199
188
|
variant: "outline",
|
|
200
189
|
children: e.role
|
|
201
190
|
}), e.expiresAt && /* @__PURE__ */ u("span", {
|
|
202
|
-
className: "text-xs text-
|
|
191
|
+
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
203
192
|
children: [/* @__PURE__ */ l(f, { className: "size-3" }), new Date(e.expiresAt).toLocaleDateString()]
|
|
204
193
|
})]
|
|
205
194
|
})]
|
|
206
195
|
}), /* @__PURE__ */ l("button", {
|
|
207
196
|
type: "button",
|
|
208
197
|
onClick: () => void $(e.id),
|
|
209
|
-
className: "p-1.5 rounded hover:bg-
|
|
198
|
+
className: "p-1.5 rounded hover:bg-status-error-bg/10 text-text-secondary hover:text-status-error-text",
|
|
210
199
|
"aria-label": "Revoke access",
|
|
211
200
|
children: /* @__PURE__ */ l(g, { className: "size-4" })
|
|
212
201
|
})]
|
|
213
202
|
}, e.id))
|
|
214
203
|
})]
|
|
215
204
|
})] }) : /* @__PURE__ */ u(c, { children: [
|
|
216
|
-
!
|
|
205
|
+
!w && /* @__PURE__ */ u("div", {
|
|
217
206
|
className: "rounded-md border border-status-warning-border bg-status-warning-bg-subtle px-3 py-2 text-xs text-status-warning-text",
|
|
218
207
|
children: [
|
|
219
208
|
"Anyone with this link can view ",
|
|
@@ -222,15 +211,15 @@ var S = ({ isOpen: S, onClose: C, vaultId: w, secretId: T, name: se, className:
|
|
|
222
211
|
]
|
|
223
212
|
}),
|
|
224
213
|
/* @__PURE__ */ u("form", {
|
|
225
|
-
onSubmit:
|
|
214
|
+
onSubmit: ve,
|
|
226
215
|
className: "space-y-3",
|
|
227
216
|
children: [
|
|
228
217
|
/* @__PURE__ */ u("div", {
|
|
229
218
|
className: "grid grid-cols-2 gap-3",
|
|
230
219
|
children: [/* @__PURE__ */ l(i, {
|
|
231
220
|
label: "Expires",
|
|
232
|
-
value:
|
|
233
|
-
onChange:
|
|
221
|
+
value: M,
|
|
222
|
+
onChange: N,
|
|
234
223
|
options: y
|
|
235
224
|
}), /* @__PURE__ */ l(r, {
|
|
236
225
|
id: "link-max-views",
|
|
@@ -254,8 +243,8 @@ var S = ({ isOpen: S, onClose: C, vaultId: w, secretId: T, name: se, className:
|
|
|
254
243
|
className: "flex justify-end",
|
|
255
244
|
children: /* @__PURE__ */ u(n, {
|
|
256
245
|
type: "submit",
|
|
257
|
-
disabled:
|
|
258
|
-
children: [
|
|
246
|
+
disabled: q,
|
|
247
|
+
children: [q ? /* @__PURE__ */ l(h, { className: "size-4 animate-spin" }) : /* @__PURE__ */ l(m, { className: "size-4" }), "Create link"]
|
|
259
248
|
})
|
|
260
249
|
})
|
|
261
250
|
]
|
|
@@ -271,31 +260,31 @@ var S = ({ isOpen: S, onClose: C, vaultId: w, secretId: T, name: se, className:
|
|
|
271
260
|
readOnly: !0,
|
|
272
261
|
value: R,
|
|
273
262
|
onFocus: (e) => e.currentTarget.select(),
|
|
274
|
-
className: "flex h-9 w-full rounded-md border border-border bg-
|
|
263
|
+
className: "flex h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm font-mono"
|
|
275
264
|
}), /* @__PURE__ */ l(n, {
|
|
276
265
|
type: "button",
|
|
277
266
|
variant: "outline",
|
|
278
267
|
size: "sm",
|
|
279
|
-
onClick: () => void
|
|
280
|
-
children: l(
|
|
268
|
+
onClick: () => void ye(),
|
|
269
|
+
children: l(me ? d : p, { className: "size-4" })
|
|
281
270
|
})]
|
|
282
271
|
})]
|
|
283
272
|
}),
|
|
284
273
|
/* @__PURE__ */ u("div", {
|
|
285
274
|
className: "space-y-2",
|
|
286
275
|
children: [/* @__PURE__ */ l("h3", {
|
|
287
|
-
className: "text-xs font-semibold uppercase tracking-wide text-
|
|
276
|
+
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
288
277
|
children: "Active links"
|
|
289
|
-
}),
|
|
278
|
+
}), W ? /* @__PURE__ */ l("div", {
|
|
290
279
|
className: "flex justify-center py-4",
|
|
291
|
-
children: /* @__PURE__ */ l(h, { className: "size-5 animate-spin text-
|
|
292
|
-
}) :
|
|
293
|
-
className: "text-sm text-
|
|
280
|
+
children: /* @__PURE__ */ l(h, { className: "size-5 animate-spin text-text-secondary" })
|
|
281
|
+
}) : X.length === 0 ? /* @__PURE__ */ l("p", {
|
|
282
|
+
className: "text-sm text-text-secondary py-2",
|
|
294
283
|
children: "No active links."
|
|
295
284
|
}) : /* @__PURE__ */ l("ul", {
|
|
296
285
|
className: "space-y-2",
|
|
297
|
-
children:
|
|
298
|
-
className: "flex items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2",
|
|
286
|
+
children: X.map((e) => /* @__PURE__ */ u("li", {
|
|
287
|
+
className: "flex items-center justify-between gap-2 rounded-md border border-border-subtle/60 px-3 py-2",
|
|
299
288
|
children: [/* @__PURE__ */ u("div", {
|
|
300
289
|
className: "min-w-0",
|
|
301
290
|
children: [/* @__PURE__ */ u("div", {
|
|
@@ -306,31 +295,31 @@ var S = ({ isOpen: S, onClose: C, vaultId: w, secretId: T, name: se, className:
|
|
|
306
295
|
children: e.status === "ACTIVE" ? "Active" : "Revoked"
|
|
307
296
|
}),
|
|
308
297
|
e.requiresPassword && /* @__PURE__ */ u("span", {
|
|
309
|
-
className: "text-xs text-
|
|
298
|
+
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
310
299
|
children: [/* @__PURE__ */ l(ie, { className: "size-3" }), " Password"]
|
|
311
300
|
}),
|
|
312
301
|
/* @__PURE__ */ u("span", {
|
|
313
|
-
className: "text-xs text-
|
|
302
|
+
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
314
303
|
children: [
|
|
315
|
-
/* @__PURE__ */ l(
|
|
304
|
+
/* @__PURE__ */ l(re, { className: "size-3" }),
|
|
316
305
|
e.viewCount,
|
|
317
306
|
e.maxViews ? `/${e.maxViews}` : "",
|
|
318
307
|
" views"
|
|
319
308
|
]
|
|
320
309
|
}),
|
|
321
310
|
e.expiresAt && /* @__PURE__ */ u("span", {
|
|
322
|
-
className: "text-xs text-
|
|
311
|
+
className: "text-xs text-text-secondary inline-flex items-center gap-1",
|
|
323
312
|
children: [/* @__PURE__ */ l(f, { className: "size-3" }), new Date(e.expiresAt).toLocaleDateString()]
|
|
324
313
|
})
|
|
325
314
|
]
|
|
326
315
|
}), /* @__PURE__ */ u("p", {
|
|
327
|
-
className: "text-xs text-
|
|
316
|
+
className: "text-xs text-text-secondary mt-0.5",
|
|
328
317
|
children: ["Created ", new Date(e.createdAt).toLocaleString()]
|
|
329
318
|
})]
|
|
330
319
|
}), e.status === "ACTIVE" && /* @__PURE__ */ l("button", {
|
|
331
320
|
type: "button",
|
|
332
321
|
onClick: () => void $(e.id),
|
|
333
|
-
className: "p-1.5 rounded hover:bg-
|
|
322
|
+
className: "p-1.5 rounded hover:bg-status-error-bg/10 text-text-secondary hover:text-status-error-text",
|
|
334
323
|
"aria-label": "Revoke link",
|
|
335
324
|
children: /* @__PURE__ */ l(g, { className: "size-4" })
|
|
336
325
|
})]
|
|
@@ -340,7 +329,7 @@ var S = ({ isOpen: S, onClose: C, vaultId: w, secretId: T, name: se, className:
|
|
|
340
329
|
] })]
|
|
341
330
|
})
|
|
342
331
|
]
|
|
343
|
-
})
|
|
332
|
+
})
|
|
344
333
|
});
|
|
345
334
|
};
|
|
346
335
|
//#endregion
|