@stratum-hq/react 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ConfigDriftIndicator.d.ts +9 -0
- package/dist/components/ConfigDriftIndicator.d.ts.map +1 -0
- package/dist/components/ConfigDriftIndicator.js +24 -0
- package/dist/components/ConfigDriftIndicator.js.map +1 -0
- package/dist/components/EmptyState.d.ts +12 -0
- package/dist/components/EmptyState.d.ts.map +1 -0
- package/dist/components/EmptyState.js +5 -0
- package/dist/components/EmptyState.js.map +1 -0
- package/dist/components/TenantHealthCard.d.ts +15 -0
- package/dist/components/TenantHealthCard.d.ts.map +1 -0
- package/dist/components/TenantHealthCard.js +12 -0
- package/dist/components/TenantHealthCard.js.map +1 -0
- package/dist/components/TenantThemeProvider.d.ts +14 -0
- package/dist/components/TenantThemeProvider.d.ts.map +1 -0
- package/dist/components/TenantThemeProvider.js +19 -0
- package/dist/components/TenantThemeProvider.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/default.css +1143 -0
- package/package.json +2 -1
- package/dist/components/ConfigEditor.stories.d.ts +0 -35
- package/dist/components/ConfigEditor.stories.d.ts.map +0 -1
- package/dist/components/ConfigEditor.stories.js +0 -73
- package/dist/components/ConfigEditor.stories.js.map +0 -1
- package/dist/components/PermissionEditor.stories.d.ts +0 -34
- package/dist/components/PermissionEditor.stories.d.ts.map +0 -1
- package/dist/components/PermissionEditor.stories.js +0 -90
- package/dist/components/PermissionEditor.stories.js.map +0 -1
- package/dist/components/Skeleton.stories.d.ts +0 -46
- package/dist/components/Skeleton.stories.d.ts.map +0 -1
- package/dist/components/Skeleton.stories.js +0 -125
- package/dist/components/Skeleton.stories.js.map +0 -1
- package/dist/components/TenantSwitcher.stories.d.ts +0 -30
- package/dist/components/TenantSwitcher.stories.d.ts.map +0 -1
- package/dist/components/TenantSwitcher.stories.js +0 -76
- package/dist/components/TenantSwitcher.stories.js.map +0 -1
- package/dist/components/TenantTree.stories.d.ts +0 -28
- package/dist/components/TenantTree.stories.d.ts.map +0 -1
- package/dist/components/TenantTree.stories.js +0 -71
- package/dist/components/TenantTree.stories.js.map +0 -1
- package/dist/components/Toast.stories.d.ts +0 -36
- package/dist/components/Toast.stories.d.ts.map +0 -1
- package/dist/components/Toast.stories.js +0 -105
- package/dist/components/Toast.stories.js.map +0 -1
- package/dist/components/storybook-helpers.d.ts +0 -96
- package/dist/components/storybook-helpers.d.ts.map +0 -1
- package/dist/components/storybook-helpers.js +0 -473
- package/dist/components/storybook-helpers.js.map +0 -1
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { TenantTree } from "./TenantTree.js";
|
|
3
|
-
import { MockStratumProvider, deepHierarchyTenants, singleRootTenant, } from "./storybook-helpers.js";
|
|
4
|
-
const meta = {
|
|
5
|
-
title: "Components/TenantTree",
|
|
6
|
-
component: TenantTree,
|
|
7
|
-
parameters: {
|
|
8
|
-
docs: {
|
|
9
|
-
description: {
|
|
10
|
-
component: "Interactive tree view of the tenant hierarchy. " +
|
|
11
|
-
"Nodes can be expanded/collapsed to reveal children. " +
|
|
12
|
-
"Displays RLS badges and archived status indicators.",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
decorators: [
|
|
17
|
-
(Story) => (_jsx(MockStratumProvider, { children: _jsx("div", { style: { padding: "24px", maxWidth: 500 }, children: _jsx(Story, {}) }) })),
|
|
18
|
-
],
|
|
19
|
-
};
|
|
20
|
-
export default meta;
|
|
21
|
-
/**
|
|
22
|
-
* Default 3-level hierarchy: Acme Corp -> MSSP/Direct channels ->
|
|
23
|
-
* MSPs and clients. Expand nodes to browse the tree.
|
|
24
|
-
*/
|
|
25
|
-
export const Default = {
|
|
26
|
-
args: {
|
|
27
|
-
onSelect: (id) => console.log("Selected tenant:", id),
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Loading state while the tenant tree is being fetched from the API.
|
|
32
|
-
*/
|
|
33
|
-
export const Loading = {
|
|
34
|
-
args: {},
|
|
35
|
-
decorators: [
|
|
36
|
-
(Story) => (_jsx(MockStratumProvider, { loading: true, children: _jsx("div", { style: { padding: "24px", maxWidth: 500 }, children: _jsx(Story, {}) }) })),
|
|
37
|
-
],
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Empty state when no tenants exist in the hierarchy.
|
|
41
|
-
*/
|
|
42
|
-
export const Empty = {
|
|
43
|
-
args: {},
|
|
44
|
-
decorators: [
|
|
45
|
-
(Story) => (_jsx(MockStratumProvider, { tenants: [], children: _jsx("div", { style: { padding: "24px", maxWidth: 500 }, children: _jsx(Story, {}) }) })),
|
|
46
|
-
],
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Deep 5-level hierarchy: Global Platform -> Region -> MSSP -> MSP -> Client.
|
|
50
|
-
* Tests indentation and readability at deep nesting levels.
|
|
51
|
-
*/
|
|
52
|
-
export const DeepHierarchy = {
|
|
53
|
-
args: {
|
|
54
|
-
onSelect: (id) => console.log("Selected tenant:", id),
|
|
55
|
-
},
|
|
56
|
-
decorators: [
|
|
57
|
-
(Story) => (_jsx(MockStratumProvider, { tenants: deepHierarchyTenants, children: _jsx("div", { style: { padding: "24px", maxWidth: 500 }, children: _jsx(Story, {}) }) })),
|
|
58
|
-
],
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Single root node with no children. Minimal tree display.
|
|
62
|
-
*/
|
|
63
|
-
export const SingleRootNode = {
|
|
64
|
-
args: {
|
|
65
|
-
onSelect: (id) => console.log("Selected tenant:", id),
|
|
66
|
-
},
|
|
67
|
-
decorators: [
|
|
68
|
-
(Story) => (_jsx(MockStratumProvider, { tenants: singleRootTenant, children: _jsx("div", { style: { padding: "24px", maxWidth: 500 }, children: _jsx(Story, {}) }) })),
|
|
69
|
-
],
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=TenantTree.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TenantTree.stories.js","sourceRoot":"","sources":["../../src/components/TenantTree.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,mBAAmB,EAEnB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,IAAI,GAA4B;IACpC,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,UAAU;IACrB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,SAAS,EACP,iDAAiD;oBACjD,sDAAsD;oBACtD,qDAAqD;aACxD;SACF;KACF;IACD,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,KAAC,mBAAmB,cAClB,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,YAC5C,KAAC,KAAK,KAAG,GACL,GACc,CACvB;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,QAAQ,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,CAAC;KAC9D;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,CACT,KAAC,mBAAmB,IAAC,OAAO,EAAE,IAAI,YAChC,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,YAC5C,KAAC,KAAK,KAAG,GACL,G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ast } from "./Toast.js";
|
|
3
|
-
declare const meta: Meta<typeof Toast>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Toast>;
|
|
6
|
-
/**
|
|
7
|
-
* Success toast — used after saving config, creating a tenant, etc.
|
|
8
|
-
* Auto-dismisses after 4 seconds.
|
|
9
|
-
*/
|
|
10
|
-
export declare const Success: Story;
|
|
11
|
-
/**
|
|
12
|
-
* Error toast — used for API failures, permission errors, etc.
|
|
13
|
-
* Does not auto-dismiss; requires manual close.
|
|
14
|
-
*/
|
|
15
|
-
export declare const Error: Story;
|
|
16
|
-
/**
|
|
17
|
-
* Warning toast — used for non-critical issues like approaching
|
|
18
|
-
* rate limits or deprecated config keys.
|
|
19
|
-
*/
|
|
20
|
-
export declare const Warning: Story;
|
|
21
|
-
/**
|
|
22
|
-
* Info toast — used for general notifications like tenant context
|
|
23
|
-
* switches or background operations completing.
|
|
24
|
-
*/
|
|
25
|
-
export declare const Info: Story;
|
|
26
|
-
/**
|
|
27
|
-
* All four toast variants displayed together, matching the top-right
|
|
28
|
-
* stacked layout from the ToastContainer.
|
|
29
|
-
*/
|
|
30
|
-
export declare const AllVariants: Story;
|
|
31
|
-
/**
|
|
32
|
-
* Interactive ToastContainer demo. Click buttons to trigger different
|
|
33
|
-
* toast types and see the stacking behavior (max 3 visible).
|
|
34
|
-
*/
|
|
35
|
-
export declare const InteractiveContainer: Story;
|
|
36
|
-
//# sourceMappingURL=Toast.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.stories.d.ts","sourceRoot":"","sources":["../../src/components/Toast.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAInC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAc5B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAanB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,KAclB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KA4BzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAsDlC,CAAC"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Toast } from "./Toast.js";
|
|
4
|
-
import { ToastContainer } from "./ToastContainer.js";
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Components/Toast",
|
|
7
|
-
component: Toast,
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component: "Toast notification for user feedback. Positioned top-right via " +
|
|
12
|
-
"ToastContainer. Success/info/warning auto-dismiss after 4 seconds; " +
|
|
13
|
-
"error toasts persist until manually dismissed. Left border colored " +
|
|
14
|
-
"by semantic type.",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
export default meta;
|
|
20
|
-
/**
|
|
21
|
-
* Success toast — used after saving config, creating a tenant, etc.
|
|
22
|
-
* Auto-dismisses after 4 seconds.
|
|
23
|
-
*/
|
|
24
|
-
export const Success = {
|
|
25
|
-
args: {
|
|
26
|
-
message: "Configuration saved successfully for CyberShield MSP",
|
|
27
|
-
type: "success",
|
|
28
|
-
onDismiss: () => console.log("Toast dismissed"),
|
|
29
|
-
autoDismiss: 0, // Disable in Storybook so it stays visible
|
|
30
|
-
},
|
|
31
|
-
decorators: [
|
|
32
|
-
(Story) => (_jsx("div", { style: { padding: "24px", maxWidth: 400 }, children: _jsx(Story, {}) })),
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Error toast — used for API failures, permission errors, etc.
|
|
37
|
-
* Does not auto-dismiss; requires manual close.
|
|
38
|
-
*/
|
|
39
|
-
export const Error = {
|
|
40
|
-
args: {
|
|
41
|
-
message: "Failed to update config: Permission denied. This value is locked by Acme Corp.",
|
|
42
|
-
type: "error",
|
|
43
|
-
onDismiss: () => console.log("Toast dismissed"),
|
|
44
|
-
},
|
|
45
|
-
decorators: [
|
|
46
|
-
(Story) => (_jsx("div", { style: { padding: "24px", maxWidth: 400 }, children: _jsx(Story, {}) })),
|
|
47
|
-
],
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Warning toast — used for non-critical issues like approaching
|
|
51
|
-
* rate limits or deprecated config keys.
|
|
52
|
-
*/
|
|
53
|
-
export const Warning = {
|
|
54
|
-
args: {
|
|
55
|
-
message: "API rate limit at 90% (900/1000 requests). Consider upgrading the plan.",
|
|
56
|
-
type: "warning",
|
|
57
|
-
onDismiss: () => console.log("Toast dismissed"),
|
|
58
|
-
autoDismiss: 0,
|
|
59
|
-
},
|
|
60
|
-
decorators: [
|
|
61
|
-
(Story) => (_jsx("div", { style: { padding: "24px", maxWidth: 400 }, children: _jsx(Story, {}) })),
|
|
62
|
-
],
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Info toast — used for general notifications like tenant context
|
|
66
|
-
* switches or background operations completing.
|
|
67
|
-
*/
|
|
68
|
-
export const Info = {
|
|
69
|
-
args: {
|
|
70
|
-
message: "Switched to tenant: Northwind Security (SCHEMA_PER_TENANT isolation)",
|
|
71
|
-
type: "info",
|
|
72
|
-
onDismiss: () => console.log("Toast dismissed"),
|
|
73
|
-
autoDismiss: 0,
|
|
74
|
-
},
|
|
75
|
-
decorators: [
|
|
76
|
-
(Story) => (_jsx("div", { style: { padding: "24px", maxWidth: 400 }, children: _jsx(Story, {}) })),
|
|
77
|
-
],
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* All four toast variants displayed together, matching the top-right
|
|
81
|
-
* stacked layout from the ToastContainer.
|
|
82
|
-
*/
|
|
83
|
-
export const AllVariants = {
|
|
84
|
-
render: () => (_jsxs("div", { style: { padding: "24px", maxWidth: 400, display: "flex", flexDirection: "column", gap: "8px" }, children: [_jsx(Toast, { message: "Tenant created: Globex Industries", type: "success", onDismiss: () => { }, autoDismiss: 0 }), _jsx(Toast, { message: "Switched to CyberShield MSP context", type: "info", onDismiss: () => { }, autoDismiss: 0 }), _jsx(Toast, { message: "Config key 'app.legacy_mode' is deprecated", type: "warning", onDismiss: () => { }, autoDismiss: 0 }), _jsx(Toast, { message: "Failed to delete permission: tenant.manage is locked by root", type: "error", onDismiss: () => { } })] })),
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* Interactive ToastContainer demo. Click buttons to trigger different
|
|
88
|
-
* toast types and see the stacking behavior (max 3 visible).
|
|
89
|
-
*/
|
|
90
|
-
export const InteractiveContainer = {
|
|
91
|
-
render: function InteractiveDemo() {
|
|
92
|
-
const [toasts, setToasts] = useState([]);
|
|
93
|
-
let counter = 0;
|
|
94
|
-
const addToast = (message, type) => {
|
|
95
|
-
counter += 1;
|
|
96
|
-
const id = `toast-${counter}-${Date.now()}`;
|
|
97
|
-
setToasts((prev) => [{ id, message, type }, ...prev]);
|
|
98
|
-
};
|
|
99
|
-
const dismiss = (id) => {
|
|
100
|
-
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
101
|
-
};
|
|
102
|
-
return (_jsxs("div", { style: { padding: "24px" }, children: [_jsxs("div", { style: { display: "flex", gap: "8px", flexWrap: "wrap", marginBottom: "24px" }, children: [_jsx("button", { type: "button", onClick: () => addToast("Config saved for CyberShield MSP", "success"), style: { padding: "8px 16px", borderRadius: "4px", border: "1px solid #059669", background: "#D1FAE5", cursor: "pointer" }, children: "Success Toast" }), _jsx("button", { type: "button", onClick: () => addToast("API error: rate limit exceeded (429)", "error"), style: { padding: "8px 16px", borderRadius: "4px", border: "1px solid #DC2626", background: "#FEE2E2", cursor: "pointer" }, children: "Error Toast" }), _jsx("button", { type: "button", onClick: () => addToast("Permission 'billing.view' expires in 7 days", "warning"), style: { padding: "8px 16px", borderRadius: "4px", border: "1px solid #D97706", background: "#FEF3C7", cursor: "pointer" }, children: "Warning Toast" }), _jsx("button", { type: "button", onClick: () => addToast("Tenant tree refreshed (8 tenants loaded)", "info"), style: { padding: "8px 16px", borderRadius: "4px", border: "1px solid #2563EB", background: "#DBEAFE", cursor: "pointer" }, children: "Info Toast" })] }), _jsxs("p", { style: { color: "#64748B", fontSize: "13px" }, children: ["Active toasts: ", toasts.length, " (max 3 visible)"] }), _jsx(ToastContainer, { toasts: toasts, onDismiss: dismiss, maxVisible: 3 })] }));
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
//# sourceMappingURL=Toast.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.stories.js","sourceRoot":"","sources":["../../src/components/Toast.stories.tsx"],"names":[],"mappings":";AACA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,MAAM,IAAI,GAAuB;IAC/B,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,SAAS,EACP,iEAAiE;oBACjE,qEAAqE;oBACrE,qEAAqE;oBACrE,mBAAmB;aACtB;SACF;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QAC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,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,4BAGnH,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,6CAA6C,EAAE,SAAS,CAAC,EACjF,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,8BAGnH,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,0CAA0C,EAAE,MAAM,CAAC,EAC3E,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,2BAGnH,IACL,EACN,aAAG,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,gCAC9B,MAAM,CAAC,MAAM,wBAC3B,EACJ,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,GAAI,IACjE,CACP,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared mock data and decorator for Storybook stories.
|
|
3
|
-
*
|
|
4
|
-
* All styled components depend on StratumProvider context via useStratum().
|
|
5
|
-
* This module provides a MockStratumProvider that injects controlled data
|
|
6
|
-
* into the real StratumContext so all hooks work without a live API.
|
|
7
|
-
*/
|
|
8
|
-
import { type ReactNode } from "react";
|
|
9
|
-
import type { TenantNode } from "@stratum-hq/core";
|
|
10
|
-
export declare const mockTenants: TenantNode[];
|
|
11
|
-
/** Generate a large list of tenants for stress-testing. */
|
|
12
|
-
export declare function generateManyTenants(count: number): TenantNode[];
|
|
13
|
-
export declare const deepHierarchyTenants: TenantNode[];
|
|
14
|
-
export declare const singleRootTenant: TenantNode[];
|
|
15
|
-
export declare const mockConfigEntries: ({
|
|
16
|
-
key: string;
|
|
17
|
-
value: string;
|
|
18
|
-
source_tenant_id: string;
|
|
19
|
-
inherited: boolean;
|
|
20
|
-
locked: boolean;
|
|
21
|
-
} | {
|
|
22
|
-
key: string;
|
|
23
|
-
value: boolean;
|
|
24
|
-
source_tenant_id: string;
|
|
25
|
-
inherited: boolean;
|
|
26
|
-
locked: boolean;
|
|
27
|
-
} | {
|
|
28
|
-
key: string;
|
|
29
|
-
value: number;
|
|
30
|
-
source_tenant_id: string;
|
|
31
|
-
inherited: boolean;
|
|
32
|
-
locked: boolean;
|
|
33
|
-
})[];
|
|
34
|
-
export declare const mockSensitiveConfigEntries: ({
|
|
35
|
-
key: string;
|
|
36
|
-
value: string;
|
|
37
|
-
source_tenant_id: string;
|
|
38
|
-
inherited: boolean;
|
|
39
|
-
locked: boolean;
|
|
40
|
-
} | {
|
|
41
|
-
key: string;
|
|
42
|
-
value: boolean;
|
|
43
|
-
source_tenant_id: string;
|
|
44
|
-
inherited: boolean;
|
|
45
|
-
locked: boolean;
|
|
46
|
-
} | {
|
|
47
|
-
key: string;
|
|
48
|
-
value: number;
|
|
49
|
-
source_tenant_id: string;
|
|
50
|
-
inherited: boolean;
|
|
51
|
-
locked: boolean;
|
|
52
|
-
})[];
|
|
53
|
-
export declare const mockLockedConfigEntries: ({
|
|
54
|
-
locked: boolean;
|
|
55
|
-
inherited: boolean;
|
|
56
|
-
source_tenant_id: string;
|
|
57
|
-
key: string;
|
|
58
|
-
value: string;
|
|
59
|
-
} | {
|
|
60
|
-
locked: boolean;
|
|
61
|
-
inherited: boolean;
|
|
62
|
-
source_tenant_id: string;
|
|
63
|
-
key: string;
|
|
64
|
-
value: boolean;
|
|
65
|
-
} | {
|
|
66
|
-
locked: boolean;
|
|
67
|
-
inherited: boolean;
|
|
68
|
-
source_tenant_id: string;
|
|
69
|
-
key: string;
|
|
70
|
-
value: number;
|
|
71
|
-
})[];
|
|
72
|
-
export declare const mockPermissions: {
|
|
73
|
-
policy_id: string;
|
|
74
|
-
key: string;
|
|
75
|
-
value: boolean;
|
|
76
|
-
mode: string;
|
|
77
|
-
source_tenant_id: string;
|
|
78
|
-
locked: boolean;
|
|
79
|
-
delegated: boolean;
|
|
80
|
-
}[];
|
|
81
|
-
interface MockStratumProviderProps {
|
|
82
|
-
tenants?: TenantNode[];
|
|
83
|
-
configEntries?: typeof mockConfigEntries;
|
|
84
|
-
permissions?: typeof mockPermissions;
|
|
85
|
-
initialTenantId?: string;
|
|
86
|
-
loading?: boolean;
|
|
87
|
-
children: ReactNode;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Wraps children with the real StratumContext populated by mock data.
|
|
91
|
-
* All real hooks (useTenant, useTenantTree, useConfig, usePermissions)
|
|
92
|
-
* will read from this context and receive controlled responses via apiCall.
|
|
93
|
-
*/
|
|
94
|
-
export declare function MockStratumProvider({ tenants, configEntries, permissions, initialTenantId, loading: forceLoading, children, }: MockStratumProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
95
|
-
export {};
|
|
96
|
-
//# sourceMappingURL=storybook-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storybook-helpers.d.ts","sourceRoot":"","sources":["../../src/components/storybook-helpers.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAc,EAAyB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AASnD,eAAO,MAAM,WAAW,EAAE,UAAU,EAyHnC,CAAC;AAEF,2DAA2D;AAC3D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE,CAsB/D;AAGD,eAAO,MAAM,oBAAoB,EAAE,UAAU,EA4E5C,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,UAAU,EAgBxC,CAAC;AAMF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;IAkD7B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;IAgBtC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;IAKjC,CAAC;AAMJ,eAAO,MAAM,eAAe;;;;;;;;GAuD3B,CAAC;AAMF,UAAU,wBAAwB;IAChC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,iBAAiB,CAAC;IACzC,WAAW,CAAC,EAAE,OAAO,eAAe,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAqB,EACrB,aAAiC,EACjC,WAA6B,EAC7B,eAAe,EACf,OAAO,EAAE,YAAoB,EAC7B,QAAQ,GACT,EAAE,wBAAwB,2CA0F1B"}
|