-
Selected Bundle
-
- {enabledProducts.map((p, idx) => (
-
-
- {categoryMeta[p.category].icon} {p.name}
- {p.quantity > 1 && x{p.quantity}}
-
-
- EUR {(parseFloat(p.price) * p.quantity).toFixed(2)}
- {p.type === 'recurring' && /mo}
-
+ {/* Line items */}
+ {enabledProducts.length === 0 ? (
+
Select products above to build your bundle
+ ) : (
+
+ {categoryTotals
+ .filter((c) => c.count > 0)
+ .map((cat) => (
+
+
+ {cat.icon}
+ {cat.label}
+
+ {enabledProducts
+ .filter((p) => p.category === cat.category)
+ .map((p, idx) => (
+
+
+ {p.name}
+ {p.quantity > 1 && x{p.quantity}}
+
+
+ EUR {(parseFloat(p.price) * p.quantity).toFixed(2)}
+ {p.type === 'recurring' && (
+ /mo
+ )}
+
+
+ ))}
+
+ ))}
- ))}
- {enabledProducts.length === 0 && (
-
No products selected
)}
+ {enabledProducts.length > 0 && (
+
+
+ One-time total (net)
+ EUR {oneTimeCosts.toFixed(2)}
+
+ {monthlyCosts > 0 && (
+
+ Monthly total (net)
+ EUR {monthlyCosts.toFixed(2)}/mo
+
+ )}
+
+ )}
{/* Computed results */}
-
Computed via Library
-
+
+ Computed via @epilot/pricing
+
+
-
+
-
+
{(result.total_details?.breakdown?.recurrences?.length ?? 0) > 0 && (
-
-
By Recurrence:
- {result.total_details?.breakdown?.recurrences?.map((r: any, i: number) => (
-
-
- {r.type === 'one_time' ? 'One-time' : r.billing_period}
-
- {fmtCents(r.amount_total)}
-
- ))}
+
+
By Recurrence
+
+ {result.total_details?.breakdown?.recurrences?.map((r: any, i: number) => (
+
+
+ {r.type === 'one_time' ? 'One-time' : r.billing_period}
+
+ {fmtCents(r.amount_total)}
+
+ ))}
+
)}
- {/* Usage */}
-
+ {/* Code block */}
+
` {
+${enabledProducts
+ .slice(0, 4)
+ .map(
+ (p) => ` {
quantity: ${p.quantity},
_price: {
unit_amount_decimal: '${p.price}',
@@ -353,12 +470,13 @@ ${enabledProducts.slice(0, 4).map((p) => ` {
description: '${p.name}',
},
taxes: [{ tax: { rate: ${taxRate} } }],
- },`).join('\n')}${enabledProducts.length > 4 ? `\n // ... ${enabledProducts.length - 4} more items` : ''}
+ },`,
+ )
+ .join('\n')}${enabledProducts.length > 4 ? `\n // ... ${enabledProducts.length - 4} more items` : ''}
];
const result = computeAggregatedAndPriceTotals(items);
-// result.amount_total = ${fmtCents(result.amount_total)}
-// Recurrence breakdown available via result.total_details.breakdown.recurrences`}
+// result.amount_total = ${fmtCents(result.amount_total)}`}
/>
diff --git a/demo/src/sections/OverviewDemo.tsx b/demo/src/sections/OverviewDemo.tsx
index 7846cfd..2e79e2d 100644
--- a/demo/src/sections/OverviewDemo.tsx
+++ b/demo/src/sections/OverviewDemo.tsx
@@ -1,194 +1,276 @@
import { CodeBlock } from '../components/CodeBlock';
+import {
+ SolarIllustration,
+ WallboxIllustration,
+ HeatPumpIllustration,
+ SmartHomeIllustration,
+} from '../components/ProductShowcase';
interface OverviewDemoProps {
onNavigate: (id: string) => void;
}
-const features = [
+const energyProducts = [
{
- id: 'per-unit',
- title: 'Per Unit Pricing',
- desc: 'Simple price x quantity calculations with tax support',
- icon: '๐ฆ',
- color: 'bg-blue-50 border-blue-200',
- },
- {
- id: 'tiered-volume',
- title: 'Tiered Volume',
- desc: 'Single tier selected based on total quantity',
- icon: '๐',
- color: 'bg-indigo-50 border-indigo-200',
- },
- {
- id: 'tiered-graduated',
- title: 'Tiered Graduated',
- desc: 'Different rates apply to different quantity ranges',
- icon: '๐',
- color: 'bg-purple-50 border-purple-200',
- },
- {
- id: 'tiered-flatfee',
- title: 'Tiered Flat Fee',
- desc: 'Fixed fee based on quantity range',
- icon: '๐ท๏ธ',
- color: 'bg-pink-50 border-pink-200',
- },
- {
- id: 'tax',
- title: 'Tax Handling',
- desc: 'Inclusive/exclusive tax with multi-rate breakdown',
- icon: '๐งพ',
- color: 'bg-green-50 border-green-200',
- },
- {
- id: 'discounts',
- title: 'Discounts & Coupons',
- desc: 'Fixed, percentage, and cashback coupon types',
- icon: '๐๏ธ',
- color: 'bg-amber-50 border-amber-200',
- },
- {
- id: 'composite',
- title: 'Composite Pricing',
- desc: 'Multi-component bundled price items',
- icon: '๐งฉ',
- color: 'bg-cyan-50 border-cyan-200',
- },
- {
- id: 'recurring',
- title: 'Recurring Billing',
- desc: 'Billing periods and frequency normalization',
- icon: '๐',
- color: 'bg-teal-50 border-teal-200',
+ id: 'electricity',
+ title: 'Electricity Tariffs',
+ desc: 'Single & dual-tariff pricing with Grundpreis, Arbeitspreis, and smart meter support.',
+ icon: 'โก',
+ gradient: 'gradient-electricity',
+ price: 'from 28.5 ct/kWh',
},
{
- id: 'currency',
- title: 'Currency & Formatting',
- desc: 'Multi-currency support with locale-aware formatting',
- icon: '๐ฑ',
- color: 'bg-emerald-50 border-emerald-200',
+ id: 'gas',
+ title: 'Gas Supply',
+ desc: 'Gas tariffs with CO2 levy, storage levy, and per-kWh work price breakdowns',
+ icon: '๐ฅ',
+ gradient: 'gradient-gas',
+ price: 'from 8.9 ct/kWh',
},
{
- id: 'dynamic-tariff',
- title: 'Dynamic Tariff',
- desc: 'Market-based pricing with configurable markup',
- icon: 'โก',
- color: 'bg-yellow-50 border-yellow-200',
+ id: 'house-connection',
+ title: 'House Connection',
+ desc: 'Hausanschluss fees with distance-based trench work and multi-utility connections',
+ icon: '๐ก',
+ gradient: 'gradient-house',
+ price: 'from EUR 1,850',
},
{
- id: 'getag',
- title: 'GetAG Energy Pricing',
- desc: 'German energy operator integration with tiered markups',
- icon: '๐',
- color: 'bg-orange-50 border-orange-200',
+ id: 'non-commodity',
+ title: 'Products & Add-ons',
+ desc: 'Solar, wallboxes, heat pumps, and smart home bundles with service contracts',
+ icon: 'โ๏ธ',
+ gradient: 'gradient-solar',
+ price: 'Bundles from EUR 899',
},
];
-const useCases = [
+const addOnShowcase = [
{
- id: 'electricity',
- title: 'Electricity',
- desc: 'Single & dual-tariff (HT/NT) electricity pricing with Grundpreis and Arbeitspreis',
- icon: 'โก',
- color: 'bg-yellow-50 border-yellow-200',
+ title: 'Solar & Battery',
+ desc: 'Complete PV systems with battery storage and installation',
+ illustration: SolarIllustration,
+ price: 'EUR 12,500',
+ sub: '+ EUR 29.90/mo maintenance',
+ features: ['10 kWp solar system', '10 kWh battery storage', 'Professional installation', 'Maintenance contract'],
},
{
- id: 'gas',
- title: 'Gas',
- desc: 'Gas supply tariffs with CO2 levy, gas storage levy, and per-kWh work price',
- icon: '๐ฅ',
- color: 'bg-orange-50 border-orange-200',
+ title: 'E-Mobility',
+ desc: 'Wallbox charging solutions for home and fleet',
+ illustration: WallboxIllustration,
+ price: 'EUR 899',
+ sub: '+ EUR 59/mo charging flat rate',
+ features: ['11 kW wallbox', 'Professional installation', 'Smart charging', 'Monthly flat rate'],
},
{
- id: 'house-connection',
- title: 'House Connection',
- desc: 'Hausanschluss fees with distance-based trench work and connection services',
- icon: '๐ก',
- color: 'bg-emerald-50 border-emerald-200',
+ title: 'Heat Pumps',
+ desc: 'Modern heating solutions with smart controls',
+ illustration: HeatPumpIllustration,
+ price: 'EUR 15,800',
+ sub: '+ EUR 39.90/mo service',
+ features: ['Air-to-water system', 'Installation included', 'Smart thermostat', 'Service contract'],
},
{
- id: 'non-commodity',
- title: 'Non-Commodity',
- desc: 'Solar panels, wallboxes, heat pumps, and smart home products with service contracts',
- icon: '๐',
- color: 'bg-purple-50 border-purple-200',
+ title: 'Smart Home',
+ desc: 'Intelligent energy management and automation',
+ illustration: SmartHomeIllustration,
+ price: 'EUR 249',
+ sub: 'Energy manager from EUR 499',
+ features: ['Smart thermostat', 'Energy monitoring', 'App control', 'Consumption insights'],
},
];
+const capabilities = [
+ { id: 'per-unit', title: 'Per Unit', icon: '๐ฆ' },
+ { id: 'tiered-volume', title: 'Tiered Volume', icon: '๐' },
+ { id: 'tiered-graduated', title: 'Graduated', icon: '๐' },
+ { id: 'tiered-flatfee', title: 'Flat Fee', icon: '๐ท๏ธ' },
+ { id: 'tax', title: 'Tax', icon: '๐งพ' },
+ { id: 'discounts', title: 'Discounts', icon: '๐๏ธ' },
+ { id: 'composite', title: 'Composite', icon: '๐งฉ' },
+ { id: 'recurring', title: 'Recurring', icon: '๐' },
+ { id: 'currency', title: 'Currency', icon: '๐ฑ' },
+ { id: 'dynamic-tariff', title: 'Dynamic', icon: 'โก' },
+ { id: 'getag', title: 'GetAG', icon: '๐' },
+];
+
export function OverviewDemo({ onNavigate }: OverviewDemoProps) {
return (
{/* Hero */}
-
-
- epilot Pricing Playground
+
+
+
+ Interactive Playground
+
+
+ Energy Pricing,
+
+
+ Made Simple.
+
-
- Interactive playground for @epilot/pricing โ a comprehensive
- pricing calculation engine supporting 6 pricing models, tax handling,
- discounts, composite pricing, recurring billing, multi-currency formatting, and
- energy-market integrations. Explore each capability below.
+
+ Configure tariffs, bundle products, and compute prices in real-time. From electricity and gas to solar panels
+ and wallboxes โ everything your sales team needs.
- {/* Stats */}
-
+ {/* Stats row */}
+
{[
- { label: 'Pricing Models', value: '6' },
- { label: 'Exported Functions', value: '40+' },
- { label: 'Billing Periods', value: '6' },
- { label: 'Decimal Precision', value: '12 digits' },
+ { label: 'Pricing Models', value: '6', color: 'bg-blue-50 text-blue-700' },
+ { label: 'Billing Periods', value: '6', color: 'bg-emerald-50 text-emerald-700' },
+ { label: 'Functions', value: '40+', color: 'bg-amber-50 text-amber-700' },
+ { label: 'Decimal Precision', value: '12 digits', color: 'bg-purple-50 text-purple-700' },
].map((stat) => (
-
-
{stat.value}
-
{stat.label}
+
+ {stat.value}
+ {stat.label}
))}
- {/* Use Cases */}
-
Energy & Utility Use Cases
-
- {useCases.map((f) => (
-