@burdenoff/microfe-security 2026.1105.1 → 2026.1109.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 +72 -73
- 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 +53 -0
- package/dist/security/components/ui.js +1 -2
- 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 +41 -0
- package/dist/security/constants/externalSecretProviders.js +1 -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 +2 -3
- 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 +3 -4
- package/dist/security/routes/SecurityAdminRoutes.js.map +1 -1
- package/dist/security/routes/SecurityRoutes.d.ts +18 -0
- package/dist/security/routes/SecurityRoutes.js +3 -4
- 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 +842 -0
- package/dist/security/translations/en.js +1 -2
- 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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SecurityAdminRootProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Admin-facing root component for the Security microfrontend.
|
|
5
|
+
*
|
|
6
|
+
* Renders governance/oversight pages (audit, dashboard, access review,
|
|
7
|
+
* providers, import/export) plus vault management for administrative inspection.
|
|
8
|
+
* Used by admin-app.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { SecurityAdminRoot } from '@burdenoff/micro-fe/security';
|
|
13
|
+
*
|
|
14
|
+
* <SecurityAdminRoot basePath="/security" {...contentMfeProps} />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const SecurityAdminRoot: FC<SecurityAdminRootProps>;
|
|
@@ -2,14 +2,16 @@ import { useTr as e } from "./hooks/useTr.js";
|
|
|
2
2
|
import { SecurityRootBase as t } from "./SecurityRootBase.js";
|
|
3
3
|
import { SecurityAdminRoutes as n } from "./routes/SecurityAdminRoutes.js";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
var i = /* @__PURE__ */ r(n, {}), a = (n) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
// src/security/SecurityAdminRoot.tsx
|
|
6
|
+
var i = /* @__PURE__ */ r(n, {}), a = (n) => {
|
|
7
|
+
let a = e();
|
|
8
|
+
return /* @__PURE__ */ r(t, {
|
|
9
|
+
mode: "admin",
|
|
10
|
+
routes: i,
|
|
11
|
+
footerLabel: a("security.footer.statusAdmin", "Security Admin"),
|
|
12
|
+
...n
|
|
13
|
+
});
|
|
14
|
+
};
|
|
13
15
|
export { a as SecurityAdminRoot };
|
|
14
16
|
|
|
15
17
|
//# sourceMappingURL=SecurityAdminRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityAdminRoot.js","names":[],"sources":["../../src/security/SecurityAdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useTr } from './hooks/useTr';\nimport type { SecurityAdminRootProps } from './types';\nimport { SecurityRootBase } from './SecurityRootBase';\nimport { SecurityAdminRoutes } from './routes/SecurityAdminRoutes';\n\nconst routesElement = <SecurityAdminRoutes />;\n\n/**\n * Admin-facing root component for the Security microfrontend.\n *\n * Renders governance/oversight pages (audit, dashboard, access review,\n * providers, import/export) plus vault management for administrative inspection.\n * Used by admin-app.\n *\n * @example\n * ```tsx\n * import { SecurityAdminRoot } from '@burdenoff/micro-fe/security';\n *\n * <SecurityAdminRoot basePath=\"/security\" {...contentMfeProps} />\n * ```\n */\nexport const SecurityAdminRoot: FC<SecurityAdminRootProps> = (props) => {\n const tr = useTr();\n return (\n <SecurityRootBase\n mode=\"admin\"\n routes={routesElement}\n footerLabel={tr('security.footer.statusAdmin', 'Security Admin')}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"SecurityAdminRoot.js","names":["routesElement","SecurityAdminRoutes","SecurityAdminRoot","tr","useTr","SecurityRootBase","props"],"sources":["../../src/security/SecurityAdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useTr } from './hooks/useTr';\nimport type { SecurityAdminRootProps } from './types';\nimport { SecurityRootBase } from './SecurityRootBase';\nimport { SecurityAdminRoutes } from './routes/SecurityAdminRoutes';\n\nconst routesElement = <SecurityAdminRoutes />;\n\n/**\n * Admin-facing root component for the Security microfrontend.\n *\n * Renders governance/oversight pages (audit, dashboard, access review,\n * providers, import/export) plus vault management for administrative inspection.\n * Used by admin-app.\n *\n * @example\n * ```tsx\n * import { SecurityAdminRoot } from '@burdenoff/micro-fe/security';\n *\n * <SecurityAdminRoot basePath=\"/security\" {...contentMfeProps} />\n * ```\n */\nexport const SecurityAdminRoot: FC<SecurityAdminRootProps> = (props) => {\n const tr = useTr();\n return (\n <SecurityRootBase\n mode=\"admin\"\n routes={routesElement}\n footerLabel={tr('security.footer.statusAdmin', 'Security Admin')}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;AAMA,IAAMA,IAAgB,kBAACC,GAAD,CAAsB,CAAA,GAgB/BC,KAAiD,MAAU;CACtE,IAAMC,IAAKC,EAAM;CACjB,OACE,kBAACC,GAAD;EACE,MAAK;EACL,QAAQL;EACR,aAAaG,EAAG,+BAA+B,gBAAgB;EAC/D,GAAIG;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SecurityRootProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Root component for the Security microfrontend (backward-compatible, all routes).
|
|
5
|
+
*
|
|
6
|
+
* Renders all pages (user operational + admin governance).
|
|
7
|
+
* Kept for backward compatibility with existing consumers.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { SecurityRoot } from '@burdenoff/micro-fe/security';
|
|
12
|
+
*
|
|
13
|
+
* <SecurityRoot basePath="/security" {...props} />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const SecurityRoot: FC<SecurityRootProps>;
|
|
@@ -2,14 +2,16 @@ import { useTr as e } from "./hooks/useTr.js";
|
|
|
2
2
|
import { SecurityRootBase as t } from "./SecurityRootBase.js";
|
|
3
3
|
import { SecurityRoutes as n } from "./routes/SecurityRoutes.js";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
var i = /* @__PURE__ */ r(n, {}), a = (n) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
// src/security/SecurityRoot.tsx
|
|
6
|
+
var i = /* @__PURE__ */ r(n, {}), a = (n) => {
|
|
7
|
+
let a = e();
|
|
8
|
+
return /* @__PURE__ */ r(t, {
|
|
9
|
+
mode: "all",
|
|
10
|
+
routes: i,
|
|
11
|
+
footerLabel: a("security.footer.statusReady", "Security Ready"),
|
|
12
|
+
...n
|
|
13
|
+
});
|
|
14
|
+
};
|
|
13
15
|
export { a as SecurityRoot };
|
|
14
16
|
|
|
15
17
|
//# sourceMappingURL=SecurityRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityRoot.js","names":[],"sources":["../../src/security/SecurityRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useTr } from './hooks/useTr';\nimport type { SecurityRootProps } from './types';\nimport { SecurityRootBase } from './SecurityRootBase';\nimport { SecurityRoutes } from './routes/SecurityRoutes';\n\nconst routesElement = <SecurityRoutes />;\n\n/**\n * Root component for the Security microfrontend (backward-compatible, all routes).\n *\n * Renders all pages (user operational + admin governance).\n * Kept for backward compatibility with existing consumers.\n *\n * @example\n * ```tsx\n * import { SecurityRoot } from '@burdenoff/micro-fe/security';\n *\n * <SecurityRoot basePath=\"/security\" {...props} />\n * ```\n */\nexport const SecurityRoot: FC<SecurityRootProps> = (props) => {\n const tr = useTr();\n return (\n <SecurityRootBase\n mode=\"all\"\n routes={routesElement}\n footerLabel={tr('security.footer.statusReady', 'Security Ready')}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"SecurityRoot.js","names":["routesElement","SecurityRoutes","SecurityRoot","tr","useTr","SecurityRootBase","props"],"sources":["../../src/security/SecurityRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useTr } from './hooks/useTr';\nimport type { SecurityRootProps } from './types';\nimport { SecurityRootBase } from './SecurityRootBase';\nimport { SecurityRoutes } from './routes/SecurityRoutes';\n\nconst routesElement = <SecurityRoutes />;\n\n/**\n * Root component for the Security microfrontend (backward-compatible, all routes).\n *\n * Renders all pages (user operational + admin governance).\n * Kept for backward compatibility with existing consumers.\n *\n * @example\n * ```tsx\n * import { SecurityRoot } from '@burdenoff/micro-fe/security';\n *\n * <SecurityRoot basePath=\"/security\" {...props} />\n * ```\n */\nexport const SecurityRoot: FC<SecurityRootProps> = (props) => {\n const tr = useTr();\n return (\n <SecurityRootBase\n mode=\"all\"\n routes={routesElement}\n footerLabel={tr('security.footer.statusReady', 'Security Ready')}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;AAMA,IAAMA,IAAgB,kBAACC,GAAD,CAAiB,CAAA,GAe1BC,KAAuC,MAAU;CAC5D,IAAMC,IAAKC,EAAM;CACjB,OACE,kBAACC,GAAD;EACE,MAAK;EACL,QAAQL;EACR,aAAaG,EAAG,+BAA+B,gBAAgB;EAC/D,GAAIG;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { SecurityRootProps, SecurityMode } from './types';
|
|
3
|
+
interface SecurityRootBaseProps extends SecurityRootProps {
|
|
4
|
+
mode: SecurityMode;
|
|
5
|
+
routes: ReactNode;
|
|
6
|
+
footerLabel: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Shared base for all Security root components.
|
|
10
|
+
* Handles provider setup, nav/footer registration, and error boundary wrapping.
|
|
11
|
+
*
|
|
12
|
+
* Split into outer (ErrorBoundary + FeatureFlagProvider) and inner
|
|
13
|
+
* (SecurityRootBaseWithFeatureFlags consumes useFeatureFlag) so the hook
|
|
14
|
+
* always runs inside a provider — see comment on the inner component.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SecurityRootBase: FC<SecurityRootBaseProps>;
|
|
17
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SecurityProvider as e } from "./providers/SecurityProvider.js";
|
|
2
|
+
import { useTr as t } from "./hooks/useTr.js";
|
|
3
3
|
import { SECURITY_FEATURE_FLAGS as n } from "./constants/featureFlags.js";
|
|
4
4
|
import { getNavigationConfig as r } from "./config/navigation.js";
|
|
5
5
|
import { useEffect as i, useMemo as a } from "react";
|
|
@@ -7,9 +7,9 @@ import { ErrorBoundary as o } from "@burdenoff/fe-libs/shared/components";
|
|
|
7
7
|
import { FeatureFlagProvider as s } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
8
8
|
import { useFeatureFlag as c } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
9
|
import { jsx as l } from "react/jsx-runtime";
|
|
10
|
-
|
|
10
|
+
// src/security/SecurityRootBase.tsx
|
|
11
11
|
var u = ({ mode: o, routes: s, footerLabel: u, ...d }) => {
|
|
12
|
-
let { registerNavItems: f, registerFooterItems: p, basePath: m = "/" } = d, h = c(n.
|
|
12
|
+
let { registerNavItems: f, registerFooterItems: p, basePath: m = "/" } = d, h = c(n.VAULT_INTEGRATIONS, !1), g = t(), _ = a(() => {
|
|
13
13
|
let e = r(m, o, g);
|
|
14
14
|
if (h || !e.children) return e;
|
|
15
15
|
let t = (e) => e.filter((e) => e.id !== "security-providers");
|
|
@@ -33,26 +33,25 @@ var u = ({ mode: o, routes: s, footerLabel: u, ...d }) => {
|
|
|
33
33
|
order: 10,
|
|
34
34
|
section: "left"
|
|
35
35
|
}]);
|
|
36
|
-
}, [p, u]), /* @__PURE__ */ l(
|
|
36
|
+
}, [p, u]), /* @__PURE__ */ l(e, {
|
|
37
37
|
...d,
|
|
38
38
|
children: s
|
|
39
39
|
});
|
|
40
|
-
}, d = (
|
|
41
|
-
let { workspaceId: n, mode: r } = t;
|
|
40
|
+
}, d = (e) => {
|
|
41
|
+
let { workspaceId: n, mode: r } = e, i = t();
|
|
42
42
|
return /* @__PURE__ */ l(o, {
|
|
43
43
|
fallback: /* @__PURE__ */ l("div", {
|
|
44
44
|
className: "p-6 text-center text-text-secondary",
|
|
45
|
-
children:
|
|
45
|
+
children: i("security.errorBoundary.message", "Something went wrong loading this module. Please refresh the page.")
|
|
46
46
|
}),
|
|
47
47
|
children: /* @__PURE__ */ l(s, {
|
|
48
48
|
workspaceId: n ?? null,
|
|
49
49
|
gateway: "global",
|
|
50
50
|
defaultEnabled: r === "user",
|
|
51
|
-
children: /* @__PURE__ */ l(u, { ...
|
|
51
|
+
children: /* @__PURE__ */ l(u, { ...e })
|
|
52
52
|
})
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
-
//#endregion
|
|
56
55
|
export { d as SecurityRootBase };
|
|
57
56
|
|
|
58
57
|
//# sourceMappingURL=SecurityRootBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityRootBase.js","names":[],"sources":["../../src/security/SecurityRootBase.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { useEffect, useMemo } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { SecurityProvider } from './providers/SecurityProvider';\nimport { useTr } from './hooks/useTr';\nimport type { NavItem, SecurityRootProps, SecurityMode } from './types';\nimport { SECURITY_FEATURE_FLAGS } from './constants/featureFlags';\nimport { getNavigationConfig } from './config/navigation';\n\ninterface SecurityRootBaseProps extends SecurityRootProps {\n mode: SecurityMode;\n routes: ReactNode;\n footerLabel: string;\n}\n\n/**\n * Inner component — runs *inside* `<FeatureFlagProvider>` so `useFeatureFlag`\n * always has a parent provider to read from. Prior to the split, the hook was\n * called above the provider, which threw in dev/test entry paths that didn't\n * have a shell-level feature-flag provider mounted above the MFE.\n */\nconst SecurityRootBaseWithFeatureFlags: FC<SecurityRootBaseProps> = ({\n mode,\n routes,\n footerLabel,\n ...props\n}) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const providersEnabled = useFeatureFlag(SECURITY_FEATURE_FLAGS.
|
|
1
|
+
{"version":3,"file":"SecurityRootBase.js","names":["SecurityRootBaseWithFeatureFlags","props","providersEnabled","useFeatureFlag","SECURITY_FEATURE_FLAGS","tr","useTr","filteredNavItem","useMemo","navItem","getNavigationConfig","basePath","mode","filterProviders","items","c","useEffect","registerNavItems","registerFooterItems","footerLabel","SecurityProvider","routes","SecurityRootBase","ErrorBoundary","FeatureFlagProvider","workspaceId"],"sources":["../../src/security/SecurityRootBase.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { useEffect, useMemo } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { SecurityProvider } from './providers/SecurityProvider';\nimport { useTr } from './hooks/useTr';\nimport type { NavItem, SecurityRootProps, SecurityMode } from './types';\nimport { SECURITY_FEATURE_FLAGS } from './constants/featureFlags';\nimport { getNavigationConfig } from './config/navigation';\n\ninterface SecurityRootBaseProps extends SecurityRootProps {\n mode: SecurityMode;\n routes: ReactNode;\n footerLabel: string;\n}\n\n/**\n * Inner component — runs *inside* `<FeatureFlagProvider>` so `useFeatureFlag`\n * always has a parent provider to read from. Prior to the split, the hook was\n * called above the provider, which threw in dev/test entry paths that didn't\n * have a shell-level feature-flag provider mounted above the MFE.\n */\nconst SecurityRootBaseWithFeatureFlags: FC<SecurityRootBaseProps> = ({\n mode,\n routes,\n footerLabel,\n ...props\n}) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const providersEnabled = useFeatureFlag(SECURITY_FEATURE_FLAGS.VAULT_INTEGRATIONS, false);\n const tr = useTr();\n\n // Strip the Providers child when the flag is off — otherwise admins see a\n // clickable nav link that silently redirects to the security home.\n const filteredNavItem = useMemo(() => {\n const navItem = getNavigationConfig(basePath, mode, tr);\n if (providersEnabled || !navItem.children) return navItem;\n const filterProviders = (items: NavItem[]): NavItem[] =>\n items.filter((c) => c.id !== 'security-providers');\n return { ...navItem, children: filterProviders(navItem.children) };\n }, [basePath, mode, providersEnabled, tr]);\n\n useEffect(() => {\n if (!registerNavItems) return;\n const cleanup = registerNavItems(filteredNavItem);\n return cleanup;\n }, [registerNavItems, filteredNavItem]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'security-status',\n label: footerLabel,\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, footerLabel]);\n\n return <SecurityProvider {...props}>{routes}</SecurityProvider>;\n};\n\n/**\n * Shared base for all Security root components.\n * Handles provider setup, nav/footer registration, and error boundary wrapping.\n *\n * Split into outer (ErrorBoundary + FeatureFlagProvider) and inner\n * (SecurityRootBaseWithFeatureFlags consumes useFeatureFlag) so the hook\n * always runs inside a provider — see comment on the inner component.\n */\nexport const SecurityRootBase: FC<SecurityRootBaseProps> = (props) => {\n const { workspaceId, mode } = props;\n const tr = useTr();\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n {tr(\n 'security.errorBoundary.message',\n 'Something went wrong loading this module. Please refresh the page.'\n )}\n </div>\n }\n >\n <FeatureFlagProvider\n workspaceId={workspaceId ?? null}\n gateway=\"global\"\n defaultEnabled={mode === 'user'}\n >\n <SecurityRootBaseWithF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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SecurityUserRootProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* User-facing root component for the Security microfrontend.
|
|
5
|
+
*
|
|
6
|
+
* Renders only vault/secret operational pages (CRUD).
|
|
7
|
+
* Used by product app shells (vibecontrols-app, bigconsole, etc.).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { SecurityUserRoot } from '@burdenoff/micro-fe/security';
|
|
12
|
+
*
|
|
13
|
+
* <SecurityUserRoot basePath="/security" {...workspaceBaseProps} />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const SecurityUserRoot: FC<SecurityUserRootProps>;
|
|
@@ -2,14 +2,16 @@ import { useTr as e } from "./hooks/useTr.js";
|
|
|
2
2
|
import { SecurityRootBase as t } from "./SecurityRootBase.js";
|
|
3
3
|
import { SecurityUserRoutes as n } from "./routes/SecurityUserRoutes.js";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
var i = /* @__PURE__ */ r(n, {}), a = (n) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
// src/security/SecurityUserRoot.tsx
|
|
6
|
+
var i = /* @__PURE__ */ r(n, {}), a = (n) => {
|
|
7
|
+
let a = e();
|
|
8
|
+
return /* @__PURE__ */ r(t, {
|
|
9
|
+
mode: "user",
|
|
10
|
+
routes: i,
|
|
11
|
+
footerLabel: a("security.footer.statusReady", "Security Ready"),
|
|
12
|
+
...n
|
|
13
|
+
});
|
|
14
|
+
};
|
|
13
15
|
export { a as SecurityUserRoot };
|
|
14
16
|
|
|
15
17
|
//# sourceMappingURL=SecurityUserRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityUserRoot.js","names":[],"sources":["../../src/security/SecurityUserRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useTr } from './hooks/useTr';\nimport type { SecurityUserRootProps } from './types';\nimport { SecurityRootBase } from './SecurityRootBase';\nimport { SecurityUserRoutes } from './routes/SecurityUserRoutes';\n\nconst routesElement = <SecurityUserRoutes />;\n\n/**\n * User-facing root component for the Security microfrontend.\n *\n * Renders only vault/secret operational pages (CRUD).\n * Used by product app shells (vibecontrols-app, bigconsole, etc.).\n *\n * @example\n * ```tsx\n * import { SecurityUserRoot } from '@burdenoff/micro-fe/security';\n *\n * <SecurityUserRoot basePath=\"/security\" {...workspaceBaseProps} />\n * ```\n */\nexport const SecurityUserRoot: FC<SecurityUserRootProps> = (props) => {\n const tr = useTr();\n return (\n <SecurityRootBase\n mode=\"user\"\n routes={routesElement}\n footerLabel={tr('security.footer.statusReady', 'Security Ready')}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"SecurityUserRoot.js","names":["routesElement","SecurityUserRoutes","SecurityUserRoot","tr","useTr","SecurityRootBase","props"],"sources":["../../src/security/SecurityUserRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useTr } from './hooks/useTr';\nimport type { SecurityUserRootProps } from './types';\nimport { SecurityRootBase } from './SecurityRootBase';\nimport { SecurityUserRoutes } from './routes/SecurityUserRoutes';\n\nconst routesElement = <SecurityUserRoutes />;\n\n/**\n * User-facing root component for the Security microfrontend.\n *\n * Renders only vault/secret operational pages (CRUD).\n * Used by product app shells (vibecontrols-app, bigconsole, etc.).\n *\n * @example\n * ```tsx\n * import { SecurityUserRoot } from '@burdenoff/micro-fe/security';\n *\n * <SecurityUserRoot basePath=\"/security\" {...workspaceBaseProps} />\n * ```\n */\nexport const SecurityUserRoot: FC<SecurityUserRootProps> = (props) => {\n const tr = useTr();\n return (\n <SecurityRootBase\n mode=\"user\"\n routes={routesElement}\n footerLabel={tr('security.footer.statusReady', 'Security Ready')}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;AAMA,IAAMA,IAAgB,kBAACC,GAAD,CAAqB,CAAA,GAe9BC,KAA+C,MAAU;CACpE,IAAMC,IAAKC,EAAM;CACjB,OACE,kBAACC,GAAD;EACE,MAAK;EACL,QAAQL;EACR,aAAaG,EAAG,+BAA+B,gBAAgB;EAC/D,GAAIG;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface ActivityTimelineProps {
|
|
3
|
+
entries: Array<Record<string, unknown>>;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Vertical timeline of recent audit activity events.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ActivityTimeline: FC<ActivityTimelineProps>;
|
|
10
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
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 { Activity as i, Edit2 as a, Eye as o, Lock as s, Plus as c, RefreshCw as l, Trash2 as u, Unlock as d, UserMinus as f, UserPlus as p } from "lucide-react";
|
|
5
|
-
|
|
5
|
+
// src/security/components/ActivityTimeline.tsx
|
|
6
6
|
var m = {
|
|
7
7
|
"vault.created": {
|
|
8
8
|
icon: c,
|
|
@@ -71,20 +71,20 @@ var g = (e) => ({
|
|
|
71
71
|
"member.added": "activityTimeline.action.memberAdded",
|
|
72
72
|
"member.removed": "activityTimeline.action.memberRemoved"
|
|
73
73
|
})[e] ?? e, _ = ({ entries: a, className: o }) => {
|
|
74
|
-
let s =
|
|
74
|
+
let s = t();
|
|
75
75
|
return /* @__PURE__ */ r("div", {
|
|
76
|
-
className:
|
|
76
|
+
className: e("relative", o),
|
|
77
77
|
children: [/* @__PURE__ */ n("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ n("div", {
|
|
78
78
|
className: "space-y-4",
|
|
79
|
-
children: a.map((
|
|
80
|
-
let a =
|
|
79
|
+
children: a.map((t) => {
|
|
80
|
+
let a = t.action, o = m[a] ?? {
|
|
81
81
|
icon: i,
|
|
82
82
|
color: "text-text-secondary bg-bg-sunken"
|
|
83
83
|
}, c = o.icon, l = g(a);
|
|
84
84
|
return /* @__PURE__ */ r("div", {
|
|
85
85
|
className: "relative flex items-start gap-3 pl-1",
|
|
86
86
|
children: [/* @__PURE__ */ n("div", {
|
|
87
|
-
className:
|
|
87
|
+
className: e("relative z-10 p-1.5 rounded-full shrink-0", o.color),
|
|
88
88
|
children: /* @__PURE__ */ n(c, { className: "size-3" })
|
|
89
89
|
}), /* @__PURE__ */ r("div", {
|
|
90
90
|
className: "flex-1 min-w-0 pt-0.5",
|
|
@@ -93,34 +93,33 @@ var g = (e) => ({
|
|
|
93
93
|
children: [
|
|
94
94
|
/* @__PURE__ */ n("span", {
|
|
95
95
|
className: "font-medium",
|
|
96
|
-
children:
|
|
96
|
+
children: t.actorId
|
|
97
97
|
}),
|
|
98
98
|
" ",
|
|
99
99
|
/* @__PURE__ */ n("span", {
|
|
100
100
|
className: "text-text-secondary",
|
|
101
101
|
children: s(`security.${l}`, a.replace(".", " "))
|
|
102
102
|
}),
|
|
103
|
-
|
|
103
|
+
t.entityId ? /* @__PURE__ */ r("span", {
|
|
104
104
|
className: "font-medium",
|
|
105
105
|
children: [
|
|
106
106
|
" ",
|
|
107
|
-
|
|
107
|
+
t.entityType ? String(t.entityType) : s("security.activityTimeline.resource", "resource"),
|
|
108
108
|
":",
|
|
109
|
-
String(
|
|
109
|
+
String(t.entityId)
|
|
110
110
|
]
|
|
111
111
|
}) : null
|
|
112
112
|
]
|
|
113
113
|
}), /* @__PURE__ */ n("p", {
|
|
114
114
|
className: "text-xs text-text-secondary mt-0.5",
|
|
115
|
-
children: h(
|
|
115
|
+
children: h(t.timestamp, s)
|
|
116
116
|
})]
|
|
117
117
|
})]
|
|
118
|
-
},
|
|
118
|
+
}, t.id);
|
|
119
119
|
})
|
|
120
120
|
})]
|
|
121
121
|
});
|
|
122
122
|
};
|
|
123
|
-
//#endregion
|
|
124
123
|
export { _ as ActivityTimeline };
|
|
125
124
|
|
|
126
125
|
//# sourceMappingURL=ActivityTimeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityTimeline.js","names":[],"sources":["../../../src/security/components/ActivityTimeline.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport {\n Lock,\n Unlock,\n Plus,\n Edit2,\n Trash2,\n Eye,\n RefreshCw,\n UserPlus,\n UserMinus,\n Activity,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks/useTr';\n\ninterface ActivityTimelineProps {\n entries: Array<Record<string, unknown>>;\n className?: string;\n}\n\nconst actionIconMap: Record<string, { icon: typeof Activity; color: string }> = {\n 'vault.created': { icon: Plus, color: 'text-status-success-text bg-status-success-bg-subtle' },\n 'vault.updated': { icon: Edit2, color: 'text-status-info-text bg-status-info-bg-subtle' },\n 'vault.deleted': { icon: Trash2, color: 'text-status-error-text bg-status-error-bg-subtle' },\n 'vault.locked': { icon: Lock, color: 'text-status-warning-text bg-status-warning-bg-subtle' },\n 'vault.unlocked': { icon: Unlock, color: 'text-status-success-text bg-status-success-bg-subtle' },\n 'secret.created': { icon: Plus, color: 'text-status-success-text bg-status-success-bg-subtle' },\n 'secret.updated': { icon: Edit2, color: 'text-status-info-text bg-status-info-bg-subtle' },\n 'secret.deleted': { icon: Trash2, color: 'text-status-error-text bg-status-error-bg-subtle' },\n 'secret.accessed': { icon: Eye, color: 'text-accent-purple bg-accent-purple-subtle' },\n 'secret.rotated': { icon: RefreshCw, color: 'text-accent-cyan bg-accent-cyan-subtle' },\n 'member.added': { icon: UserPlus, color: 'text-status-success-text bg-status-success-bg-subtle' },\n 'member.removed': { icon: UserMinus, color: 'text-status-error-text bg-status-error-bg-subtle' },\n};\n\nfunction formatRelativeTime(dateStr: string, tr: ReturnType<typeof useTr>): string {\n const now = new Date();\n const date = new Date(dateStr);\n const diffMs = now.getTime() - date.getTime();\n const diffMins = Math.floor(diffMs / 60000);\n const diffHours = Math.floor(diffMins / 60);\n const diffDays = Math.floor(diffHours / 24);\n\n if (diffMins < 1) return tr('security.activityTimeline.justNow', 'just now');\n if (diffMins < 60)\n return tr('security.activityTimeline.minutesAgo', '{{count}}m ago', { count: diffMins });\n if (diffHours < 24)\n return tr('security.activityTimeline.hoursAgo', '{{count}}h ago', { count: diffHours });\n if (diffDays < 7)\n return tr('security.activityTimeline.daysAgo', '{{count}}d ago', { count: diffDays });\n return date.toLocaleDateString();\n}\n\nconst actionTranslationKey = (action: string): string => {\n const map: Record<string, string> = {\n 'vault.created': 'activityTimeline.action.vaultCreated',\n 'vault.updated': 'activityTimeline.action.vaultUpdated',\n 'vault.deleted': 'activityTimeline.action.vaultDeleted',\n 'vault.locked': 'activityTimeline.action.vaultLocked',\n 'vault.unlocked': 'activityTimeline.action.vaultUnlocked',\n 'secret.created': 'activityTimeline.action.secretCreated',\n 'secret.updated': 'activityTimeline.action.secretUpdated',\n 'secret.deleted': 'activityTimeline.action.secretDeleted',\n 'secret.accessed': 'activityTimeline.action.secretAccessed',\n 'secret.rotated': 'activityTimeline.action.secretRotated',\n 'member.added': 'activityTimeline.action.memberAdded',\n 'member.removed': 'activityTimeline.action.memberRemoved',\n };\n return map[action] ?? action;\n};\n\n/**\n * Vertical timeline of recent audit activity events.\n */\nexport const ActivityTimeline: FC<ActivityTimelineProps> = ({ entries, className }) => {\n const tr = useTr();\n\n return (\n <div className={cn('relative', className)}>\n {/* Vertical line */}\n <div className=\"absolute left-4 top-2 bottom-2 w-px bg-border\" />\n\n <div className=\"space-y-4\">\n {entries.map((entry) => {\n const action = entry.action as string;\n const config = actionIconMap[action] ?? {\n icon: Activity,\n color: 'text-text-secondary bg-bg-sunken',\n };\n const Icon = config.icon;\n const actionKey = actionTranslationKey(action);\n\n return (\n <div key={entry.id as string} className=\"relative flex items-start gap-3 pl-1\">\n {/* Timeline dot */}\n <div className={cn('relative z-10 p-1.5 rounded-full shrink-0', config.color)}>\n <Icon className=\"size-3\" />\n </div>\n\n {/* Content */}\n <div className=\"flex-1 min-w-0 pt-0.5\">\n <p className=\"text-sm text-text-primary\">\n <span className=\"font-medium\">{entry.actorId as string}</span>{' '}\n <span className=\"text-text-secondary\">\n {tr(`security.${actionKey}`, action.replace('.', ' '))}\n </span>\n {entry.entityId ? (\n <span className=\"font-medium\">\n {' '}\n {entry.entityType\n ? String(entry.entityType)\n : tr('security.activityTimeline.resource', 'resource')}\n :{String(entry.entityId)}\n </span>\n ) : null}\n </p>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {formatRelativeTime(entry.timestamp as string, tr)}\n </p>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;AAqBA,
|
|
1
|
+
{"version":3,"file":"ActivityTimeline.js","names":["actionIconMap","Plus","Edit2","Trash2","Lock","Unlock","Eye","RefreshCw","UserPlus","UserMinus","formatRelativeTime","now","date","dateStr","diffMs","diffMins","diffHours","diffDays","tr","actionTranslationKey","action","ActivityTimeline","useTr","cn","className","entries","entry","config","Activity","Icon","actionKey"],"sources":["../../../src/security/components/ActivityTimeline.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport {\n Lock,\n Unlock,\n Plus,\n Edit2,\n Trash2,\n Eye,\n RefreshCw,\n UserPlus,\n UserMinus,\n Activity,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks/useTr';\n\ninterface ActivityTimelineProps {\n entries: Array<Record<string, unknown>>;\n className?: string;\n}\n\nconst actionIconMap: Record<string, { icon: typeof Activity; color: string }> = {\n 'vault.created': { icon: Plus, color: 'text-status-success-text bg-status-success-bg-subtle' },\n 'vault.updated': { icon: Edit2, color: 'text-status-info-text bg-status-info-bg-subtle' },\n 'vault.deleted': { icon: Trash2, color: 'text-status-error-text bg-status-error-bg-subtle' },\n 'vault.locked': { icon: Lock, color: 'text-status-warning-text bg-status-warning-bg-subtle' },\n 'vault.unlocked': { icon: Unlock, color: 'text-status-success-text bg-status-success-bg-subtle' },\n 'secret.created': { icon: Plus, color: 'text-status-success-text bg-status-success-bg-subtle' },\n 'secret.updated': { icon: Edit2, color: 'text-status-info-text bg-status-info-bg-subtle' },\n 'secret.deleted': { icon: Trash2, color: 'text-status-error-text bg-status-error-bg-subtle' },\n 'secret.accessed': { icon: Eye, color: 'text-accent-purple bg-accent-purple-subtle' },\n 'secret.rotated': { icon: RefreshCw, color: 'text-accent-cyan bg-accent-cyan-subtle' },\n 'member.added': { icon: UserPlus, color: 'text-status-success-text bg-status-success-bg-subtle' },\n 'member.removed': { icon: UserMinus, color: 'text-status-error-text bg-status-error-bg-subtle' },\n};\n\nfunction formatRelativeTime(dateStr: string, tr: ReturnType<typeof useTr>): string {\n const now = new Date();\n const date = new Date(dateStr);\n const diffMs = now.getTime() - date.getTime();\n const diffMins = Math.floor(diffMs / 60000);\n const diffHours = Math.floor(diffMins / 60);\n const diffDays = Math.floor(diffHours / 24);\n\n if (diffMins < 1) return tr('security.activityTimeline.justNow', 'just now');\n if (diffMins < 60)\n return tr('security.activityTimeline.minutesAgo', '{{count}}m ago', { count: diffMins });\n if (diffHours < 24)\n return tr('security.activityTimeline.hoursAgo', '{{count}}h ago', { count: diffHours });\n if (diffDays < 7)\n return tr('security.activityTimeline.daysAgo', '{{count}}d ago', { count: diffDays });\n return date.toLocaleDateString();\n}\n\nconst actionTranslationKey = (action: string): string => {\n const map: Record<string, string> = {\n 'vault.created': 'activityTimeline.action.vaultCreated',\n 'vault.updated': 'activityTimeline.action.vaultUpdated',\n 'vault.deleted': 'activityTimeline.action.vaultDeleted',\n 'vault.locked': 'activityTimeline.action.vaultLocked',\n 'vault.unlocked': 'activityTimeline.action.vaultUnlocked',\n 'secret.created': 'activityTimeline.action.secretCreated',\n 'secret.updated': 'activityTimeline.action.secretUpdated',\n 'secret.deleted': 'activityTimeline.action.secretDeleted',\n 'secret.accessed': 'activityTimeline.action.secretAccessed',\n 'secret.rotated': 'activityTimeline.action.secretRotated',\n 'member.added': 'activityTimeline.action.memberAdded',\n 'member.removed': 'activityTimeline.action.memberRemoved',\n };\n return map[action] ?? action;\n};\n\n/**\n * Vertical timeline of recent audit activity events.\n */\nexport const ActivityTimeline: FC<ActivityTimelineProps> = ({ entries, className }) => {\n const tr = useTr();\n\n return (\n <div className={cn('relative', className)}>\n {/* Vertical line */}\n <div className=\"absolute left-4 top-2 bottom-2 w-px bg-border\" />\n\n <div className=\"space-y-4\">\n {entries.map((entry) => {\n const action = entry.action as string;\n const config = actionIconMap[action] ?? {\n icon: Activity,\n color: 'text-text-secondary bg-bg-sunken',\n };\n const Icon = config.icon;\n const actionKey = actionTranslationKey(action);\n\n return (\n <div key={entry.id as string} className=\"relative flex items-start gap-3 pl-1\">\n {/* Timeline dot */}\n <div className={cn('relative z-10 p-1.5 rounded-full shrink-0', config.color)}>\n <Icon className=\"size-3\" />\n </div>\n\n {/* Content */}\n <div className=\"flex-1 min-w-0 pt-0.5\">\n <p className=\"text-sm text-text-primary\">\n <span className=\"font-medium\">{entry.actorId as string}</span>{' '}\n <span className=\"text-text-secondary\">\n {tr(`security.${actionKey}`, action.replace('.', ' '))}\n </span>\n {entry.entityId ? (\n <span className=\"font-medium\">\n {' '}\n {entry.entityType\n ? String(entry.entityType)\n : tr('security.activityTimeline.resource', 'resource')}\n :{String(entry.entityId)}\n </span>\n ) : null}\n </p>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {formatRelativeTime(entry.timestamp as string, tr)}\n </p>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;AAqBA,IAAMA,IAA0E;CAC9E,iBAAiB;EAAE,MAAMC;EAAM,OAAO;CAAuD;CAC7F,iBAAiB;EAAE,MAAMC;EAAO,OAAO;CAAiD;CACxF,iBAAiB;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
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { Badge as t, Button as n } from "./ui.js";
|
|
3
|
+
import { useBulkSecretOperations as r } from "../hooks/useBulkSecretOperations.js";
|
|
4
|
+
import { useSecurityEventEmitter as i } from "../hooks/useSecurityEventEmitter.js";
|
|
5
|
+
import { useSecurityStore as a } from "../store/securityStore.js";
|
|
6
|
+
import { ConfirmDialog as o } from "./ConfirmDialog.js";
|
|
7
|
+
import { useTr as s } from "../hooks/useTr.js";
|
|
8
8
|
import { useState as c } from "react";
|
|
9
9
|
import { usePermission as l } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
10
10
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
11
|
import { FolderInput as p, Loader2 as m, Tag as h, Trash2 as g, X as _ } from "lucide-react";
|
|
12
|
-
|
|
12
|
+
// src/security/components/BulkActionBar.tsx
|
|
13
13
|
var v = ({ vaultId: v, className: y }) => {
|
|
14
|
-
let b =
|
|
14
|
+
let b = s(), x = a((e) => e.selectedSecretIds.length), S = a((e) => e.clearSecretSelection), { bulkDeleteSecrets: C, bulkMoveSecrets: w, bulkLabelSecrets: T, loading: E } = r(), { emit: D } = i(), O = l("secret:delete"), k = l("secret:update"), [A, j] = c(!1);
|
|
15
15
|
return x === 0 ? null : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("div", {
|
|
16
|
-
className:
|
|
16
|
+
className: e("flex items-center justify-between gap-3 px-4 py-3 rounded-lg", "bg-action-primary-bg/5 border border-primary/20", "animate-in slide-in-from-bottom-2 duration-200", y),
|
|
17
17
|
children: [/* @__PURE__ */ f("div", {
|
|
18
18
|
className: "flex items-center gap-2",
|
|
19
|
-
children: [/* @__PURE__ */ d(
|
|
19
|
+
children: [/* @__PURE__ */ d(t, {
|
|
20
20
|
variant: "default",
|
|
21
21
|
children: b("security.bulkActionBar.selected", "{{count}} selected", { count: x })
|
|
22
22
|
}), /* @__PURE__ */ d("button", {
|
|
@@ -31,27 +31,27 @@ var v = ({ vaultId: v, className: y }) => {
|
|
|
31
31
|
className: "flex items-center gap-2",
|
|
32
32
|
children: [
|
|
33
33
|
E && /* @__PURE__ */ d(m, { className: "size-4 animate-spin text-text-secondary" }),
|
|
34
|
-
k && /* @__PURE__ */ f(
|
|
34
|
+
k && /* @__PURE__ */ f(n, {
|
|
35
35
|
variant: "outline",
|
|
36
36
|
size: "sm",
|
|
37
37
|
disabled: E,
|
|
38
38
|
onClick: () => {
|
|
39
39
|
let e = prompt(b("security.bulkActionBar.labelPrompt", "Enter label to apply:"));
|
|
40
40
|
if (e) {
|
|
41
|
-
let t =
|
|
41
|
+
let t = a.getState().selectedSecretIds;
|
|
42
42
|
T(t, e), S();
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
children: [/* @__PURE__ */ d(h, { className: "size-3.5" }), b("security.bulkActionBar.label", "Label")]
|
|
46
46
|
}),
|
|
47
|
-
k && /* @__PURE__ */ f(
|
|
47
|
+
k && /* @__PURE__ */ f(n, {
|
|
48
48
|
variant: "outline",
|
|
49
49
|
size: "sm",
|
|
50
50
|
disabled: E,
|
|
51
51
|
onClick: () => {
|
|
52
52
|
let e = prompt(b("security.bulkActionBar.movePrompt", "Enter target vault ID:"));
|
|
53
53
|
if (e) {
|
|
54
|
-
let t =
|
|
54
|
+
let t = a.getState().selectedSecretIds;
|
|
55
55
|
w(t, e), t.forEach((e) => D("secret.updated", {
|
|
56
56
|
secretId: e,
|
|
57
57
|
vaultId: v
|
|
@@ -60,7 +60,7 @@ var v = ({ vaultId: v, className: y }) => {
|
|
|
60
60
|
},
|
|
61
61
|
children: [/* @__PURE__ */ d(p, { className: "size-3.5" }), b("security.bulkActionBar.move", "Move")]
|
|
62
62
|
}),
|
|
63
|
-
O && /* @__PURE__ */ f(
|
|
63
|
+
O && /* @__PURE__ */ f(n, {
|
|
64
64
|
variant: "destructive",
|
|
65
65
|
size: "sm",
|
|
66
66
|
disabled: E,
|
|
@@ -69,11 +69,11 @@ var v = ({ vaultId: v, className: y }) => {
|
|
|
69
69
|
})
|
|
70
70
|
]
|
|
71
71
|
})]
|
|
72
|
-
}), /* @__PURE__ */ d(
|
|
72
|
+
}), /* @__PURE__ */ d(o, {
|
|
73
73
|
isOpen: A,
|
|
74
74
|
onClose: () => j(!1),
|
|
75
75
|
onConfirm: async () => {
|
|
76
|
-
let e =
|
|
76
|
+
let e = a.getState().selectedSecretIds;
|
|
77
77
|
await C(e), e.forEach((e) => D("secret.deleted", {
|
|
78
78
|
secretId: e,
|
|
79
79
|
vaultId: v
|
|
@@ -88,7 +88,6 @@ var v = ({ vaultId: v, className: y }) => {
|
|
|
88
88
|
variant: "destructive"
|
|
89
89
|
})] });
|
|
90
90
|
};
|
|
91
|
-
//#endregion
|
|
92
91
|
export { v as BulkActionBar };
|
|
93
92
|
|
|
94
93
|
//# sourceMappingURL=BulkActionBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkActionBar.js","names":[],"sources":["../../../src/security/components/BulkActionBar.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useState } from 'react';\nimport { Trash2, FolderInput, Tag, X, Loader2 } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { Button, Badge } from './ui';\nimport { useBulkSecretOperations } from '../hooks/useBulkSecretOperations';\nimport { useSecurityEventEmitter } from '../hooks/useSecurityEventEmitter';\nimport { useSecurityStore } from '../store/securityStore';\nimport { ConfirmDialog } from './ConfirmDialog';\nimport { usePermission } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\n\ninterface BulkActionBarProps {\n vaultId: string;\n className?: string;\n}\n\nexport const BulkActionBar: FC<BulkActionBarProps> = ({ vaultId, className }) => {\n const tr = useTr();\n\n const selectedCount = useSecurityStore((s) => s.selectedSecretIds.length);\n const clearSelection = useSecurityStore((s) => s.clearSecretSelection);\n const { bulkDeleteSecrets, bulkMoveSecrets, bulkLabelSecrets, loading } =\n useBulkSecretOperations();\n const { emit } = useSecurityEventEmitter();\n\n const canDeleteSecret = usePermission('secret:delete');\n const canUpdateSecret = usePermission('secret:update');\n\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n\n if (selectedCount === 0) return null;\n\n return (\n <>\n <div\n className={cn(\n 'flex items-center justify-between gap-3 px-4 py-3 rounded-lg',\n 'bg-action-primary-bg/5 border border-primary/20',\n 'animate-in slide-in-from-bottom-2 duration-200',\n className\n )}\n >\n <div className=\"flex items-center gap-2\">\n <Badge variant=\"default\">\n {tr('security.bulkActionBar.selected', '{{count}} selected', { count: selectedCount })}\n </Badge>\n <button\n type=\"button\"\n onClick={clearSelection}\n className=\"p-1 rounded hover:bg-accent text-text-secondary\"\n title={tr('security.bulkActionBar.clearSelection', 'Clear selection')}\n aria-label={tr('security.bulkActionBar.clearSelection', 'Clear selection')}\n >\n <X className=\"size-4\" />\n </button>\n </div>\n\n <div className=\"flex items-center gap-2\">\n {loading && <Loader2 className=\"size-4 animate-spin text-text-secondary\" />}\n\n {canUpdateSecret && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={loading}\n onClick={() => {\n const label = prompt(\n tr('security.bulkActionBar.labelPrompt', 'Enter label to apply:')\n );\n if (label) {\n const selectedIds = useSecurityStore.getState().selectedSecretIds;\n bulkLabelSecrets(selectedIds, label);\n clearSelection();\n }\n }}\n >\n <Tag className=\"size-3.5\" />\n {tr('security.bulkActionBar.label', 'Label')}\n </Button>\n )}\n\n {canUpdateSecret && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={loading}\n onClick={() => {\n const targetId = prompt(\n tr('security.bulkActionBar.movePrompt', 'Enter target vault ID:')\n );\n if (targetId) {\n const selectedIds = useSecurityStore.getState().selectedSecretIds;\n bulkMoveSecrets(selectedIds, targetId);\n selectedIds.forEach((id) => emit('secret.updated', { secretId: id, vaultId }));\n clearSelection();\n }\n }}\n >\n <FolderInput className=\"size-3.5\" />\n {tr('security.bulkActionBar.move', 'Move')}\n </Button>\n )}\n\n {canDeleteSecret && (\n <Button\n variant=\"destructive\"\n size=\"sm\"\n disabled={loading}\n onClick={() => setShowDeleteConfirm(true)}\n >\n <Trash2 className=\"size-3.5\" />\n {tr('security.bulkActionBar.delete', 'Delete')}\n </Button>\n )}\n </div>\n </div>\n\n <ConfirmDialog\n isOpen={showDeleteConfirm}\n onClose={() => setShowDeleteConfirm(false)}\n onConfirm={async () => {\n const selectedIds = useSecurityStore.getState().selectedSecretIds;\n await bulkDeleteSecrets(selectedIds);\n selectedIds.forEach((id) => emit('secret.deleted', { secretId: id, vaultId }));\n setShowDeleteConfirm(false);\n clearSelection();\n }}\n title={tr('security.bulkActionBar.deleteConfirm.title', 'Delete Selected Secrets')}\n description={tr(\n 'security.bulkActionBar.deleteConfirm.description',\n 'Are you sure you want to delete {{count}} selected secret{{suffix}}? This action cannot be undone.',\n { count: selectedCount, suffix: selectedCount !== 1 ? 's' : '' }\n )}\n confirmLabel={tr('security.bulkActionBar.deleteConfirm.confirm', 'Delete All')}\n variant=\"destructive\"\n />\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAiBA,
|
|
1
|
+
{"version":3,"file":"BulkActionBar.js","names":["_Fragment","BulkActionBar","tr","useTr","selectedCount","useSecurityStore","s","clearSelection","useBulkSecretOperations","useSecurityEventEmitter","canDeleteSecret","usePermission","canUpdateSecret","showDeleteConfirm","setShowDeleteConfirm","useState","Fragment","cn","className","Badge","X","loading","Loader2","Button","label","selectedIds","bulkLabelSecrets","Tag","targetId","bulkMoveSecrets","emit","id","FolderInput","Trash2","ConfirmDialog","bulkDeleteSecrets"],"sources":["../../../src/security/components/BulkActionBar.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useState } from 'react';\nimport { Trash2, FolderInput, Tag, X, Loader2 } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { Button, Badge } from './ui';\nimport { useBulkSecretOperations } from '../hooks/useBulkSecretOperations';\nimport { useSecurityEventEmitter } from '../hooks/useSecurityEventEmitter';\nimport { useSecurityStore } from '../store/securityStore';\nimport { ConfirmDialog } from './ConfirmDialog';\nimport { usePermission } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\n\ninterface BulkActionBarProps {\n vaultId: string;\n className?: string;\n}\n\nexport const BulkActionBar: FC<BulkActionBarProps> = ({ vaultId, className }) => {\n const tr = useTr();\n\n const selectedCount = useSecurityStore((s) => s.selectedSecretIds.length);\n const clearSelection = useSecurityStore((s) => s.clearSecretSelection);\n const { bulkDeleteSecrets, bulkMoveSecrets, bulkLabelSecrets, loading } =\n useBulkSecretOperations();\n const { emit } = useSecurityEventEmitter();\n\n const canDeleteSecret = usePermission('secret:delete');\n const canUpdateSecret = usePermission('secret:update');\n\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n\n if (selectedCount === 0) return null;\n\n return (\n <>\n <div\n className={cn(\n 'flex items-center justify-between gap-3 px-4 py-3 rounded-lg',\n 'bg-action-primary-bg/5 border border-primary/20',\n 'animate-in slide-in-from-bottom-2 duration-200',\n className\n )}\n >\n <div className=\"flex items-center gap-2\">\n <Badge variant=\"default\">\n {tr('security.bulkActionBar.selected', '{{count}} selected', { count: selectedCount })}\n </Badge>\n <button\n type=\"button\"\n onClick={clearSelection}\n className=\"p-1 rounded hover:bg-accent text-text-secondary\"\n title={tr('security.bulkActionBar.clearSelection', 'Clear selection')}\n aria-label={tr('security.bulkActionBar.clearSelection', 'Clear selection')}\n >\n <X className=\"size-4\" />\n </button>\n </div>\n\n <div className=\"flex items-center gap-2\">\n {loading && <Loader2 className=\"size-4 animate-spin text-text-secondary\" />}\n\n {canUpdateSecret && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={loading}\n onClick={() => {\n const label = prompt(\n tr('security.bulkActionBar.labelPrompt', 'Enter label to apply:')\n );\n if (label) {\n const selectedIds = useSecurityStore.getState().selectedSecretIds;\n bulkLabelSecrets(selectedIds, label);\n clearSelection();\n }\n }}\n >\n <Tag className=\"size-3.5\" />\n {tr('security.bulkActionBar.label', 'Label')}\n </Button>\n )}\n\n {canUpdateSecret && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={loading}\n onClick={() => {\n const targetId = prompt(\n tr('security.bulkActionBar.movePrompt', 'Enter target vault ID:')\n );\n if (targetId) {\n const selectedIds = useSecurityStore.getState().selectedSecretIds;\n bulkMoveSecrets(selectedIds, targetId);\n selectedIds.forEach((id) => emit('secret.updated', { secretId: id, vaultId }));\n clearSelection();\n }\n }}\n >\n <FolderInput className=\"size-3.5\" />\n {tr('security.bulkActionBar.move', 'Move')}\n </Button>\n )}\n\n {canDeleteSecret && (\n <Button\n variant=\"destructive\"\n size=\"sm\"\n disabled={loading}\n onClick={() => setShowDeleteConfirm(true)}\n >\n <Trash2 className=\"size-3.5\" />\n {tr('security.bulkActionBar.delete', 'Delete')}\n </Button>\n )}\n </div>\n </div>\n\n <ConfirmDialog\n isOpen={showDeleteConfirm}\n onClose={() => setShowDeleteConfirm(false)}\n onConfirm={async () => {\n const selectedIds = useSecurityStore.getState().selectedSecretIds;\n await bulkDeleteSecrets(selectedIds);\n selectedIds.forEach((id) => emit('secret.deleted', { secretId: id, vaultId }));\n setShowDeleteConfirm(false);\n clearSelection();\n }}\n title={tr('security.bulkActionBar.deleteConfirm.title', 'Delete Selected Secrets')}\n description={tr(\n 'security.bulkActionBar.deleteConfirm.description',\n 'Are you sure you want to delete {{count}} selected secret{{suffix}}? This action cannot be undone.',\n { count: selectedCount, suffix: selectedCount !== 1 ? 's' : '' }\n )}\n confirmLabel={tr('security.bulkActionBar.deleteConfirm.confirm', 'Delete All')}\n variant=\"destructive\"\n />\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAiBA,IAAaC,KAAyC,EAAE,YAAS,mBAAgB;CAC/E,IAAMC,IAAKC,EAAM,GAEXC,IAAgBC,GAAkB,MA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void;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
confirmLabel?: string;
|
|
9
|
+
cancelLabel?: string;
|
|
10
|
+
variant?: 'default' | 'destructive';
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Generic confirmation dialog with customizable title, description, and variant.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ConfirmDialog: FC<ConfirmDialogProps>;
|
|
17
|
+
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
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 } from "lucide-react";
|
|
5
5
|
import { AlertDialog as a, AlertDialogAction as o, AlertDialogCancel as s, AlertDialogContent as c, AlertDialogDescription as l, AlertDialogFooter as u, AlertDialogHeader as d, AlertDialogTitle as f } from "@burdenoff/fe-libs/ui";
|
|
6
|
-
|
|
6
|
+
// src/security/components/ConfirmDialog.tsx
|
|
7
7
|
var p = ({ isOpen: p, onClose: m, onConfirm: h, title: g, description: _, confirmLabel: v, cancelLabel: y, variant: b = "default", className: x }) => {
|
|
8
|
-
let S =
|
|
8
|
+
let S = t(), C = v ?? S("security.confirmDialog.confirm", "Confirm"), w = y ?? S("security.confirmDialog.cancel", "Cancel");
|
|
9
9
|
return /* @__PURE__ */ n(a, {
|
|
10
10
|
open: p,
|
|
11
11
|
onOpenChange: (e) => {
|
|
12
12
|
e || m();
|
|
13
13
|
},
|
|
14
14
|
children: /* @__PURE__ */ r(c, {
|
|
15
|
-
className:
|
|
15
|
+
className: e("max-w-md", x),
|
|
16
16
|
children: [/* @__PURE__ */ n(d, { children: /* @__PURE__ */ r("div", {
|
|
17
17
|
className: "flex items-start gap-4",
|
|
18
18
|
children: [b === "destructive" && /* @__PURE__ */ n("div", {
|
|
@@ -36,7 +36,6 @@ var p = ({ isOpen: p, onClose: m, onConfirm: h, title: g, description: _, confir
|
|
|
36
36
|
})
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
|
-
//#endregion
|
|
40
39
|
export { p as ConfirmDialog };
|
|
41
40
|
|
|
42
41
|
//# sourceMappingURL=ConfirmDialog.js.map
|