@busiverse/ui 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -144,5 +144,76 @@ npm run typecheck
144
144
  npm run build
145
145
  npm audit --audit-level=low
146
146
  npm pack --dry-run
147
- npm publish --access restricted
147
+ npm publish --access public
148
148
  ```
149
+
150
+ ## Version 0.2.0 additions
151
+
152
+ This release adds the BUSIVERSE standardized service pricing system used by `busiverse-landing` and reusable by every separately deployed Vercel frontend.
153
+
154
+ ### Added
155
+
156
+ - `busiverseServicePricingCatalog` with 257 Account-rated operation rows.
157
+ - `ServicePricingExplorer` for external pricing, internal Busiverse chargeback, estimated direct cost, margin, and standardized equivalents.
158
+ - `RegionSelector` and supported pricing regions.
159
+ - Country/region/currency/time-zone aware pricing display helpers.
160
+ - Time-series aware service metadata for services that surface metrics, decision history, request metering, blockchain events, model jobs, and market data.
161
+
162
+ ### Vercel frontend usage
163
+
164
+ Install from public npm after publishing this version:
165
+
166
+ ```bash
167
+ npm install @busiverse/ui@^0.2.0
168
+ ```
169
+
170
+ Import shared styles once in each Vite frontend entrypoint:
171
+
172
+ ```tsx
173
+ import "@busiverse/ui/styles.css";
174
+ ```
175
+
176
+ Wrap the frontend with the i18n provider:
177
+
178
+ ```tsx
179
+ import { BusiverseI18nProvider } from "@busiverse/ui";
180
+
181
+ <BusiverseI18nProvider
182
+ initialRegion={{
183
+ locale: import.meta.env.VITE_DEFAULT_LOCALE ?? "en-NG",
184
+ countryCode: import.meta.env.VITE_DEFAULT_COUNTRY ?? "NG",
185
+ regionCode: import.meta.env.VITE_DEFAULT_REGION ?? "NG-LA",
186
+ currencyCode: import.meta.env.VITE_DEFAULT_CURRENCY ?? "NGN",
187
+ timeZone: import.meta.env.VITE_DEFAULT_TIME_ZONE ?? "Africa/Lagos",
188
+ }}
189
+ >
190
+ <App />
191
+ </BusiverseI18nProvider>
192
+ ```
193
+
194
+ Use the standardized pricing explorer anywhere pricing must be shown:
195
+
196
+ ```tsx
197
+ import { ServicePricingExplorer } from "@busiverse/ui";
198
+
199
+ <ServicePricingExplorer />
200
+ ```
201
+
202
+ The current currency conversion rates are display fallbacks only. Final production charging still belongs to Account, with Location and Mint resolving region, currency, taxes, pass-through cost, and local pricing rules.
203
+
204
+
205
+ ## v0.2.1 network-neutral security patch
206
+
207
+ `@busiverse/ui` no longer performs direct network access from inside the package. The previous `createGatewayClient` implementation used the browser `fetch` global directly, which can be flagged by npm/package scanners as “network access”. The package now requires the consuming frontend to inject a transport function.
208
+
209
+ ```ts
210
+ import { createGatewayClient } from "@busiverse/ui";
211
+
212
+ export const gateway = createGatewayClient({
213
+ baseUrl: import.meta.env.VITE_GATEWAY_API_URL,
214
+ transport: window.fetch.bind(window),
215
+ getAccessToken: async () => accessToken,
216
+ });
217
+ ```
218
+
219
+ Font loading is also app-owned. The shared CSS does not import Google Fonts or any remote stylesheet. Each separately deployed Vercel frontend should self-host the BUSIVERSE fonts or load them explicitly at the app level.
@@ -1,6 +1,15 @@
1
1
  import type { BusiverseRegionContext } from "../i18n/types";
2
+ export type GatewayTransport = (url: string, init: RequestInit) => Promise<Response>;
2
3
  export interface GatewayClientOptions {
3
4
  baseUrl: string;
5
+ /**
6
+ * Transport is intentionally injected by the consuming frontend.
7
+ *
8
+ * The shared UI package must remain network-neutral so package scanners do not
9
+ * classify @busiverse/ui itself as a network-capable module. Browser/Vercel
10
+ * apps should pass `window.fetch.bind(window)` or their own audited wrapper.
11
+ */
12
+ transport: GatewayTransport;
4
13
  getAccessToken?: () => Promise<string | null | undefined> | string | null | undefined;
5
14
  region?: BusiverseRegionContext;
6
15
  defaultHeaders?: HeadersInit;
@@ -1 +1 @@
1
- {"version":3,"file":"createGatewayClient.d.ts","sourceRoot":"","sources":["../../src/api/createGatewayClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAG5D,MAAM,WAAW,o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* as React from "react";
2
+ import { type BusiversePricingRow, type PricingAudience } from "../../pricing/servicePricingCatalog";
3
+ export interface ServicePricingExplorerProps {
4
+ className?: string;
5
+ title?: string;
6
+ description?: string;
7
+ rows?: BusiversePricingRow[];
8
+ defaultAudience?: PricingAudience;
9
+ showRegionSelector?: boolean;
10
+ maxInitialRows?: number;
11
+ }
12
+ export declare function ServicePricingExplorer({ className, title, description, rows, defaultAudience, showRegionSelector, maxInitialRows, }: ServicePricingExplorerProps): React.JSX.Element;
13
+ //# sourceMappingURL=ServicePricingExplorer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServicePricingExplorer.d.ts","sourceRoot":"","sources":["../../../src/components/billing/ServicePricingExplorer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,EAGL,KAAK,mBAAmB,EAExB,KAAK,eAAe,EACrB,MAAM,qCAAqC,CAAC;AAG7C,MAAM,WAAW,2BAA2B;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAgCD,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,KAAsC,EACtC,WAA0N,EAC1N,IAAqC,EACrC,eAA4B,EAC5B,kBAAyB,EACzB,cAAmB,GACpB,EAAE,2BAA2B,qBAyF7B"}
@@ -1,3 +1,4 @@
1
1
  export * from "./CurrencyAmount";
2
2
  export * from "./UsageQuotaBar";
3
+ export * from "./ServicePricingExplorer";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/billing/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/billing/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { type BusiverseSupportedRegion } from "../pricing/regions";
3
+ export interface RegionSelectorProps {
4
+ regions?: BusiverseSupportedRegion[];
5
+ label?: string;
6
+ className?: string;
7
+ }
8
+ export declare function RegionSelector({ regions, label, className }: RegionSelectorProps): React.JSX.Element;
9
+ //# sourceMappingURL=RegionSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RegionSelector.d.ts","sourceRoot":"","sources":["../../src/i18n/RegionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA6B,KAAK,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAI9F,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAAE,OAAmC,EAAE,KAAwB,EAAE,SAAS,EAAE,EAAE,mBAAmB,qBAqB/H"}
@@ -1,4 +1,5 @@
1
- export * from "./types";
2
1
  export * from "./BusiverseI18nProvider";
3
2
  export * from "./format";
3
+ export * from "./types";
4
+ export * from "./RegionSelector";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./tokens";
2
2
  export * from "./assets/assets";
3
3
  export * from "./components";
4
4
  export * from "./registry/services";
5
+ export * from "./pricing";
5
6
  export * from "./api";
6
7
  export * from "./auth";
7
8
  export * from "./i18n";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}