@burdenoff/microfe-security 2026.1105.2 → 2026.1113.1
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/dev/Dashboard.d.ts +4 -0
- package/dist/dev/SecurityApp.d.ts +10 -0
- package/dist/dev/main.d.ts +0 -0
- package/dist/dev/useDarkMode.d.ts +7 -0
- package/dist/generated/global-operations.d.ts +1 -0
- package/dist/generated/global-types.d.ts +27686 -0
- package/dist/generated/wspace-operations.d.ts +1948 -0
- package/dist/generated/wspace-operations.js +102 -103
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +147604 -0
- package/dist/generated/wspace-types.js +1 -2
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +229 -167
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/security/SecurityAdminRoot.d.ts +17 -0
- package/dist/security/SecurityAdminRoot.js +10 -8
- package/dist/security/SecurityAdminRoot.js.map +1 -1
- package/dist/security/SecurityRoot.d.ts +16 -0
- package/dist/security/SecurityRoot.js +10 -8
- package/dist/security/SecurityRoot.js.map +1 -1
- package/dist/security/SecurityRootBase.d.ts +17 -0
- package/dist/security/SecurityRootBase.js +9 -10
- package/dist/security/SecurityRootBase.js.map +1 -1
- package/dist/security/SecurityUserRoot.d.ts +16 -0
- package/dist/security/SecurityUserRoot.js +10 -8
- package/dist/security/SecurityUserRoot.js.map +1 -1
- package/dist/security/components/ActivityTimeline.d.ts +10 -0
- package/dist/security/components/ActivityTimeline.js +14 -15
- package/dist/security/components/ActivityTimeline.js.map +1 -1
- package/dist/security/components/BulkActionBar.d.ts +7 -0
- package/dist/security/components/BulkActionBar.js +18 -19
- package/dist/security/components/BulkActionBar.js.map +1 -1
- package/dist/security/components/ConfirmDialog.d.ts +17 -0
- package/dist/security/components/ConfirmDialog.js +5 -6
- package/dist/security/components/ConfirmDialog.js.map +1 -1
- package/dist/security/components/CopyButton.d.ts +18 -0
- package/dist/security/components/CopyButton.js +30 -29
- package/dist/security/components/CopyButton.js.map +1 -1
- package/dist/security/components/ExportDialog.d.ts +5 -0
- package/dist/security/components/ExportDialog.js +22 -22
- package/dist/security/components/ExportDialog.js.map +1 -1
- package/dist/security/components/ExternalSecretProviders.d.ts +16 -0
- package/dist/security/components/ExternalSecretProviders.js +159 -144
- package/dist/security/components/ExternalSecretProviders.js.map +1 -1
- package/dist/security/components/ImportWizard.d.ts +5 -0
- package/dist/security/components/ImportWizard.js +28 -29
- package/dist/security/components/ImportWizard.js.map +1 -1
- package/dist/security/components/PageLayout.d.ts +32 -0
- package/dist/security/components/PageLayout.js +1 -2
- package/dist/security/components/PageLayout.js.map +1 -1
- package/dist/security/components/PasswordGenerator.d.ts +15 -0
- package/dist/security/components/PasswordGenerator.js +14 -15
- package/dist/security/components/PasswordGenerator.js.map +1 -1
- package/dist/security/components/RotationStatusBadge.d.ts +11 -0
- package/dist/security/components/RotationStatusBadge.js +5 -6
- package/dist/security/components/RotationStatusBadge.js.map +1 -1
- package/dist/security/components/SecretFormFields.d.ts +21 -0
- package/dist/security/components/SecretFormFields.js +40 -41
- package/dist/security/components/SecretFormFields.js.map +1 -1
- package/dist/security/components/SecretRow.d.ts +11 -0
- package/dist/security/components/SecretRow.js +14 -15
- package/dist/security/components/SecretRow.js.map +1 -1
- package/dist/security/components/SecretShareDialog.d.ts +19 -0
- package/dist/security/components/SecretShareDialog.js +106 -107
- package/dist/security/components/SecretShareDialog.js.map +1 -1
- package/dist/security/components/SecretTypeBadge.d.ts +11 -0
- package/dist/security/components/SecretTypeBadge.js +7 -8
- package/dist/security/components/SecretTypeBadge.js.map +1 -1
- package/dist/security/components/SecretTypeIcon.d.ts +12 -0
- package/dist/security/components/SecretTypeIcon.js +6 -7
- package/dist/security/components/SecretTypeIcon.js.map +1 -1
- package/dist/security/components/SecretValueDisplay.d.ts +24 -0
- package/dist/security/components/SecretValueDisplay.js +9 -10
- package/dist/security/components/SecretValueDisplay.js.map +1 -1
- package/dist/security/components/SecurityPermissionGuard.d.ts +14 -0
- package/dist/security/components/SecurityPermissionGuard.js +1 -2
- package/dist/security/components/SecurityPermissionGuard.js.map +1 -1
- package/dist/security/components/SecurityScoreCard.d.ts +12 -0
- package/dist/security/components/SecurityScoreCard.js +14 -15
- package/dist/security/components/SecurityScoreCard.js.map +1 -1
- package/dist/security/components/VaultCard.d.ts +11 -0
- package/dist/security/components/VaultCard.js +8 -9
- package/dist/security/components/VaultCard.js.map +1 -1
- package/dist/security/components/VaultFormFields.d.ts +15 -0
- package/dist/security/components/VaultFormFields.js +8 -9
- package/dist/security/components/VaultFormFields.js.map +1 -1
- package/dist/security/components/VaultShareDialog.d.ts +14 -0
- package/dist/security/components/VaultShareDialog.js +12 -13
- package/dist/security/components/VaultShareDialog.js.map +1 -1
- package/dist/security/components/ui.d.ts +59 -0
- package/dist/security/components/ui.js +15 -5
- package/dist/security/components/ui.js.map +1 -1
- package/dist/security/config/navigation.d.ts +12 -0
- package/dist/security/config/navigation.js +1 -2
- package/dist/security/config/navigation.js.map +1 -1
- package/dist/security/constants/externalSecretProviders.d.ts +48 -0
- package/dist/security/constants/externalSecretProviders.js +49 -2
- package/dist/security/constants/externalSecretProviders.js.map +1 -1
- package/dist/security/constants/featureFlags.d.ts +39 -0
- package/dist/security/constants/featureFlags.js +1 -2
- package/dist/security/constants/featureFlags.js.map +1 -1
- package/dist/security/constants/permissions.d.ts +9 -0
- package/dist/security/constants/permissions.js +1 -2
- package/dist/security/constants/permissions.js.map +1 -1
- package/dist/security/constants/providers.d.ts +11 -0
- package/dist/security/constants/providers.js +1 -2
- package/dist/security/constants/providers.js.map +1 -1
- package/dist/security/constants/secretTypes.d.ts +16 -0
- package/dist/security/constants/secretTypes.js +1 -2
- package/dist/security/constants/secretTypes.js.map +1 -1
- package/dist/security/hooks/useAuditLog.d.ts +16 -0
- package/dist/security/hooks/useAuditLog.js +1 -2
- package/dist/security/hooks/useAuditLog.js.map +1 -1
- package/dist/security/hooks/useBulkSecretOperations.d.ts +6 -0
- package/dist/security/hooks/useBulkSecretOperations.js +1 -2
- package/dist/security/hooks/useBulkSecretOperations.js.map +1 -1
- package/dist/security/hooks/useImportExport.d.ts +53 -0
- package/dist/security/hooks/useImportExport.js +3 -4
- package/dist/security/hooks/useImportExport.js.map +1 -1
- package/dist/security/hooks/useProviderQueries.d.ts +9 -0
- package/dist/security/hooks/useProviderQueries.js +1 -2
- package/dist/security/hooks/useProviderQueries.js.map +1 -1
- package/dist/security/hooks/useSecretQueries.d.ts +7 -0
- package/dist/security/hooks/useSecretQueries.js +1 -2
- package/dist/security/hooks/useSecretQueries.js.map +1 -1
- package/dist/security/hooks/useSecretValue.d.ts +11 -0
- package/dist/security/hooks/useSecretValue.js +1 -2
- package/dist/security/hooks/useSecretValue.js.map +1 -1
- package/dist/security/hooks/useSecurityCacheInvalidation.d.ts +1 -0
- package/dist/security/hooks/useSecurityCacheInvalidation.js +1 -2
- package/dist/security/hooks/useSecurityCacheInvalidation.js.map +1 -1
- package/dist/security/hooks/useSecurityDashboard.d.ts +20 -0
- package/dist/security/hooks/useSecurityDashboard.js +1 -2
- package/dist/security/hooks/useSecurityDashboard.js.map +1 -1
- package/dist/security/hooks/useSecurityEventEmitter.d.ts +13 -0
- package/dist/security/hooks/useSecurityEventEmitter.js +1 -2
- package/dist/security/hooks/useSecurityEventEmitter.js.map +1 -1
- package/dist/security/hooks/useSecuritySubscriptions.d.ts +5 -0
- package/dist/security/hooks/useSecuritySubscriptions.js +1 -2
- package/dist/security/hooks/useSecuritySubscriptions.js.map +1 -1
- package/dist/security/hooks/useShareQueries.d.ts +13 -0
- package/dist/security/hooks/useShareQueries.js +1 -2
- package/dist/security/hooks/useShareQueries.js.map +1 -1
- package/dist/security/hooks/useTr.d.ts +16 -0
- package/dist/security/hooks/useTr.js +1 -2
- package/dist/security/hooks/useTr.js.map +1 -1
- package/dist/security/hooks/useVaultQueries.d.ts +12 -0
- package/dist/security/hooks/useVaultQueries.js +1 -2
- package/dist/security/hooks/useVaultQueries.js.map +1 -1
- package/dist/security/index.d.ts +32 -0
- package/dist/security/index.js +8 -7
- package/dist/security/pages/AccessReviewPage.d.ts +1 -0
- package/dist/security/pages/AccessReviewPage.js +31 -29
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/AuditLogPage.d.ts +1 -0
- package/dist/security/pages/AuditLogPage.js +16 -17
- package/dist/security/pages/AuditLogPage.js.map +1 -1
- package/dist/security/pages/ImportExportPage.d.ts +1 -0
- package/dist/security/pages/ImportExportPage.js +10 -11
- package/dist/security/pages/ImportExportPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.d.ts +1 -0
- package/dist/security/pages/ProviderDetailPage.js +82 -87
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.d.ts +1 -0
- package/dist/security/pages/ProvidersPage.js +20 -21
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecretCreatePage.d.ts +1 -0
- package/dist/security/pages/SecretCreatePage.js +45 -50
- package/dist/security/pages/SecretCreatePage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.d.ts +1 -0
- package/dist/security/pages/SecretDetailPage.js +52 -57
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.d.ts +1 -0
- package/dist/security/pages/SecurityDashboardPage.js +13 -14
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/SharedWithMePage.d.ts +1 -0
- package/dist/security/pages/SharedWithMePage.js +32 -33
- package/dist/security/pages/SharedWithMePage.js.map +1 -1
- package/dist/security/pages/VaultCreatePage.d.ts +1 -0
- package/dist/security/pages/VaultCreatePage.js +36 -38
- package/dist/security/pages/VaultCreatePage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.d.ts +1 -0
- package/dist/security/pages/VaultDetailPage.js +81 -86
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultLandingPage.d.ts +9 -0
- package/dist/security/pages/VaultLandingPage.js +4 -5
- package/dist/security/pages/VaultLandingPage.js.map +1 -1
- package/dist/security/pages/VaultSettingsPage.d.ts +1 -0
- package/dist/security/pages/VaultSettingsPage.js +37 -42
- package/dist/security/pages/VaultSettingsPage.js.map +1 -1
- package/dist/security/pages/VaultShareViewer.d.ts +18 -0
- package/dist/security/pages/VaultShareViewer.js +17 -18
- package/dist/security/pages/VaultShareViewer.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.d.ts +1 -0
- package/dist/security/pages/VaultsDashboardPage.js +147 -148
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/dist/security/providers/SecurityProvider.d.ts +11 -0
- package/dist/security/providers/SecurityProvider.js +26 -29
- package/dist/security/providers/SecurityProvider.js.map +1 -1
- package/dist/security/routes/SecurityAdminRoutes.d.ts +6 -0
- package/dist/security/routes/SecurityAdminRoutes.js +1 -2
- package/dist/security/routes/SecurityAdminRoutes.js.map +1 -1
- package/dist/security/routes/SecurityRoutes.d.ts +18 -0
- package/dist/security/routes/SecurityRoutes.js +1 -2
- package/dist/security/routes/SecurityRoutes.js.map +1 -1
- package/dist/security/routes/SecurityUserRoutes.d.ts +10 -0
- package/dist/security/routes/SecurityUserRoutes.js +10 -11
- package/dist/security/routes/SecurityUserRoutes.js.map +1 -1
- package/dist/security/routes/routeUtils.d.ts +26 -0
- package/dist/security/routes/routeUtils.js +1 -2
- package/dist/security/routes/routeUtils.js.map +1 -1
- package/dist/security/store/securityStore.d.ts +33 -0
- package/dist/security/store/securityStore.js +1 -2
- package/dist/security/store/securityStore.js.map +1 -1
- package/dist/security/translations/en.d.ts +850 -0
- package/dist/security/translations/en.js +12 -5
- package/dist/security/translations/en.js.map +1 -1
- package/dist/security/translations/index.d.ts +1 -0
- package/dist/security/types/index.d.ts +282 -0
- package/dist/security/utils/clipboard.d.ts +11 -0
- package/dist/security/utils/clipboard.js +1 -2
- package/dist/security/utils/clipboard.js.map +1 -1
- package/dist/security/utils/cn.d.ts +5 -0
- package/dist/security/utils/cn.js +2 -3
- package/dist/security/utils/cn.js.map +1 -1
- package/dist/security/utils/fileParser.d.ts +17 -0
- package/dist/security/utils/fileParser.js +2 -11
- package/dist/security/utils/fileParser.js.map +1 -1
- package/dist/security/utils/i18n.d.ts +11 -0
- package/dist/security/utils/passwordGenerator.d.ts +21 -0
- package/dist/security/utils/passwordGenerator.js +1 -2
- package/dist/security/utils/passwordGenerator.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +2 -0
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +62 -46
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { getSecretTypeInfo as e } from "../constants/secretTypes.js";
|
|
2
|
+
import { SecretTypeIcon as t } from "./SecretTypeIcon.js";
|
|
3
|
+
import { cn as n } from "../utils/cn.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/security/components/SecretTypeBadge.tsx
|
|
6
6
|
var a = ({ type: a, className: o }) => {
|
|
7
|
-
let s =
|
|
7
|
+
let s = e(a);
|
|
8
8
|
return /* @__PURE__ */ i("span", {
|
|
9
|
-
className:
|
|
10
|
-
children: [/* @__PURE__ */ r(
|
|
9
|
+
className: n("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium", "bg-bg-sunken border border-border-subtle", o),
|
|
10
|
+
children: [/* @__PURE__ */ r(t, {
|
|
11
11
|
type: a,
|
|
12
12
|
size: 12
|
|
13
13
|
}), s.label]
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { a as SecretTypeBadge };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=SecretTypeBadge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretTypeBadge.js","names":[],"sources":["../../../src/security/components/SecretTypeBadge.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport type { SecretType } from '../types';\nimport { getSecretTypeInfo } from '../constants/secretTypes';\nimport { SecretTypeIcon } from './SecretTypeIcon';\nimport { cn } from '../utils/cn';\n\ninterface SecretTypeBadgeProps {\n type: SecretType;\n className?: string;\n}\n\n/**\n * Colored badge showing the secret type with its icon.\n */\nexport const SecretTypeBadge: FC<SecretTypeBadgeProps> = ({ type, className }) => {\n const info = getSecretTypeInfo(type);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n 'bg-bg-sunken border border-border-subtle',\n className\n )}\n >\n <SecretTypeIcon type={type} size={12} />\n {info.label}\n </span>\n );\n};\n"],"mappings":";;;;;AAcA,
|
|
1
|
+
{"version":3,"file":"SecretTypeBadge.js","names":["SecretTypeBadge","info","getSecretTypeInfo","type","cn","className","SecretTypeIcon"],"sources":["../../../src/security/components/SecretTypeBadge.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport type { SecretType } from '../types';\nimport { getSecretTypeInfo } from '../constants/secretTypes';\nimport { SecretTypeIcon } from './SecretTypeIcon';\nimport { cn } from '../utils/cn';\n\ninterface SecretTypeBadgeProps {\n type: SecretType;\n className?: string;\n}\n\n/**\n * Colored badge showing the secret type with its icon.\n */\nexport const SecretTypeBadge: FC<SecretTypeBadgeProps> = ({ type, className }) => {\n const info = getSecretTypeInfo(type);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n 'bg-bg-sunken border border-border-subtle',\n className\n )}\n >\n <SecretTypeIcon type={type} size={12} />\n {info.label}\n </span>\n );\n};\n"],"mappings":";;;;;AAcA,IAAaA,KAA6C,EAAE,SAAM,mBAAgB;CAChF,IAAMC,IAAOC,EAAkBC,CAAI;CAEnC,OACE,kBAAC,QAAD;EACE,WAAWC,EACT,mFACA,4CACAC,CACF;EALF,UAAA,CAOE,kBAACC,GAAD;GAAsB;GAAM,MAAM;EAAK,CAAA,GACtCL,EAAK,KACF;;AAEV"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SecretType } from '../types';
|
|
3
|
+
interface SecretTypeIconProps {
|
|
4
|
+
type: SecretType;
|
|
5
|
+
size?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders the appropriate icon for a given secret type.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SecretTypeIcon: FC<SecretTypeIconProps>;
|
|
12
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { getSecretTypeInfo as e } from "../constants/secretTypes.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
import { Award as r, Database as i, FileCode as a, Key as o, KeyRound as s, Lock as c, Settings as l, Shield as u, Terminal as d, Ticket as f, Webhook as p } from "lucide-react";
|
|
5
|
-
|
|
5
|
+
// src/security/components/SecretTypeIcon.tsx
|
|
6
6
|
var m = {
|
|
7
7
|
KeyRound: s,
|
|
8
8
|
Key: o,
|
|
@@ -16,13 +16,12 @@ var m = {
|
|
|
16
16
|
FileCode: a,
|
|
17
17
|
Settings: l
|
|
18
18
|
}, h = ({ type: r, size: i = 16, className: a }) => {
|
|
19
|
-
let o =
|
|
20
|
-
return /* @__PURE__ */ n(
|
|
19
|
+
let o = e(r), s = m[o.icon] ?? l;
|
|
20
|
+
return /* @__PURE__ */ n(s, {
|
|
21
21
|
size: i,
|
|
22
|
-
className:
|
|
22
|
+
className: t(o.color, a)
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
//#endregion
|
|
26
25
|
export { h as SecretTypeIcon };
|
|
27
26
|
|
|
28
27
|
//# sourceMappingURL=SecretTypeIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretTypeIcon.js","names":[],"sources":["../../../src/security/components/SecretTypeIcon.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport {\n KeyRound,\n Key,\n Ticket,\n Award,\n Terminal,\n Database,\n Lock,\n Shield,\n Webhook,\n FileCode,\n Settings,\n} from 'lucide-react';\nimport type { SecretType } from '../types';\nimport { getSecretTypeInfo } from '../constants/secretTypes';\nimport { cn } from '../utils/cn';\n\ninterface SecretTypeIconProps {\n type: SecretType;\n size?: number;\n className?: string;\n}\n\nconst iconMap: Record<string, FC<{ className?: string; size?: number }>> = {\n KeyRound,\n Key,\n Ticket,\n Award,\n Terminal,\n Database,\n Lock,\n Shield,\n Webhook,\n FileCode,\n Settings,\n};\n\n/**\n * Renders the appropriate icon for a given secret type.\n */\nexport const SecretTypeIcon: FC<SecretTypeIconProps> = ({ type, size = 16, className }) => {\n const info = getSecretTypeInfo(type);\n const IconComponent = iconMap[info.icon] ?? Settings;\n\n return <IconComponent size={size} className={cn(info.color, className)} />;\n};\n"],"mappings":";;;;;AAwBA,
|
|
1
|
+
{"version":3,"file":"SecretTypeIcon.js","names":["iconMap","SecretTypeIcon","info","getSecretTypeInfo","type","IconComponent","Settings","cn","className"],"sources":["../../../src/security/components/SecretTypeIcon.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport {\n KeyRound,\n Key,\n Ticket,\n Award,\n Terminal,\n Database,\n Lock,\n Shield,\n Webhook,\n FileCode,\n Settings,\n} from 'lucide-react';\nimport type { SecretType } from '../types';\nimport { getSecretTypeInfo } from '../constants/secretTypes';\nimport { cn } from '../utils/cn';\n\ninterface SecretTypeIconProps {\n type: SecretType;\n size?: number;\n className?: string;\n}\n\nconst iconMap: Record<string, FC<{ className?: string; size?: number }>> = {\n KeyRound,\n Key,\n Ticket,\n Award,\n Terminal,\n Database,\n Lock,\n Shield,\n Webhook,\n FileCode,\n Settings,\n};\n\n/**\n * Renders the appropriate icon for a given secret type.\n */\nexport const SecretTypeIcon: FC<SecretTypeIconProps> = ({ type, size = 16, className }) => {\n const info = getSecretTypeInfo(type);\n const IconComponent = iconMap[info.icon] ?? Settings;\n\n return <IconComponent size={size} className={cn(info.color, className)} />;\n};\n"],"mappings":";;;;;AAwBA,IAAMA,IAAqE;CACzE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAKaC,KAA2C,EAAE,SAAM,UAAO,IAAI,mBAAgB;CACzF,IAAMC,IAAOC,EAAkBC,CAAI,GAC7BC,IAAgBL,EAAQE,EAAK,SAASI;CAE5C,OAAO,kBAACD,GAAD;EAAqB;EAAM,WAAWE,EAAGL,EAAK,OAAOM,CAAS;CAAI,CAAA;AAC3E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface SecretValueDisplayProps {
|
|
3
|
+
/** The actual secret value */
|
|
4
|
+
value: string;
|
|
5
|
+
/** Whether the value is currently revealed */
|
|
6
|
+
isRevealed: boolean;
|
|
7
|
+
/** Callback to toggle reveal state; if undefined the reveal button is disabled */
|
|
8
|
+
onToggleReveal?: () => void;
|
|
9
|
+
/** Auto-hide timer in milliseconds (0 = no auto-hide, default 30000) */
|
|
10
|
+
autoHideMs?: number;
|
|
11
|
+
/** Clipboard auto-clear time in ms */
|
|
12
|
+
clipboardAutoClearMs?: number;
|
|
13
|
+
/** Whether loading the decrypted value */
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
/** Additional CSS classes */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Displays a secret value with masking, reveal toggle, and auto-hide.
|
|
20
|
+
* When hidden, shows masked dots. When revealed, shows the actual value
|
|
21
|
+
* with a monospaced font and auto-hides after the configured timeout.
|
|
22
|
+
*/
|
|
23
|
+
export declare const SecretValueDisplay: FC<SecretValueDisplayProps>;
|
|
24
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { CopyButton as t } from "./CopyButton.js";
|
|
3
|
+
import { useTr as n } from "../hooks/useTr.js";
|
|
4
4
|
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
5
5
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
6
|
import { Eye as c, EyeOff as l } from "lucide-react";
|
|
7
|
-
|
|
7
|
+
// src/security/components/SecretValueDisplay.tsx
|
|
8
8
|
var u = ({ value: u, isRevealed: d, onToggleReveal: f, autoHideMs: p = 3e4, clipboardAutoClearMs: m = 3e4, isLoading: h = !1, className: g }) => {
|
|
9
|
-
let _ =
|
|
9
|
+
let _ = n(), v = i(null), [, y] = a(0), b = i(f);
|
|
10
10
|
r(() => {
|
|
11
11
|
b.current = f;
|
|
12
12
|
});
|
|
@@ -24,10 +24,10 @@ var u = ({ value: u, isRevealed: d, onToggleReveal: f, autoHideMs: p = 3e4, clip
|
|
|
24
24
|
}, [d, p]);
|
|
25
25
|
let S = v.current, C = d && p > 0 && S !== null ? Math.max(0, p - (Date.now() - S)) : 0, w = "•".repeat(Math.min(24, u.length || 16));
|
|
26
26
|
return /* @__PURE__ */ s("div", {
|
|
27
|
-
className:
|
|
27
|
+
className: e("flex items-center gap-2", g),
|
|
28
28
|
children: [
|
|
29
29
|
/* @__PURE__ */ o("div", {
|
|
30
|
-
className:
|
|
30
|
+
className: e("flex-1 px-3 py-2 rounded-md border border-border-subtle bg-bg-sunken/50", "font-mono text-sm select-all", !d && "tracking-wider"),
|
|
31
31
|
children: h ? /* @__PURE__ */ o("span", {
|
|
32
32
|
className: "text-text-secondary animate-pulse",
|
|
33
33
|
children: _("security.secretValueDisplay.decrypting", "Decrypting…")
|
|
@@ -45,11 +45,11 @@ var u = ({ value: u, isRevealed: d, onToggleReveal: f, autoHideMs: p = 3e4, clip
|
|
|
45
45
|
type: "button",
|
|
46
46
|
onClick: f,
|
|
47
47
|
disabled: h || !f,
|
|
48
|
-
className:
|
|
48
|
+
className: e("p-2 rounded-md text-text-secondary hover:text-text-primary", "hover:bg-accent transition-colors", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
49
49
|
"aria-label": d ? _("security.secretValueDisplay.hide", "Hide value") : _("security.secretValueDisplay.reveal", "Reveal value"),
|
|
50
50
|
title: d ? _("security.secretValueDisplay.hide", "Hide value") : _("security.secretValueDisplay.reveal", "Reveal value"),
|
|
51
51
|
children: o(d ? l : c, { className: "size-4" })
|
|
52
|
-
}), /* @__PURE__ */ o(
|
|
52
|
+
}), /* @__PURE__ */ o(t, {
|
|
53
53
|
value: u,
|
|
54
54
|
autoClearMs: m,
|
|
55
55
|
disabled: h || !u
|
|
@@ -62,7 +62,6 @@ var u = ({ value: u, isRevealed: d, onToggleReveal: f, autoHideMs: p = 3e4, clip
|
|
|
62
62
|
]
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
|
-
//#endregion
|
|
66
65
|
export { u as SecretValueDisplay };
|
|
67
66
|
|
|
68
67
|
//# sourceMappingURL=SecretValueDisplay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretValueDisplay.js","names":[],"sources":["../../../src/security/components/SecretValueDisplay.tsx"],"sourcesContent":["import { type FC, useEffect, useRef, useState } from 'react';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { CopyButton } from './CopyButton';\nimport { useTr } from '../hooks/useTr';\n\ninterface SecretValueDisplayProps {\n /** The actual secret value */\n value: string;\n /** Whether the value is currently revealed */\n isRevealed: boolean;\n /** Callback to toggle reveal state; if undefined the reveal button is disabled */\n onToggleReveal?: () => void;\n /** Auto-hide timer in milliseconds (0 = no auto-hide, default 30000) */\n autoHideMs?: number;\n /** Clipboard auto-clear time in ms */\n clipboardAutoClearMs?: number;\n /** Whether loading the decrypted value */\n isLoading?: boolean;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * Displays a secret value with masking, reveal toggle, and auto-hide.\n * When hidden, shows masked dots. When revealed, shows the actual value\n * with a monospaced font and auto-hides after the configured timeout.\n */\nexport const SecretValueDisplay: FC<SecretValueDisplayProps> = ({\n value,\n isRevealed,\n onToggleReveal,\n autoHideMs = 30000,\n clipboardAutoClearMs = 30000,\n isLoading = false,\n className,\n}) => {\n const tr = useTr();\n // When the current reveal window started (ms epoch). Held in a ref so prop\n // sync doesn't trigger a render; ticks come from a single state update below.\n const revealedAtRef = useRef<number | null>(null);\n // Bump on each tick to re-render the countdown. Single setState in effect.\n const [, setTick] = useState(0);\n\n // Latest onToggleReveal — accessed inside timeout without becoming a dep.\n const onToggleRevealRef = useRef(onToggleReveal);\n useEffect(() => {\n onToggleRevealRef.current = onToggleReveal;\n });\n\n // Reset the reveal window timestamp directly during render when isRevealed\n // changes — avoids adjusting state in an effect on prop change.\n const prevRevealedRef = useRef<boolean | null>(null);\n if (prevRevealedRef.current !== isRevealed) {\n prevRevealedRef.current = isRevealed;\n revealedAtRef.current = isRevealed && autoHideMs > 0 ? Date.now() : null;\n }\n\n // Tick every second while revealed so the countdown re-renders.\n useEffect(() => {\n if (!isRevealed || autoHideMs <= 0) return;\n const interval = setInterval(() => setTick((t) => t + 1), 1000);\n return () => clearInterval(interval);\n }, [isRevealed, autoHideMs]);\n\n // Auto-hide after the configured timeout.\n useEffect(() => {\n if (!isRevealed || autoHideMs <= 0) return;\n const hideTimeout = setTimeout(() => {\n onToggleRevealRef.current?.();\n }, autoHideMs);\n return () => clearTimeout(hideTimeout);\n }, [isRevealed, autoHideMs]);\n\n const revealedAt = revealedAtRef.current;\n const autoHideCountdown =\n isRevealed && autoHideMs > 0 && revealedAt !== null\n ? Math.max(0, autoHideMs - (Date.now() - revealedAt))\n : 0;\n\n const maskedValue = '\\u2022'.repeat(Math.min(24, value.length || 16));\n\n return (\n <div className={cn('flex items-center gap-2', className)}>\n <div\n className={cn(\n 'flex-1 px-3 py-2 rounded-md border border-border-subtle bg-bg-sunken/50',\n 'font-mono text-sm select-all',\n !isRevealed && 'tracking-wider'\n )}\n >\n {isLoading ? (\n <span className=\"text-text-secondary animate-pulse\">\n {tr('security.secretValueDisplay.decrypting', 'Decrypting…')}\n </span>\n ) : isRevealed ? (\n <span className=\"break-all\">{value}</span>\n ) : (\n <span className=\"text-text-secondary\">{maskedValue}</span>\n )}\n </div>\n\n <div className=\"flex items-center gap-1 shrink-0\">\n {/* Reveal/Hide toggle */}\n <button\n type=\"button\"\n onClick={onToggleReveal}\n disabled={isLoading || !onToggleReveal}\n className={cn(\n 'p-2 rounded-md text-text-secondary hover:text-text-primary',\n 'hover:bg-accent transition-colors',\n 'disabled:opacity-50 disabled:cursor-not-allowed'\n )}\n aria-label={\n isRevealed\n ? tr('security.secretValueDisplay.hide', 'Hide value')\n : tr('security.secretValueDisplay.reveal', 'Reveal value')\n }\n title={\n isRevealed\n ? tr('security.secretValueDisplay.hide', 'Hide value')\n : tr('security.secretValueDisplay.reveal', 'Reveal value')\n }\n >\n {isRevealed ? <EyeOff className=\"size-4\" /> : <Eye className=\"size-4\" />}\n </button>\n\n {/* Copy button */}\n <CopyButton\n value={value}\n autoClearMs={clipboardAutoClearMs}\n disabled={isLoading || !value}\n />\n </div>\n\n {/* Auto-hide countdown */}\n {isRevealed && autoHideMs > 0 && autoHideCountdown > 0 && (\n <span className=\"text-xs text-text-secondary tabular-nums shrink-0\">\n {Math.ceil(autoHideCountdown / 1000)}s\n </span>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;AA4BA,
|
|
1
|
+
{"version":3,"file":"SecretValueDisplay.js","names":["SecretValueDisplay","tr","useTr","revealedAtRef","useRef","setTick","useState","onToggleRevealRef","onToggleReveal","prevRevealedRef","isRevealed","autoHideMs","useEffect","interval","t","hideTimeout","revealedAt","autoHideCountdown","maskedValue","value","cn","className","isLoading","jsx","EyeOff","Eye","CopyButton","clipboardAutoClearMs"],"sources":["../../../src/security/components/SecretValueDisplay.tsx"],"sourcesContent":["import { type FC, useEffect, useRef, useState } from 'react';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { CopyButton } from './CopyButton';\nimport { useTr } from '../hooks/useTr';\n\ninterface SecretValueDisplayProps {\n /** The actual secret value */\n value: string;\n /** Whether the value is currently revealed */\n isRevealed: boolean;\n /** Callback to toggle reveal state; if undefined the reveal button is disabled */\n onToggleReveal?: () => void;\n /** Auto-hide timer in milliseconds (0 = no auto-hide, default 30000) */\n autoHideMs?: number;\n /** Clipboard auto-clear time in ms */\n clipboardAutoClearMs?: number;\n /** Whether loading the decrypted value */\n isLoading?: boolean;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * Displays a secret value with masking, reveal toggle, and auto-hide.\n * When hidden, shows masked dots. When revealed, shows the actual value\n * with a monospaced font and auto-hides after the configured timeout.\n */\nexport const SecretValueDisplay: FC<SecretValueDisplayProps> = ({\n value,\n isRevealed,\n onToggleReveal,\n autoHideMs = 30000,\n clipboardAutoClearMs = 30000,\n isLoading = false,\n className,\n}) => {\n const tr = useTr();\n // When the current reveal window started (ms epoch). Held in a ref so prop\n // sync doesn't trigger a render; ticks come from a single state update below.\n const revealedAtRef = useRef<number | null>(null);\n // Bump on each tick to re-render the countdown. Single setState in effect.\n const [, setTick] = useState(0);\n\n // Latest onToggleReveal — accessed inside timeout without becoming a dep.\n const onToggleRevealRef = useRef(onToggleReveal);\n useEffect(() => {\n onToggleRevealRef.current = onToggleReveal;\n });\n\n // Reset the reveal window timestamp directly during render when isRevealed\n // changes — avoids adjusting state in an effect on prop change.\n const prevRevealedRef = useRef<boolean | null>(null);\n if (prevRevealedRef.current !== isRevealed) {\n prevRevealedRef.current = isRevealed;\n revealedAtRef.current = isRevealed && autoHideMs > 0 ? Date.now() : null;\n }\n\n // Tick every second while revealed so the countdown re-renders.\n useEffect(() => {\n if (!isRevealed || autoHideMs <= 0) return;\n const interval = setInterval(() => setTick((t) => t + 1), 1000);\n return () => clearInterval(interval);\n }, [isRevealed, autoHideMs]);\n\n // Auto-hide after the configured timeout.\n useEffect(() => {\n if (!isRevealed || autoHideMs <= 0) return;\n const hideTimeout = setTimeout(() => {\n onToggleRevealRef.current?.();\n }, autoHideMs);\n return () => clearTimeout(hideTimeout);\n }, [isRevealed, autoHideMs]);\n\n const revealedAt = revealedAtRef.current;\n const autoHideCountdown =\n isRevealed && autoHideMs > 0 && revealedAt !== null\n ? Math.max(0, autoHideMs - (Date.now() - revealedAt))\n : 0;\n\n const maskedValue = '\\u2022'.repeat(Math.min(24, value.length || 16));\n\n return (\n <div className={cn('flex items-center gap-2', className)}>\n <div\n className={cn(\n 'flex-1 px-3 py-2 rounded-md border border-border-subtle bg-bg-sunken/50',\n 'font-mono text-sm select-all',\n !isRevealed && 'tracking-wider'\n )}\n >\n {isLoading ? (\n <span className=\"text-text-secondary animate-pulse\">\n {tr('security.secretValueDisplay.decrypting', 'Decrypting…')}\n </span>\n ) : isRevealed ? (\n <span className=\"break-all\">{value}</span>\n ) : (\n <span className=\"text-text-secondary\">{maskedValue}</span>\n )}\n </div>\n\n <div className=\"flex items-center gap-1 shrink-0\">\n {/* Reveal/Hide toggle */}\n <button\n type=\"button\"\n onClick={onToggleReveal}\n disabled={isLoading || !onToggleReveal}\n className={cn(\n 'p-2 rounded-md text-text-secondary hover:text-text-primary',\n 'hover:bg-accent transition-colors',\n 'disabled:opacity-50 disabled:cursor-not-allowed'\n )}\n aria-label={\n isRevealed\n ? tr('security.secretValueDisplay.hide', 'Hide value')\n : tr('security.secretValueDisplay.reveal', 'Reveal value')\n }\n title={\n isRevealed\n ? tr('security.secretValueDisplay.hide', 'Hide value')\n : tr('security.secretValueDisplay.reveal', 'Reveal value')\n }\n >\n {isRevealed ? <EyeOff className=\"size-4\" /> : <Eye className=\"size-4\" />}\n </button>\n\n {/* Copy button */}\n <CopyButton\n value={value}\n autoClearMs={clipboardAutoClearMs}\n disabled={isLoading || !value}\n />\n </div>\n\n {/* Auto-hide countdown */}\n {isRevealed && autoHideMs > 0 && autoHideCountdown > 0 && (\n <span className=\"text-xs text-text-secondary tabular-nums shrink-0\">\n {Math.ceil(autoHideCountdown / 1000)}s\n </span>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;AA4BA,IAAaA,KAAmD,EAC9D,UACA,eACA,mBACA,gBAAa,KACb,0BAAuB,KACvB,eAAY,IACZ,mBACI;CACJ,IAAMC,IAAKC,EAAM,GAGXC,IAAgBC,EAAsB,IAAI,GAE1C,GAAGC,KAAWC,EAAS,CAAC,GAGxBC,IAAoBH,EAAOI,CAAc;CAC/C,QAAgB;EACd,EAAkB,UAAUA;CAC9B,CAAC;CAID,IAAMC,IAAkBL,EAAuB,IAAI;CAcnD,AAbIK,EAAgB,YAAYC,MAC9B,EAAgB,UAAUA,GAC1B,EAAc,UAAUA,KAAcC,IAAa,IAAI,KAAK,IAAI,IAAI,OAItEC,QAAgB;EACd,IAAI,CAACF,KAAcC,KAAc,GAAG;EACpC,IAAME,IAAW,kBAAkBR,GAAS,MAAMS,IAAI,CAAC,GAAG,GAAI;EAC9D,aAAa,cAAcD,CAAQ;CACrC,GAAG,CAACH,GAAYC,CAAU,CAAC,GAG3BC,QAAgB;EACd,IAAI,CAACF,KAAcC,KAAc,GAAG;EACpC,IAAMI,IAAc,iBAAiB;GACnC,EAAkB,UAAU;EAC9B,GAAGJ,CAAU;EACb,aAAa,aAAaI,CAAW;CACvC,GAAG,CAACL,GAAYC,CAAU,CAAC;CAE3B,IAAMK,IAAab,EAAc,SAC3Bc,IACJP,KAAcC,IAAa,KAAKK,MAAe,OAC3C,KAAK,IAAI,GAAGL,KAAc,KAAK,IAAI,IAAIK,EAAW,IAClD,GAEAE,IAAc,IAAS,OAAO,KAAK,IAAI,IAAIC,EAAM,UAAU,EAAE,CAAC;CAEpE,OACE,kBAAC,OAAD;EAAK,WAAWC,EAAG,2BAA2BC,CAAS;EAAvD,UAAA;GACE,kBAAC,OAAD;IACE,WAAWD,EACT,2EACA,gCACA,CAACV,KAAc,gBACjB;IAEC,UAAAY,IACC,kBAAC,QAAD;KAAM,WAAU;KACb,UAAArB,EAAG,0CAA0C,aAAa;IACvD,CAAA,IACJS,IACF,kBAAC,QAAD;KAAM,WAAU;KAAa,UAAAS;IAAY,CAAA,IAEzC,kBAAC,QAAD;KAAM,WAAU;KAAuB,UAAAD;IAAkB,CAAA;GAExD,CAAA;GAEL,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CAEE,kBAAC,UAAD;KACE,MAAK;KACL,SAASV;KACT,UAAUc,KAAa,CAACd;KACxB,WAAWY,EACT,8DACA,qCACA,iDACF;KACA,cACEV,IACIT,EAAG,oCAAoC,YAAY,IACnDA,EAAG,sCAAsC,cAAc;KAE7D,OACES,IACIT,EAAG,oCAAoC,YAAY,IACnDA,EAAG,sCAAsC,cAAc;KAG5D,UAAasB,EAAbb,IAAcc,IAAgCC,GAAjC,EAAQ,WAAU,SAAU,CAA6B;IACjE,CAAA,GAGR,kBAACC,GAAD;KACS;KACP,aAAaC;KACb,UAAUL,KAAa,CAACH;IACzB,CAAA,CACE;;GAGJT,KAAcC,IAAa,KAAKM,IAAoB,KACnD,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACG,KAAK,KAAKA,IAAoB,GAAI,GAAE,GACjC;;EAEL;;AAET"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export type SecurityPermission = 'vault:read' | 'vault:create' | 'vault:update' | 'vault:delete' | 'vault:lock' | 'secret:read' | 'secret:create' | 'secret:update' | 'secret:delete' | 'secret:decrypt' | 'member:read' | 'member:add' | 'member:remove' | 'member:update_role';
|
|
3
|
+
interface SecurityPermissionGuardProps {
|
|
4
|
+
permission: SecurityPermission;
|
|
5
|
+
/**
|
|
6
|
+
* Optional feature flag key. When provided, BOTH the RBAC permission check
|
|
7
|
+
* AND the feature flag must pass for children to be rendered.
|
|
8
|
+
*/
|
|
9
|
+
featureFlagKey?: string;
|
|
10
|
+
featureFlagDefault?: boolean;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare const SecurityPermissionGuard: FC<SecurityPermissionGuardProps>;
|
|
14
|
+
export {};
|
|
@@ -3,7 +3,7 @@ import { AccessDenied as t } from "@burdenoff/fe-libs/shared/components";
|
|
|
3
3
|
import { useFeatureFlag as n, usePermissions as r } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
4
4
|
import { Fragment as i, jsx as a } from "react/jsx-runtime";
|
|
5
5
|
import { Loader2 as o } from "lucide-react";
|
|
6
|
-
|
|
6
|
+
// src/security/components/SecurityPermissionGuard.tsx
|
|
7
7
|
var s = ({ permission: s, featureFlagKey: c, featureFlagDefault: l = !0, children: u }) => {
|
|
8
8
|
let { hasPermission: d, isLoading: f } = r(), p = e(), m = n(c ?? "__none__", l);
|
|
9
9
|
return f ? /* @__PURE__ */ a("div", {
|
|
@@ -14,7 +14,6 @@ var s = ({ permission: s, featureFlagKey: c, featureFlagDefault: l = !0, childre
|
|
|
14
14
|
description: p("security.accessDenied.description", "You don't have permission to perform this action.")
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { s as SecurityPermissionGuard };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=SecurityPermissionGuard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityPermissionGuard.js","names":[],"sources":["../../../src/security/components/SecurityPermissionGuard.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { Loader2 } from 'lucide-react';\nimport { usePermissions, useFeatureFlag } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { AccessDenied } from '@burdenoff/fe-libs/shared/components';\nimport { useTr } from '../hooks/useTr';\n\nexport type SecurityPermission =\n | 'vault:read'\n | 'vault:create'\n | 'vault:update'\n | 'vault:delete'\n | 'vault:lock'\n | 'secret:read'\n | 'secret:create'\n | 'secret:update'\n | 'secret:delete'\n | 'secret:decrypt'\n | 'member:read'\n | 'member:add'\n | 'member:remove'\n | 'member:update_role';\n\ninterface SecurityPermissionGuardProps {\n permission: SecurityPermission;\n /**\n * Optional feature flag key. When provided, BOTH the RBAC permission check\n * AND the feature flag must pass for children to be rendered.\n */\n featureFlagKey?: string;\n featureFlagDefault?: boolean;\n children: ReactNode;\n}\n\nexport const SecurityPermissionGuard: FC<SecurityPermissionGuardProps> = ({\n permission,\n featureFlagKey,\n featureFlagDefault = true,\n children,\n}) => {\n const { hasPermission, isLoading } = usePermissions();\n const tr = useTr();\n\n const featureEnabled = useFeatureFlag(featureFlagKey ?? '__none__', featureFlagDefault);\n\n if (isLoading) {\n return (\n <div className=\"flex min-h-[200px] items-center justify-center\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n );\n }\n\n if (!hasPermission(permission)) {\n return (\n <AccessDenied\n title={tr('security.accessDenied.title', 'Access Denied')}\n description={tr(\n 'security.accessDenied.description',\n \"You don't have permission to perform this action.\"\n )}\n />\n );\n }\n\n if (featureFlagKey && !featureEnabled) {\n return null;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;;;AAiCA,
|
|
1
|
+
{"version":3,"file":"SecurityPermissionGuard.js","names":["_Fragment","SecurityPermissionGuard","usePermissions","tr","useTr","featureEnabled","useFeatureFlag","featureFlagKey","featureFlagDefault","isLoading","Loader2","hasPermission","permission","Fragment","AccessDenied"],"sources":["../../../src/security/components/SecurityPermissionGuard.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { Loader2 } from 'lucide-react';\nimport { usePermissions, useFeatureFlag } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { AccessDenied } from '@burdenoff/fe-libs/shared/components';\nimport { useTr } from '../hooks/useTr';\n\nexport type SecurityPermission =\n | 'vault:read'\n | 'vault:create'\n | 'vault:update'\n | 'vault:delete'\n | 'vault:lock'\n | 'secret:read'\n | 'secret:create'\n | 'secret:update'\n | 'secret:delete'\n | 'secret:decrypt'\n | 'member:read'\n | 'member:add'\n | 'member:remove'\n | 'member:update_role';\n\ninterface SecurityPermissionGuardProps {\n permission: SecurityPermission;\n /**\n * Optional feature flag key. When provided, BOTH the RBAC permission check\n * AND the feature flag must pass for children to be rendered.\n */\n featureFlagKey?: string;\n featureFlagDefault?: boolean;\n children: ReactNode;\n}\n\nexport const SecurityPermissionGuard: FC<SecurityPermissionGuardProps> = ({\n permission,\n featureFlagKey,\n featureFlagDefault = true,\n children,\n}) => {\n const { hasPermission, isLoading } = usePermissions();\n const tr = useTr();\n\n const featureEnabled = useFeatureFlag(featureFlagKey ?? '__none__', featureFlagDefault);\n\n if (isLoading) {\n return (\n <div className=\"flex min-h-[200px] items-center justify-center\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n );\n }\n\n if (!hasPermission(permission)) {\n return (\n <AccessDenied\n title={tr('security.accessDenied.title', 'Access Denied')}\n description={tr(\n 'security.accessDenied.description',\n \"You don't have permission to perform this action.\"\n )}\n />\n );\n }\n\n if (featureFlagKey && !featureEnabled) {\n return null;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;;;AAiCA,IAAaC,KAA6D,EACxE,eACA,mBACA,wBAAqB,IACrB,kBACI;CACJ,IAAM,EAAE,kBAAe,iBAAcC,EAAe,GAC9CC,IAAKC,EAAM,GAEXC,IAAiBC,EAAeC,KAAkB,YAAYC,CAAkB;CA0BtF,OAxBIC,IAEA,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAACC,GAAD,EAAS,WAAU,mCAAoC,CAAA;CACpD,CAAA,IAIJC,EAAcC,CAAU,IAYzBL,KAAkB,CAACF,IACd,OAGF,kBAAAL,GAAA,EAAG,YAAW,CAAA,IAdjB,kBAACc,GAAD;EACE,OAAOX,EAAG,+BAA+B,eAAe;EACxD,aAAaA,EACX,qCACA,mDACF;CACD,CAAA;AASP"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface SecurityScoreCardProps {
|
|
3
|
+
score: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Boff UI 2.0 featured accent glow — use when this is the hero card of the page. */
|
|
6
|
+
glow?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Visual card displaying the security health score as a circular gauge.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SecurityScoreCard: FC<SecurityScoreCardProps>;
|
|
12
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
import { AlertTriangle as i, CheckCircle as a, Shield as o, XCircle as s } from "lucide-react";
|
|
5
5
|
import { GlassCard as c } from "@burdenoff/fe-libs/ui";
|
|
6
|
-
|
|
6
|
+
// src/security/components/SecurityScoreCard.tsx
|
|
7
7
|
var l = ({ score: l, className: u, glow: d }) => {
|
|
8
|
-
let f =
|
|
8
|
+
let f = t(), p = ((e) => e >= 80 ? {
|
|
9
9
|
key: "excellent",
|
|
10
10
|
label: f("security.securityScoreCard.excellent", "Excellent"),
|
|
11
11
|
color: "text-status-success-text",
|
|
@@ -33,7 +33,7 @@ var l = ({ score: l, className: u, glow: d }) => {
|
|
|
33
33
|
return /* @__PURE__ */ r(c, {
|
|
34
34
|
treatment: "glass",
|
|
35
35
|
glow: d,
|
|
36
|
-
className:
|
|
36
|
+
className: e("p-5 flex flex-col items-center gap-2", u),
|
|
37
37
|
children: [/* @__PURE__ */ r("div", {
|
|
38
38
|
className: "relative",
|
|
39
39
|
children: [/* @__PURE__ */ r("svg", {
|
|
@@ -41,16 +41,16 @@ var l = ({ score: l, className: u, glow: d }) => {
|
|
|
41
41
|
height: 80,
|
|
42
42
|
viewBox: "0 0 80 80",
|
|
43
43
|
children: [/* @__PURE__ */ n("circle", {
|
|
44
|
-
cx:
|
|
45
|
-
cy:
|
|
44
|
+
cx: 40,
|
|
45
|
+
cy: 40,
|
|
46
46
|
r: 37,
|
|
47
47
|
fill: "none",
|
|
48
48
|
stroke: "currentColor",
|
|
49
49
|
strokeWidth: 6,
|
|
50
50
|
className: "text-muted/30"
|
|
51
51
|
}), /* @__PURE__ */ n("circle", {
|
|
52
|
-
cx:
|
|
53
|
-
cy:
|
|
52
|
+
cx: 40,
|
|
53
|
+
cy: 40,
|
|
54
54
|
r: 37,
|
|
55
55
|
fill: "none",
|
|
56
56
|
stroke: "currentColor",
|
|
@@ -58,13 +58,13 @@ var l = ({ score: l, className: u, glow: d }) => {
|
|
|
58
58
|
strokeDasharray: h,
|
|
59
59
|
strokeDashoffset: g,
|
|
60
60
|
strokeLinecap: "round",
|
|
61
|
-
className:
|
|
62
|
-
transform:
|
|
61
|
+
className: e(p.color, "transition-all duration-200"),
|
|
62
|
+
transform: "rotate(-90 40 40)"
|
|
63
63
|
})]
|
|
64
64
|
}), /* @__PURE__ */ n("div", {
|
|
65
65
|
className: "absolute inset-0 flex items-center justify-center",
|
|
66
66
|
children: /* @__PURE__ */ n("span", {
|
|
67
|
-
className:
|
|
67
|
+
className: e("text-xl font-bold tabular-nums", p.color),
|
|
68
68
|
children: l
|
|
69
69
|
})
|
|
70
70
|
})]
|
|
@@ -72,8 +72,8 @@ var l = ({ score: l, className: u, glow: d }) => {
|
|
|
72
72
|
className: "text-center",
|
|
73
73
|
children: [/* @__PURE__ */ r("div", {
|
|
74
74
|
className: "flex items-center gap-1",
|
|
75
|
-
children: [/* @__PURE__ */ n(m, { className:
|
|
76
|
-
className:
|
|
75
|
+
children: [/* @__PURE__ */ n(m, { className: e("h-4 w-4", p.color) }), /* @__PURE__ */ n("span", {
|
|
76
|
+
className: e("text-sm font-semibold", p.color),
|
|
77
77
|
children: p.label
|
|
78
78
|
})]
|
|
79
79
|
}), /* @__PURE__ */ n("p", {
|
|
@@ -83,7 +83,6 @@ var l = ({ score: l, className: u, glow: d }) => {
|
|
|
83
83
|
})]
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
|
-
//#endregion
|
|
87
86
|
export { l as SecurityScoreCard };
|
|
88
87
|
|
|
89
88
|
//# sourceMappingURL=SecurityScoreCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityScoreCard.js","names":[],"sources":["../../../src/security/components/SecurityScoreCard.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Shield, CheckCircle, AlertTriangle, XCircle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks/useTr';\n\ninterface SecurityScoreCardProps {\n score: number;\n className?: string;\n /** Boff UI 2.0 featured accent glow — use when this is the hero card of the page. */\n glow?: boolean;\n}\n\n/**\n * Visual card displaying the security health score as a circular gauge.\n */\nexport const SecurityScoreCard: FC<SecurityScoreCardProps> = ({ score, className, glow }) => {\n const tr = useTr();\n const getScoreConfig = (s: number) => {\n if (s >= 80)\n return {\n key: 'excellent',\n label: tr('security.securityScoreCard.excellent', 'Excellent'),\n color: 'text-status-success-text',\n bg: 'bg-status-success-bg',\n Icon: CheckCircle,\n };\n if (s >= 60)\n return {\n key: 'good',\n label: tr('security.securityScoreCard.good', 'Good'),\n color: 'text-status-info-text',\n bg: 'bg-accent-blue',\n Icon: Shield,\n };\n if (s >= 40)\n return {\n key: 'fair',\n label: tr('security.securityScoreCard.fair', 'Fair'),\n color: 'text-status-warning-text',\n bg: 'bg-status-warning-bg',\n Icon: AlertTriangle,\n };\n return {\n key: 'needsAttention',\n label: tr('security.securityScoreCard.needsAttention', 'Needs Attention'),\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg',\n Icon: XCircle,\n };\n };\n\n const config = getScoreConfig(score);\n const Icon = config.Icon;\n\n // SVG circle properties\n const size = 80;\n const strokeWidth = 6;\n const radius = (size - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n const offset = circumference - (score / 100) * circumference;\n\n return (\n <GlassCard\n treatment=\"glass\"\n glow={glow}\n className={cn('p-5 flex flex-col items-center gap-2', className)}\n >\n <div className=\"relative\">\n <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>\n {/* Background circle */}\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n className=\"text-muted/30\"\n />\n {/* Score circle */}\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n strokeDasharray={circumference}\n strokeDashoffset={offset}\n strokeLinecap=\"round\"\n className={cn(config.color, 'transition-all duration-200')}\n transform={`rotate(-90 ${size / 2} ${size / 2})`}\n />\n </svg>\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <span className={cn('text-xl font-bold tabular-nums', config.color)}>{score}</span>\n </div>\n </div>\n <div className=\"text-center\">\n <div className=\"flex items-center gap-1\">\n <Icon className={cn('h-4 w-4', config.color)} />\n <span className={cn('text-sm font-semibold', config.color)}>{config.label}</span>\n </div>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tr('security.securityScoreCard.healthScore', 'Health Score')}\n </p>\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"SecurityScoreCard.js","names":["SecurityScoreCard","tr","useTr","config","s","CheckCircle","Shield","AlertTriangle","XCircle","score","Icon","circumference","offset","GlassCard","cn","className"],"sources":["../../../src/security/components/SecurityScoreCard.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Shield, CheckCircle, AlertTriangle, XCircle } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks/useTr';\n\ninterface SecurityScoreCardProps {\n score: number;\n className?: string;\n /** Boff UI 2.0 featured accent glow — use when this is the hero card of the page. */\n glow?: boolean;\n}\n\n/**\n * Visual card displaying the security health score as a circular gauge.\n */\nexport const SecurityScoreCard: FC<SecurityScoreCardProps> = ({ score, className, glow }) => {\n const tr = useTr();\n const getScoreConfig = (s: number) => {\n if (s >= 80)\n return {\n key: 'excellent',\n label: tr('security.securityScoreCard.excellent', 'Excellent'),\n color: 'text-status-success-text',\n bg: 'bg-status-success-bg',\n Icon: CheckCircle,\n };\n if (s >= 60)\n return {\n key: 'good',\n label: tr('security.securityScoreCard.good', 'Good'),\n color: 'text-status-info-text',\n bg: 'bg-accent-blue',\n Icon: Shield,\n };\n if (s >= 40)\n return {\n key: 'fair',\n label: tr('security.securityScoreCard.fair', 'Fair'),\n color: 'text-status-warning-text',\n bg: 'bg-status-warning-bg',\n Icon: AlertTriangle,\n };\n return {\n key: 'needsAttention',\n label: tr('security.securityScoreCard.needsAttention', 'Needs Attention'),\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg',\n Icon: XCircle,\n };\n };\n\n const config = getScoreConfig(score);\n const Icon = config.Icon;\n\n // SVG circle properties\n const size = 80;\n const strokeWidth = 6;\n const radius = (size - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n const offset = circumference - (score / 100) * circumference;\n\n return (\n <GlassCard\n treatment=\"glass\"\n glow={glow}\n className={cn('p-5 flex flex-col items-center gap-2', className)}\n >\n <div className=\"relative\">\n <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>\n {/* Background circle */}\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n className=\"text-muted/30\"\n />\n {/* Score circle */}\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n strokeDasharray={circumference}\n strokeDashoffset={offset}\n strokeLinecap=\"round\"\n className={cn(config.color, 'transition-all duration-200')}\n transform={`rotate(-90 ${size / 2} ${size / 2})`}\n />\n </svg>\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <span className={cn('text-xl font-bold tabular-nums', config.color)}>{score}</span>\n </div>\n </div>\n <div className=\"text-center\">\n <div className=\"flex items-center gap-1\">\n <Icon className={cn('h-4 w-4', config.color)} />\n <span className={cn('text-sm font-semibold', config.color)}>{config.label}</span>\n </div>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tr('security.securityScoreCard.healthScore', 'Health Score')}\n </p>\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;AAgBA,IAAaA,KAAiD,EAAE,UAAO,cAAW,cAAW;CAC3F,IAAMC,IAAKC,EAAM,GAmCXC,MAlCkB,MAClBC,KAAK,KACA;EACL,KAAK;EACL,OAAOH,EAAG,wCAAwC,WAAW;EAC7D,OAAO;EACP,IAAI;EACJ,MAAMI;CACR,IACED,KAAK,KACA;EACL,KAAK;EACL,OAAOH,EAAG,mCAAmC,MAAM;EACnD,OAAO;EACP,IAAI;EACJ,MAAMK;CACR,IACEF,KAAK,KACA;EACL,KAAK;EACL,OAAOH,EAAG,mCAAmC,MAAM;EACnD,OAAO;EACP,IAAI;EACJ,MAAMM;CACR,IACK;EACL,KAAK;EACL,OAAON,EAAG,6CAA6C,iBAAiB;EACxE,OAAO;EACP,IAAI;EACJ,MAAMO;CACR,EAGa,CAAeC,CAAK,GAC7BC,IAAOP,EAAO,MAMdQ,IAAgB,IAAI,KAAK,KAAK,IAC9BC,IAASD,IAAiBF,IAAQ,MAAOE;CAE/C,OACE,kBAACE,GAAD;EACE,WAAU;EACJ;EACN,WAAWC,EAAG,wCAAwCC,CAAS;EAHjE,UAAA,CAKE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,OAAO;IAAM,QAAQ;IAAM,SAAS;IAAzC,UAAA,CAEE,kBAAC,UAAD;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;KACH,MAAK;KACL,QAAO;KACM;KACb,WAAU;IACX,CAAA,GAED,kBAAC,UAAD;KACE,IAAI;KACJ,IAAI;KACJ,GAAG;KACH,MAAK;KACL,QAAO;KACM;KACb,iBAAiBJ;KACjB,kBAAkBC;KAClB,eAAc;KACd,WAAWE,EAAGX,EAAO,OAAO,6BAA6B;KACzD,WAAW;IACZ,CAAA,CACE;GACL,CAAA,GAAA,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAAC,QAAD;KAAM,WAAWW,EAAG,kCAAkCX,EAAO,KAAK;KAAI,UAAAM;IAAY,CAAA;GAC/E,CAAA,CACF;EACL,CAAA,GAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAACC,GAAD,EAAM,WAAWI,EAAG,WAAWX,EAAO,KAAK,EAAI,CAAA,GAC/C,kBAAC,QAAD;KAAM,WAAWW,EAAG,yBAAyBX,EAAO,KAAK;KAAI,UAAAA,EAAO;IAAY,CAAA,CAC7E;GACL,CAAA,GAAA,kBAAC,KAAD;IAAG,WAAU;IACV,UAAAF,EAAG,0CAA0C,cAAc;GAC3D,CAAA,CACA;EACI,CAAA,CAAA;;AAEf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Vault } from '../types';
|
|
3
|
+
interface VaultCardProps {
|
|
4
|
+
vault: Vault;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
isSelected?: boolean;
|
|
7
|
+
onSelect?: (vaultId: string) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const VaultCard: FC<VaultCardProps>;
|
|
11
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { Badge as t, Card as n } from "./ui.js";
|
|
3
|
+
import { useTr as r } from "../hooks/useTr.js";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
import { Archive as o, KeyRound as s, Lock as c, Users as l } from "lucide-react";
|
|
6
|
-
|
|
6
|
+
// src/security/components/VaultCard.tsx
|
|
7
7
|
var u = ({ vault: u, onClick: d, isSelected: f, onSelect: p, className: m }) => {
|
|
8
|
-
let h =
|
|
8
|
+
let h = r(), g = {
|
|
9
9
|
ACTIVE: {
|
|
10
10
|
label: h("security.vaultCard.status.active", "Active"),
|
|
11
11
|
variant: "success",
|
|
@@ -32,9 +32,9 @@ var u = ({ vault: u, onClick: d, isSelected: f, onSelect: p, className: m }) =>
|
|
|
32
32
|
icon: o
|
|
33
33
|
}
|
|
34
34
|
}, _ = g[u.status] ?? g.ACTIVE, v = _.icon, y = u.secretCount === 1 ? h("security.vaultCard.secretCount.singular", "{{count}} secret", { count: u.secretCount }) : h("security.vaultCard.secretCount.plural", "{{count}} secrets", { count: u.secretCount }), b = u.memberCount === 1 ? h("security.vaultCard.memberCount.singular", "{{count}} member", { count: u.memberCount }) : h("security.vaultCard.memberCount.plural", "{{count}} members", { count: u.memberCount });
|
|
35
|
-
return /* @__PURE__ */ a(
|
|
35
|
+
return /* @__PURE__ */ a(n, {
|
|
36
36
|
onClick: d,
|
|
37
|
-
className:
|
|
37
|
+
className: e("p-5", "focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none", f && "ring-2 ring-primary/50", m),
|
|
38
38
|
"aria-selected": f,
|
|
39
39
|
"data-tour": "vaults-card-item",
|
|
40
40
|
children: [/* @__PURE__ */ a("div", {
|
|
@@ -64,7 +64,7 @@ var u = ({ vault: u, onClick: d, isSelected: f, onSelect: p, className: m }) =>
|
|
|
64
64
|
children: u.description
|
|
65
65
|
})] })
|
|
66
66
|
]
|
|
67
|
-
}), /* @__PURE__ */ a(
|
|
67
|
+
}), /* @__PURE__ */ a(t, {
|
|
68
68
|
variant: _.variant,
|
|
69
69
|
children: [
|
|
70
70
|
u.status === "ACTIVE" && /* @__PURE__ */ i("span", {
|
|
@@ -95,7 +95,6 @@ var u = ({ vault: u, onClick: d, isSelected: f, onSelect: p, className: m }) =>
|
|
|
95
95
|
})]
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
|
-
//#endregion
|
|
99
98
|
export { u as VaultCard };
|
|
100
99
|
|
|
101
100
|
//# sourceMappingURL=VaultCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VaultCard.js","names":[],"sources":["../../../src/security/components/VaultCard.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { KeyRound, Users, Lock, Archive } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { Card, Badge } from './ui';\nimport { useTr } from '../hooks/useTr';\nimport type { Vault } from '../types';\n\ninterface VaultCardProps {\n vault: Vault;\n onClick?: () => void;\n isSelected?: boolean;\n onSelect?: (vaultId: string) => void;\n className?: string;\n}\n\nexport const VaultCard: FC<VaultCardProps> = ({\n vault,\n onClick,\n isSelected,\n onSelect,\n className,\n}) => {\n const tr = useTr();\n\n const statusConfig: Record<\n string,\n { label: string; variant: 'success' | 'warning' | 'outline'; icon: typeof Lock | null }\n > = {\n ACTIVE: {\n label: tr('security.vaultCard.status.active', 'Active'),\n variant: 'success',\n icon: null,\n },\n LOCKED: {\n label: tr('security.vaultCard.status.locked', 'Locked'),\n variant: 'warning',\n icon: Lock,\n },\n ARCHIVED: {\n label: tr('security.vaultCard.status.archived', 'Archived'),\n variant: 'outline',\n icon: Archive,\n },\n SUSPENDED: {\n label: tr('security.vaultCard.status.suspended', 'Suspended'),\n variant: 'outline',\n icon: Archive,\n },\n DELETED: {\n label: tr('security.vaultCard.status.deleted', 'Deleted'),\n variant: 'outline',\n icon: Archive,\n },\n };\n\n const status = statusConfig[vault.status] ?? statusConfig.ACTIVE;\n const StatusIcon = status.icon;\n\n const secretLabel =\n vault.secretCount === 1\n ? tr('security.vaultCard.secretCount.singular', '{{count}} secret', {\n count: vault.secretCount,\n })\n : tr('security.vaultCard.secretCount.plural', '{{count}} secrets', {\n count: vault.secretCount,\n });\n\n const memberLabel =\n vault.memberCount === 1\n ? tr('security.vaultCard.memberCount.singular', '{{count}} member', {\n count: vault.memberCount,\n })\n : tr('security.vaultCard.memberCount.plural', '{{count}} members', {\n count: vault.memberCount,\n });\n\n return (\n <Card\n onClick={onClick}\n className={cn(\n 'p-5',\n 'focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none',\n isSelected && 'ring-2 ring-primary/50',\n className\n )}\n aria-selected={isSelected}\n data-tour=\"vaults-card-item\"\n >\n <div className=\"flex items-start justify-between mb-3\">\n <div className=\"flex items-center gap-2.5\">\n {onSelect && (\n <input\n type=\"checkbox\"\n checked={isSelected ?? false}\n onChange={(e) => {\n e.stopPropagation();\n onSelect(vault.id);\n }}\n onClick={(e) => e.stopPropagation()}\n className=\"size-4 rounded border-border-subtle text-primary focus:ring-primary shrink-0\"\n aria-label={tr('security.vaultCard.checkbox.aria', 'Select vault {{name}}', {\n name: vault.name,\n })}\n />\n )}\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10 text-primary\">\n <KeyRound className=\"size-5\" />\n </div>\n <div>\n <h3 className=\"font-semibold text-text-primary leading-tight\">{vault.name}</h3>\n {vault.description && (\n <p className=\"text-xs text-text-secondary mt-0.5 line-clamp-1\">{vault.description}</p>\n )}\n </div>\n </div>\n <Badge variant={status.variant}>\n {vault.status === 'ACTIVE' && (\n <span\n aria-hidden=\"true\"\n className=\"size-1.5 rounded-full bg-status-success-text motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {StatusIcon && <StatusIcon className=\"size-3\" />}\n {status.label}\n </Badge>\n </div>\n\n <div className=\"flex items-center gap-4 text-sm text-text-secondary\">\n <div className=\"flex items-center gap-1.5\" aria-label={secretLabel}>\n <KeyRound className=\"size-3.5\" />\n <span aria-hidden=\"true\">{secretLabel}</span>\n </div>\n <div className=\"flex items-center gap-1.5\" aria-label={memberLabel}>\n <Users className=\"size-3.5\" />\n <span aria-hidden=\"true\">{memberLabel}</span>\n </div>\n </div>\n </Card>\n );\n};\n"],"mappings":";;;;;;AAeA,
|
|
1
|
+
{"version":3,"file":"VaultCard.js","names":["VaultCard","tr","useTr","statusConfig","Lock","Archive","status","vault","StatusIcon","secretLabel","memberLabel","Card","cn","isSelected","className","onSelect","KeyRound","Badge","Users"],"sources":["../../../src/security/components/VaultCard.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { KeyRound, Users, Lock, Archive } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { Card, Badge } from './ui';\nimport { useTr } from '../hooks/useTr';\nimport type { Vault } from '../types';\n\ninterface VaultCardProps {\n vault: Vault;\n onClick?: () => void;\n isSelected?: boolean;\n onSelect?: (vaultId: string) => void;\n className?: string;\n}\n\nexport const VaultCard: FC<VaultCardProps> = ({\n vault,\n onClick,\n isSelected,\n onSelect,\n className,\n}) => {\n const tr = useTr();\n\n const statusConfig: Record<\n string,\n { label: string; variant: 'success' | 'warning' | 'outline'; icon: typeof Lock | null }\n > = {\n ACTIVE: {\n label: tr('security.vaultCard.status.active', 'Active'),\n variant: 'success',\n icon: null,\n },\n LOCKED: {\n label: tr('security.vaultCard.status.locked', 'Locked'),\n variant: 'warning',\n icon: Lock,\n },\n ARCHIVED: {\n label: tr('security.vaultCard.status.archived', 'Archived'),\n variant: 'outline',\n icon: Archive,\n },\n SUSPENDED: {\n label: tr('security.vaultCard.status.suspended', 'Suspended'),\n variant: 'outline',\n icon: Archive,\n },\n DELETED: {\n label: tr('security.vaultCard.status.deleted', 'Deleted'),\n variant: 'outline',\n icon: Archive,\n },\n };\n\n const status = statusConfig[vault.status] ?? statusConfig.ACTIVE;\n const StatusIcon = status.icon;\n\n const secretLabel =\n vault.secretCount === 1\n ? tr('security.vaultCard.secretCount.singular', '{{count}} secret', {\n count: vault.secretCount,\n })\n : tr('security.vaultCard.secretCount.plural', '{{count}} secrets', {\n count: vault.secretCount,\n });\n\n const memberLabel =\n vault.memberCount === 1\n ? tr('security.vaultCard.memberCount.singular', '{{count}} member', {\n count: vault.memberCount,\n })\n : tr('security.vaultCard.memberCount.plural', '{{count}} members', {\n count: vault.memberCount,\n });\n\n return (\n <Card\n onClick={onClick}\n className={cn(\n 'p-5',\n 'focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none',\n isSelected && 'ring-2 ring-primary/50',\n className\n )}\n aria-selected={isSelected}\n data-tour=\"vaults-card-item\"\n >\n <div className=\"flex items-start justify-between mb-3\">\n <div className=\"flex items-center gap-2.5\">\n {onSelect && (\n <input\n type=\"checkbox\"\n checked={isSelected ?? false}\n onChange={(e) => {\n e.stopPropagation();\n onSelect(vault.id);\n }}\n onClick={(e) => e.stopPropagation()}\n className=\"size-4 rounded border-border-subtle text-primary focus:ring-primary shrink-0\"\n aria-label={tr('security.vaultCard.checkbox.aria', 'Select vault {{name}}', {\n name: vault.name,\n })}\n />\n )}\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10 text-primary\">\n <KeyRound className=\"size-5\" />\n </div>\n <div>\n <h3 className=\"font-semibold text-text-primary leading-tight\">{vault.name}</h3>\n {vault.description && (\n <p className=\"text-xs text-text-secondary mt-0.5 line-clamp-1\">{vault.description}</p>\n )}\n </div>\n </div>\n <Badge variant={status.variant}>\n {vault.status === 'ACTIVE' && (\n <span\n aria-hidden=\"true\"\n className=\"size-1.5 rounded-full bg-status-success-text motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {StatusIcon && <StatusIcon className=\"size-3\" />}\n {status.label}\n </Badge>\n </div>\n\n <div className=\"flex items-center gap-4 text-sm text-text-secondary\">\n <div className=\"flex items-center gap-1.5\" aria-label={secretLabel}>\n <KeyRound className=\"size-3.5\" />\n <span aria-hidden=\"true\">{secretLabel}</span>\n </div>\n <div className=\"flex items-center gap-1.5\" aria-label={memberLabel}>\n <Users className=\"size-3.5\" />\n <span aria-hidden=\"true\">{memberLabel}</span>\n </div>\n </div>\n </Card>\n );\n};\n"],"mappings":";;;;;;AAeA,IAAaA,KAAiC,EAC5C,UACA,YACA,eACA,aACA,mBACI;CACJ,IAAMC,IAAKC,EAAM,GAEXC,IAGF;EACF,QAAQ;GACN,OAAOF,EAAG,oCAAoC,QAAQ;GACtD,SAAS;GACT,MAAM;EACR;EACA,QAAQ;GACN,OAAOA,EAAG,oCAAoC,QAAQ;GACtD,SAAS;GACT,MAAMG;EACR;EACA,UAAU;GACR,OAAOH,EAAG,sCAAsC,UAAU;GAC1D,SAAS;GACT,MAAMI;EACR;EACA,WAAW;GACT,OAAOJ,EAAG,uCAAuC,WAAW;GAC5D,SAAS;GACT,MAAMI;EACR;EACA,SAAS;GACP,OAAOJ,EAAG,qCAAqC,SAAS;GACxD,SAAS;GACT,MAAMI;EACR;CACF,GAEMC,IAASH,EAAaI,EAAM,WAAWJ,EAAa,QACpDK,IAAaF,EAAO,MAEpBG,IACJF,EAAM,gBAAgB,IAClBN,EAAG,2CAA2C,oBAAoB,EAChE,OAAOM,EAAM,YACf,CAAC,IACDN,EAAG,yCAAyC,qBAAqB,EAC/D,OAAOM,EAAM,YACf,CAAC,GAEDG,IACJH,EAAM,gBAAgB,IAClBN,EAAG,2CAA2C,oBAAoB,EAChE,OAAOM,EAAM,YACf,CAAC,IACDN,EAAG,yCAAyC,qBAAqB,EAC/D,OAAOM,EAAM,YACf,CAAC;CAEP,OACE,kBAACI,GAAD;EACW;EACT,WAAWC,EACT,OACA,8EACAC,KAAc,0BACdC,CACF;EACA,iBAAeD;EACf,aAAU;EATZ,UAAA,CAWE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACGE,KACC,kBAAC,SAAD;MACE,MAAK;MACL,SAASF,KAAc;MACvB,WAAW,MAAM;OAEf,AADA,EAAE,gBAAgB,GAClBE,EAASR,EAAM,EAAE;MACnB;MACA,UAAU,MAAM,EAAE,gBAAgB;MAClC,WAAU;MACV,cAAYN,EAAG,oCAAoC,yBAAyB,EAC1E,MAAMM,EAAM,KACd,CAAC;KACF,CAAA;KAEH,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAACS,GAAD,EAAU,WAAU,SAAU,CAAA;KAC3B,CAAA;KACL,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;MAAI,WAAU;MAAiD,UAAAT,EAAM;KAAS,CAAA,GAC7EA,EAAM,eACL,kBAAC,KAAD;MAAG,WAAU;MAAmD,UAAAA,EAAM;KAAe,CAAA,CAEpF,EAAA,CAAA;IACF;GACL,CAAA,GAAA,kBAACU,GAAD;IAAO,SAASX,EAAO;IAAvB,UAAA;KACGC,EAAM,WAAW,YAChB,kBAAC,QAAD;MACE,eAAY;MACZ,WAAU;KACX,CAAA;KAEFC,KAAc,kBAACA,GAAD,EAAY,WAAU,SAAU,CAAA;KAC9CF,EAAO;IACH;GACJ,CAAA,CAAA;EAEL,CAAA,GAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAA4B,cAAYG;IAAvD,UAAA,CACE,kBAACO,GAAD,EAAU,WAAU,WAAY,CAAA,GAChC,kBAAC,QAAD;KAAM,eAAY;KAAQ,UAAAP;IAAkB,CAAA,CACzC;GACL,CAAA,GAAA,kBAAC,OAAD;IAAK,WAAU;IAA4B,cAAYC;IAAvD,UAAA,CACE,kBAACQ,GAAD,EAAO,WAAU,WAAY,CAAA,GAC7B,kBAAC,QAAD;KAAM,eAAY;KAAQ,UAAAR;IAAkB,CAAA,CACzC;GACF,CAAA,CAAA;EACD,CAAA,CAAA;;AAEV"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { VaultStatus } from '../types';
|
|
3
|
+
interface VaultFormFieldsProps {
|
|
4
|
+
name: string;
|
|
5
|
+
onNameChange: (value: string) => void;
|
|
6
|
+
description: string;
|
|
7
|
+
onDescriptionChange: (value: string) => void;
|
|
8
|
+
scope: string;
|
|
9
|
+
onScopeChange: (value: string) => void;
|
|
10
|
+
status?: VaultStatus;
|
|
11
|
+
onStatusChange?: (value: VaultStatus) => void;
|
|
12
|
+
isEdit?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const VaultFormFields: FC<VaultFormFieldsProps>;
|
|
15
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Input as e, Select as t } from "./ui.js";
|
|
2
|
+
import { useTr as n } from "../hooks/useTr.js";
|
|
3
3
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/security/components/VaultFormFields.tsx
|
|
5
5
|
var a = ({ name: a, onNameChange: o, description: s, onDescriptionChange: c, scope: l, onScopeChange: u, status: d, onStatusChange: f, isEdit: p = !1 }) => {
|
|
6
|
-
let m =
|
|
6
|
+
let m = n();
|
|
7
7
|
return /* @__PURE__ */ i("div", {
|
|
8
8
|
className: "space-y-4",
|
|
9
9
|
children: [
|
|
@@ -15,7 +15,7 @@ var a = ({ name: a, onNameChange: o, description: s, onDescriptionChange: c, sco
|
|
|
15
15
|
className: "text-sm font-medium text-text-primary",
|
|
16
16
|
children: m("security.vaultForm.name", "Vault Name")
|
|
17
17
|
}),
|
|
18
|
-
/* @__PURE__ */ r(
|
|
18
|
+
/* @__PURE__ */ r(e, {
|
|
19
19
|
id: "vault-name",
|
|
20
20
|
placeholder: m("security.vaultForm.namePlaceholder", "e.g. Production Credentials"),
|
|
21
21
|
value: a,
|
|
@@ -34,7 +34,7 @@ var a = ({ name: a, onNameChange: o, description: s, onDescriptionChange: c, sco
|
|
|
34
34
|
htmlFor: "vault-description",
|
|
35
35
|
className: "text-sm font-medium text-text-primary",
|
|
36
36
|
children: m("security.vaultForm.description", "Description")
|
|
37
|
-
}), /* @__PURE__ */ r(
|
|
37
|
+
}), /* @__PURE__ */ r(e, {
|
|
38
38
|
id: "vault-description",
|
|
39
39
|
placeholder: m("security.vaultForm.descriptionPlaceholder", "e.g. API keys and database credentials for production"),
|
|
40
40
|
value: s,
|
|
@@ -49,7 +49,7 @@ var a = ({ name: a, onNameChange: o, description: s, onDescriptionChange: c, sco
|
|
|
49
49
|
className: "text-sm font-medium text-text-primary",
|
|
50
50
|
children: m("security.vaultForm.scope", "Scope")
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */ r(
|
|
52
|
+
/* @__PURE__ */ r(t, {
|
|
53
53
|
id: "vault-scope",
|
|
54
54
|
value: l,
|
|
55
55
|
onChange: u,
|
|
@@ -85,7 +85,7 @@ var a = ({ name: a, onNameChange: o, description: s, onDescriptionChange: c, sco
|
|
|
85
85
|
htmlFor: "vault-status",
|
|
86
86
|
className: "text-sm font-medium text-text-primary",
|
|
87
87
|
children: m("security.vaultForm.status", "Status")
|
|
88
|
-
}), /* @__PURE__ */ r(
|
|
88
|
+
}), /* @__PURE__ */ r(t, {
|
|
89
89
|
id: "vault-status",
|
|
90
90
|
value: d || "ACTIVE",
|
|
91
91
|
onChange: (e) => f(e),
|
|
@@ -108,7 +108,6 @@ var a = ({ name: a, onNameChange: o, description: s, onDescriptionChange: c, sco
|
|
|
108
108
|
]
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
|
-
//#endregion
|
|
112
111
|
export { a as VaultFormFields };
|
|
113
112
|
|
|
114
113
|
//# sourceMappingURL=VaultFormFields.js.map
|