@busiverse/ui 0.2.13 → 0.2.15
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 +7 -0
- package/dist/assets/assets.ts +47 -0
- package/dist/{chunk-UWSNRCQW.js → chunk-HXWXIXU3.js} +40 -1
- package/dist/index.js +17 -9
- 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/styles.css +48 -11
- package/dist/theme/brandColor.d.ts +72 -0
- package/dist/theme/brandColor.d.ts.map +1 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme-public.js +11 -3
- package/package.json +127 -121
package/README.md
CHANGED
|
@@ -293,3 +293,10 @@ This frontend uses the shared BUSIVERSE theme contract from `@busiverse/ui`.
|
|
|
293
293
|
## Theme contract
|
|
294
294
|
|
|
295
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.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const busiverseAssets = {
|
|
2
|
+
logo: {
|
|
3
|
+
horizontal: {
|
|
4
|
+
white: new URL("./assets/logo/busiverse-horizontal---white.svg", import.meta.url).href,
|
|
5
|
+
black: new URL("./assets/logo/busiverse-horizontal---black.svg", import.meta.url).href,
|
|
6
|
+
color: new URL("./assets/logo/busiverse-horizontal---color.svg", import.meta.url).href,
|
|
7
|
+
},
|
|
8
|
+
full: {
|
|
9
|
+
white: new URL("./assets/logo/busiverse-primary-full-logo---white.svg", import.meta.url).href,
|
|
10
|
+
black: new URL("./assets/logo/busiverse-primary-full-logo---black.svg", import.meta.url).href,
|
|
11
|
+
color: new URL("./assets/logo/busiverse-primary-full-logo---color.svg", import.meta.url).href,
|
|
12
|
+
},
|
|
13
|
+
vertical: {
|
|
14
|
+
white: new URL("./assets/logo/busiverse-vertical---white.svg", import.meta.url).href,
|
|
15
|
+
black: new URL("./assets/logo/busiverse-vertical---black.svg", import.meta.url).href,
|
|
16
|
+
color: new URL("./assets/logo/busiverse-vertical---color.svg", import.meta.url).href,
|
|
17
|
+
},
|
|
18
|
+
icon: {
|
|
19
|
+
white: new URL("./assets/icon/busiverse-icon-only---white.svg", import.meta.url).href,
|
|
20
|
+
black: new URL("./assets/icon/busiverse-icon-only---black.svg", import.meta.url).href,
|
|
21
|
+
color: new URL("./assets/icon/busiverse-icon-only---color.svg", import.meta.url).href,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
favicon: {
|
|
25
|
+
ico: new URL("./assets/favicon.io/favicon.ico", import.meta.url).href,
|
|
26
|
+
png16: new URL("./assets/favicon.io/favicon-16x16.png", import.meta.url).href,
|
|
27
|
+
png32: new URL("./assets/favicon.io/favicon-32x32.png", import.meta.url).href,
|
|
28
|
+
png96: new URL("./assets/favicon.io/favicon-96x96.png", import.meta.url).href,
|
|
29
|
+
appleTouchIcon: new URL("./assets/favicon.io/apple-touch-icon.png", import.meta.url).href,
|
|
30
|
+
androidChrome192: new URL("./assets/favicon.io/android-chrome-192x192.png", import.meta.url).href,
|
|
31
|
+
androidChrome512: new URL("./assets/favicon.io/android-chrome-512x512.png", import.meta.url).href,
|
|
32
|
+
androidIcon192: new URL("./assets/favicon.io/android-icon-192x192.png", import.meta.url).href,
|
|
33
|
+
msTile144: new URL("./assets/favicon.io/ms-icon-144x144.png", import.meta.url).href,
|
|
34
|
+
},
|
|
35
|
+
social: {
|
|
36
|
+
xHeader: new URL("./assets/social/busiverse-twitter_x-header-2.7777777777777777x-darkbg.png", import.meta.url).href,
|
|
37
|
+
xProfile: new URL("./assets/social/busiverse-twitter_x-profile-picture-2.2222222222222223x-darkbg.png", import.meta.url).href,
|
|
38
|
+
linkedInCover: new URL("./assets/social/busiverse-linkedin-cover-photo-2.64x-darkbg.png", import.meta.url).href,
|
|
39
|
+
linkedInProfile: new URL("./assets/social/busiverse-linkedin-profile-picture-2.2222222222222223x-darkbg.png", import.meta.url).href,
|
|
40
|
+
facebookCover: new URL("./assets/social/busiverse-facebook-cover-photo-1.7333333333333334x-darkbg.png", import.meta.url).href,
|
|
41
|
+
facebookProfile: new URL("./assets/social/busiverse-facebook-profile-picture-1x-darkbg.png", import.meta.url).href,
|
|
42
|
+
instagramPost: new URL("./assets/social/busiverse-instagram-post-6x-darkbg.png", import.meta.url).href,
|
|
43
|
+
instagramProfile: new URL("./assets/social/busiverse-instagram-profile-picture-1.7777777777777777x-darkbg.png", import.meta.url).href,
|
|
44
|
+
},
|
|
45
|
+
} as const;
|
|
46
|
+
|
|
47
|
+
export type BusiverseAssets = typeof busiverseAssets;
|
|
@@ -82,8 +82,47 @@ function ThemeModeSelect({ className, buttonClassName, label = "Theme", compact
|
|
|
82
82
|
] });
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
// src/theme/brandColor.ts
|
|
86
|
+
var BRAND_COLOR_FALLBACKS = {
|
|
87
|
+
"--color-brand-blue": "#3B82F6",
|
|
88
|
+
"--color-brand-violet": "#8B5CF6",
|
|
89
|
+
"--color-brand-cyan": "#06B6D4",
|
|
90
|
+
"--color-action-blue": "#2563EB",
|
|
91
|
+
"--color-action-blue-hover": "#1D4ED8",
|
|
92
|
+
"--color-action-violet": "#7C3AED",
|
|
93
|
+
"--color-action-violet-hover": "#6D28D9",
|
|
94
|
+
"--color-action-cyan": "#0E7490",
|
|
95
|
+
"--color-action-cyan-hover": "#155E75"
|
|
96
|
+
};
|
|
97
|
+
var BRAND_CHART_SERIES = [
|
|
98
|
+
"--color-brand-blue",
|
|
99
|
+
"--color-brand-violet",
|
|
100
|
+
"--color-brand-cyan"
|
|
101
|
+
];
|
|
102
|
+
function brandColor(token, element) {
|
|
103
|
+
const fallback = BRAND_COLOR_FALLBACKS[token];
|
|
104
|
+
if (typeof document === "undefined") return fallback;
|
|
105
|
+
try {
|
|
106
|
+
const target = element ?? document.documentElement;
|
|
107
|
+
const value = getComputedStyle(target).getPropertyValue(token).trim();
|
|
108
|
+
return value === "" ? fallback : value;
|
|
109
|
+
} catch {
|
|
110
|
+
return fallback;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function brandChartColors(count, element) {
|
|
114
|
+
if (!Number.isInteger(count) || count < 0) {
|
|
115
|
+
throw new RangeError(`brandChartColors expects a non-negative integer, received ${count}`);
|
|
116
|
+
}
|
|
117
|
+
return Array.from({ length: count }, (_, index) => brandColor(BRAND_CHART_SERIES[index % BRAND_CHART_SERIES.length], element));
|
|
118
|
+
}
|
|
119
|
+
|
|
85
120
|
export {
|
|
86
121
|
BUSIVERSE_THEME_STORAGE_KEY,
|
|
87
122
|
BusiverseThemeProvider,
|
|
88
|
-
ThemeModeSelect
|
|
123
|
+
ThemeModeSelect,
|
|
124
|
+
BRAND_COLOR_FALLBACKS,
|
|
125
|
+
BRAND_CHART_SERIES,
|
|
126
|
+
brandColor,
|
|
127
|
+
brandChartColors
|
|
89
128
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
+
busiverseColors,
|
|
3
|
+
busiverseContainers,
|
|
4
|
+
busiverseRadius,
|
|
5
|
+
busiverseSpacing,
|
|
6
|
+
busiverseTypography
|
|
7
|
+
} from "./chunk-SXD6EH2C.js";
|
|
8
|
+
import {
|
|
9
|
+
BRAND_CHART_SERIES,
|
|
10
|
+
BRAND_COLOR_FALLBACKS,
|
|
2
11
|
BUSIVERSE_THEME_STORAGE_KEY,
|
|
3
12
|
BusiverseThemeProvider,
|
|
4
|
-
ThemeModeSelect
|
|
5
|
-
|
|
13
|
+
ThemeModeSelect,
|
|
14
|
+
brandChartColors,
|
|
15
|
+
brandColor
|
|
16
|
+
} from "./chunk-HXWXIXU3.js";
|
|
6
17
|
import {
|
|
7
18
|
Badge,
|
|
8
19
|
Card,
|
|
@@ -71,13 +82,6 @@ import {
|
|
|
71
82
|
import {
|
|
72
83
|
cn
|
|
73
84
|
} from "./chunk-PYZVP4NI.js";
|
|
74
|
-
import {
|
|
75
|
-
busiverseColors,
|
|
76
|
-
busiverseContainers,
|
|
77
|
-
busiverseRadius,
|
|
78
|
-
busiverseSpacing,
|
|
79
|
-
busiverseTypography
|
|
80
|
-
} from "./chunk-SXD6EH2C.js";
|
|
81
85
|
|
|
82
86
|
// src/tokens/motion.ts
|
|
83
87
|
var busiverseMotion = {
|
|
@@ -350,6 +354,8 @@ function UserMenu() {
|
|
|
350
354
|
export {
|
|
351
355
|
AppShell,
|
|
352
356
|
AuthSessionProvider,
|
|
357
|
+
BRAND_CHART_SERIES,
|
|
358
|
+
BRAND_COLOR_FALLBACKS,
|
|
353
359
|
BUSIVERSE_THEME_STORAGE_KEY,
|
|
354
360
|
Badge,
|
|
355
361
|
BusiverseBrandHead,
|
|
@@ -395,6 +401,8 @@ export {
|
|
|
395
401
|
UsageQuotaBar,
|
|
396
402
|
UserMenu,
|
|
397
403
|
applyBusiverseBrandHead,
|
|
404
|
+
brandChartColors,
|
|
405
|
+
brandColor,
|
|
398
406
|
busiverseAssets,
|
|
399
407
|
busiverseColors,
|
|
400
408
|
busiverseContainers,
|
|
@@ -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
|
+
};
|
package/dist/styles.css
CHANGED
|
@@ -37,15 +37,45 @@
|
|
|
37
37
|
--card-foreground: 222 47% 11%;
|
|
38
38
|
--popover: 0 0% 100%;
|
|
39
39
|
--popover-foreground: 222 47% 11%;
|
|
40
|
-
|
|
40
|
+
/* Surfaces that carry white text use the brand's ACCESSIBLE variants, not the brand accents.
|
|
41
|
+
*
|
|
42
|
+
* These were the brand accent colours -- --primary and --accent were both `217 91% 60%`, which is
|
|
43
|
+
* #3B82F6, and --destructive was `0 84% 60%`. Each is paired with a white foreground here, and the
|
|
44
|
+
* brand system restricts exactly that pairing: section 15.1 warns the accents "are not always safe
|
|
45
|
+
* as backgrounds for small white text", and section 17.3 lists #FFFFFF on #3B82F6 at 3.7:1 as
|
|
46
|
+
* "large text only". Measured, the three shipped pairs were 3.64:1, 3.64:1 and 3.78:1 against the
|
|
47
|
+
* 4.5:1 that section 17.1 requires for normal text -- so every default button in every frontend
|
|
48
|
+
* failed AA for its label.
|
|
49
|
+
*
|
|
50
|
+
* Section 15.2 exists to solve this and the hex token block above already carried the right values;
|
|
51
|
+
* only this shadcn bridge had missed them. --primary and --accent are now Accessible Blue #2563EB
|
|
52
|
+
* (5.17:1) and --destructive is red-600 #DC2626 (4.83:1) -- the brand system names no destructive
|
|
53
|
+
* colour, so the closest palette-consistent value that clears 17.1 is used and recorded here.
|
|
54
|
+
*
|
|
55
|
+
* --ring keeps the brand accent deliberately: it is a UI component outline, which section 17.1
|
|
56
|
+
* holds to 3:1, and #3B82F6 meets that at 3.68:1.
|
|
57
|
+
*
|
|
58
|
+
* The .dark block does not redefine these, so this is the value in both themes. */
|
|
59
|
+
--primary: 221 83% 53%;
|
|
41
60
|
--primary-foreground: 0 0% 100%;
|
|
42
|
-
--secondary: 210
|
|
61
|
+
--secondary: 210 40% 96%; /* Slate 100 #F1F5F9, section 15.4 */
|
|
43
62
|
--secondary-foreground: 222 47% 11%;
|
|
44
|
-
--muted: 210
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
--muted: 210 40% 96%;
|
|
64
|
+
/* Slate 600 #475569, and deliberately NOT the Slate 500 that section 15.6 names for muted text.
|
|
65
|
+
*
|
|
66
|
+
* Section 15.6 assigns Slate 500 #64748B to muted text but never states which surface it sits on,
|
|
67
|
+
* and section 17.2 never verifies that pair. Measured, Slate 500 on the Slate 100 muted surface is
|
|
68
|
+
* 4.34:1 -- under the 4.5:1 section 17.1 requires. So the brand document's own two rules disagree
|
|
69
|
+
* here, and the accessibility rule is the binding one: section 17.4 says to test contrast before
|
|
70
|
+
* release and not to use low-contrast text.
|
|
71
|
+
*
|
|
72
|
+
* Slate 600 stays inside the brand's Slate ramp and clears both surfaces it is used on: 6.92:1 on
|
|
73
|
+
* muted, 7.58:1 on white. Worth raising with brand governance (section 34) so 15.6 records a
|
|
74
|
+
* surface for muted text rather than leaving it to be inferred. */
|
|
75
|
+
--muted-foreground: 215 19% 35%;
|
|
76
|
+
--accent: 221 83% 53%;
|
|
47
77
|
--accent-foreground: 0 0% 100%;
|
|
48
|
-
--destructive: 0
|
|
78
|
+
--destructive: 0 72% 51%;
|
|
49
79
|
--destructive-foreground: 0 0% 100%;
|
|
50
80
|
--border: 214 32% 91%;
|
|
51
81
|
--input: 214 32% 91%;
|
|
@@ -53,10 +83,13 @@
|
|
|
53
83
|
--base-bg: 210 40% 98%;
|
|
54
84
|
--surface-bg: 0 0% 100%;
|
|
55
85
|
--surface-elevated: 210 33% 96%;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
--text-
|
|
86
|
+
/* Section 15.6, text on light backgrounds: Slate 900 body, Slate 700 secondary, Slate 500 muted;
|
|
87
|
+
* Slate 400 for disabled. These were approximations (`215 16% 28%`, `215 14% 42%`, `215 10% 60%`)
|
|
88
|
+
* that each rendered a slightly different colour from the brand's. */
|
|
89
|
+
--text-heading: 222 47% 11%; /* Slate 900 #0F172A */
|
|
90
|
+
--text-body: 215 25% 27%; /* Slate 700 #334155 */
|
|
91
|
+
--text-muted: 215 16% 47%; /* Slate 500 #64748B */
|
|
92
|
+
--text-disabled: 215 20% 65%; /* Slate 400 #94A3B8 */
|
|
60
93
|
|
|
61
94
|
--font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
|
|
62
95
|
--font-body: "Inter", system-ui, sans-serif;
|
|
@@ -87,7 +120,11 @@
|
|
|
87
120
|
--color-border-dark-medium: rgba(255,255,255,.20);
|
|
88
121
|
--color-border-dark-strong: rgba(255,255,255,.32);
|
|
89
122
|
|
|
90
|
-
|
|
123
|
+
/* Slate 950 #020617, section 15.3. Was `222 47% 4%`, which renders #05080F -- eight units off in a
|
|
124
|
+
* channel and desaturated, so the dark theme's primary surface was a slightly different colour from
|
|
125
|
+
* the one the brand specifies. White on the corrected value measures 20.17:1, matching the 20.3:1
|
|
126
|
+
* section 17.2 records for this pair. */
|
|
127
|
+
--background: 229 84% 5%;
|
|
91
128
|
--foreground: 0 0% 100%;
|
|
92
129
|
--card: 222 47% 7%;
|
|
93
130
|
--card-foreground: 0 0% 100%;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a brand colour token to a concrete colour string, for the APIs that cannot take one.
|
|
3
|
+
*
|
|
4
|
+
* <h2>Why this exists</h2>
|
|
5
|
+
*
|
|
6
|
+
* Charting libraries, canvas drawing and anything that hands a colour to a non-DOM renderer need a
|
|
7
|
+
* real value — `var(--color-brand-blue)` is meaningless to Recharts, so every chart in the estate
|
|
8
|
+
* wrote the hex literally instead:
|
|
9
|
+
*
|
|
10
|
+
* ```tsx
|
|
11
|
+
* renderChart(revenueData, "#8B5CF6", ...)
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* That renders correctly and is still wrong: 97 literals across 14 frontends duplicate a token the
|
|
15
|
+
* design system already publishes, so each one stops tracking the brand the moment the token moves.
|
|
16
|
+
* Nothing fails when they diverge — a colour is never an error — which is why they accumulated
|
|
17
|
+
* unnoticed. `ops/check-brand-tokens.sh` reports them; this is what they should become.
|
|
18
|
+
*
|
|
19
|
+
* <h2>Why it reads the live value rather than returning a constant</h2>
|
|
20
|
+
*
|
|
21
|
+
* Reading the computed custom property means the answer follows the active theme and any override an
|
|
22
|
+
* app has applied, which a hardcoded hex cannot. The documented fallback is used only where there is
|
|
23
|
+
* no document to read — server rendering, unit tests, a thumbnail capture — so callers always get a
|
|
24
|
+
* usable colour and never an empty string.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The brand colour tokens this module can resolve, each with the value the brand system specifies.
|
|
28
|
+
*
|
|
29
|
+
* The fallbacks are duplicated from the stylesheet deliberately: this module must work with no DOM,
|
|
30
|
+
* and a fallback that guesses would be worse than one that is wrong loudly.
|
|
31
|
+
* `busiverse-ui/tests/brand-compliance.test.mjs` holds both copies to the brand document, so they
|
|
32
|
+
* cannot drift apart silently.
|
|
33
|
+
*/
|
|
34
|
+
export declare const BRAND_COLOR_FALLBACKS: {
|
|
35
|
+
readonly "--color-brand-blue": "#3B82F6";
|
|
36
|
+
readonly "--color-brand-violet": "#8B5CF6";
|
|
37
|
+
readonly "--color-brand-cyan": "#06B6D4";
|
|
38
|
+
readonly "--color-action-blue": "#2563EB";
|
|
39
|
+
readonly "--color-action-blue-hover": "#1D4ED8";
|
|
40
|
+
readonly "--color-action-violet": "#7C3AED";
|
|
41
|
+
readonly "--color-action-violet-hover": "#6D28D9";
|
|
42
|
+
readonly "--color-action-cyan": "#0E7490";
|
|
43
|
+
readonly "--color-action-cyan-hover": "#155E75";
|
|
44
|
+
};
|
|
45
|
+
export type BrandColorToken = keyof typeof BRAND_COLOR_FALLBACKS;
|
|
46
|
+
/**
|
|
47
|
+
* The default order for chart series.
|
|
48
|
+
*
|
|
49
|
+
* Blue, violet, cyan — the order section 15.1 lists them in, and the order the charts already use, so
|
|
50
|
+
* adopting this changes no existing chart's appearance. Ordering it here means a fourth series gets a
|
|
51
|
+
* decided colour instead of an invented one.
|
|
52
|
+
*/
|
|
53
|
+
export declare const BRAND_CHART_SERIES: readonly BrandColorToken[];
|
|
54
|
+
/**
|
|
55
|
+
* The resolved colour for one brand token.
|
|
56
|
+
*
|
|
57
|
+
* Returns the documented value when there is no document, when the property is unset, or when
|
|
58
|
+
* reading it throws — some embedding contexts refuse `getComputedStyle`. A chart with a fallback
|
|
59
|
+
* colour is a working chart; a chart with `""` is an invisible series.
|
|
60
|
+
*/
|
|
61
|
+
export declare function brandColor(token: BrandColorToken, element?: Element): string;
|
|
62
|
+
/**
|
|
63
|
+
* Resolved colours for a chart's series, in brand order, cycling when there are more series than
|
|
64
|
+
* brand accents.
|
|
65
|
+
*
|
|
66
|
+
* Cycling rather than generating: an invented fourth colour is off-brand by definition, and a
|
|
67
|
+
* repeated accent is at least a decision somebody can see and correct. If a chart genuinely needs
|
|
68
|
+
* more than three distinguishable series, that is a brand question — section 34 governance — not one
|
|
69
|
+
* a helper should answer by interpolating.
|
|
70
|
+
*/
|
|
71
|
+
export declare function brandChartColors(count: number, element?: Element): string[];
|
|
72
|
+
//# sourceMappingURL=brandColor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brandColor.d.ts","sourceRoot":"","sources":["../../src/theme/brandColor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;CAUxB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,qBAAqB,CAAC;AAEjE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAIxD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAW5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAM3E"}
|
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,0BAA0B,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,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;AACpD,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC"}
|
package/dist/theme-public.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BRAND_CHART_SERIES,
|
|
3
|
+
BRAND_COLOR_FALLBACKS,
|
|
2
4
|
BUSIVERSE_THEME_STORAGE_KEY,
|
|
3
5
|
BusiverseThemeProvider,
|
|
4
|
-
ThemeModeSelect
|
|
5
|
-
|
|
6
|
+
ThemeModeSelect,
|
|
7
|
+
brandChartColors,
|
|
8
|
+
brandColor
|
|
9
|
+
} from "./chunk-HXWXIXU3.js";
|
|
6
10
|
import "./chunk-PYZVP4NI.js";
|
|
7
11
|
export {
|
|
12
|
+
BRAND_CHART_SERIES,
|
|
13
|
+
BRAND_COLOR_FALLBACKS,
|
|
8
14
|
BUSIVERSE_THEME_STORAGE_KEY,
|
|
9
15
|
BusiverseThemeProvider,
|
|
10
|
-
ThemeModeSelect
|
|
16
|
+
ThemeModeSelect,
|
|
17
|
+
brandChartColors,
|
|
18
|
+
brandColor
|
|
11
19
|
};
|
package/package.json
CHANGED
|
@@ -1,121 +1,127 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@busiverse/ui",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"author": "Joel Julius Okoromi <okmarq@gmail.com> (https://busiversehq.com)",
|
|
5
|
-
"description": "BUSIVERSE shared React UI, design tokens, pricing, i18n, auth helpers, and product shell. Network-neutral core; Gateway transport is app-injected.",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"sideEffects": [
|
|
8
|
-
"./dist/styles.css"
|
|
9
|
-
],
|
|
10
|
-
"files": [
|
|
11
|
-
"dist",
|
|
12
|
-
"README.md"
|
|
13
|
-
],
|
|
14
|
-
"main": "./dist/index.js",
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
|
-
"exports": {
|
|
17
|
-
".": {
|
|
18
|
-
"types": "./dist/index.d.ts",
|
|
19
|
-
"import": "./dist/index.js",
|
|
20
|
-
"default": "./dist/index.js"
|
|
21
|
-
},
|
|
22
|
-
"./styles.css": "./dist/styles.css",
|
|
23
|
-
"./tailwind": {
|
|
24
|
-
"types": "./dist/tailwind-public.d.ts",
|
|
25
|
-
"import": "./dist/tailwind-public.js",
|
|
26
|
-
"default": "./dist/tailwind-public.js"
|
|
27
|
-
},
|
|
28
|
-
"./assets/*": "./dist/assets/*",
|
|
29
|
-
"./package.json": "./package.json",
|
|
30
|
-
"./brand": {
|
|
31
|
-
"types": "./dist/brand.d.ts",
|
|
32
|
-
"import": "./dist/brand.js",
|
|
33
|
-
"default": "./dist/brand.js"
|
|
34
|
-
},
|
|
35
|
-
"./i18n": {
|
|
36
|
-
"types": "./dist/i18n-public.d.ts",
|
|
37
|
-
"import": "./dist/i18n-public.js",
|
|
38
|
-
"default": "./dist/i18n-public.js"
|
|
39
|
-
},
|
|
40
|
-
"./billing": {
|
|
41
|
-
"types": "./dist/billing.d.ts",
|
|
42
|
-
"import": "./dist/billing.js",
|
|
43
|
-
"default": "./dist/billing.js"
|
|
44
|
-
},
|
|
45
|
-
"./social": {
|
|
46
|
-
"types": "./dist/social.d.ts",
|
|
47
|
-
"import": "./dist/social.js",
|
|
48
|
-
"default": "./dist/social.js"
|
|
49
|
-
},
|
|
50
|
-
"./marketing": {
|
|
51
|
-
"types": "./dist/marketing.d.ts",
|
|
52
|
-
"import": "./dist/marketing.js",
|
|
53
|
-
"default": "./dist/marketing.js"
|
|
54
|
-
},
|
|
55
|
-
"./assets": {
|
|
56
|
-
"types": "./dist/assets-public.d.ts",
|
|
57
|
-
"import": "./dist/assets-public.js",
|
|
58
|
-
"default": "./dist/assets-public.js"
|
|
59
|
-
},
|
|
60
|
-
"./theme": {
|
|
61
|
-
"types": "./dist/theme-public.d.ts",
|
|
62
|
-
"import": "./dist/theme-public.js",
|
|
63
|
-
"default": "./dist/theme-public.js"
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
},
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@busiverse/ui",
|
|
3
|
+
"version": "0.2.15",
|
|
4
|
+
"author": "Joel Julius Okoromi <okmarq@gmail.com> (https://busiversehq.com)",
|
|
5
|
+
"description": "BUSIVERSE shared React UI, design tokens, pricing, i18n, auth helpers, and product shell. Network-neutral core; Gateway transport is app-injected.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"./dist/styles.css"
|
|
9
|
+
],
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./styles.css": "./dist/styles.css",
|
|
23
|
+
"./tailwind": {
|
|
24
|
+
"types": "./dist/tailwind-public.d.ts",
|
|
25
|
+
"import": "./dist/tailwind-public.js",
|
|
26
|
+
"default": "./dist/tailwind-public.js"
|
|
27
|
+
},
|
|
28
|
+
"./assets/*": "./dist/assets/*",
|
|
29
|
+
"./package.json": "./package.json",
|
|
30
|
+
"./brand": {
|
|
31
|
+
"types": "./dist/brand.d.ts",
|
|
32
|
+
"import": "./dist/brand.js",
|
|
33
|
+
"default": "./dist/brand.js"
|
|
34
|
+
},
|
|
35
|
+
"./i18n": {
|
|
36
|
+
"types": "./dist/i18n-public.d.ts",
|
|
37
|
+
"import": "./dist/i18n-public.js",
|
|
38
|
+
"default": "./dist/i18n-public.js"
|
|
39
|
+
},
|
|
40
|
+
"./billing": {
|
|
41
|
+
"types": "./dist/billing.d.ts",
|
|
42
|
+
"import": "./dist/billing.js",
|
|
43
|
+
"default": "./dist/billing.js"
|
|
44
|
+
},
|
|
45
|
+
"./social": {
|
|
46
|
+
"types": "./dist/social.d.ts",
|
|
47
|
+
"import": "./dist/social.js",
|
|
48
|
+
"default": "./dist/social.js"
|
|
49
|
+
},
|
|
50
|
+
"./marketing": {
|
|
51
|
+
"types": "./dist/marketing.d.ts",
|
|
52
|
+
"import": "./dist/marketing.js",
|
|
53
|
+
"default": "./dist/marketing.js"
|
|
54
|
+
},
|
|
55
|
+
"./assets": {
|
|
56
|
+
"types": "./dist/assets-public.d.ts",
|
|
57
|
+
"import": "./dist/assets-public.js",
|
|
58
|
+
"default": "./dist/assets-public.js"
|
|
59
|
+
},
|
|
60
|
+
"./theme": {
|
|
61
|
+
"types": "./dist/theme-public.d.ts",
|
|
62
|
+
"import": "./dist/theme-public.js",
|
|
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"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"scripts": {
|
|
72
|
+
"clean": "node scripts/clean.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",
|
|
74
|
+
"typecheck": "tsc --noEmit",
|
|
75
|
+
"test": "node --test tests/*.test.mjs",
|
|
76
|
+
"pack:local": "npm pack",
|
|
77
|
+
"prepublishOnly": "npm run typecheck && npm run build && npm pack --dry-run"
|
|
78
|
+
},
|
|
79
|
+
"peerDependencies": {
|
|
80
|
+
"react": "^19.2.7",
|
|
81
|
+
"react-dom": "^19.2.7",
|
|
82
|
+
"tailwindcss": "^4.3.1",
|
|
83
|
+
"next-themes": "^0.4.6"
|
|
84
|
+
},
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@types/react": "19.2.17",
|
|
87
|
+
"@types/react-dom": "19.2.3",
|
|
88
|
+
"react": "19.2.7",
|
|
89
|
+
"react-dom": "19.2.7",
|
|
90
|
+
"tailwindcss": "4.3.1",
|
|
91
|
+
"tsup": "8.5.1",
|
|
92
|
+
"typescript": "6.0.3",
|
|
93
|
+
"next-themes": "0.4.6"
|
|
94
|
+
},
|
|
95
|
+
"publishConfig": {
|
|
96
|
+
"registry": "https://registry.npmjs.org/",
|
|
97
|
+
"access": "public"
|
|
98
|
+
},
|
|
99
|
+
"repository": {
|
|
100
|
+
"type": "git",
|
|
101
|
+
"url": "git+https://okmarq@github.com/Busiverse/ui-package.git"
|
|
102
|
+
},
|
|
103
|
+
"keywords": [
|
|
104
|
+
"Busiverse",
|
|
105
|
+
"Ecosystem",
|
|
106
|
+
"Business",
|
|
107
|
+
"Technology",
|
|
108
|
+
"Intelligence"
|
|
109
|
+
],
|
|
110
|
+
"license": "ISC",
|
|
111
|
+
"bugs": {
|
|
112
|
+
"url": "https://github.com/Busiverse/ui-package/issues"
|
|
113
|
+
},
|
|
114
|
+
"homepage": "https://github.com/Busiverse/ui-package#readme",
|
|
115
|
+
"peerDependenciesMeta": {
|
|
116
|
+
"tailwindcss": {
|
|
117
|
+
"optional": true
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"engines": {
|
|
121
|
+
"node": ">=22.12.0",
|
|
122
|
+
"npm": ">=10.9.0"
|
|
123
|
+
},
|
|
124
|
+
"overrides": {
|
|
125
|
+
"esbuild": "0.28.1"
|
|
126
|
+
}
|
|
127
|
+
}
|