@busiverse/ui 0.2.12 → 0.2.14
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/README.md +12 -0
- package/dist/{chunk-BJYKR462.js → chunk-UWSNRCQW.js} +36 -10
- package/dist/index.js +12 -8
- package/dist/sandbox/SandboxExperience.d.ts +5 -0
- package/dist/sandbox/SandboxExperience.d.ts.map +1 -0
- package/dist/sandbox/index.d.ts +4 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/sandboxClient.d.ts +9 -0
- package/dist/sandbox/sandboxClient.d.ts.map +1 -0
- package/dist/sandbox/types.d.ts +37 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/sandbox.d.ts +2 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +190 -0
- package/dist/theme/BusiverseThemeProvider.d.ts +12 -0
- package/dist/theme/BusiverseThemeProvider.d.ts.map +1 -0
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme-public.js +5 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -288,3 +288,15 @@ This frontend uses the shared BUSIVERSE theme contract from `@busiverse/ui`.
|
|
|
288
288
|
- App pages must not hard-code `className="dark ..."` wrappers.
|
|
289
289
|
- `vite.config.ts` must keep `loadEnv`; do not remove it while adding build or chunking improvements.
|
|
290
290
|
- Existing `VITE_*` environment variable names must not be renamed without approval.
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
## Theme contract
|
|
294
|
+
|
|
295
|
+
Use `BusiverseThemeProvider` from `@busiverse/ui/theme` in every separately deployed frontend. The only approved storage key is `busiverse-theme`, and every app must expose Light, Dark, and System through `ThemeModeSelect`. Do not create per-frontend theme storage keys or binary-only toggles.
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
## Sandbox UI
|
|
299
|
+
|
|
300
|
+
`@busiverse/ui/sandbox` provides the shared Busiverse sandbox experience used by service frontends. It is network-neutral: it renders sandbox scenarios, dependency maps, event timelines, pricing previews, and gateway headers without making backend calls or embedding secrets.
|
|
301
|
+
|
|
302
|
+
Frontends must pass service-specific scenario content and keep API calls Gateway-only. Sandbox tokens must be issued by Authentication and enforced by Gateway; browser code must never receive client secrets.
|
|
@@ -2,32 +2,56 @@ import {
|
|
|
2
2
|
cn
|
|
3
3
|
} from "./chunk-PYZVP4NI.js";
|
|
4
4
|
|
|
5
|
+
// src/theme/BusiverseThemeProvider.tsx
|
|
6
|
+
import { ThemeProvider } from "next-themes";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var BUSIVERSE_THEME_STORAGE_KEY = "busiverse-theme";
|
|
9
|
+
function BusiverseThemeProvider({
|
|
10
|
+
children,
|
|
11
|
+
defaultTheme = "system",
|
|
12
|
+
storageKey = BUSIVERSE_THEME_STORAGE_KEY,
|
|
13
|
+
enableSystem = true,
|
|
14
|
+
disableTransitionOnChange = true
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
ThemeProvider,
|
|
18
|
+
{
|
|
19
|
+
attribute: "class",
|
|
20
|
+
defaultTheme,
|
|
21
|
+
enableSystem,
|
|
22
|
+
storageKey,
|
|
23
|
+
disableTransitionOnChange,
|
|
24
|
+
children
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
5
29
|
// src/theme/ThemeModeSelect.tsx
|
|
6
30
|
import { useTheme } from "next-themes";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
31
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
8
32
|
var MODES = [
|
|
9
33
|
{
|
|
10
34
|
value: "light",
|
|
11
35
|
label: "Light",
|
|
12
36
|
title: "Use light mode",
|
|
13
37
|
icon: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ jsx2("circle", { cx: "12", cy: "12", r: "4" }),
|
|
39
|
+
/* @__PURE__ */ jsx2("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" })
|
|
16
40
|
] })
|
|
17
41
|
},
|
|
18
42
|
{
|
|
19
43
|
value: "dark",
|
|
20
44
|
label: "Dark",
|
|
21
45
|
title: "Use dark mode",
|
|
22
|
-
icon: /* @__PURE__ */
|
|
46
|
+
icon: /* @__PURE__ */ jsx2("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx2("path", { d: "M20.99 12.43A8.5 8.5 0 1 1 11.57 3a6.5 6.5 0 0 0 9.42 9.43Z" }) })
|
|
23
47
|
},
|
|
24
48
|
{
|
|
25
49
|
value: "system",
|
|
26
50
|
label: "System",
|
|
27
51
|
title: "Follow system theme",
|
|
28
52
|
icon: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ jsx2("rect", { x: "3", y: "4", width: "18", height: "12", rx: "2" }),
|
|
54
|
+
/* @__PURE__ */ jsx2("path", { d: "M8 20h8M12 16v4" })
|
|
31
55
|
] })
|
|
32
56
|
}
|
|
33
57
|
];
|
|
@@ -35,8 +59,8 @@ function ThemeModeSelect({ className, buttonClassName, label = "Theme", compact
|
|
|
35
59
|
const { theme = "system", setTheme, resolvedTheme } = useTheme();
|
|
36
60
|
const currentMode = theme === "light" || theme === "dark" || theme === "system" ? theme : "system";
|
|
37
61
|
return /* @__PURE__ */ jsxs("div", { className: cn("busiverse-theme-mode-select", className), role: "group", "aria-label": label, "data-theme-mode": currentMode, "data-resolved-theme": resolvedTheme ?? currentMode, children: [
|
|
38
|
-
!compact && /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
62
|
+
!compact && /* @__PURE__ */ jsx2("span", { className: "busiverse-theme-mode-label", children: label }),
|
|
63
|
+
/* @__PURE__ */ jsx2("div", { className: "busiverse-theme-mode-options", children: MODES.map((mode) => {
|
|
40
64
|
const active = currentMode === mode.value;
|
|
41
65
|
return /* @__PURE__ */ jsxs(
|
|
42
66
|
"button",
|
|
@@ -48,8 +72,8 @@ function ThemeModeSelect({ className, buttonClassName, label = "Theme", compact
|
|
|
48
72
|
onClick: () => setTheme(mode.value),
|
|
49
73
|
children: [
|
|
50
74
|
mode.icon,
|
|
51
|
-
!compact && /* @__PURE__ */
|
|
52
|
-
compact && /* @__PURE__ */
|
|
75
|
+
!compact && /* @__PURE__ */ jsx2("span", { children: mode.label }),
|
|
76
|
+
compact && /* @__PURE__ */ jsx2("span", { className: "busiverse-sr-only", children: mode.label })
|
|
53
77
|
]
|
|
54
78
|
},
|
|
55
79
|
mode.value
|
|
@@ -59,5 +83,7 @@ function ThemeModeSelect({ className, buttonClassName, label = "Theme", compact
|
|
|
59
83
|
}
|
|
60
84
|
|
|
61
85
|
export {
|
|
86
|
+
BUSIVERSE_THEME_STORAGE_KEY,
|
|
87
|
+
BusiverseThemeProvider,
|
|
62
88
|
ThemeModeSelect
|
|
63
89
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
+
busiverseColors,
|
|
3
|
+
busiverseContainers,
|
|
4
|
+
busiverseRadius,
|
|
5
|
+
busiverseSpacing,
|
|
6
|
+
busiverseTypography
|
|
7
|
+
} from "./chunk-SXD6EH2C.js";
|
|
8
|
+
import {
|
|
9
|
+
BUSIVERSE_THEME_STORAGE_KEY,
|
|
10
|
+
BusiverseThemeProvider,
|
|
2
11
|
ThemeModeSelect
|
|
3
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UWSNRCQW.js";
|
|
4
13
|
import {
|
|
5
14
|
Badge,
|
|
6
15
|
Card,
|
|
@@ -69,13 +78,6 @@ import {
|
|
|
69
78
|
import {
|
|
70
79
|
cn
|
|
71
80
|
} from "./chunk-PYZVP4NI.js";
|
|
72
|
-
import {
|
|
73
|
-
busiverseColors,
|
|
74
|
-
busiverseContainers,
|
|
75
|
-
busiverseRadius,
|
|
76
|
-
busiverseSpacing,
|
|
77
|
-
busiverseTypography
|
|
78
|
-
} from "./chunk-SXD6EH2C.js";
|
|
79
81
|
|
|
80
82
|
// src/tokens/motion.ts
|
|
81
83
|
var busiverseMotion = {
|
|
@@ -348,6 +350,7 @@ function UserMenu() {
|
|
|
348
350
|
export {
|
|
349
351
|
AppShell,
|
|
350
352
|
AuthSessionProvider,
|
|
353
|
+
BUSIVERSE_THEME_STORAGE_KEY,
|
|
351
354
|
Badge,
|
|
352
355
|
BusiverseBrandHead,
|
|
353
356
|
BusiverseGithubIcon,
|
|
@@ -356,6 +359,7 @@ export {
|
|
|
356
359
|
BusiverseLogo,
|
|
357
360
|
BusiverseMailIcon,
|
|
358
361
|
BusiverseSocialIcon,
|
|
362
|
+
BusiverseThemeProvider,
|
|
359
363
|
BusiverseXIcon,
|
|
360
364
|
Button,
|
|
361
365
|
Card,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SandboxExperience.d.ts","sourceRoot":"","sources":["../../src/sandbox/SandboxExperience.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,sBAAsB,EAAmB,MAAM,SAAS,CAAC;AAyCvE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,qBA+I9D;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const BUSIVERSE_SANDBOX_ENVIRONMENT: "SANDBOX";
|
|
2
|
+
export type SandboxHeadersInput = {
|
|
3
|
+
sandboxId?: string;
|
|
4
|
+
tenantId?: string;
|
|
5
|
+
correlationId?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function createSandboxHeaders(input?: SandboxHeadersInput): Record<string, string>;
|
|
8
|
+
export declare function isSandboxEnvironment(value: unknown): value is typeof BUSIVERSE_SANDBOX_ENVIRONMENT;
|
|
9
|
+
//# sourceMappingURL=sandboxClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandboxClient.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandboxClient.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,EAAG,SAAkB,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,GAAE,mBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU5F;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,6BAA6B,CAElG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type SandboxEnvironment = "SANDBOX";
|
|
2
|
+
export type SandboxDependency = {
|
|
3
|
+
name: string;
|
|
4
|
+
href: string;
|
|
5
|
+
reason: string;
|
|
6
|
+
};
|
|
7
|
+
export type SandboxScenario = {
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
entrypoint: string;
|
|
11
|
+
simulated: string[];
|
|
12
|
+
dependencies: SandboxDependency[];
|
|
13
|
+
pricePreview: string;
|
|
14
|
+
events: string[];
|
|
15
|
+
promoteChecklist: string[];
|
|
16
|
+
};
|
|
17
|
+
export type SandboxEvent = {
|
|
18
|
+
label: string;
|
|
19
|
+
service: string;
|
|
20
|
+
status: "Ready" | "Simulated" | "Blocked" | "Review";
|
|
21
|
+
detail: string;
|
|
22
|
+
};
|
|
23
|
+
export type SandboxExperienceProps = {
|
|
24
|
+
serviceName: string;
|
|
25
|
+
serviceCode: string;
|
|
26
|
+
headline: string;
|
|
27
|
+
description: string;
|
|
28
|
+
apiPrefix: string;
|
|
29
|
+
publicUrl: string;
|
|
30
|
+
signupUrl?: string;
|
|
31
|
+
scenarios: SandboxScenario[];
|
|
32
|
+
controls: string[];
|
|
33
|
+
blockedEffects: string[];
|
|
34
|
+
dataPolicy: string[];
|
|
35
|
+
events: SandboxEvent[];
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sandbox/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;IACrD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../src/sandbox.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/sandbox.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// src/sandbox/sandboxClient.ts
|
|
2
|
+
var BUSIVERSE_SANDBOX_ENVIRONMENT = "SANDBOX";
|
|
3
|
+
function createSandboxHeaders(input = {}) {
|
|
4
|
+
const headers = {
|
|
5
|
+
"X-Busiverse-Environment": BUSIVERSE_SANDBOX_ENVIRONMENT
|
|
6
|
+
};
|
|
7
|
+
if (input.sandboxId) headers["X-Busiverse-Sandbox-Id"] = input.sandboxId;
|
|
8
|
+
if (input.tenantId) headers["X-Busiverse-Tenant-Id"] = input.tenantId;
|
|
9
|
+
if (input.correlationId) headers["X-Correlation-Id"] = input.correlationId;
|
|
10
|
+
return headers;
|
|
11
|
+
}
|
|
12
|
+
function isSandboxEnvironment(value) {
|
|
13
|
+
return value === BUSIVERSE_SANDBOX_ENVIRONMENT;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/sandbox/SandboxExperience.tsx
|
|
17
|
+
import * as React from "react";
|
|
18
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
function cx(...classes) {
|
|
20
|
+
return classes.filter(Boolean).join(" ");
|
|
21
|
+
}
|
|
22
|
+
function Card({ children, className = "" }) {
|
|
23
|
+
return /* @__PURE__ */ jsx("section", { className: cx("rounded-3xl border border-white/10 bg-white/[0.04] p-6 shadow-2xl shadow-black/10 backdrop-blur-xl", className), children });
|
|
24
|
+
}
|
|
25
|
+
function Pill({ children }) {
|
|
26
|
+
return /* @__PURE__ */ jsx("span", { className: "inline-flex items-center rounded-full border border-white/10 bg-white/[0.06] px-3 py-1 text-xs font-medium text-muted-foreground", children });
|
|
27
|
+
}
|
|
28
|
+
function ScenarioCard({ scenario, active, onSelect }) {
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
type: "button",
|
|
33
|
+
onClick: onSelect,
|
|
34
|
+
className: cx(
|
|
35
|
+
"w-full rounded-2xl border p-5 text-left transition duration-200",
|
|
36
|
+
active ? "border-primary/60 bg-primary/10 shadow-lg shadow-primary/10" : "border-white/10 bg-white/[0.03] hover:border-primary/30 hover:bg-white/[0.06]"
|
|
37
|
+
),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between", children: [
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
41
|
+
/* @__PURE__ */ jsx("h3", { className: "font-heading text-lg font-semibold text-foreground", children: scenario.title }),
|
|
42
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm leading-6 text-muted-foreground", children: scenario.description })
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ jsx(Pill, { children: scenario.entrypoint })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsx("p", { className: "mt-4 text-sm font-medium text-primary", children: scenario.pricePreview })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function SandboxExperience(props) {
|
|
52
|
+
const [activeIndex, setActiveIndex] = React.useState(0);
|
|
53
|
+
const [sandboxId] = React.useState(() => `sbx_${props.serviceCode.toLowerCase().replace(/[^a-z0-9]+/g, "_")}_preview`);
|
|
54
|
+
const active = props.scenarios[activeIndex] ?? props.scenarios[0];
|
|
55
|
+
const headers = createSandboxHeaders({ sandboxId, correlationId: `${props.serviceCode.toLowerCase()}-sandbox-preview` });
|
|
56
|
+
return /* @__PURE__ */ jsxs("main", { className: "min-h-screen bg-background text-foreground", children: [
|
|
57
|
+
/* @__PURE__ */ jsxs("section", { className: "relative overflow-hidden border-b border-white/10", children: [
|
|
58
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 -z-10 bg-[radial-gradient(circle_at_top_left,hsl(var(--primary)/0.22),transparent_34%),radial-gradient(circle_at_top_right,hsl(var(--accent)/0.18),transparent_30%)]" }),
|
|
59
|
+
/* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-7xl flex-col gap-8 px-4 py-12 sm:px-6 lg:px-8 lg:py-16", children: [
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
61
|
+
/* @__PURE__ */ jsx(Pill, { children: "Sandbox environment" }),
|
|
62
|
+
/* @__PURE__ */ jsx(Pill, { children: "Resettable data" }),
|
|
63
|
+
/* @__PURE__ */ jsx(Pill, { children: "No production side effects" })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-8 lg:grid-cols-[1.2fr_0.8fr] lg:items-end", children: [
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
67
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold uppercase tracking-[0.3em] text-primary", children: props.serviceName }),
|
|
68
|
+
/* @__PURE__ */ jsx("h1", { className: "mt-4 max-w-4xl font-heading text-4xl font-bold tracking-tight sm:text-5xl lg:text-6xl", children: props.headline }),
|
|
69
|
+
/* @__PURE__ */ jsx("p", { className: "mt-6 max-w-3xl text-base leading-8 text-muted-foreground sm:text-lg", children: props.description }),
|
|
70
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-8 flex flex-wrap gap-3", children: [
|
|
71
|
+
/* @__PURE__ */ jsx("a", { href: "#scenarios", className: "rounded-full bg-primary px-5 py-3 text-sm font-semibold text-primary-foreground shadow-lg shadow-primary/20", children: "Run a scenario" }),
|
|
72
|
+
/* @__PURE__ */ jsx("a", { href: props.signupUrl ?? "https://user.busiversehq.com/signup", className: "rounded-full border border-white/10 bg-white/[0.04] px-5 py-3 text-sm font-semibold text-foreground hover:bg-white/[0.08]", children: "Create sandbox tenant" }),
|
|
73
|
+
/* @__PURE__ */ jsx("a", { href: props.publicUrl, className: "rounded-full border border-white/10 px-5 py-3 text-sm font-semibold text-muted-foreground hover:text-foreground", children: "Open service" })
|
|
74
|
+
] })
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
77
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
78
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
79
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Environment" }),
|
|
80
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 font-heading text-2xl font-semibold", children: "SANDBOX" })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsx("span", { className: "rounded-full border border-emerald-400/30 bg-emerald-400/10 px-3 py-1 text-xs font-semibold text-emerald-300", children: "isolated" })
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ jsxs("dl", { className: "mt-6 space-y-4 text-sm", children: [
|
|
85
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-4 border-t border-white/10 pt-4", children: [
|
|
86
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: "Sandbox ID" }),
|
|
87
|
+
/* @__PURE__ */ jsx("dd", { className: "font-mono text-xs", children: sandboxId })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-4 border-t border-white/10 pt-4", children: [
|
|
90
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: "API prefix" }),
|
|
91
|
+
/* @__PURE__ */ jsx("dd", { className: "font-mono text-xs", children: props.apiPrefix })
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between gap-4 border-t border-white/10 pt-4", children: [
|
|
94
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: "Promotion" }),
|
|
95
|
+
/* @__PURE__ */ jsx("dd", { children: "configuration only" })
|
|
96
|
+
] })
|
|
97
|
+
] })
|
|
98
|
+
] })
|
|
99
|
+
] })
|
|
100
|
+
] })
|
|
101
|
+
] }),
|
|
102
|
+
/* @__PURE__ */ jsxs("section", { id: "scenarios", className: "mx-auto grid max-w-7xl gap-6 px-4 py-10 sm:px-6 lg:grid-cols-[0.9fr_1.1fr] lg:px-8", children: [
|
|
103
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4", children: props.scenarios.map((scenario, index) => /* @__PURE__ */ jsx(ScenarioCard, { scenario, active: index === activeIndex, onSelect: () => setActiveIndex(index) }, scenario.title)) }),
|
|
104
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
105
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
106
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [
|
|
107
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
108
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold uppercase tracking-[0.24em] text-primary", children: "Active scenario" }),
|
|
109
|
+
/* @__PURE__ */ jsx("h2", { className: "mt-2 font-heading text-3xl font-semibold", children: active.title }),
|
|
110
|
+
/* @__PURE__ */ jsx("p", { className: "mt-3 text-sm leading-6 text-muted-foreground", children: active.description })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsx(Pill, { children: active.entrypoint })
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-6 grid gap-4 md:grid-cols-2", children: [
|
|
115
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
116
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-foreground", children: "Simulated workflow" }),
|
|
117
|
+
/* @__PURE__ */ jsx("ul", { className: "mt-3 space-y-2 text-sm text-muted-foreground", children: active.simulated.map((item) => /* @__PURE__ */ jsx("li", { className: "rounded-xl bg-white/[0.03] px-3 py-2", children: item }, item)) })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
120
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-foreground", children: "Promotion checklist" }),
|
|
121
|
+
/* @__PURE__ */ jsx("ul", { className: "mt-3 space-y-2 text-sm text-muted-foreground", children: active.promoteChecklist.map((item) => /* @__PURE__ */ jsx("li", { className: "rounded-xl bg-white/[0.03] px-3 py-2", children: item }, item)) })
|
|
122
|
+
] })
|
|
123
|
+
] })
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
126
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-2xl font-semibold", children: "Dependency map" }),
|
|
127
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 grid gap-3 sm:grid-cols-2", children: active.dependencies.map((dependency) => /* @__PURE__ */ jsxs("a", { href: dependency.href, className: "rounded-2xl border border-white/10 bg-white/[0.03] p-4 transition hover:border-primary/40 hover:bg-white/[0.06]", children: [
|
|
128
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-foreground", children: dependency.name }),
|
|
129
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-sm leading-6 text-muted-foreground", children: dependency.reason })
|
|
130
|
+
] }, dependency.name)) })
|
|
131
|
+
] }),
|
|
132
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-6 lg:grid-cols-2", children: [
|
|
133
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
134
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-2xl font-semibold", children: "Sandbox headers" }),
|
|
135
|
+
/* @__PURE__ */ jsx("pre", { className: "mt-4 overflow-x-auto rounded-2xl border border-white/10 bg-black/30 p-4 text-xs text-muted-foreground", children: /* @__PURE__ */ jsx("code", { children: JSON.stringify(headers, null, 2) }) })
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
138
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-2xl font-semibold", children: "Production price preview" }),
|
|
139
|
+
/* @__PURE__ */ jsx("p", { className: "mt-4 text-sm leading-6 text-muted-foreground", children: active.pricePreview }),
|
|
140
|
+
/* @__PURE__ */ jsx("p", { className: "mt-4 text-xs leading-5 text-muted-foreground", children: "Sandbox usage is not billed. This preview maps workflow activity to customer-facing production pricing only." })
|
|
141
|
+
] })
|
|
142
|
+
] })
|
|
143
|
+
] })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ jsxs("section", { className: "mx-auto grid max-w-7xl gap-6 px-4 pb-14 sm:px-6 lg:grid-cols-3 lg:px-8", children: [
|
|
146
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
147
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-semibold", children: "Controls" }),
|
|
148
|
+
/* @__PURE__ */ jsx("ul", { className: "mt-4 space-y-2 text-sm text-muted-foreground", children: props.controls.map((item) => /* @__PURE__ */ jsxs("li", { children: [
|
|
149
|
+
"\u2022 ",
|
|
150
|
+
item
|
|
151
|
+
] }, item)) })
|
|
152
|
+
] }),
|
|
153
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
154
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-semibold", children: "Blocked production effects" }),
|
|
155
|
+
/* @__PURE__ */ jsx("ul", { className: "mt-4 space-y-2 text-sm text-muted-foreground", children: props.blockedEffects.map((item) => /* @__PURE__ */ jsxs("li", { children: [
|
|
156
|
+
"\u2022 ",
|
|
157
|
+
item
|
|
158
|
+
] }, item)) })
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
161
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-semibold", children: "Data policy" }),
|
|
162
|
+
/* @__PURE__ */ jsx("ul", { className: "mt-4 space-y-2 text-sm text-muted-foreground", children: props.dataPolicy.map((item) => /* @__PURE__ */ jsxs("li", { children: [
|
|
163
|
+
"\u2022 ",
|
|
164
|
+
item
|
|
165
|
+
] }, item)) })
|
|
166
|
+
] })
|
|
167
|
+
] }),
|
|
168
|
+
/* @__PURE__ */ jsx("section", { className: "mx-auto max-w-7xl px-4 pb-16 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
169
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between", children: [
|
|
170
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
171
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold uppercase tracking-[0.24em] text-primary", children: "Observability" }),
|
|
172
|
+
/* @__PURE__ */ jsx("h2", { className: "mt-2 font-heading text-3xl font-semibold", children: "Sandbox event timeline" })
|
|
173
|
+
] }),
|
|
174
|
+
/* @__PURE__ */ jsx(Pill, { children: "correlation aware" })
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ jsx("div", { className: "mt-6 grid gap-3", children: props.events.map((event) => /* @__PURE__ */ jsxs("div", { className: "grid gap-3 rounded-2xl border border-white/10 bg-white/[0.03] p-4 md:grid-cols-[0.8fr_0.6fr_0.4fr_1.2fr] md:items-center", children: [
|
|
177
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-foreground", children: event.label }),
|
|
178
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: event.service }),
|
|
179
|
+
/* @__PURE__ */ jsx("span", { className: "w-fit rounded-full border border-white/10 px-3 py-1 text-xs text-muted-foreground", children: event.status }),
|
|
180
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: event.detail })
|
|
181
|
+
] }, `${event.service}-${event.label}`)) })
|
|
182
|
+
] }) })
|
|
183
|
+
] });
|
|
184
|
+
}
|
|
185
|
+
export {
|
|
186
|
+
BUSIVERSE_SANDBOX_ENVIRONMENT,
|
|
187
|
+
SandboxExperience,
|
|
188
|
+
createSandboxHeaders,
|
|
189
|
+
isSandboxEnvironment
|
|
190
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare const BUSIVERSE_THEME_STORAGE_KEY = "busiverse-theme";
|
|
3
|
+
export type BusiverseThemeMode = "light" | "dark" | "system";
|
|
4
|
+
export interface BusiverseThemeProviderProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
defaultTheme?: BusiverseThemeMode;
|
|
7
|
+
storageKey?: string;
|
|
8
|
+
enableSystem?: boolean;
|
|
9
|
+
disableTransitionOnChange?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function BusiverseThemeProvider({ children, defaultTheme, storageKey, enableSystem, disableTransitionOnChange, }: BusiverseThemeProviderProps): React.JSX.Element;
|
|
12
|
+
//# sourceMappingURL=BusiverseThemeProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BusiverseThemeProvider.d.ts","sourceRoot":"","sources":["../../src/theme/BusiverseThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,eAAO,MAAM,2BAA2B,oBAAoB,CAAC;AAC7D,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE7D,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,YAAuB,EACvB,UAAwC,EACxC,YAAmB,EACnB,yBAAgC,GACjC,EAAE,2BAA2B,qBAY7B"}
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/theme-public.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BUSIVERSE_THEME_STORAGE_KEY,
|
|
3
|
+
BusiverseThemeProvider,
|
|
2
4
|
ThemeModeSelect
|
|
3
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UWSNRCQW.js";
|
|
4
6
|
import "./chunk-PYZVP4NI.js";
|
|
5
7
|
export {
|
|
8
|
+
BUSIVERSE_THEME_STORAGE_KEY,
|
|
9
|
+
BusiverseThemeProvider,
|
|
6
10
|
ThemeModeSelect
|
|
7
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@busiverse/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"author": "Joel Julius Okoromi <okmarq@gmail.com> (https://busiversehq.com)",
|
|
5
5
|
"description": "BUSIVERSE shared React UI, design tokens, pricing, i18n, auth helpers, and product shell. Network-neutral core; Gateway transport is app-injected.",
|
|
6
6
|
"type": "module",
|
|
@@ -61,11 +61,16 @@
|
|
|
61
61
|
"types": "./dist/theme-public.d.ts",
|
|
62
62
|
"import": "./dist/theme-public.js",
|
|
63
63
|
"default": "./dist/theme-public.js"
|
|
64
|
+
},
|
|
65
|
+
"./sandbox": {
|
|
66
|
+
"types": "./dist/sandbox.d.ts",
|
|
67
|
+
"import": "./dist/sandbox.js",
|
|
68
|
+
"default": "./dist/sandbox.js"
|
|
64
69
|
}
|
|
65
70
|
},
|
|
66
71
|
"scripts": {
|
|
67
72
|
"clean": "node scripts/clean.mjs",
|
|
68
|
-
"build": "npm run clean && tsup src/index.ts src/tailwind-public.ts src/brand.ts src/i18n-public.ts src/billing.ts src/social.ts src/marketing.ts src/assets-public.ts src/theme-public.ts --format esm --target es2022 && tsc -p tsconfig.build.json && node scripts/copy-static.mjs",
|
|
73
|
+
"build": "npm run clean && tsup src/index.ts src/tailwind-public.ts src/brand.ts src/i18n-public.ts src/billing.ts src/social.ts src/marketing.ts src/assets-public.ts src/theme-public.ts src/sandbox.ts --format esm --target es2022 && tsc -p tsconfig.build.json && node scripts/copy-static.mjs",
|
|
69
74
|
"typecheck": "tsc --noEmit",
|
|
70
75
|
"pack:local": "npm pack",
|
|
71
76
|
"prepublishOnly": "npm run typecheck && npm run build && npm pack --dry-run"
|