@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,132 +1,137 @@
|
|
|
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 { Button as n } from "./ui.js";
|
|
4
|
+
import { DEFAULT_PASSWORD_OPTIONS as r, calculatePasswordStrength as i, generatePassword as a } from "../utils/passwordGenerator.js";
|
|
5
|
+
import { CopyButton as o } from "./CopyButton.js";
|
|
6
|
+
import { useCallback as s, useState as c } from "react";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import { RefreshCw as d } from "lucide-react";
|
|
8
9
|
//#region src/security/components/PasswordGenerator.tsx
|
|
9
|
-
var
|
|
10
|
-
let [
|
|
11
|
-
|
|
12
|
-
}, [
|
|
10
|
+
var f = ({ onAccept: f, clipboardAutoClearMs: p = 3e4, className: m }) => {
|
|
11
|
+
let h = e(), [g, _] = c(r), [v, y] = c(() => a(r)), b = s(() => {
|
|
12
|
+
y(a(g));
|
|
13
|
+
}, [g]), x = s((e, t) => {
|
|
13
14
|
let n = {
|
|
14
|
-
...
|
|
15
|
+
...g,
|
|
15
16
|
[e]: t
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
-
}, [
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className:
|
|
18
|
+
_(n), y(a(n));
|
|
19
|
+
}, [g]), S = i(v);
|
|
20
|
+
return /* @__PURE__ */ u("div", {
|
|
21
|
+
className: t("space-y-4 rounded-lg border border-border-subtle p-4", m),
|
|
21
22
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ u("div", {
|
|
23
24
|
className: "flex items-center gap-2",
|
|
24
25
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ l("div", {
|
|
26
27
|
className: "flex-1 px-3 py-2 rounded-md border border-border-subtle bg-bg-sunken/50 font-mono text-sm break-all select-all",
|
|
27
|
-
children:
|
|
28
|
+
children: v
|
|
28
29
|
}),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ l("button", {
|
|
30
31
|
type: "button",
|
|
31
|
-
onClick:
|
|
32
|
+
onClick: b,
|
|
32
33
|
className: "p-2 rounded-md text-text-secondary hover:text-text-primary hover:bg-accent transition-colors",
|
|
33
|
-
title: "Generate new password",
|
|
34
|
-
children: /* @__PURE__ */
|
|
34
|
+
title: h("security.passwordGenerator.title", "Generate new password"),
|
|
35
|
+
children: /* @__PURE__ */ l(d, { className: "size-4" })
|
|
35
36
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
value:
|
|
38
|
-
autoClearMs:
|
|
37
|
+
/* @__PURE__ */ l(o, {
|
|
38
|
+
value: v,
|
|
39
|
+
autoClearMs: p
|
|
39
40
|
})
|
|
40
41
|
]
|
|
41
42
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ u("div", {
|
|
43
44
|
className: "space-y-1",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ u("div", {
|
|
45
46
|
className: "flex justify-between text-xs",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
47
|
+
children: [/* @__PURE__ */ l("span", {
|
|
47
48
|
className: "text-text-secondary",
|
|
48
|
-
children: "Strength"
|
|
49
|
-
}), /* @__PURE__ */
|
|
49
|
+
children: h("security.passwordGenerator.strength", "Strength")
|
|
50
|
+
}), /* @__PURE__ */ l("span", {
|
|
50
51
|
className: "font-medium capitalize",
|
|
51
|
-
children:
|
|
52
|
+
children: h(`security.passwordGenerator.${S.label}`, S.label)
|
|
52
53
|
})]
|
|
53
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ l("div", {
|
|
54
55
|
className: "h-1.5 rounded-full bg-bg-sunken overflow-hidden",
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
className:
|
|
57
|
-
style: { width: `${
|
|
56
|
+
children: /* @__PURE__ */ l("div", {
|
|
57
|
+
className: t("h-full rounded-full transition-all duration-300", S.color),
|
|
58
|
+
style: { width: `${S.score}%` }
|
|
58
59
|
})
|
|
59
60
|
})]
|
|
60
61
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ u("div", {
|
|
62
63
|
className: "space-y-1",
|
|
63
|
-
children: [/* @__PURE__ */
|
|
64
|
+
children: [/* @__PURE__ */ u("div", {
|
|
64
65
|
className: "flex justify-between text-xs",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ l("span", {
|
|
66
67
|
className: "text-text-secondary",
|
|
67
|
-
children: "Length"
|
|
68
|
-
}), /* @__PURE__ */
|
|
68
|
+
children: h("security.passwordGenerator.length", "Length")
|
|
69
|
+
}), /* @__PURE__ */ l("span", {
|
|
69
70
|
className: "font-medium tabular-nums",
|
|
70
|
-
children:
|
|
71
|
+
children: g.length
|
|
71
72
|
})]
|
|
72
|
-
}), /* @__PURE__ */
|
|
73
|
+
}), /* @__PURE__ */ l("input", {
|
|
73
74
|
type: "range",
|
|
74
75
|
min: 8,
|
|
75
76
|
max: 128,
|
|
76
|
-
value:
|
|
77
|
-
onChange: (e) =>
|
|
77
|
+
value: g.length,
|
|
78
|
+
onChange: (e) => x("length", parseInt(e.target.value, 10)),
|
|
78
79
|
className: "w-full accent-primary",
|
|
79
|
-
"aria-label": "Password length"
|
|
80
|
+
"aria-label": h("security.passwordGenerator.length", "Password length")
|
|
80
81
|
})]
|
|
81
82
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ u("div", {
|
|
83
84
|
className: "grid grid-cols-2 gap-2",
|
|
84
85
|
children: [[
|
|
85
86
|
{
|
|
86
87
|
key: "uppercase",
|
|
87
|
-
label: "Uppercase (A-Z)"
|
|
88
|
+
label: h("security.passwordGenerator.uppercase", "Uppercase (A-Z)"),
|
|
89
|
+
aria: h("security.passwordGenerator.uppercase", "Uppercase letters")
|
|
88
90
|
},
|
|
89
91
|
{
|
|
90
92
|
key: "lowercase",
|
|
91
|
-
label: "Lowercase (a-z)"
|
|
93
|
+
label: h("security.passwordGenerator.lowercase", "Lowercase (a-z)"),
|
|
94
|
+
aria: h("security.passwordGenerator.lowercase", "Lowercase letters")
|
|
92
95
|
},
|
|
93
96
|
{
|
|
94
97
|
key: "numbers",
|
|
95
|
-
label: "Numbers (0-9)"
|
|
98
|
+
label: h("security.passwordGenerator.numbers", "Numbers (0-9)"),
|
|
99
|
+
aria: h("security.passwordGenerator.numbers", "Numbers")
|
|
96
100
|
},
|
|
97
101
|
{
|
|
98
102
|
key: "symbols",
|
|
99
|
-
label: "Symbols (!@#...)"
|
|
103
|
+
label: h("security.passwordGenerator.symbols", "Symbols (!@#...)"),
|
|
104
|
+
aria: h("security.passwordGenerator.symbols", "Symbols")
|
|
100
105
|
}
|
|
101
|
-
].map(({ key: e, label: t }) => /* @__PURE__ */
|
|
106
|
+
].map(({ key: e, label: t, aria: n }) => /* @__PURE__ */ u("label", {
|
|
102
107
|
className: "flex items-center gap-2 text-sm cursor-pointer",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ l("input", {
|
|
104
109
|
type: "checkbox",
|
|
105
|
-
checked:
|
|
106
|
-
onChange: (t) =>
|
|
110
|
+
checked: g[e],
|
|
111
|
+
onChange: (t) => x(e, t.target.checked),
|
|
107
112
|
className: "rounded accent-primary",
|
|
108
|
-
"aria-label":
|
|
113
|
+
"aria-label": n
|
|
109
114
|
}), t]
|
|
110
|
-
}, e)), /* @__PURE__ */
|
|
115
|
+
}, e)), /* @__PURE__ */ u("label", {
|
|
111
116
|
className: "flex items-center gap-2 text-sm cursor-pointer col-span-2",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ l("input", {
|
|
113
118
|
type: "checkbox",
|
|
114
|
-
checked:
|
|
115
|
-
onChange: (e) =>
|
|
119
|
+
checked: g.excludeAmbiguous,
|
|
120
|
+
onChange: (e) => x("excludeAmbiguous", e.target.checked),
|
|
116
121
|
className: "rounded accent-primary",
|
|
117
|
-
"aria-label": "Exclude ambiguous characters"
|
|
118
|
-
}), "Exclude ambiguous (0, O, l, 1, I)"]
|
|
122
|
+
"aria-label": h("security.passwordGenerator.excludeAmbiguous", "Exclude ambiguous characters")
|
|
123
|
+
}), h("security.passwordGenerator.excludeAmbiguous", "Exclude ambiguous (0, O, l, 1, I)")]
|
|
119
124
|
})]
|
|
120
125
|
}),
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
onClick: () =>
|
|
126
|
+
/* @__PURE__ */ l(n, {
|
|
127
|
+
onClick: () => f(v),
|
|
123
128
|
className: "w-full",
|
|
124
|
-
children: "Use This Password"
|
|
129
|
+
children: h("security.passwordGenerator.usePassword", "Use This Password")
|
|
125
130
|
})
|
|
126
131
|
]
|
|
127
132
|
});
|
|
128
133
|
};
|
|
129
134
|
//#endregion
|
|
130
|
-
export {
|
|
135
|
+
export { f as PasswordGenerator };
|
|
131
136
|
|
|
132
137
|
//# sourceMappingURL=PasswordGenerator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordGenerator.js","names":[],"sources":["../../../src/security/components/PasswordGenerator.tsx"],"sourcesContent":["import { type FC, useState, useCallback } from 'react';\nimport { RefreshCw } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport {\n generatePassword,\n calculatePasswordStrength,\n DEFAULT_PASSWORD_OPTIONS,\n type PasswordOptions,\n} from '../utils/passwordGenerator';\nimport { CopyButton } from './CopyButton';\nimport { Button } from './ui';\n\ninterface PasswordGeneratorProps {\n /** Called when user accepts the generated password */\n onAccept: (password: string) => void;\n /** Auto-clear clipboard timer */\n clipboardAutoClearMs?: number;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * Password generator with configurable length, character sets, and strength meter.\n * Uses crypto.getRandomValues for cryptographically secure generation.\n */\nexport const PasswordGenerator: FC<PasswordGeneratorProps> = ({\n onAccept,\n clipboardAutoClearMs = 30000,\n className,\n}) => {\n const [options, setOptions] = useState<PasswordOptions>(DEFAULT_PASSWORD_OPTIONS);\n const [password, setPassword] = useState(() => generatePassword(DEFAULT_PASSWORD_OPTIONS));\n\n const regenerate = useCallback(() => {\n setPassword(generatePassword(options));\n }, [options]);\n\n const handleOptionChange = useCallback(\n (key: keyof PasswordOptions, value: boolean | number) => {\n const newOptions = { ...options, [key]: value };\n setOptions(newOptions);\n setPassword(generatePassword(newOptions));\n },\n [options]\n );\n\n const strength = calculatePasswordStrength(password);\n\n return (\n <div className={cn('space-y-4 rounded-lg border border-border-subtle p-4', className)}>\n {/* Generated password display */}\n <div className=\"flex items-center gap-2\">\n <div className=\"flex-1 px-3 py-2 rounded-md border border-border-subtle bg-bg-sunken/50 font-mono text-sm break-all select-all\">\n {password}\n </div>\n <button\n type=\"button\"\n onClick={regenerate}\n className=\"p-2 rounded-md text-text-secondary hover:text-text-primary hover:bg-accent transition-colors\"\n title
|
|
1
|
+
{"version":3,"file":"PasswordGenerator.js","names":[],"sources":["../../../src/security/components/PasswordGenerator.tsx"],"sourcesContent":["import { type FC, useState, useCallback } from 'react';\nimport { RefreshCw } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport {\n generatePassword,\n calculatePasswordStrength,\n DEFAULT_PASSWORD_OPTIONS,\n type PasswordOptions,\n} from '../utils/passwordGenerator';\nimport { CopyButton } from './CopyButton';\nimport { Button } from './ui';\nimport { useTr } from '../hooks/useTr';\n\ninterface PasswordGeneratorProps {\n /** Called when user accepts the generated password */\n onAccept: (password: string) => void;\n /** Auto-clear clipboard timer */\n clipboardAutoClearMs?: number;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * Password generator with configurable length, character sets, and strength meter.\n * Uses crypto.getRandomValues for cryptographically secure generation.\n */\nexport const PasswordGenerator: FC<PasswordGeneratorProps> = ({\n onAccept,\n clipboardAutoClearMs = 30000,\n className,\n}) => {\n const tr = useTr();\n const [options, setOptions] = useState<PasswordOptions>(DEFAULT_PASSWORD_OPTIONS);\n const [password, setPassword] = useState(() => generatePassword(DEFAULT_PASSWORD_OPTIONS));\n\n const regenerate = useCallback(() => {\n setPassword(generatePassword(options));\n }, [options]);\n\n const handleOptionChange = useCallback(\n (key: keyof PasswordOptions, value: boolean | number) => {\n const newOptions = { ...options, [key]: value };\n setOptions(newOptions);\n setPassword(generatePassword(newOptions));\n },\n [options]\n );\n\n const strength = calculatePasswordStrength(password);\n\n return (\n <div className={cn('space-y-4 rounded-lg border border-border-subtle p-4', className)}>\n {/* Generated password display */}\n <div className=\"flex items-center gap-2\">\n <div className=\"flex-1 px-3 py-2 rounded-md border border-border-subtle bg-bg-sunken/50 font-mono text-sm break-all select-all\">\n {password}\n </div>\n <button\n type=\"button\"\n onClick={regenerate}\n className=\"p-2 rounded-md text-text-secondary hover:text-text-primary hover:bg-accent transition-colors\"\n title={tr('security.passwordGenerator.title', 'Generate new password')}\n >\n <RefreshCw className=\"size-4\" />\n </button>\n <CopyButton value={password} autoClearMs={clipboardAutoClearMs} />\n </div>\n\n {/* Strength meter */}\n <div className=\"space-y-1\">\n <div className=\"flex justify-between text-xs\">\n <span className=\"text-text-secondary\">\n {tr('security.passwordGenerator.strength', 'Strength')}\n </span>\n <span className=\"font-medium capitalize\">\n {tr(`security.passwordGenerator.${strength.label}`, strength.label)}\n </span>\n </div>\n <div className=\"h-1.5 rounded-full bg-bg-sunken overflow-hidden\">\n <div\n className={cn('h-full rounded-full transition-all duration-300', strength.color)}\n style={{ width: `${strength.score}%` }}\n />\n </div>\n </div>\n\n {/* Length slider */}\n <div className=\"space-y-1\">\n <div className=\"flex justify-between text-xs\">\n <span className=\"text-text-secondary\">\n {tr('security.passwordGenerator.length', 'Length')}\n </span>\n <span className=\"font-medium tabular-nums\">{options.length}</span>\n </div>\n <input\n type=\"range\"\n min={8}\n max={128}\n value={options.length}\n onChange={(e) => handleOptionChange('length', parseInt(e.target.value, 10))}\n className=\"w-full accent-primary\"\n aria-label={tr('security.passwordGenerator.length', 'Password length')}\n />\n </div>\n\n {/* Character set toggles */}\n <div className=\"grid grid-cols-2 gap-2\">\n {[\n {\n key: 'uppercase' as const,\n label: tr('security.passwordGenerator.uppercase', 'Uppercase (A-Z)'),\n aria: tr('security.passwordGenerator.uppercase', 'Uppercase letters'),\n },\n {\n key: 'lowercase' as const,\n label: tr('security.passwordGenerator.lowercase', 'Lowercase (a-z)'),\n aria: tr('security.passwordGenerator.lowercase', 'Lowercase letters'),\n },\n {\n key: 'numbers' as const,\n label: tr('security.passwordGenerator.numbers', 'Numbers (0-9)'),\n aria: tr('security.passwordGenerator.numbers', 'Numbers'),\n },\n {\n key: 'symbols' as const,\n label: tr('security.passwordGenerator.symbols', 'Symbols (!@#...)'),\n aria: tr('security.passwordGenerator.symbols', 'Symbols'),\n },\n ].map(({ key, label, aria }) => (\n <label key={key} className=\"flex items-center gap-2 text-sm cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={options[key]}\n onChange={(e) => handleOptionChange(key, e.target.checked)}\n className=\"rounded accent-primary\"\n aria-label={aria}\n />\n {label}\n </label>\n ))}\n <label className=\"flex items-center gap-2 text-sm cursor-pointer col-span-2\">\n <input\n type=\"checkbox\"\n checked={options.excludeAmbiguous}\n onChange={(e) => handleOptionChange('excludeAmbiguous', e.target.checked)}\n className=\"rounded accent-primary\"\n aria-label={tr(\n 'security.passwordGenerator.excludeAmbiguous',\n 'Exclude ambiguous characters'\n )}\n />\n {tr('security.passwordGenerator.excludeAmbiguous', 'Exclude ambiguous (0, O, l, 1, I)')}\n </label>\n </div>\n\n {/* Accept button */}\n <Button onClick={() => onAccept(password)} className=\"w-full\">\n {tr('security.passwordGenerator.usePassword', 'Use This Password')}\n </Button>\n </div>\n );\n};\n"],"mappings":"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"}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { Badge as t } from "./ui.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { AlertCircle as i, AlertTriangle as a, CheckCircle as o } from "lucide-react";
|
|
4
5
|
//#region src/security/components/RotationStatusBadge.tsx
|
|
5
|
-
var
|
|
6
|
-
let { label:
|
|
6
|
+
var s = ({ status: s, className: c }) => {
|
|
7
|
+
let l = e(), { label: u, variant: d, Icon: f } = {
|
|
7
8
|
healthy: {
|
|
8
|
-
label: "Healthy",
|
|
9
|
+
label: l("security.rotationStatus.healthy", "Healthy"),
|
|
9
10
|
variant: "success",
|
|
10
|
-
Icon:
|
|
11
|
+
Icon: o
|
|
11
12
|
},
|
|
12
13
|
due: {
|
|
13
|
-
label: "Due",
|
|
14
|
+
label: l("security.rotationStatus.due", "Due"),
|
|
14
15
|
variant: "warning",
|
|
15
|
-
Icon:
|
|
16
|
+
Icon: i
|
|
16
17
|
},
|
|
17
18
|
overdue: {
|
|
18
|
-
label: "Overdue",
|
|
19
|
+
label: l("security.rotationStatus.overdue", "Overdue"),
|
|
19
20
|
variant: "destructive",
|
|
20
|
-
Icon:
|
|
21
|
+
Icon: a
|
|
21
22
|
}
|
|
22
|
-
}[
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
variant:
|
|
25
|
-
className:
|
|
26
|
-
children: [/* @__PURE__ */
|
|
23
|
+
}[s];
|
|
24
|
+
return /* @__PURE__ */ r(t, {
|
|
25
|
+
variant: d,
|
|
26
|
+
className: c,
|
|
27
|
+
children: [/* @__PURE__ */ n(f, { className: "size-3" }), u]
|
|
27
28
|
});
|
|
28
29
|
};
|
|
29
30
|
//#endregion
|
|
30
|
-
export {
|
|
31
|
+
export { s as RotationStatusBadge };
|
|
31
32
|
|
|
32
33
|
//# sourceMappingURL=RotationStatusBadge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RotationStatusBadge.js","names":[],"sources":["../../../src/security/components/RotationStatusBadge.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { CheckCircle, AlertCircle, AlertTriangle } from 'lucide-react';\nimport type { RotationStatus } from '../types';\nimport { Badge } from './ui';\n\ninterface RotationStatusBadgeProps {\n status: RotationStatus;\n className?: string;\n}\n\n/**\n * Badge showing rotation status: healthy, due, or overdue.\n */\nexport const RotationStatusBadge: FC<RotationStatusBadgeProps> = ({ status, className }) => {\n const config = {\n healthy: {\n label: 'Healthy',\n variant: 'success' as const,\n Icon: CheckCircle,\n },\n due: {\n label: 'Due',\n variant: 'warning' as const,\n Icon: AlertCircle,\n },\n overdue: {\n label: 'Overdue',\n variant: 'destructive' as const,\n Icon: AlertTriangle,\n },\n };\n\n const { label, variant, Icon } = config[status];\n\n return (\n <Badge variant={variant} className={className}>\n <Icon className=\"size-3\" />\n {label}\n </Badge>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RotationStatusBadge.js","names":[],"sources":["../../../src/security/components/RotationStatusBadge.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { CheckCircle, AlertCircle, AlertTriangle } from 'lucide-react';\nimport type { RotationStatus } from '../types';\nimport { Badge } from './ui';\nimport { useTr } from '../hooks/useTr';\n\ninterface RotationStatusBadgeProps {\n status: RotationStatus;\n className?: string;\n}\n\n/**\n * Badge showing rotation status: healthy, due, or overdue.\n */\nexport const RotationStatusBadge: FC<RotationStatusBadgeProps> = ({ status, className }) => {\n const tr = useTr();\n const config = {\n healthy: {\n label: tr('security.rotationStatus.healthy', 'Healthy'),\n variant: 'success' as const,\n Icon: CheckCircle,\n },\n due: {\n label: tr('security.rotationStatus.due', 'Due'),\n variant: 'warning' as const,\n Icon: AlertCircle,\n },\n overdue: {\n label: tr('security.rotationStatus.overdue', 'Overdue'),\n variant: 'destructive' as const,\n Icon: AlertTriangle,\n },\n };\n\n const { label, variant, Icon } = config[status];\n\n return (\n <Badge variant={variant} className={className}>\n <Icon className=\"size-3\" />\n {label}\n </Badge>\n );\n};\n"],"mappings":";;;;;AAcA,IAAa,KAAqD,EAAE,WAAQ,mBAAgB;CAC1F,IAAM,IAAK,GAAO,EAmBZ,EAAE,UAAO,YAAS,YAlBT;EACb,SAAS;GACP,OAAO,EAAG,mCAAmC,UAAU;GACvD,SAAS;GACT,MAAM;GACP;EACD,KAAK;GACH,OAAO,EAAG,+BAA+B,MAAM;GAC/C,SAAS;GACT,MAAM;GACP;EACD,SAAS;GACP,OAAO,EAAG,mCAAmC,UAAU;GACvD,SAAS;GACT,MAAM;GACP;EACF,CAEuC;AAExC,QACE,kBAAC,GAAD;EAAgB;EAAoB;YAApC,CACE,kBAAC,GAAD,EAAM,WAAU,UAAW,CAAA,EAC1B,EACK"}
|
|
@@ -1,164 +1,173 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
|
+
import { Button as n, Input as r, Select as i } from "./ui.js";
|
|
4
|
+
import { SECRET_TYPES as a } from "../constants/secretTypes.js";
|
|
5
|
+
import { PasswordGenerator as o } from "./PasswordGenerator.js";
|
|
6
|
+
import { useState as s } from "react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import { Minus as u, Plus as d } from "lucide-react";
|
|
9
|
+
import { OptionalFields as f } from "@burdenoff/fe-libs/ui";
|
|
9
10
|
//#region src/security/components/SecretFormFields.tsx
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var p = ({ type: r, value: i, onValueChange: a, showPasswordGen: s, setShowPasswordGen: u }) => {
|
|
12
|
+
let d = e();
|
|
13
|
+
if (r === "CREDENTIAL") return /* @__PURE__ */ l("div", {
|
|
14
|
+
className: "space-y-2",
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ c("label", {
|
|
17
|
+
htmlFor: "secret-value-password",
|
|
18
|
+
className: "text-sm font-medium text-text-primary",
|
|
19
|
+
children: d("security.secretForm.password", "Password")
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ c("input", {
|
|
22
|
+
id: "secret-value-password",
|
|
23
|
+
"aria-label": d("security.secretForm.password", "Password"),
|
|
24
|
+
type: "password",
|
|
25
|
+
value: i,
|
|
26
|
+
onChange: (e) => a(e.target.value),
|
|
27
|
+
placeholder: d("security.secretForm.passwordPlaceholder", "Enter password"),
|
|
28
|
+
className: t("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)]")
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ c(n, {
|
|
31
|
+
variant: "outline",
|
|
32
|
+
size: "sm",
|
|
33
|
+
type: "button",
|
|
34
|
+
onClick: () => u(!s),
|
|
35
|
+
children: s ? d("security.secretForm.hideGenerator", "Hide Generator") : d("security.secretForm.generatePassword", "Generate Password")
|
|
36
|
+
}),
|
|
37
|
+
s && /* @__PURE__ */ c(o, { onAccept: (e) => {
|
|
38
|
+
a(e), u(!1);
|
|
39
|
+
} })
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
if (r === "CERTIFICATE" || r === "PRIVATE_KEY") {
|
|
43
|
+
let e = r === "CERTIFICATE", n = e ? d("security.secretForm.certificatePem", "Certificate (PEM)") : d("security.secretForm.privateKey", "Private Key");
|
|
44
|
+
return /* @__PURE__ */ l("div", {
|
|
45
|
+
className: "space-y-1.5",
|
|
46
|
+
children: [/* @__PURE__ */ c("label", {
|
|
47
|
+
htmlFor: "secret-value-pem",
|
|
48
|
+
className: "text-sm font-medium text-text-primary",
|
|
49
|
+
children: n
|
|
50
|
+
}), /* @__PURE__ */ c("textarea", {
|
|
51
|
+
id: "secret-value-pem",
|
|
52
|
+
"aria-label": n,
|
|
53
|
+
value: i,
|
|
54
|
+
onChange: (e) => a(e.target.value),
|
|
55
|
+
placeholder: e ? "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----" : "-----BEGIN OPENSSH PRIVATE KEY-----\n...\n-----END OPENSSH PRIVATE KEY-----",
|
|
56
|
+
rows: 8,
|
|
57
|
+
className: t("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]")
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return r === "STRUCTURED_DATA" ? /* @__PURE__ */ l("div", {
|
|
62
|
+
className: "space-y-3",
|
|
63
|
+
children: [/* @__PURE__ */ c("label", {
|
|
64
|
+
htmlFor: "secret-value-json",
|
|
15
65
|
className: "text-sm font-medium text-text-primary",
|
|
16
|
-
children: "
|
|
17
|
-
}),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
value:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
i
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}), /* @__PURE__ */ s("textarea", {
|
|
45
|
-
id: "secret-value-pem",
|
|
46
|
-
"aria-label": n === "CERTIFICATE" ? "Certificate (PEM)" : "Private Key",
|
|
47
|
-
value: r,
|
|
48
|
-
onChange: (e) => i(e.target.value),
|
|
49
|
-
placeholder: n === "CERTIFICATE" ? "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----" : "-----BEGIN OPENSSH PRIVATE KEY-----\n...\n-----END OPENSSH PRIVATE KEY-----",
|
|
50
|
-
rows: 8,
|
|
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
|
-
})]
|
|
53
|
-
}) : n === "STRUCTURED_DATA" ? /* @__PURE__ */ c("div", {
|
|
54
|
-
className: "space-y-3",
|
|
55
|
-
children: [/* @__PURE__ */ s("label", {
|
|
56
|
-
htmlFor: "secret-value-json",
|
|
57
|
-
className: "text-sm font-medium text-text-primary",
|
|
58
|
-
children: "Structured Data (JSON format)"
|
|
59
|
-
}), /* @__PURE__ */ s("textarea", {
|
|
60
|
-
id: "secret-value-json",
|
|
61
|
-
"aria-label": "Structured Data JSON",
|
|
62
|
-
value: r,
|
|
63
|
-
onChange: (e) => i(e.target.value),
|
|
64
|
-
placeholder: "{\n \"key\": \"value\",\n \"connection\": \"...\"\n}",
|
|
65
|
-
rows: 5,
|
|
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
|
-
})]
|
|
68
|
-
}) : /* @__PURE__ */ c("div", {
|
|
69
|
-
className: "space-y-1.5",
|
|
70
|
-
children: [/* @__PURE__ */ s("label", {
|
|
71
|
-
htmlFor: "secret-value-text",
|
|
72
|
-
className: "text-sm font-medium text-text-primary",
|
|
73
|
-
children: "Value"
|
|
74
|
-
}), /* @__PURE__ */ s("textarea", {
|
|
75
|
-
id: "secret-value-text",
|
|
76
|
-
"aria-label": "Value",
|
|
77
|
-
value: r,
|
|
78
|
-
onChange: (e) => i(e.target.value),
|
|
79
|
-
placeholder: "Enter secret value",
|
|
80
|
-
rows: 3,
|
|
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
|
-
})]
|
|
83
|
-
}), p = ({ type: a, onTypeChange: p, name: m, onNameChange: h, value: g, onValueChange: _, description: v, onDescriptionChange: y, labels: b, onLabelsChange: x, className: S }) => {
|
|
84
|
-
let [C, w] = o(""), [T, E] = o(!1), D = i.map((e) => ({
|
|
66
|
+
children: d("security.secretForm.structuredData", "Structured Data (JSON format)")
|
|
67
|
+
}), /* @__PURE__ */ c("textarea", {
|
|
68
|
+
id: "secret-value-json",
|
|
69
|
+
"aria-label": d("security.secretForm.structuredData", "Structured Data JSON"),
|
|
70
|
+
value: i,
|
|
71
|
+
onChange: (e) => a(e.target.value),
|
|
72
|
+
placeholder: "{\n \"key\": \"value\",\n \"connection\": \"...\"\n}",
|
|
73
|
+
rows: 5,
|
|
74
|
+
className: t("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")
|
|
75
|
+
})]
|
|
76
|
+
}) : /* @__PURE__ */ l("div", {
|
|
77
|
+
className: "space-y-1.5",
|
|
78
|
+
children: [/* @__PURE__ */ c("label", {
|
|
79
|
+
htmlFor: "secret-value-text",
|
|
80
|
+
className: "text-sm font-medium text-text-primary",
|
|
81
|
+
children: d("security.secretForm.value", "Value")
|
|
82
|
+
}), /* @__PURE__ */ c("textarea", {
|
|
83
|
+
id: "secret-value-text",
|
|
84
|
+
"aria-label": d("security.secretForm.value", "Value"),
|
|
85
|
+
value: i,
|
|
86
|
+
onChange: (e) => a(e.target.value),
|
|
87
|
+
placeholder: d("security.secretForm.valuePlaceholder", "Enter secret value"),
|
|
88
|
+
rows: 3,
|
|
89
|
+
className: t("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")
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
}, m = ({ type: o, onTypeChange: m, name: h, onNameChange: g, value: _, onValueChange: v, description: y, onDescriptionChange: b, labels: x, onLabelsChange: S, className: C }) => {
|
|
93
|
+
let w = e(), [T, E] = s(""), [D, O] = s(!1), k = a.map((e) => ({
|
|
85
94
|
value: e.value,
|
|
86
|
-
label: e.label
|
|
87
|
-
})),
|
|
88
|
-
let e =
|
|
89
|
-
e && !
|
|
90
|
-
},
|
|
91
|
-
x
|
|
95
|
+
label: w(`security.${e.translationKey}`, e.label)
|
|
96
|
+
})), A = () => {
|
|
97
|
+
let e = T.trim();
|
|
98
|
+
e && !x.includes(e) && (S([...x, e]), E(""));
|
|
99
|
+
}, j = (e) => {
|
|
100
|
+
S(x.filter((t) => t !== e));
|
|
92
101
|
};
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
-
className:
|
|
102
|
+
return /* @__PURE__ */ l("div", {
|
|
103
|
+
className: t("space-y-4", C),
|
|
95
104
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
label: "Secret Type",
|
|
98
|
-
value:
|
|
99
|
-
onChange: (e) =>
|
|
100
|
-
options:
|
|
105
|
+
/* @__PURE__ */ c(i, {
|
|
106
|
+
label: w("security.secretForm.type", "Secret Type"),
|
|
107
|
+
value: o,
|
|
108
|
+
onChange: (e) => m(e),
|
|
109
|
+
options: k
|
|
101
110
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ c(r, {
|
|
103
112
|
id: "secret-name",
|
|
104
|
-
label: "Name",
|
|
105
|
-
value:
|
|
106
|
-
onChange: (e) =>
|
|
107
|
-
placeholder: "e.g., production-database-password",
|
|
113
|
+
label: w("security.secretForm.name", "Name"),
|
|
114
|
+
value: h,
|
|
115
|
+
onChange: (e) => g(e.target.value),
|
|
116
|
+
placeholder: w("security.secretForm.namePlaceholder", "e.g., production-database-password"),
|
|
108
117
|
required: !0
|
|
109
118
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ c(r, {
|
|
111
120
|
id: "secret-description",
|
|
112
|
-
label: "Description (optional)",
|
|
113
|
-
value:
|
|
114
|
-
onChange: (e) =>
|
|
115
|
-
placeholder: "Brief description of this secret"
|
|
121
|
+
label: w("security.secretForm.description", "Description (optional)"),
|
|
122
|
+
value: y,
|
|
123
|
+
onChange: (e) => b(e.target.value),
|
|
124
|
+
placeholder: w("security.secretForm.descriptionPlaceholder", "Brief description of this secret")
|
|
116
125
|
}),
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
type:
|
|
119
|
-
value:
|
|
120
|
-
onValueChange:
|
|
121
|
-
showPasswordGen:
|
|
122
|
-
setShowPasswordGen:
|
|
126
|
+
/* @__PURE__ */ c(p, {
|
|
127
|
+
type: o,
|
|
128
|
+
value: _,
|
|
129
|
+
onValueChange: v,
|
|
130
|
+
showPasswordGen: D,
|
|
131
|
+
setShowPasswordGen: O
|
|
123
132
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
title: "Advanced metadata",
|
|
126
|
-
description: "Custom labels for filtering and grouping secrets.",
|
|
127
|
-
children: /* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ c(f, {
|
|
134
|
+
title: w("security.secretForm.advancedMetadata", "Advanced metadata"),
|
|
135
|
+
description: w("security.secretForm.labelsDescription", "Custom labels for filtering and grouping secrets."),
|
|
136
|
+
children: /* @__PURE__ */ l("div", {
|
|
128
137
|
className: "space-y-2",
|
|
129
138
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ c("label", {
|
|
131
140
|
htmlFor: "secret-new-label",
|
|
132
141
|
className: "text-sm font-medium text-text-primary",
|
|
133
|
-
children: "Labels"
|
|
142
|
+
children: w("security.secretForm.labels", "Labels")
|
|
134
143
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ l("div", {
|
|
136
145
|
className: "flex items-center gap-2",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ c("input", {
|
|
138
147
|
id: "secret-new-label",
|
|
139
|
-
"aria-label": "Add label",
|
|
140
|
-
value:
|
|
141
|
-
onChange: (e) =>
|
|
142
|
-
onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(),
|
|
143
|
-
placeholder: "Add label",
|
|
144
|
-
className:
|
|
145
|
-
}), /* @__PURE__ */
|
|
148
|
+
"aria-label": w("security.secretForm.addLabel", "Add label"),
|
|
149
|
+
value: T,
|
|
150
|
+
onChange: (e) => E(e.target.value),
|
|
151
|
+
onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(), A()),
|
|
152
|
+
placeholder: w("security.secretForm.addLabelPlaceholder", "Add label"),
|
|
153
|
+
className: t("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)]")
|
|
154
|
+
}), /* @__PURE__ */ c(n, {
|
|
146
155
|
variant: "outline",
|
|
147
156
|
size: "sm",
|
|
148
157
|
type: "button",
|
|
149
|
-
onClick:
|
|
150
|
-
children: /* @__PURE__ */
|
|
158
|
+
onClick: A,
|
|
159
|
+
children: /* @__PURE__ */ c(d, { className: "size-3" })
|
|
151
160
|
})]
|
|
152
161
|
}),
|
|
153
|
-
|
|
162
|
+
x.length > 0 && /* @__PURE__ */ c("div", {
|
|
154
163
|
className: "flex flex-wrap gap-1.5",
|
|
155
|
-
children:
|
|
164
|
+
children: x.map((e) => /* @__PURE__ */ l("span", {
|
|
156
165
|
className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs bg-bg-sunken border border-border-subtle",
|
|
157
|
-
children: [e, /* @__PURE__ */
|
|
166
|
+
children: [e, /* @__PURE__ */ c("button", {
|
|
158
167
|
type: "button",
|
|
159
|
-
onClick: () =>
|
|
168
|
+
onClick: () => j(e),
|
|
160
169
|
className: "p-0.5 rounded-full hover:bg-status-error-bg/10 hover:text-status-error-text",
|
|
161
|
-
children: /* @__PURE__ */
|
|
170
|
+
children: /* @__PURE__ */ c(u, { className: "size-2.5" })
|
|
162
171
|
})]
|
|
163
172
|
}, e))
|
|
164
173
|
})
|
|
@@ -169,6 +178,6 @@ var f = ({ type: n, value: r, onValueChange: i, showPasswordGen: o, setShowPassw
|
|
|
169
178
|
});
|
|
170
179
|
};
|
|
171
180
|
//#endregion
|
|
172
|
-
export {
|
|
181
|
+
export { m as SecretFormFields };
|
|
173
182
|
|
|
174
183
|
//# sourceMappingURL=SecretFormFields.js.map
|