@billing-io/designs 1.0.0

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.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Full SVG logo badge (the "b." glyph) used in billing.js overlay headers.
3
+ * This is the production brand mark — use this in all customer-facing contexts.
4
+ */
5
+ export declare const BRAND_SVG_VIEWBOX = "0 0 1024 1024";
6
+ export declare const BRAND_SVG_PATHS: {
7
+ background: {
8
+ fill: string;
9
+ d: string;
10
+ };
11
+ letterB: {
12
+ fill: string;
13
+ d: string;
14
+ };
15
+ dot: {
16
+ fill: string;
17
+ d: string;
18
+ };
19
+ };
20
+ /**
21
+ * Build an inline-HTML brand badge at the given size.
22
+ * This is the full SVG version used in the canonical billing.js.
23
+ */
24
+ export type BadgeSize = "sm" | "md" | "lg";
25
+ export interface BadgeDimensions {
26
+ size: number;
27
+ borderRadius: number;
28
+ }
29
+ export declare const BADGE_DIMENSIONS: Record<BadgeSize, BadgeDimensions>;
30
+ export declare function buildBrandBadgeHTML(size?: BadgeSize): string;
31
+ /**
32
+ * Get the full SVG markup for the brand logo (no container div).
33
+ */
34
+ export declare function getBrandSVG(width?: number, height?: number): string;
35
+ //# sourceMappingURL=brand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../src/brand.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAU3B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,SAAS,EAAE,eAAe,CAI/D,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,IAAI,GAAE,SAAgB,GAAG,MAAM,CAUlE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,GAAE,MAAW,EAAE,MAAM,GAAE,MAAW,GAAG,MAAM,CAQ3E"}
package/dist/brand.js ADDED
@@ -0,0 +1,43 @@
1
+ // @billing-io/designs — Brand assets
2
+ // Canonical SVG badge and brand constants for billing.io
3
+ /**
4
+ * Full SVG logo badge (the "b." glyph) used in billing.js overlay headers.
5
+ * This is the production brand mark — use this in all customer-facing contexts.
6
+ */
7
+ export const BRAND_SVG_VIEWBOX = "0 0 1024 1024";
8
+ export const BRAND_SVG_PATHS = {
9
+ background: { fill: "#000", d: "" },
10
+ letterB: {
11
+ fill: "#fff",
12
+ d: "M648.077,530.65c0,46.2-18.34,81.95-55,107.25-25.3,17.239-51.7,25.851-79.2,25.851-10.27,0-25.119-3.301-44.55-9.9-10.27-3.661-18.149-5.5-23.649-5.5-9.9,0-19.989,3.67-30.25,11-2.2,1.461-3.851,2.2-4.95,2.2-2.569,0-4.039-1.101-4.4-3.3-.369-2.2-.55-8.801-.55-19.801v-322.85c0-9.53-1.719-15.761-5.156-18.7-3.438-2.931-10.948-4.4-22.533-4.4-9.771,0-14.66-1.28-14.66-3.85s2.234-3.85,6.694-3.85c41.653,0,77.919-4.581,108.797-13.75l.559,8.8v162.25c14.618-20.161,34.899-30.25,60.853-30.25,31.427,0,57.285,11.095,77.567,33.274,20.281,22.189,30.43,50.695,30.43,85.525ZM566.127,532.851c0-71.131-14.85-106.7-44.55-106.7-16.5,0-28.6,7.7-36.3,23.1-2.939,5.87-4.675,12.745-5.225,20.625-.551,7.89-.825,30.345-.825,67.375v33.551c0,34.469,2.286,57.294,6.875,68.475,4.58,11.189,13.836,16.775,27.774,16.775,19.062,0,32.536-9.351,40.426-28.051,7.88-18.699,11.824-50.41,11.824-95.149Z",
13
+ },
14
+ dot: {
15
+ fill: "#fff",
16
+ d: "M692.003,642.041c0,7.235-2.336,13.186-7,17.851-4.671,4.665-10.621,7-17.851,7s-13.3-2.396-18.2-7.175c-4.899-4.78-7.35-10.676-7.35-17.676,0-7.229,2.45-13.3,7.35-18.199s10.965-7.351,18.2-7.351c6.765,0,12.601,2.45,17.5,7.351,4.9,4.899,7.351,10.97,7.351,18.199Z",
17
+ },
18
+ };
19
+ export const BADGE_DIMENSIONS = {
20
+ sm: { size: 18, borderRadius: 4 },
21
+ md: { size: 20, borderRadius: 5 },
22
+ lg: { size: 24, borderRadius: 6 },
23
+ };
24
+ export function buildBrandBadgeHTML(size = "md") {
25
+ const { size: dim, borderRadius: br } = BADGE_DIMENSIONS[size];
26
+ return (`<div style="width:${dim}px;height:${dim}px;background:#000;border-radius:${br}px;display:flex;align-items:center;justify-content:center;overflow:hidden;">` +
27
+ `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${BRAND_SVG_VIEWBOX}" width="${dim}" height="${dim}">` +
28
+ `<rect width="1024" height="1024" fill="#000"/>` +
29
+ `<path fill="${BRAND_SVG_PATHS.letterB.fill}" d="${BRAND_SVG_PATHS.letterB.d}"/>` +
30
+ `<path fill="${BRAND_SVG_PATHS.dot.fill}" d="${BRAND_SVG_PATHS.dot.d}"/>` +
31
+ `</svg></div>`);
32
+ }
33
+ /**
34
+ * Get the full SVG markup for the brand logo (no container div).
35
+ */
36
+ export function getBrandSVG(width = 24, height = 24) {
37
+ return (`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${BRAND_SVG_VIEWBOX}" width="${width}" height="${height}">` +
38
+ `<rect width="1024" height="1024" fill="#000"/>` +
39
+ `<path fill="${BRAND_SVG_PATHS.letterB.fill}" d="${BRAND_SVG_PATHS.letterB.d}"/>` +
40
+ `<path fill="${BRAND_SVG_PATHS.dot.fill}" d="${BRAND_SVG_PATHS.dot.d}"/>` +
41
+ `</svg>`);
42
+ }
43
+ //# sourceMappingURL=brand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.js","sourceRoot":"","sources":["../src/brand.ts"],"names":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,iBAAiB,YAAY,KAAK,aAAa,MAAM,IAAI;QAC7G,gDAAgD;QAChD,eAAe,eAAe,CAAC,OAAO,CAAC,IAAI,QAAQ,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK;QACjF,eAAe,eAAe,CAAC,GAAG,CAAC,IAAI,QAAQ,eAAe,CAAC,GAAG,CAAC,CAAC,KAAK;QACzE,QAAQ,CACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { PLANS, MARKETING_PLANS, MARKETING_SANDBOX, COMPARISON_PLANS, COMPARISON_DATA, PRICING_FAQS, MID_CYCLE_THRESHOLD_USD, PAST_DUE_RESTRICT_HOURS, RESTRICT_SUSPEND_HOURS, USAGE_WARNING_THRESHOLD, BILLING_EMAIL_EVENTS, BILLING_EVENT_TYPES, } from "./plans.js";
2
+ export type { PlanId, BillingStatus, PlanConfig, MarketingPlan, MarketingSandboxPlan, ComparisonValue, ComparisonFeature, ComparisonSection, FaqEntry, } from "./plans.js";
3
+ export { BRAND_SVG_VIEWBOX, BRAND_SVG_PATHS, BADGE_DIMENSIONS, buildBrandBadgeHTML, getBrandSVG, } from "./brand.js";
4
+ export type { BadgeSize, BadgeDimensions } from "./brand.js";
5
+ export { OVERLAY_Z_INDEX, EASING, MSG_PREFIX, VARIATION_ALIASES, VARIATIONS, CLOSE_BUTTON, BACKDROP, CARD, PANEL, BOTTOM_SHEET, POPUP, FULLSCREEN, SUCCESS_AUTO_CLOSE_MS, } from "./overlay/index.js";
6
+ export type { VariationName, VariationMeta } from "./overlay/index.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,GACT,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7D,OAAO,EACL,eAAe,EACf,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,KAAK,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ // @billing-io/designs — Centralized design definitions for billing.io
2
+ //
3
+ // This package is the single source of truth for:
4
+ // - Plan/pricing definitions and types
5
+ // - Brand assets (SVG badge, logo)
6
+ // - Checkout overlay design constants (variations, animations, dimensions)
7
+ // - Billing system constants (thresholds, event types)
8
+ //
9
+ // All billing.io projects should import from this package instead of
10
+ // duplicating these values.
11
+ // Plans, pricing, and billing constants
12
+ export { PLANS, MARKETING_PLANS, MARKETING_SANDBOX, COMPARISON_PLANS, COMPARISON_DATA, PRICING_FAQS, MID_CYCLE_THRESHOLD_USD, PAST_DUE_RESTRICT_HOURS, RESTRICT_SUSPEND_HOURS, USAGE_WARNING_THRESHOLD, BILLING_EMAIL_EVENTS, BILLING_EVENT_TYPES, } from "./plans.js";
13
+ // Brand assets
14
+ export { BRAND_SVG_VIEWBOX, BRAND_SVG_PATHS, BADGE_DIMENSIONS, buildBrandBadgeHTML, getBrandSVG, } from "./brand.js";
15
+ // Overlay design constants
16
+ export { OVERLAY_Z_INDEX, EASING, MSG_PREFIX, VARIATION_ALIASES, VARIATIONS, CLOSE_BUTTON, BACKDROP, CARD, PANEL, BOTTOM_SHEET, POPUP, FULLSCREEN, SUCCESS_AUTO_CLOSE_MS, } from "./overlay/index.js";
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,kDAAkD;AAClD,yCAAyC;AACzC,qCAAqC;AACrC,6EAA6E;AAC7E,yDAAyD;AACzD,EAAE;AACF,qEAAqE;AACrE,4BAA4B;AAE5B,wCAAwC;AACxC,OAAO,EACL,KAAK,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAcpB,eAAe;AACf,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,GACZ,MAAM,YAAY,CAAC;AAIpB,2BAA2B;AAC3B,OAAO,EACL,eAAe,EACf,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,KAAK,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,60 @@
1
+ export declare const OVERLAY_Z_INDEX = 2147483647;
2
+ export declare const EASING: {
3
+ readonly OUT_EXPO: "cubic-bezier(0.16, 1, 0.3, 1)";
4
+ readonly OUT_QUINT: "cubic-bezier(0.22, 1, 0.36, 1)";
5
+ readonly IN_EXPO: "cubic-bezier(0.7, 0, 0.84, 0)";
6
+ };
7
+ export declare const MSG_PREFIX = "billing:";
8
+ export declare const VARIATION_ALIASES: Record<string, number>;
9
+ export type VariationName = "centered" | "panel" | "bottom" | "fullscreen" | "popup";
10
+ export interface VariationMeta {
11
+ id: number;
12
+ name: string;
13
+ description: string;
14
+ /** Primary alias for this variation */
15
+ alias: VariationName;
16
+ }
17
+ export declare const VARIATIONS: VariationMeta[];
18
+ export declare const CLOSE_BUTTON: {
19
+ readonly size: 32;
20
+ readonly borderRadius: 10;
21
+ readonly background: "#f3f4f6";
22
+ readonly hoverBackground: "#e5e7eb";
23
+ readonly color: "#6b7280";
24
+ readonly iconSize: 14;
25
+ };
26
+ export declare const BACKDROP: {
27
+ readonly color: "rgba(0,0,0,0.4)";
28
+ readonly blur: "12px";
29
+ readonly lightColor: "rgba(0,0,0,0.3)";
30
+ readonly lightBlur: "6px";
31
+ readonly scrimColor: "rgba(0,0,0,0.08)";
32
+ };
33
+ export declare const CARD: {
34
+ readonly maxWidth: 460;
35
+ readonly maxHeight: 680;
36
+ readonly borderRadius: 20;
37
+ readonly minIframeHeight: 600;
38
+ };
39
+ export declare const PANEL: {
40
+ readonly width: 460;
41
+ };
42
+ export declare const BOTTOM_SHEET: {
43
+ readonly maxWidth: 500;
44
+ readonly maxHeight: "92vh";
45
+ readonly minIframeHeight: 580;
46
+ readonly handleWidth: 36;
47
+ readonly handleHeight: 4;
48
+ };
49
+ export declare const POPUP: {
50
+ readonly width: 420;
51
+ readonly height: 640;
52
+ readonly offset: 24;
53
+ readonly borderRadius: 16;
54
+ };
55
+ export declare const FULLSCREEN: {
56
+ readonly background: "rgba(247,248,250,1)";
57
+ readonly backgroundTransparent: "rgba(247,248,250,0)";
58
+ };
59
+ export declare const SUCCESS_AUTO_CLOSE_MS = 2500;
60
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/overlay/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,aAAa,CAAC;AAG1C,eAAO,MAAM,MAAM;;;;CAIT,CAAC;AAGX,eAAO,MAAM,UAAU,aAAa,CAAC;AAGrC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMpD,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC;AAErF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,eAAO,MAAM,UAAU,EAAE,aAAa,EAMrC,CAAC;AAGF,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAGX,eAAO,MAAM,QAAQ;;;;;;CAMX,CAAC;AAGX,eAAO,MAAM,IAAI;;;;;CAKP,CAAC;AAGX,eAAO,MAAM,KAAK;;CAER,CAAC;AAGX,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAGX,eAAO,MAAM,KAAK;;;;;CAKR,CAAC;AAGX,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAGX,eAAO,MAAM,qBAAqB,OAAO,CAAC"}
@@ -0,0 +1,77 @@
1
+ // @billing-io/designs — Checkout overlay design constants
2
+ // Shared values used across all 5 overlay variations in billing.js
3
+ export const OVERLAY_Z_INDEX = 2147483647;
4
+ // Spring-like easing curves for overlay animations
5
+ export const EASING = {
6
+ OUT_EXPO: "cubic-bezier(0.16, 1, 0.3, 1)",
7
+ OUT_QUINT: "cubic-bezier(0.22, 1, 0.36, 1)",
8
+ IN_EXPO: "cubic-bezier(0.7, 0, 0.84, 0)",
9
+ };
10
+ // PostMessage protocol
11
+ export const MSG_PREFIX = "billing:";
12
+ // Variation name -> number mapping
13
+ export const VARIATION_ALIASES = {
14
+ centered: 1, card: 1,
15
+ panel: 2, side: 2, sidepanel: 2,
16
+ bottom: 3, sheet: 3, bottomsheet: 3,
17
+ fullscreen: 4, full: 4, takeover: 4,
18
+ popup: 5, floating: 5, pill: 5,
19
+ };
20
+ export const VARIATIONS = [
21
+ { id: 1, name: "Centered Card", description: "Classic centered modal, backdrop blur", alias: "centered" },
22
+ { id: 2, name: "Side Panel", description: "Right-anchored slide-in sheet", alias: "panel" },
23
+ { id: 3, name: "Bottom Sheet", description: "Mobile-friendly bottom sheet", alias: "bottom" },
24
+ { id: 4, name: "Fullscreen", description: "Immersive full-screen overlay", alias: "fullscreen" },
25
+ { id: 5, name: "Floating Popup", description: "Compact bottom-right popup", alias: "popup" },
26
+ ];
27
+ // Close button dimensions
28
+ export const CLOSE_BUTTON = {
29
+ size: 32,
30
+ borderRadius: 10,
31
+ background: "#f3f4f6",
32
+ hoverBackground: "#e5e7eb",
33
+ color: "#6b7280",
34
+ iconSize: 14,
35
+ };
36
+ // Backdrop defaults
37
+ export const BACKDROP = {
38
+ color: "rgba(0,0,0,0.4)",
39
+ blur: "12px",
40
+ lightColor: "rgba(0,0,0,0.3)",
41
+ lightBlur: "6px",
42
+ scrimColor: "rgba(0,0,0,0.08)",
43
+ };
44
+ // Card dimensions shared across variations
45
+ export const CARD = {
46
+ maxWidth: 460,
47
+ maxHeight: 680,
48
+ borderRadius: 20,
49
+ minIframeHeight: 600,
50
+ };
51
+ // Side panel dimensions
52
+ export const PANEL = {
53
+ width: 460,
54
+ };
55
+ // Bottom sheet dimensions
56
+ export const BOTTOM_SHEET = {
57
+ maxWidth: 500,
58
+ maxHeight: "92vh",
59
+ minIframeHeight: 580,
60
+ handleWidth: 36,
61
+ handleHeight: 4,
62
+ };
63
+ // Floating popup dimensions
64
+ export const POPUP = {
65
+ width: 420,
66
+ height: 640,
67
+ offset: 24,
68
+ borderRadius: 16,
69
+ };
70
+ // Fullscreen background
71
+ export const FULLSCREEN = {
72
+ background: "rgba(247,248,250,1)",
73
+ backgroundTransparent: "rgba(247,248,250,0)",
74
+ };
75
+ // Auto-close delay after successful payment (ms)
76
+ export const SUCCESS_AUTO_CLOSE_MS = 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B,UAAU,EAAE,qBAAqB;IACjC,qBAAqB,EAAE,qBAAqB;CACpC,CAAC;AAEX,iDAAiD;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { OVERLAY_Z_INDEX, EASING, MSG_PREFIX, VARIATION_ALIASES, VARIATIONS, CLOSE_BUTTON, BACKDROP, CARD, PANEL, BOTTOM_SHEET, POPUP, FULLSCREEN, SUCCESS_AUTO_CLOSE_MS, } from "./constants.js";
2
+ export type { VariationName, VariationMeta } from "./constants.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/overlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,KAAK,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { OVERLAY_Z_INDEX, EASING, MSG_PREFIX, VARIATION_ALIASES, VARIATIONS, CLOSE_BUTTON, BACKDROP, CARD, PANEL, BOTTOM_SHEET, POPUP, FULLSCREEN, SUCCESS_AUTO_CLOSE_MS, } from "./constants.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/overlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,KAAK,EACL,UAAU,EACV,qBAAqB,GACtB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,82 @@
1
+ export type PlanId = "free" | "starter" | "growth" | "enterprise";
2
+ export type BillingStatus = "active" | "past_due" | "restricted" | "suspended";
3
+ export interface PlanConfig {
4
+ id: PlanId;
5
+ name: string;
6
+ description: string;
7
+ monthlyMinimum: number;
8
+ volumeBps: number;
9
+ perPaymentFee: number;
10
+ includedVolumeUsd: number;
11
+ features: string[];
12
+ requiresCard: boolean;
13
+ }
14
+ export declare const PLANS: Record<PlanId, PlanConfig>;
15
+ export interface MarketingPlan {
16
+ id: PlanId;
17
+ name: string;
18
+ price: string;
19
+ period: string;
20
+ badge?: string;
21
+ subheadline: string;
22
+ features: string[];
23
+ ctaLabel: string;
24
+ ctaHref: string;
25
+ ctaExternal?: boolean;
26
+ }
27
+ export declare const MARKETING_PLANS: MarketingPlan[];
28
+ export interface MarketingSandboxPlan {
29
+ name: string;
30
+ price: string;
31
+ period: string;
32
+ features: string[];
33
+ ctaLabel: string;
34
+ ctaHref: string;
35
+ footnote: string;
36
+ }
37
+ export declare const MARKETING_SANDBOX: MarketingSandboxPlan;
38
+ export type ComparisonValue = boolean | string | Record<string, boolean | string>;
39
+ export interface ComparisonFeature {
40
+ name: string;
41
+ value: ComparisonValue;
42
+ }
43
+ export interface ComparisonSection {
44
+ title: string;
45
+ features: ComparisonFeature[];
46
+ }
47
+ export declare const COMPARISON_PLANS: readonly ["Sandbox", "Starter", "Growth", "Scale"];
48
+ export declare const COMPARISON_DATA: ComparisonSection[];
49
+ export interface FaqEntry {
50
+ id: string;
51
+ question: string;
52
+ answer: string;
53
+ }
54
+ export declare const PRICING_FAQS: FaqEntry[];
55
+ export declare const MID_CYCLE_THRESHOLD_USD = 100;
56
+ export declare const PAST_DUE_RESTRICT_HOURS = 48;
57
+ export declare const RESTRICT_SUSPEND_HOURS = 168;
58
+ export declare const USAGE_WARNING_THRESHOLD = 0.8;
59
+ export declare const BILLING_EMAIL_EVENTS: {
60
+ readonly CARD_REQUIRED: "card_required";
61
+ readonly USAGE_APPROACHING_LIMIT: "usage_approaching_limit";
62
+ readonly MID_CYCLE_CHARGE: "mid_cycle_charge";
63
+ readonly PAYMENT_FAILED: "payment_failed";
64
+ readonly SERVICE_RESTRICTED: "service_restricted";
65
+ readonly SERVICE_SUSPENDED: "service_suspended";
66
+ readonly PAYMENT_RECOVERED: "payment_recovered";
67
+ };
68
+ export declare const BILLING_EVENT_TYPES: {
69
+ readonly PLAN_CHANGED: "plan_changed";
70
+ readonly SUBSCRIPTION_CREATED: "subscription_created";
71
+ readonly USAGE_RECORDED: "usage_recorded";
72
+ readonly INVOICE_CREATED: "invoice_created";
73
+ readonly INVOICE_PAID: "invoice_paid";
74
+ readonly INVOICE_FAILED: "invoice_failed";
75
+ readonly MID_CYCLE_INVOICE: "mid_cycle_invoice";
76
+ readonly STATUS_CHANGED: "status_changed";
77
+ readonly PAYMENT_METHOD_UPDATED: "payment_method_updated";
78
+ readonly ACCOUNT_RESTRICTED: "account_restricted";
79
+ readonly ACCOUNT_SUSPENDED: "account_suspended";
80
+ readonly ACCOUNT_RECOVERED: "account_recovered";
81
+ };
82
+ //# sourceMappingURL=plans.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAC;AAElE,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC;AAE/E,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC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,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,YAAY,EAAE,QAAQ,EAyClC,CAAC;AAMF,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,eAAO,MAAM,oBAAoB;;;;;;;;CAQvB,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;CAatB,CAAC"}
package/dist/plans.js ADDED
@@ -0,0 +1,277 @@
1
+ // @billing-io/designs — Canonical plan definitions
2
+ // All billing.io projects should import plan data from this package.
3
+ export const PLANS = {
4
+ free: {
5
+ id: "free",
6
+ name: "Free",
7
+ description: "For development and testing",
8
+ monthlyMinimum: 0,
9
+ volumeBps: 0,
10
+ perPaymentFee: 0,
11
+ includedVolumeUsd: 2000,
12
+ features: [
13
+ "Up to $2,000/month processed",
14
+ "Limited API rate",
15
+ "No production SLA",
16
+ "No webhook retries",
17
+ ],
18
+ requiresCard: false,
19
+ },
20
+ starter: {
21
+ id: "starter",
22
+ name: "Starter",
23
+ description: "For production applications",
24
+ monthlyMinimum: 49,
25
+ volumeBps: 30, // 0.30%
26
+ perPaymentFee: 0.02,
27
+ includedVolumeUsd: 5000,
28
+ features: [
29
+ "0.30% of settled volume",
30
+ "$0.02 per successful payment",
31
+ "First $5,000/month included",
32
+ "Standard webhooks",
33
+ "Email support",
34
+ ],
35
+ requiresCard: true,
36
+ },
37
+ growth: {
38
+ id: "growth",
39
+ name: "Growth",
40
+ description: "For scaling businesses",
41
+ monthlyMinimum: 199,
42
+ volumeBps: 20, // 0.20%
43
+ perPaymentFee: 0.02,
44
+ includedVolumeUsd: 50000,
45
+ features: [
46
+ "0.20% of settled volume",
47
+ "$0.02 per successful payment",
48
+ "First $50,000/month included",
49
+ "Webhook retries + logs",
50
+ "Team access",
51
+ "Priority email support",
52
+ ],
53
+ requiresCard: true,
54
+ },
55
+ enterprise: {
56
+ id: "enterprise",
57
+ name: "Enterprise",
58
+ description: "Custom pricing and SLA",
59
+ monthlyMinimum: 2000,
60
+ volumeBps: 10, // 0.10-0.15%, configurable
61
+ perPaymentFee: 0.02,
62
+ includedVolumeUsd: 500000,
63
+ features: [
64
+ "0.10-0.15% volume rate",
65
+ "Custom minimums",
66
+ "SLA guarantee",
67
+ "Dedicated infrastructure",
68
+ "Custom confirmations",
69
+ ],
70
+ requiresCard: true,
71
+ },
72
+ };
73
+ export const MARKETING_PLANS = [
74
+ {
75
+ id: "starter",
76
+ name: "Starter",
77
+ price: `$${PLANS.starter.monthlyMinimum}`,
78
+ period: "/month",
79
+ badge: "Most common",
80
+ subheadline: `${(PLANS.starter.volumeBps / 100).toFixed(2)}% of volume + $${PLANS.starter.perPaymentFee.toFixed(2)} per payment.`,
81
+ features: [
82
+ "Branded checkout on your domain",
83
+ "Embeddable checkout",
84
+ "SDK access",
85
+ "Signed webhooks",
86
+ "Dashboard and analytics",
87
+ "Email support",
88
+ ],
89
+ ctaLabel: "Go live",
90
+ ctaHref: "https://app.billing.io/signup",
91
+ },
92
+ {
93
+ id: "growth",
94
+ name: "Growth",
95
+ price: `$${PLANS.growth.monthlyMinimum}`,
96
+ period: "/month",
97
+ subheadline: `${(PLANS.growth.volumeBps / 100).toFixed(2)}% of volume + $${PLANS.growth.perPaymentFee.toFixed(2)} per payment.`,
98
+ features: [
99
+ "Everything in Starter",
100
+ "Webhook retries and logs",
101
+ "Team access (up to 5)",
102
+ "Priority support",
103
+ ],
104
+ ctaLabel: "Upgrade to Growth",
105
+ ctaHref: "https://app.billing.io/signup",
106
+ },
107
+ {
108
+ id: "enterprise",
109
+ name: "Scale",
110
+ price: `$${PLANS.enterprise.monthlyMinimum}`,
111
+ period: "/month",
112
+ subheadline: `${(PLANS.enterprise.volumeBps / 100).toFixed(2)}% of volume + $${PLANS.enterprise.perPaymentFee.toFixed(2)} per payment.`,
113
+ features: [
114
+ "Everything in Growth",
115
+ "Higher throughput and billing caps",
116
+ "Unlimited team members",
117
+ "Direct support channel",
118
+ ],
119
+ ctaLabel: "Contact sales",
120
+ ctaHref: "https://wa.me/message/ZTXL4WR3SWZQP1",
121
+ ctaExternal: true,
122
+ },
123
+ ];
124
+ export const MARKETING_SANDBOX = {
125
+ name: "Sandbox (development only)",
126
+ price: "$0",
127
+ period: "/month",
128
+ features: [
129
+ "Testnet access only",
130
+ "Full SDK access",
131
+ "Simulated webhooks",
132
+ "Dashboard preview",
133
+ "No card required",
134
+ "No time limit",
135
+ ],
136
+ ctaLabel: "Start in sandbox",
137
+ ctaHref: "https://app.billing.io/signup",
138
+ footnote: "Production usage requires a paid plan.",
139
+ };
140
+ export const COMPARISON_PLANS = ["Sandbox", "Starter", "Growth", "Scale"];
141
+ export const COMPARISON_DATA = [
142
+ {
143
+ title: "Payments",
144
+ features: [
145
+ { name: "Testnet access", value: true },
146
+ {
147
+ name: "Mainnet payments",
148
+ value: { Sandbox: false, Starter: true, Growth: true, Scale: true },
149
+ },
150
+ {
151
+ name: "Hosted checkout",
152
+ value: { Sandbox: false, Starter: true, Growth: true, Scale: true },
153
+ },
154
+ {
155
+ name: "Embeddable checkout",
156
+ value: { Sandbox: false, Starter: true, Growth: true, Scale: true },
157
+ },
158
+ ],
159
+ },
160
+ {
161
+ title: "Developer tools",
162
+ features: [
163
+ { name: "SDK access", value: true },
164
+ {
165
+ name: "Webhooks",
166
+ value: { Sandbox: "Simulated", Starter: "Signed", Growth: "Signed", Scale: "Signed" },
167
+ },
168
+ {
169
+ name: "Webhook retries",
170
+ value: { Sandbox: false, Starter: false, Growth: true, Scale: true },
171
+ },
172
+ {
173
+ name: "Dashboard",
174
+ value: { Sandbox: "Preview", Starter: true, Growth: true, Scale: true },
175
+ },
176
+ ],
177
+ },
178
+ {
179
+ title: "Team and support",
180
+ features: [
181
+ {
182
+ name: "Team members",
183
+ value: { Sandbox: "1", Starter: "1", Growth: "Up to 5", Scale: "Unlimited" },
184
+ },
185
+ {
186
+ name: "Support level",
187
+ value: { Sandbox: "Docs only", Starter: "Email", Growth: "Priority", Scale: "Direct channel" },
188
+ },
189
+ ],
190
+ },
191
+ {
192
+ title: "Billing and limits",
193
+ features: [
194
+ {
195
+ name: "Billing cap",
196
+ value: { Sandbox: "N/A", Starter: "$200", Growth: "$500", Scale: "$1,500" },
197
+ },
198
+ {
199
+ name: "Fiat access eligibility",
200
+ value: { Sandbox: false, Starter: "After volume", Growth: "After volume", Scale: "After volume" },
201
+ },
202
+ ],
203
+ },
204
+ ];
205
+ export const PRICING_FAQS = [
206
+ {
207
+ id: "faq-1",
208
+ question: "Do I need a credit card to start?",
209
+ answer: "Not for sandbox. You can build and test without a card. A payment method is required when you move to production.",
210
+ },
211
+ {
212
+ id: "faq-2",
213
+ question: "When do I start paying?",
214
+ answer: "You can build and test for free in sandbox. Production usage is billed according to your plan when you process real payments.",
215
+ },
216
+ {
217
+ id: "faq-3",
218
+ question: "When do you charge me?",
219
+ answer: "Your plan fee is charged at the start of each billing cycle. Usage fees are charged when they hit a cap or at month-end.",
220
+ },
221
+ {
222
+ id: "faq-4",
223
+ question: "What happens if my card fails?",
224
+ answer: "We notify you and retry. If payment stays unresolved, production features may be paused until it is sorted out.",
225
+ },
226
+ {
227
+ id: "faq-5",
228
+ question: "Do you hold my funds?",
229
+ answer: "No. Payments settle directly to your wallet. billing.io is non-custodial.",
230
+ },
231
+ {
232
+ id: "faq-6",
233
+ question: "Can I upgrade or downgrade plans?",
234
+ answer: "Yes. We recommend upgrades automatically when they save you money at your current volume.",
235
+ },
236
+ {
237
+ id: "faq-7",
238
+ question: "When can I access fiat payments?",
239
+ answer: "Fiat access becomes available after you process meaningful volume. It is not included by default.",
240
+ },
241
+ {
242
+ id: "faq-8",
243
+ question: "Is billing.io right for low-volume projects?",
244
+ answer: "If you are still building, use the sandbox. Production plans are designed for businesses processing real payments.",
245
+ },
246
+ ];
247
+ // ---------------------------------------------------------------------------
248
+ // Billing system constants (thresholds, events)
249
+ // ---------------------------------------------------------------------------
250
+ export const MID_CYCLE_THRESHOLD_USD = 100;
251
+ export const PAST_DUE_RESTRICT_HOURS = 48;
252
+ export const RESTRICT_SUSPEND_HOURS = 168; // 7 days
253
+ export const USAGE_WARNING_THRESHOLD = 0.8; // 80%
254
+ export const BILLING_EMAIL_EVENTS = {
255
+ CARD_REQUIRED: "card_required",
256
+ USAGE_APPROACHING_LIMIT: "usage_approaching_limit",
257
+ MID_CYCLE_CHARGE: "mid_cycle_charge",
258
+ PAYMENT_FAILED: "payment_failed",
259
+ SERVICE_RESTRICTED: "service_restricted",
260
+ SERVICE_SUSPENDED: "service_suspended",
261
+ PAYMENT_RECOVERED: "payment_recovered",
262
+ };
263
+ export const BILLING_EVENT_TYPES = {
264
+ PLAN_CHANGED: "plan_changed",
265
+ SUBSCRIPTION_CREATED: "subscription_created",
266
+ USAGE_RECORDED: "usage_recorded",
267
+ INVOICE_CREATED: "invoice_created",
268
+ INVOICE_PAID: "invoice_paid",
269
+ INVOICE_FAILED: "invoice_failed",
270
+ MID_CYCLE_INVOICE: "mid_cycle_invoice",
271
+ STATUS_CHANGED: "status_changed",
272
+ PAYMENT_METHOD_UPDATED: "payment_method_updated",
273
+ ACCOUNT_RESTRICTED: "account_restricted",
274
+ ACCOUNT_SUSPENDED: "account_suspended",
275
+ ACCOUNT_RECOVERED: "account_recovered",
276
+ };
277
+ //# sourceMappingURL=plans.js.map