@omnikit-js/ui 0.9.19 → 0.9.21
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/dist/chunk-2MKNXIZG.mjs +6154 -0
- package/dist/chunk-2MKNXIZG.mjs.map +1 -0
- package/dist/chunk-FA7CH4TP.mjs +511 -0
- package/dist/chunk-FA7CH4TP.mjs.map +1 -0
- package/dist/{chunk-WWEZXJIJ.js → chunk-MTFFRTQW.js} +31 -34
- package/dist/chunk-MTFFRTQW.js.map +1 -0
- package/dist/{chunk-FKCAHS23.js → chunk-NHN5YSUE.js} +11 -6
- package/dist/chunk-NHN5YSUE.js.map +1 -0
- package/dist/components/client/index.css +160 -0
- package/dist/components/client/index.css.map +1 -0
- package/dist/components/client/index.d.ts +3 -2
- package/dist/components/client/index.js +2 -2
- package/dist/components/client/index.mjs +1350 -0
- package/dist/components/client/index.mjs.map +1 -0
- package/dist/components/server/index.css +160 -0
- package/dist/components/server/index.css.map +1 -0
- package/dist/components/server/index.d.ts +2 -2
- package/dist/components/server/index.js +2 -2
- package/dist/components/server/index.mjs +4 -0
- package/dist/components/server/index.mjs.map +1 -0
- package/dist/{index-B8HugsDW.d.ts → index-DKuejSvz.d.ts} +1 -1
- package/dist/index.css +160 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -0
- package/dist/{types-B-w87oEm.d.ts → types-CnhWTSXv.d.ts} +15 -1
- package/package.json +1 -1
- package/dist/chunk-FKCAHS23.js.map +0 -1
- package/dist/chunk-WWEZXJIJ.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/omnikit-client.ts","../src/components/server/DataList/index.tsx","../src/components/server/Billing/client.ts","../src/components/server/Billing/index.tsx"],"names":["jsxs","Alert","jsx"],"mappings":";;;;;AAaO,IAAM,gBAAN,MAAoB;AAAA,EAK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EA,SAAS,WAAW,UAAA,EAAwC;AAC1D,EAAA,IAAI,CAAC,YAAY,OAAO,KAAA;AACxB,EAAA,MAAM,IAAA,GAAO,IAAI,IAAA,CAAK,UAAU,CAAA;AAChC,EAAA,OAAO,IAAA,CAAK,mBAAmB,OAAA,EAAS;AAAA,IACtC,IAAA,EAAM,SAAA;AAAA,IACN,KAAA,EAAO,MAAA;AAAA,IACP,GAAA,EAAK;AAAA,GACN,CAAA;AACH","file":"chunk-NHN5YSUE.js","sourcesContent":["/**\n * OmniKit API Client\n * Wrapper for making requests to OmniKit serverless platform\n */\n\nimport type {\n QueryOptions,\n QueryResponse,\n SingleRecordResponse,\n MutationResponse,\n OmniKitConfig,\n} from './types'\n\nexport class OmniKitClient {\n private baseUrl: string\n private apiKey?: string\n private jwt?: string\n\n constructor(config: OmniKitConfig) {\n this.baseUrl = config.baseUrl.replace(/\\/$/, '') // Remove trailing slash\n this.apiKey = config.apiKey\n this.jwt = config.jwt\n }\n\n private getHeaders(): HeadersInit {\n const headers: HeadersInit = {\n 'Content-Type': 'application/json',\n }\n\n if (this.jwt) {\n headers['Authorization'] = `Bearer ${this.jwt}`\n } else if (this.apiKey) {\n headers['X-API-Key'] = this.apiKey\n }\n\n return headers\n }\n\n private async request<T>(\n endpoint: string,\n options?: RequestInit\n ): Promise<T> {\n const url = `${this.baseUrl}${endpoint}`\n\n const response = await fetch(url, {\n ...options,\n headers: {\n ...this.getHeaders(),\n ...options?.headers,\n },\n })\n\n if (!response.ok) {\n const error = await response.json().catch(() => ({ error: 'Request failed' }))\n throw new Error(error.error || `HTTP ${response.status}`)\n }\n\n return response.json()\n }\n\n /**\n * Query records from a table\n */\n async query<T = any>(\n table: string,\n options?: QueryOptions\n ): Promise<QueryResponse<T>> {\n const params = new URLSearchParams()\n\n if (options?.filter) {\n params.append('filter', JSON.stringify(options.filter))\n }\n if (options?.sort) {\n params.append('sort', options.sort)\n }\n if (options?.limit) {\n params.append('limit', options.limit.toString())\n }\n if (options?.offset) {\n params.append('offset', options.offset.toString())\n }\n\n const queryString = params.toString()\n const endpoint = `/data/${table}${queryString ? `?${queryString}` : ''}`\n\n return this.request<QueryResponse<T>>(endpoint)\n }\n\n /**\n * Find a record by ID\n */\n async findById<T = any>(\n table: string,\n id: string | number\n ): Promise<SingleRecordResponse<T>> {\n return this.request<SingleRecordResponse<T>>(`/data/${table}/${id}`)\n }\n\n /**\n * Insert a new record\n */\n async insert(\n table: string,\n data: Record<string, any>\n ): Promise<MutationResponse> {\n return this.request<MutationResponse>(`/data/${table}`, {\n method: 'POST',\n body: JSON.stringify(data),\n })\n }\n\n /**\n * Update an existing record\n */\n async update(\n table: string,\n id: string | number,\n data: Record<string, any>\n ): Promise<MutationResponse> {\n return this.request<MutationResponse>(`/data/${table}/${id}`, {\n method: 'PUT',\n body: JSON.stringify(data),\n })\n }\n\n /**\n * Delete a record\n */\n async delete(table: string, id: string | number): Promise<MutationResponse> {\n return this.request<MutationResponse>(`/data/${table}/${id}`, {\n method: 'DELETE',\n })\n }\n\n /**\n * Upsert a record (insert or update)\n */\n async upsert(\n table: string,\n data: Record<string, any>\n ): Promise<MutationResponse> {\n return this.request<MutationResponse>(`/data/${table}`, {\n method: 'PUT',\n body: JSON.stringify(data),\n })\n }\n}\n\n/**\n * Create a new OmniKit client instance\n */\nexport function createOmniKitClient(config: OmniKitConfig): OmniKitClient {\n return new OmniKitClient(config)\n}\n","/**\n * DataList Component\n *\n * A server-side React component that fetches and displays data from OmniKit API.\n * Renders on the server with zero client JavaScript for data fetching.\n * Uses lite-ui Table component for consistent styling.\n *\n * @example\n * ```tsx\n * import { DataList } from '@omnikit-js/ui'\n *\n * export default function UsersPage() {\n * return (\n * <DataList\n * table=\"users\"\n * baseUrl={process.env.OMNIKIT_BASE_URL}\n * apiKey={process.env.OMNIKIT_API_KEY}\n * columns={['name', 'email', 'created_at']}\n * filter={{ active: true }}\n * limit={20}\n * />\n * )\n * }\n * ```\n */\n\nimport { Table, Alert } from '@marcoschwartz/lite-ui'\nimport { createOmniKitClient } from '../../../lib/omnikit-client'\nimport type { DataListProps, Column, ColumnDefinition } from './types'\n\nfunction normalizeColumn<T>(column: Column<T>): ColumnDefinition<T> {\n if (typeof column === 'string') {\n return {\n key: column,\n label: column.charAt(0).toUpperCase() + column.slice(1).replace(/_/g, ' '),\n sortable: true,\n }\n }\n return {\n ...column,\n label: column.label || column.key.charAt(0).toUpperCase() + column.key.slice(1).replace(/_/g, ' '),\n }\n}\n\nexport async function DataList<T extends Record<string, any>>({\n table,\n baseUrl,\n apiKey,\n jwt,\n columns,\n keyField = 'id' as keyof T,\n filter,\n sort,\n limit,\n offset,\n className = '',\n emptyMessage = 'No data found',\n errorMessage = 'Failed to load data',\n}: DataListProps<T>) {\n // Create API client\n const client = createOmniKitClient({ baseUrl, apiKey, jwt })\n\n // Fetch data\n let data: T[] = []\n let error: string | null = null\n\n try {\n const response = await client.query<T>(table, {\n filter,\n sort,\n limit,\n offset,\n })\n\n if (response.success) {\n data = response.data\n } else {\n error = response.error || errorMessage\n }\n } catch (err) {\n error = err instanceof Error ? err.message : errorMessage\n }\n\n // Normalize columns for lite-ui Table format\n const normalizedColumns = columns.map(normalizeColumn)\n\n // Pre-render data with custom render functions (since we can't pass functions to client components)\n const processedData = data.map((row) => {\n const processedRow: Record<string, any> = { ...row }\n normalizedColumns.forEach((col) => {\n if (col.render) {\n const value = col.key.split('.').reduce((obj, k) => obj?.[k], row)\n processedRow[`__rendered_${col.key}`] = col.render(value, row)\n }\n })\n return processedRow\n })\n\n const tableColumns = normalizedColumns.map((col) => ({\n key: col.render ? `__rendered_${col.key}` : col.key,\n title: col.label || col.key,\n }))\n\n // Error state\n if (error) {\n return (\n <Alert variant=\"error\" className={className}>\n <p className=\"font-medium\">Error</p>\n <p className=\"mt-1 text-sm\">{error}</p>\n </Alert>\n )\n }\n\n // Empty state\n if (data.length === 0) {\n return (\n <Alert variant=\"info\" className={className}>\n {emptyMessage}\n </Alert>\n )\n }\n\n // Render table using lite-ui Table component\n return (\n <Table\n columns={tableColumns}\n data={processedData}\n keyField={String(keyField)}\n hoverable\n responsive\n className={className}\n />\n )\n}\n","/**\n * Billing API Client\n *\n * Handles all API calls for the Billing component.\n */\n\nimport type {\n BillingData,\n BillingProps,\n Customer,\n Product,\n Subscription,\n Invoice,\n PaymentMethod,\n ProductFeature\n} from './types';\n\ninterface ApiResponse<T> {\n success: boolean;\n data?: T;\n error?: string;\n}\n\ninterface BillingClientConfig {\n baseUrl: string;\n apiKey?: string;\n accessToken?: string;\n projectId: number;\n}\n\nfunction createHeaders(config: BillingClientConfig): Record<string, string> {\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json'\n };\n\n if (config.accessToken) {\n headers['Authorization'] = `Bearer ${config.accessToken}`;\n }\n\n if (config.apiKey) {\n headers['X-API-Key'] = config.apiKey;\n }\n\n return headers;\n}\n\nasync function fetchAPI<T>(\n config: BillingClientConfig,\n url: string,\n options: RequestInit = {}\n): Promise<ApiResponse<T>> {\n try {\n const response = await fetch(url, {\n ...options,\n headers: {\n ...createHeaders(config),\n ...options.headers as Record<string, string>,\n },\n // Prevent infinite re-fetching in Next.js\n cache: 'no-store',\n });\n\n // Check for non-OK responses before parsing\n if (!response.ok) {\n // Try to get error message from JSON, fallback to status text\n try {\n const errorData = await response.json();\n return {\n success: false,\n error: errorData.error || `HTTP ${response.status}: ${response.statusText}`\n };\n } catch {\n return {\n success: false,\n error: `HTTP ${response.status}: ${response.statusText}`\n };\n }\n }\n\n // Check content type to avoid parsing HTML as JSON\n const contentType = response.headers.get('content-type');\n if (!contentType || !contentType.includes('application/json')) {\n return {\n success: false,\n error: 'Invalid response: expected JSON'\n };\n }\n\n const data = await response.json();\n return data;\n } catch (error) {\n return {\n success: false,\n error: error instanceof Error ? error.message : 'API request failed'\n };\n }\n}\n\n/**\n * Get or create customer for a user\n */\nasync function getOrCreateCustomer(\n config: BillingClientConfig,\n userId: string,\n organizationId: number,\n email: string,\n name?: string,\n testMode: boolean = true\n): Promise<ApiResponse<Customer>> {\n const { baseUrl, projectId } = config;\n\n // Try to get existing customer\n const customerData = await fetchAPI<Customer>(\n config,\n `${baseUrl}/billing/customers/by-user/${userId}?project_id=${projectId}`\n );\n\n if (customerData.success && customerData.data) {\n return customerData;\n }\n\n // Create new customer\n const createData = await fetchAPI<Customer>(\n config,\n `${baseUrl}/billing/customers`,\n {\n method: 'POST',\n body: JSON.stringify({\n project_id: projectId,\n user_id: userId,\n organization_id: organizationId,\n email,\n name,\n test_mode: testMode,\n sync_to_stripe: true\n })\n }\n );\n\n return createData;\n}\n\ninterface UserData {\n id: number;\n uuid?: string;\n email: string;\n full_name?: string;\n display_name?: string;\n organization_id?: number;\n}\n\n/**\n * Fetch user data by user ID\n */\nasync function fetchUserData(\n config: BillingClientConfig,\n userId: string\n): Promise<ApiResponse<UserData>> {\n const { baseUrl } = config;\n\n // Use the data/users endpoint (same as DataList uses)\n return fetchAPI<UserData>(\n config,\n `${baseUrl}/data/users/${userId}`\n );\n}\n\n/**\n * Fetch all billing data for a customer\n */\nexport async function fetchBillingData(\n props: BillingProps\n): Promise<ApiResponse<BillingData>> {\n const {\n baseUrl,\n apiKey,\n accessToken,\n projectId,\n userId,\n organizationId,\n userEmail,\n userName,\n testMode = true\n } = props;\n\n const config: BillingClientConfig = { baseUrl, apiKey, accessToken, projectId };\n\n try {\n // If email not provided, fetch user data first\n let email = userEmail;\n let name = userName;\n let orgId = organizationId;\n\n if (!email) {\n const userResult = await fetchUserData(config, userId);\n if (userResult.success && userResult.data) {\n email = userResult.data.email;\n name = name || userResult.data.full_name || userResult.data.display_name;\n orgId = orgId || userResult.data.organization_id;\n } else {\n return { success: false, error: userResult.error || 'User not found. Please provide userEmail.' };\n }\n }\n\n // 1. Get or create customer\n const finalOrgId = orgId || 1; // Default org if not provided\n const customerResult = await getOrCreateCustomer(\n config,\n userId,\n finalOrgId,\n email,\n name,\n testMode\n );\n\n if (!customerResult.success || !customerResult.data) {\n return { success: false, error: customerResult.error || 'Failed to get customer' };\n }\n\n const customer = customerResult.data;\n const customerId = customer.id;\n\n // 2. Fetch all billing data in parallel\n const [\n subsData,\n productsData,\n pricesData,\n entitlementsData,\n invoicesData,\n pmData,\n usageData\n ] = await Promise.all([\n fetchAPI<Subscription[]>(config, `${baseUrl}/billing/subscriptions?project_id=${projectId}&customer_id=${customerId}&status=active&include_items=true`),\n fetchAPI<Product[]>(config, `${baseUrl}/billing/products?project_id=${projectId}&limit=100&include_prices=false`),\n fetchAPI<any[]>(config, `${baseUrl}/billing/products/prices?project_id=${projectId}&limit=1000`),\n fetchAPI<any[]>(config, `${baseUrl}/billing/entitlements/list-entitlements?project_id=${projectId}&customer_id=${customerId}`),\n fetchAPI<Invoice[]>(config, `${baseUrl}/billing/invoices?project_id=${projectId}&customer_id=${customerId}&limit=10&sort=due_date:desc&include_line_items=true`),\n fetchAPI<PaymentMethod[]>(config, `${baseUrl}/billing/customers/${customerId}/payment-methods?project_id=${projectId}&status=active`),\n fetchAPI<Record<string, any>>(config, `${baseUrl}/billing/usage/get-all?project_id=${projectId}&customer_id=${customerId}`)\n ]);\n\n const currentSubscription = subsData.success && subsData.data && subsData.data.length > 0\n ? subsData.data[0]\n : null;\n const products = productsData.success && productsData.data ? productsData.data : [];\n const allPrices = pricesData.success && pricesData.data ? pricesData.data : [];\n const entitlements = entitlementsData.success && entitlementsData.data ? entitlementsData.data : [];\n const invoices = invoicesData.success && invoicesData.data ? invoicesData.data : [];\n const paymentMethods = pmData.success && pmData.data ? pmData.data : [];\n const featureUsage = usageData.success && usageData.data ? usageData.data : {};\n\n // 3. Group prices by product\n const pricesByProduct: Record<number, any[]> = {};\n allPrices.forEach((price: any) => {\n if (!pricesByProduct[price.product_id]) {\n pricesByProduct[price.product_id] = [];\n }\n pricesByProduct[price.product_id].push(price);\n });\n\n products.forEach((product: Product) => {\n product.prices = pricesByProduct[product.id] || [];\n });\n\n // 4. Fetch product features for all products\n const productFeatures: Record<number, ProductFeature[]> = {};\n await Promise.all(\n products.map(async (product: Product) => {\n const featuresData = await fetchAPI<ProductFeature[]>(\n config,\n `${baseUrl}/billing/features/product/${product.id}?project_id=${projectId}&limit=100`\n );\n productFeatures[product.id] = featuresData.success && featuresData.data ? featuresData.data : [];\n })\n );\n\n const billingData: BillingData = {\n customer,\n currentSubscription,\n products,\n productFeatures,\n entitlements,\n invoices,\n paymentMethods,\n featureUsage\n };\n\n return { success: true, data: billingData };\n } catch (error) {\n console.error('Error fetching billing data:', error);\n return {\n success: false,\n error: error instanceof Error ? error.message : 'Failed to fetch billing data'\n };\n }\n}\n\n/**\n * Fetch payment configuration (Stripe publishable key)\n */\nexport async function fetchPaymentConfig(\n config: BillingClientConfig,\n testMode: boolean = true\n): Promise<ApiResponse<{ publishable_key: string }>> {\n const { baseUrl, projectId } = config;\n\n return fetchAPI(\n config,\n `${baseUrl}/billing/payment-config?project_id=${projectId}&test_mode=${testMode}`\n );\n}\n\n/**\n * Tax calculation result\n */\nexport interface TaxInfo {\n tax_rate: number;\n tax_amount: number;\n tax_type: string;\n tax_label: string;\n jurisdiction: string;\n reverse_charge: boolean;\n customer_country?: string;\n seller_country?: string;\n subtotal: number;\n total: number;\n reason?: string;\n}\n\n/**\n * Fetch tax info for a customer\n * Uses a reference amount (e.g., $100) to get the tax rate\n */\nexport async function fetchTaxInfo(\n config: BillingClientConfig,\n customerId: number,\n referenceAmount: number = 10000 // $100 in cents\n): Promise<ApiResponse<TaxInfo>> {\n const { baseUrl, projectId } = config;\n\n return fetchAPI<TaxInfo>(\n config,\n `${baseUrl}/billing/tax/calculate`,\n {\n method: 'POST',\n body: JSON.stringify({\n project_id: projectId,\n customer_id: customerId,\n amount: referenceAmount,\n product_type: 'digital'\n })\n }\n );\n}\n","/**\n * Billing Component\n *\n * A server-side React component that displays billing information for a SaaS application.\n * Fetches real data from OmniKit Billing API.\n *\n * User email and name are automatically fetched from user data if not provided.\n *\n * @example\n * ```tsx\n * import { Billing } from '@omnikit-js/ui'\n *\n * export default async function BillingPage() {\n * return (\n * <Billing\n * baseUrl={process.env.OMNIKIT_BASE_URL!}\n * apiKey={process.env.OMNIKIT_API_KEY}\n * projectId={1}\n * userId=\"user_123\"\n * />\n * )\n * }\n * ```\n */\n\nimport { Alert } from '@marcoschwartz/lite-ui'\nimport { BillingContent } from '../../client/BillingContent'\nimport { fetchBillingData, fetchTaxInfo, type TaxInfo } from './client'\nimport type { BillingProps } from './types'\n\nexport type { BillingProps } from './types'\nexport type {\n BillingData,\n Customer,\n Subscription,\n Product,\n Price,\n Invoice,\n PaymentMethod,\n Entitlement,\n ProductFeature\n} from './types'\n\nexport async function Billing(props: BillingProps) {\n const {\n className = '',\n errorMessage = 'Failed to load billing information'\n } = props;\n\n // Fetch billing data from API\n const result = await fetchBillingData(props);\n\n // Error state\n if (!result.success || !result.data) {\n return (\n <Alert variant=\"error\" className={className}>\n <p className=\"font-medium\">Error</p>\n <p className=\"mt-1 text-sm\">{result.error || errorMessage}</p>\n </Alert>\n );\n }\n\n const { data } = result;\n\n // Fetch tax info for the customer (server-side)\n let initialTaxInfo: TaxInfo | null = null;\n if (data.customer?.id) {\n const taxConfig = {\n baseUrl: props.baseUrl,\n apiKey: props.apiKey,\n accessToken: props.accessToken,\n projectId: props.projectId,\n };\n const taxResult = await fetchTaxInfo(taxConfig, data.customer.id, 10000); // $100 reference\n if (taxResult.success && taxResult.data) {\n initialTaxInfo = taxResult.data;\n }\n }\n\n // Find current plan from subscription (like apteva-app does)\n const currentSubscriptionPriceId = data.currentSubscription?.items?.[0]?.price_id;\n const currentPlan = currentSubscriptionPriceId\n ? data.products.find(p => p.prices?.some(price => price.id === currentSubscriptionPriceId))\n : null;\n const currentPrice = currentPlan?.prices?.find(p => p.id === currentSubscriptionPriceId);\n\n // Transform data for BillingContent\n const subscription = data.currentSubscription ? {\n id: data.currentSubscription.id,\n plan: currentPlan?.name || 'Unknown Plan',\n status: data.currentSubscription.status,\n price: formatCurrency(\n currentPrice?.unit_amount || currentPrice?.amount || 0,\n data.currentSubscription.currency\n ),\n period: currentPrice?.recurring_interval || 'month',\n nextBilling: formatDate(data.currentSubscription.current_period_end),\n cancelAtPeriodEnd: data.currentSubscription.cancel_at_period_end,\n } : null;\n\n const invoices = data.invoices.map(inv => ({\n id: inv.number || inv.uuid,\n date: formatDate(inv.due_date || inv.created_at),\n amount: formatCurrency(inv.total || inv.amount_due, inv.currency),\n status: inv.status,\n url: inv.pdf_url || '#',\n }));\n\n const plans = data.products\n .filter(p => p.active && p.prices && p.prices.length > 0)\n .map(product => {\n const price = product.prices?.find(p => p.active) || product.prices?.[0];\n const features = data.productFeatures[product.id] || [];\n // Check if this product contains the current subscription's price\n const isCurrentPlan = currentSubscriptionPriceId\n ? product.prices?.some(p => p.id === currentSubscriptionPriceId)\n : false;\n\n // Get raw price amount for sorting\n const priceAmount = price?.unit_amount || 0;\n\n return {\n id: product.id,\n priceId: price?.id || 0,\n name: product.name,\n description: product.description,\n price: formatCurrency(priceAmount, price?.currency || 'usd'),\n priceAmount, // Raw amount in cents for sorting\n period: price?.recurring_interval || 'month',\n features: features.map(f => {\n // Get feature name and value\n const featureName = f.feature_name || f.feature_key || 'Feature';\n const featureValue = typeof f.value === 'object' && f.value !== null && 'value' in f.value\n ? f.value.value\n : f.value;\n const featureUnit = f.feature_unit || '';\n\n // If numeric feature with value, show it formatted\n if (featureValue !== undefined && featureValue !== null) {\n const formattedValue = typeof featureValue === 'number'\n ? featureValue.toLocaleString()\n : String(featureValue);\n return `${featureName}: ${formattedValue}${featureUnit ? ` ${featureUnit}` : ''}`.trim();\n }\n\n return featureName;\n }),\n current: isCurrentPlan || false,\n popular: product.name.toLowerCase().includes('pro') || product.name.toLowerCase().includes('professional'),\n };\n })\n .sort((a, b) => a.priceAmount - b.priceAmount); // Sort by price ascending (cheapest first)\n\n // Config for actions\n const actionConfig = {\n baseUrl: props.baseUrl,\n apiKey: props.apiKey,\n accessToken: props.accessToken,\n projectId: props.projectId,\n };\n\n return (\n <BillingContent\n subscription={subscription}\n invoices={invoices}\n paymentMethods={data.paymentMethods}\n plans={plans}\n customer={data.customer}\n entitlements={data.entitlements}\n featureUsage={data.featureUsage}\n actionConfig={actionConfig}\n initialTaxInfo={initialTaxInfo}\n className={className}\n />\n );\n}\n\n// Helper functions\nfunction formatCurrency(amount: number, currency: string = 'usd'): string {\n const formatter = new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: currency.toUpperCase(),\n });\n return formatter.format(amount / 100); // Stripe amounts are in cents\n}\n\nfunction formatDate(dateString: string | undefined): string {\n if (!dateString) return 'N/A';\n const date = new Date(dateString);\n return date.toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n });\n}\n"]}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* src/components/client/BillingContent/styles.css */
|
|
2
|
+
@layer components {
|
|
3
|
+
.okt-billing,
|
|
4
|
+
.okt-billing * {
|
|
5
|
+
box-sizing: border-box !important;
|
|
6
|
+
}
|
|
7
|
+
.okt-billing .okt-card-border {
|
|
8
|
+
border-width: 1px !important;
|
|
9
|
+
border-style: solid !important;
|
|
10
|
+
border-color: #e5e7eb !important;
|
|
11
|
+
border-radius: 0.5rem !important;
|
|
12
|
+
}
|
|
13
|
+
.okt-billing .okt-card-border:hover {
|
|
14
|
+
background-color: #f9fafb !important;
|
|
15
|
+
}
|
|
16
|
+
@media (prefers-color-scheme: dark) {
|
|
17
|
+
.okt-billing .okt-card-border {
|
|
18
|
+
border-color: #404040 !important;
|
|
19
|
+
}
|
|
20
|
+
.okt-billing .okt-card-border:hover {
|
|
21
|
+
background-color: #262626 !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
.dark .okt-billing .okt-card-border {
|
|
25
|
+
border-color: #404040 !important;
|
|
26
|
+
}
|
|
27
|
+
.dark .okt-billing .okt-card-border:hover {
|
|
28
|
+
background-color: #262626 !important;
|
|
29
|
+
}
|
|
30
|
+
.okt-billing .okt-plan-card {
|
|
31
|
+
border-width: 2px !important;
|
|
32
|
+
border-style: solid !important;
|
|
33
|
+
border-radius: 0.5rem !important;
|
|
34
|
+
}
|
|
35
|
+
.okt-billing .okt-plan-card-default {
|
|
36
|
+
border-color: #e5e7eb !important;
|
|
37
|
+
}
|
|
38
|
+
.okt-billing .okt-plan-card-selected {
|
|
39
|
+
border-color: #2563eb !important;
|
|
40
|
+
}
|
|
41
|
+
@media (prefers-color-scheme: dark) {
|
|
42
|
+
.okt-billing .okt-plan-card-default {
|
|
43
|
+
border-color: #404040 !important;
|
|
44
|
+
}
|
|
45
|
+
.okt-billing .okt-plan-card-selected {
|
|
46
|
+
border-color: #3b82f6 !important;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.dark .okt-billing .okt-plan-card-default {
|
|
50
|
+
border-color: #404040 !important;
|
|
51
|
+
}
|
|
52
|
+
.dark .okt-billing .okt-plan-card-selected {
|
|
53
|
+
border-color: #3b82f6 !important;
|
|
54
|
+
}
|
|
55
|
+
.okt-billing .okt-empty-border {
|
|
56
|
+
border-width: 1px !important;
|
|
57
|
+
border-style: dashed !important;
|
|
58
|
+
border-color: #d1d5db !important;
|
|
59
|
+
border-radius: 0.5rem !important;
|
|
60
|
+
}
|
|
61
|
+
@media (prefers-color-scheme: dark) {
|
|
62
|
+
.okt-billing .okt-empty-border {
|
|
63
|
+
border-color: #404040 !important;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
.dark .okt-billing .okt-empty-border {
|
|
67
|
+
border-color: #404040 !important;
|
|
68
|
+
}
|
|
69
|
+
.okt-billing .okt-divider {
|
|
70
|
+
border-top-width: 1px !important;
|
|
71
|
+
border-top-style: solid !important;
|
|
72
|
+
border-top-color: #e5e7eb !important;
|
|
73
|
+
}
|
|
74
|
+
@media (prefers-color-scheme: dark) {
|
|
75
|
+
.okt-billing .okt-divider {
|
|
76
|
+
border-top-color: #374151 !important;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.dark .okt-billing .okt-divider {
|
|
80
|
+
border-top-color: #374151 !important;
|
|
81
|
+
}
|
|
82
|
+
.okt-billing .okt-alert-warning {
|
|
83
|
+
border-width: 1px !important;
|
|
84
|
+
border-style: solid !important;
|
|
85
|
+
border-color: #fde68a !important;
|
|
86
|
+
border-radius: 0.5rem !important;
|
|
87
|
+
}
|
|
88
|
+
.okt-billing .okt-alert-success {
|
|
89
|
+
border-width: 1px !important;
|
|
90
|
+
border-style: solid !important;
|
|
91
|
+
border-color: #bbf7d0 !important;
|
|
92
|
+
border-radius: 0.5rem !important;
|
|
93
|
+
}
|
|
94
|
+
.okt-billing .okt-alert-error {
|
|
95
|
+
border-width: 1px !important;
|
|
96
|
+
border-style: solid !important;
|
|
97
|
+
border-color: #fecaca !important;
|
|
98
|
+
border-radius: 0.5rem !important;
|
|
99
|
+
}
|
|
100
|
+
@media (prefers-color-scheme: dark) {
|
|
101
|
+
.okt-billing .okt-alert-warning {
|
|
102
|
+
border-color: #854d0e !important;
|
|
103
|
+
}
|
|
104
|
+
.okt-billing .okt-alert-success {
|
|
105
|
+
border-color: #166534 !important;
|
|
106
|
+
}
|
|
107
|
+
.okt-billing .okt-alert-error {
|
|
108
|
+
border-color: #991b1b !important;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
.dark .okt-billing .okt-alert-warning {
|
|
112
|
+
border-color: #854d0e !important;
|
|
113
|
+
}
|
|
114
|
+
.dark .okt-billing .okt-alert-success {
|
|
115
|
+
border-color: #166534 !important;
|
|
116
|
+
}
|
|
117
|
+
.dark .okt-billing .okt-alert-error {
|
|
118
|
+
border-color: #991b1b !important;
|
|
119
|
+
}
|
|
120
|
+
.okt-billing .okt-selectable {
|
|
121
|
+
border-width: 2px !important;
|
|
122
|
+
border-style: solid !important;
|
|
123
|
+
border-radius: 0.5rem !important;
|
|
124
|
+
cursor: pointer !important;
|
|
125
|
+
transition: border-color 0.15s ease !important;
|
|
126
|
+
}
|
|
127
|
+
.okt-billing .okt-selectable-default {
|
|
128
|
+
border-color: #e5e7eb !important;
|
|
129
|
+
}
|
|
130
|
+
.okt-billing .okt-selectable-default:hover {
|
|
131
|
+
border-color: #d1d5db !important;
|
|
132
|
+
}
|
|
133
|
+
.okt-billing .okt-selectable-selected {
|
|
134
|
+
border-color: #3b82f6 !important;
|
|
135
|
+
background-color: #eff6ff !important;
|
|
136
|
+
}
|
|
137
|
+
@media (prefers-color-scheme: dark) {
|
|
138
|
+
.okt-billing .okt-selectable-default {
|
|
139
|
+
border-color: #404040 !important;
|
|
140
|
+
}
|
|
141
|
+
.okt-billing .okt-selectable-default:hover {
|
|
142
|
+
border-color: #525252 !important;
|
|
143
|
+
}
|
|
144
|
+
.okt-billing .okt-selectable-selected {
|
|
145
|
+
border-color: #3b82f6 !important;
|
|
146
|
+
background-color: rgba(59, 130, 246, 0.1) !important;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
.dark .okt-billing .okt-selectable-default {
|
|
150
|
+
border-color: #404040 !important;
|
|
151
|
+
}
|
|
152
|
+
.dark .okt-billing .okt-selectable-default:hover {
|
|
153
|
+
border-color: #525252 !important;
|
|
154
|
+
}
|
|
155
|
+
.dark .okt-billing .okt-selectable-selected {
|
|
156
|
+
border-color: #3b82f6 !important;
|
|
157
|
+
background-color: rgba(59, 130, 246, 0.1) !important;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/client/BillingContent/styles.css"],"sourcesContent":["/* OmniKit Billing - Scoped CSS */\n/* All styles are scoped to .okt-billing to prevent conflicts */\n\n@layer components {\n /* Reset borders within okt-billing to prevent conflicts */\n .okt-billing,\n .okt-billing * {\n box-sizing: border-box !important;\n }\n\n /* Scoped border styles for invoice/payment cards */\n .okt-billing .okt-card-border {\n border-width: 1px !important;\n border-style: solid !important;\n border-color: #e5e7eb !important;\n border-radius: 0.5rem !important;\n }\n\n .okt-billing .okt-card-border:hover {\n background-color: #f9fafb !important;\n }\n\n @media (prefers-color-scheme: dark) {\n .okt-billing .okt-card-border {\n border-color: #404040 !important;\n }\n .okt-billing .okt-card-border:hover {\n background-color: #262626 !important;\n }\n }\n\n .dark .okt-billing .okt-card-border {\n border-color: #404040 !important;\n }\n\n .dark .okt-billing .okt-card-border:hover {\n background-color: #262626 !important;\n }\n\n /* Plan card borders */\n .okt-billing .okt-plan-card {\n border-width: 2px !important;\n border-style: solid !important;\n border-radius: 0.5rem !important;\n }\n\n .okt-billing .okt-plan-card-default {\n border-color: #e5e7eb !important;\n }\n\n .okt-billing .okt-plan-card-selected {\n border-color: #2563eb !important;\n }\n\n @media (prefers-color-scheme: dark) {\n .okt-billing .okt-plan-card-default {\n border-color: #404040 !important;\n }\n .okt-billing .okt-plan-card-selected {\n border-color: #3b82f6 !important;\n }\n }\n\n .dark .okt-billing .okt-plan-card-default {\n border-color: #404040 !important;\n }\n\n .dark .okt-billing .okt-plan-card-selected {\n border-color: #3b82f6 !important;\n }\n\n /* Dashed border for empty states */\n .okt-billing .okt-empty-border {\n border-width: 1px !important;\n border-style: dashed !important;\n border-color: #d1d5db !important;\n border-radius: 0.5rem !important;\n }\n\n @media (prefers-color-scheme: dark) {\n .okt-billing .okt-empty-border {\n border-color: #404040 !important;\n }\n }\n\n .dark .okt-billing .okt-empty-border {\n border-color: #404040 !important;\n }\n\n /* Divider/separator borders */\n .okt-billing .okt-divider {\n border-top-width: 1px !important;\n border-top-style: solid !important;\n border-top-color: #e5e7eb !important;\n }\n\n @media (prefers-color-scheme: dark) {\n .okt-billing .okt-divider {\n border-top-color: #374151 !important;\n }\n }\n\n .dark .okt-billing .okt-divider {\n border-top-color: #374151 !important;\n }\n\n /* Alert/notification borders */\n .okt-billing .okt-alert-warning {\n border-width: 1px !important;\n border-style: solid !important;\n border-color: #fde68a !important;\n border-radius: 0.5rem !important;\n }\n\n .okt-billing .okt-alert-success {\n border-width: 1px !important;\n border-style: solid !important;\n border-color: #bbf7d0 !important;\n border-radius: 0.5rem !important;\n }\n\n .okt-billing .okt-alert-error {\n border-width: 1px !important;\n border-style: solid !important;\n border-color: #fecaca !important;\n border-radius: 0.5rem !important;\n }\n\n @media (prefers-color-scheme: dark) {\n .okt-billing .okt-alert-warning {\n border-color: #854d0e !important;\n }\n .okt-billing .okt-alert-success {\n border-color: #166534 !important;\n }\n .okt-billing .okt-alert-error {\n border-color: #991b1b !important;\n }\n }\n\n .dark .okt-billing .okt-alert-warning {\n border-color: #854d0e !important;\n }\n\n .dark .okt-billing .okt-alert-success {\n border-color: #166534 !important;\n }\n\n .dark .okt-billing .okt-alert-error {\n border-color: #991b1b !important;\n }\n\n /* Payment method selection borders */\n .okt-billing .okt-selectable {\n border-width: 2px !important;\n border-style: solid !important;\n border-radius: 0.5rem !important;\n cursor: pointer !important;\n transition: border-color 0.15s ease !important;\n }\n\n .okt-billing .okt-selectable-default {\n border-color: #e5e7eb !important;\n }\n\n .okt-billing .okt-selectable-default:hover {\n border-color: #d1d5db !important;\n }\n\n .okt-billing .okt-selectable-selected {\n border-color: #3b82f6 !important;\n background-color: #eff6ff !important;\n }\n\n @media (prefers-color-scheme: dark) {\n .okt-billing .okt-selectable-default {\n border-color: #404040 !important;\n }\n .okt-billing .okt-selectable-default:hover {\n border-color: #525252 !important;\n }\n .okt-billing .okt-selectable-selected {\n border-color: #3b82f6 !important;\n background-color: rgba(59, 130, 246, 0.1) !important;\n }\n }\n\n .dark .okt-billing .okt-selectable-default {\n border-color: #404040 !important;\n }\n\n .dark .okt-billing .okt-selectable-default:hover {\n border-color: #525252 !important;\n }\n\n .dark .okt-billing .okt-selectable-selected {\n border-color: #3b82f6 !important;\n background-color: rgba(59, 130, 246, 0.1) !important;\n }\n}\n"],"mappings":";AAGA;AAEE,GAAC;AAAA,EACD,CADC,YACY;AACX,gBAAY;AACd;AAGA,GANC,YAMY,CAAC;AACZ,kBAAc;AACd,kBAAc;AACd,kBAAc;AACd,mBAAe;AACjB;AAEA,GAbC,YAaY,CAPC,eAOe;A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;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { c as PaymentMethod, C as Customer, E as Entitlement } from '../../types-
|
|
2
|
+
import { c as PaymentMethod, C as Customer, E as Entitlement, F as FeatureUsage } from '../../types-CnhWTSXv.js';
|
|
3
3
|
export { Button, ButtonProps } from '@marcoschwartz/lite-ui';
|
|
4
4
|
|
|
5
5
|
interface Tab {
|
|
@@ -96,11 +96,12 @@ interface BillingContentProps {
|
|
|
96
96
|
plans: PlanDisplay[];
|
|
97
97
|
customer: Customer;
|
|
98
98
|
entitlements: Entitlement[];
|
|
99
|
+
featureUsage: Record<string, FeatureUsage>;
|
|
99
100
|
actionConfig: ActionConfig;
|
|
100
101
|
initialTaxInfo?: TaxCalculation | null;
|
|
101
102
|
className?: string;
|
|
102
103
|
}
|
|
103
|
-
declare function BillingContent({ subscription, invoices, paymentMethods, plans, customer,
|
|
104
|
+
declare function BillingContent({ subscription, invoices, paymentMethods, plans, customer, featureUsage, actionConfig, initialTaxInfo, className }: BillingContentProps): react_jsx_runtime.JSX.Element;
|
|
104
105
|
|
|
105
106
|
interface AddPaymentMethodFormProps {
|
|
106
107
|
customerId: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Modal } from '../../chunk-
|
|
2
|
-
export { AddPaymentMethodForm, BillingContent, Modal } from '../../chunk-
|
|
1
|
+
import { Modal } from '../../chunk-MTFFRTQW.js';
|
|
2
|
+
export { AddPaymentMethodForm, BillingContent, Modal } from '../../chunk-MTFFRTQW.js';
|
|
3
3
|
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
4
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { Button, TextInput, Spinner } from '@marcoschwartz/lite-ui';
|