@omnikit-js/ui 0.9.41 → 0.9.42
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-XYCOFFYZ.js → chunk-3AQCVPQI.js} +14 -14
- package/dist/{chunk-XYCOFFYZ.js.map → chunk-3AQCVPQI.js.map} +1 -1
- package/dist/{chunk-7NZAWCIZ.js → chunk-FNZCGWVE.js} +3 -3
- package/dist/{chunk-7NZAWCIZ.js.map → chunk-FNZCGWVE.js.map} +1 -1
- package/dist/components/client/index.js +38 -36
- package/dist/components/client/index.js.map +1 -1
- package/dist/components/server/index.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BillingContent } from './chunk-
|
|
1
|
+
import { BillingContent } from './chunk-3AQCVPQI.js';
|
|
2
2
|
import { Alert, Table } from '@marcoschwartz/lite-ui';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -527,5 +527,5 @@ function formatDate(dateString) {
|
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
export { Billing, DataList, OmniKitClient, createOmniKitClient };
|
|
530
|
-
//# sourceMappingURL=chunk-
|
|
531
|
-
//# sourceMappingURL=chunk-
|
|
530
|
+
//# sourceMappingURL=chunk-FNZCGWVE.js.map
|
|
531
|
+
//# sourceMappingURL=chunk-FNZCGWVE.js.map
|
|
@@ -1 +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,EAKzB,YAAY,MAAA,EAAuB;AACjC,IAAA,IAAA,CAAK,OAAA,GAAU,MAAA,CAAO,OAAA,CAAQ,OAAA,CAAQ,OAAO,EAAE,CAAA;AAC/C,IAAA,IAAA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MACA,UAAU,IAAA,CAAK,QAAA;AAAA,MACf,cAAc,IAAA,CAAK,YAAA;AAAA,MACnB,cAAc,IAAA,CAAK,YAAA;AAAA,MACnB,YAAA,EAAc,SAAA;AAAA,MACd,cAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;AAGA,SAAS,cAAA,CAAe,MAAA,EAAgB,QAAA,GAAmB,KAAA,EAAe;AACxE,EAAA,MAAM,SAAA,GAAY,IAAI,IAAA,CAAK,YAAA,CAAa,OAAA,EAAS;AAAA,IAC/C,KAAA,EAAO,UAAA;AAAA,IACP,QAAA,EAAU,SAAS,WAAA;AAAY,GAChC,CAAA;AACD,EAAA,OAAO,SAAA,CAAU,MAAA,CAAO,MAAA,GAAS,GAAG,CAAA;AACtC;AAEA,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-7NZAWCIZ.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 * Project data\n */\ninterface ProjectData {\n id: number;\n name: string;\n slug?: string;\n description?: string;\n}\n\n/**\n * Fetch project data by ID\n */\nexport async function fetchProject(\n config: BillingClientConfig\n): Promise<ApiResponse<ProjectData>> {\n const { baseUrl, projectId } = config;\n\n return fetchAPI<ProjectData>(\n config,\n `${baseUrl}/data/projects/${projectId}`\n );\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, fetchProject, 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 // Config for API calls\n const apiConfig = {\n baseUrl: props.baseUrl,\n apiKey: props.apiKey,\n accessToken: props.accessToken,\n projectId: props.projectId,\n };\n\n // Fetch tax info for the customer (server-side)\n let initialTaxInfo: TaxInfo | null = null;\n if (data.customer?.id) {\n const taxResult = await fetchTaxInfo(apiConfig, data.customer.id, 10000); // $100 reference\n if (taxResult.success && taxResult.data) {\n initialTaxInfo = taxResult.data;\n }\n }\n\n // Fetch project data for business name (server-side)\n let businessName: string | undefined;\n const projectResult = await fetchProject(apiConfig);\n if (projectResult.success && projectResult.data?.name) {\n businessName = projectResult.data.name;\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\n .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 // Boolean true = just show feature name (included)\n if (featureValue === true) {\n return featureName;\n }\n\n // Boolean false = skip this feature\n if (featureValue === false) {\n return null;\n }\n\n // Numeric -1 = Unlimited\n if (typeof featureValue === 'number' && featureValue === -1) {\n return `Unlimited ${featureUnit || featureName.toLowerCase()}`;\n }\n\n // Numeric value with unit\n if (typeof featureValue === 'number') {\n const formattedValue = featureValue.toLocaleString();\n return `${formattedValue} ${featureUnit || featureName.toLowerCase()}`;\n }\n\n // String value\n if (typeof featureValue === 'string' && featureValue) {\n return `${featureName}: ${featureValue}`;\n }\n\n return featureName;\n })\n .filter(Boolean) as string[],\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 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={apiConfig}\n initialTaxInfo={initialTaxInfo}\n businessName={businessName}\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"]}
|
|
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,EAKzB,YAAY,MAAA,EAAuB;AACjC,IAAA,IAAA,CAAK,OAAA,GAAU,MAAA,CAAO,OAAA,CAAQ,OAAA,CAAQ,OAAO,EAAE,CAAA;AAC/C,IAAA,IAAA,CAAK,SAAS,MAAA,CAAO,MAAA;AACrB,IAAA,IAAA,CAAK,MAAM,MAAA,CAAO,GAAA;AAAA,EACpB;AAAA,EAEQ,UAAA,GAA0B;AAChC,IAAA,MAAM,OAAA,GAAuB;AAAA,MAC3B,cAAA,EAAgB;AAAA,KAClB;AAEA,IAAA,IAAI,KAAK,GAAA,EAAK;AACZ,MAAA,OAAA,CAAQ,eAAe,CAAA,GAAI,CAAA,OAAA,EAAU,IAAA,CAAK,GAAG,CAAA,CAAA;AAAA,IAC/C,CAAA,MAAA,IAAW,KAAK,MAAA,EAAQ;AACtB,MAAA,OAAA,CAAQ,WAAW,IAAI,IAAA,CAAK,MAAA;AAAA,IAC9B;AAEA,IAAA,OAAO,OAAA;AAAA,EACT;AAAA,EAEA,MAAc,OAAA,CACZ,QAAA,EACA,OAAA,EACY;AACZ,IAAA,MAAM,GAAA,GAAM,CAAA,EAAG,IAAA,CAAK,OAAO,GAAG,QAAQ,CAAA,CAAA;AAEtC,IAAA,MAAM,QAAA,GAAW,MAAM,KAAA,CAAM,GAAA,EAAK;AAAA,MAChC,GAAG,OAAA;AAAA,MACH,OAAA,EAAS;AAAA,QACP,GAAG,KAAK,UAAA,EAAW;AAA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K;AAAA,GACN,CAAA;AACH","file":"chunk-FNZCGWVE.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 * Project data\n */\ninterface ProjectData {\n id: number;\n name: string;\n slug?: string;\n description?: string;\n}\n\n/**\n * Fetch project data by ID\n */\nexport async function fetchProject(\n config: BillingClientConfig\n): Promise<ApiResponse<ProjectData>> {\n const { baseUrl, projectId } = config;\n\n return fetchAPI<ProjectData>(\n config,\n `${baseUrl}/data/projects/${projectId}`\n );\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, fetchProject, 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 // Config for API calls\n const apiConfig = {\n baseUrl: props.baseUrl,\n apiKey: props.apiKey,\n accessToken: props.accessToken,\n projectId: props.projectId,\n };\n\n // Fetch tax info for the customer (server-side)\n let initialTaxInfo: TaxInfo | null = null;\n if (data.customer?.id) {\n const taxResult = await fetchTaxInfo(apiConfig, data.customer.id, 10000); // $100 reference\n if (taxResult.success && taxResult.data) {\n initialTaxInfo = taxResult.data;\n }\n }\n\n // Fetch project data for business name (server-side)\n let businessName: string | undefined;\n const projectResult = await fetchProject(apiConfig);\n if (projectResult.success && projectResult.data?.name) {\n businessName = projectResult.data.name;\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\n .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 // Boolean true = just show feature name (included)\n if (featureValue === true) {\n return featureName;\n }\n\n // Boolean false = skip this feature\n if (featureValue === false) {\n return null;\n }\n\n // Numeric -1 = Unlimited\n if (typeof featureValue === 'number' && featureValue === -1) {\n return `Unlimited ${featureUnit || featureName.toLowerCase()}`;\n }\n\n // Numeric value with unit\n if (typeof featureValue === 'number') {\n const formattedValue = featureValue.toLocaleString();\n return `${formattedValue} ${featureUnit || featureName.toLowerCase()}`;\n }\n\n // String value\n if (typeof featureValue === 'string' && featureValue) {\n return `${featureName}: ${featureValue}`;\n }\n\n return featureName;\n })\n .filter(Boolean) as string[],\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 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={apiConfig}\n initialTaxInfo={initialTaxInfo}\n businessName={businessName}\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"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AddPaymentMethodForm, BillingContent } from '../../chunk-
|
|
1
|
+
export { AddPaymentMethodForm, BillingContent } from '../../chunk-3AQCVPQI.js';
|
|
2
2
|
import { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { Button, TextInput, Spinner } from '@marcoschwartz/lite-ui';
|
|
@@ -13,7 +13,7 @@ function Tabs({ tabs, defaultTab, className = "" }) {
|
|
|
13
13
|
onClick: () => setActiveTab(tab.id),
|
|
14
14
|
className: `
|
|
15
15
|
whitespace-nowrap border-b-2 px-1 pb-4 text-sm font-medium transition-colors
|
|
16
|
-
${activeTab === tab.id ? "border-blue-500 text-blue-600 dark:text-
|
|
16
|
+
${activeTab === tab.id ? "border-blue-500 text-blue-600 dark:border-neutral-300 dark:text-white" : "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-neutral-400 dark:hover:text-neutral-300"}
|
|
17
17
|
`,
|
|
18
18
|
children: tab.label
|
|
19
19
|
},
|
|
@@ -119,7 +119,7 @@ function PaymentMethodManager({ currentMethod }) {
|
|
|
119
119
|
{
|
|
120
120
|
type: "text",
|
|
121
121
|
placeholder: "John Doe",
|
|
122
|
-
className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
|
|
122
|
+
className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 dark:focus:border-neutral-400 focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-neutral-400/20"
|
|
123
123
|
}
|
|
124
124
|
)
|
|
125
125
|
] }),
|
|
@@ -130,7 +130,7 @@ function PaymentMethodManager({ currentMethod }) {
|
|
|
130
130
|
{
|
|
131
131
|
type: "text",
|
|
132
132
|
placeholder: "1234 5678 9012 3456",
|
|
133
|
-
className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
|
|
133
|
+
className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 dark:focus:border-neutral-400 focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-neutral-400/20"
|
|
134
134
|
}
|
|
135
135
|
)
|
|
136
136
|
] }),
|
|
@@ -142,7 +142,7 @@ function PaymentMethodManager({ currentMethod }) {
|
|
|
142
142
|
{
|
|
143
143
|
type: "text",
|
|
144
144
|
placeholder: "MM/YY",
|
|
145
|
-
className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
|
|
145
|
+
className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 dark:focus:border-neutral-400 focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-neutral-400/20"
|
|
146
146
|
}
|
|
147
147
|
)
|
|
148
148
|
] }),
|
|
@@ -153,7 +153,7 @@ function PaymentMethodManager({ currentMethod }) {
|
|
|
153
153
|
{
|
|
154
154
|
type: "text",
|
|
155
155
|
placeholder: "123",
|
|
156
|
-
className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
|
|
156
|
+
className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 dark:focus:border-neutral-400 focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-neutral-400/20"
|
|
157
157
|
}
|
|
158
158
|
)
|
|
159
159
|
] })
|
|
@@ -164,7 +164,7 @@ function PaymentMethodManager({ currentMethod }) {
|
|
|
164
164
|
{
|
|
165
165
|
type: "checkbox",
|
|
166
166
|
id: "setDefaultModal",
|
|
167
|
-
className: "rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"
|
|
167
|
+
className: "rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-gray-300 focus:ring-blue-500 dark:focus:ring-gray-400"
|
|
168
168
|
}
|
|
169
169
|
),
|
|
170
170
|
/* @__PURE__ */ jsx("label", { htmlFor: "setDefaultModal", className: "text-sm text-gray-700 dark:text-gray-300", children: "Set as default payment method" })
|
|
@@ -298,7 +298,7 @@ function LoginForm({
|
|
|
298
298
|
"a",
|
|
299
299
|
{
|
|
300
300
|
href: forgotPasswordLink,
|
|
301
|
-
className: "text-blue-600 hover:text-blue-700 dark:text-
|
|
301
|
+
className: "text-blue-600 hover:text-blue-700 dark:text-neutral-300 dark:hover:text-white",
|
|
302
302
|
children: "Forgot password?"
|
|
303
303
|
}
|
|
304
304
|
),
|
|
@@ -306,7 +306,7 @@ function LoginForm({
|
|
|
306
306
|
"a",
|
|
307
307
|
{
|
|
308
308
|
href: registerLink,
|
|
309
|
-
className: "text-blue-600 hover:text-blue-700 dark:text-
|
|
309
|
+
className: "text-blue-600 hover:text-blue-700 dark:text-neutral-300 dark:hover:text-white",
|
|
310
310
|
children: "Create an account"
|
|
311
311
|
}
|
|
312
312
|
)
|
|
@@ -525,7 +525,7 @@ function RegisterForm({
|
|
|
525
525
|
"a",
|
|
526
526
|
{
|
|
527
527
|
href: loginLink,
|
|
528
|
-
className: "text-blue-600 hover:text-blue-700 dark:text-
|
|
528
|
+
className: "text-blue-600 hover:text-blue-700 dark:text-neutral-300 dark:hover:text-white",
|
|
529
529
|
children: "Sign in"
|
|
530
530
|
}
|
|
531
531
|
)
|
|
@@ -602,7 +602,7 @@ function ForgotPasswordForm({
|
|
|
602
602
|
"a",
|
|
603
603
|
{
|
|
604
604
|
href: loginLink,
|
|
605
|
-
className: "text-blue-600 hover:text-blue-700 dark:text-
|
|
605
|
+
className: "text-blue-600 hover:text-blue-700 dark:text-neutral-300 dark:hover:text-white",
|
|
606
606
|
children: "Back to sign in"
|
|
607
607
|
}
|
|
608
608
|
) })
|
|
@@ -774,7 +774,7 @@ function ResetPasswordForm({
|
|
|
774
774
|
"a",
|
|
775
775
|
{
|
|
776
776
|
href: loginLink,
|
|
777
|
-
className: "text-blue-600 hover:text-blue-700 dark:text-
|
|
777
|
+
className: "text-blue-600 hover:text-blue-700 dark:text-neutral-300 dark:hover:text-white",
|
|
778
778
|
children: "Back to sign in"
|
|
779
779
|
}
|
|
780
780
|
) })
|
|
@@ -1089,8 +1089,10 @@ function FileUploader({
|
|
|
1089
1089
|
speed: 0,
|
|
1090
1090
|
eta: 0
|
|
1091
1091
|
};
|
|
1092
|
-
|
|
1093
|
-
|
|
1092
|
+
queueMicrotask(() => {
|
|
1093
|
+
setOverallProgress(progress);
|
|
1094
|
+
onProgress?.(progress);
|
|
1095
|
+
});
|
|
1094
1096
|
return currentUploads;
|
|
1095
1097
|
});
|
|
1096
1098
|
}, [onProgress]);
|
|
@@ -1250,7 +1252,7 @@ function FileUploader({
|
|
|
1250
1252
|
const isUploading = uploads.some((u) => u.status === "uploading");
|
|
1251
1253
|
const hasPendingFiles = uploads.some((u) => u.status === "pending");
|
|
1252
1254
|
return /* @__PURE__ */ jsxs("div", { className: `w-full ${className}`, children: [
|
|
1253
|
-
label && /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-900 dark:text-
|
|
1255
|
+
label && /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-900 dark:text-neutral-100 mb-2", children: label }),
|
|
1254
1256
|
/* @__PURE__ */ jsxs(
|
|
1255
1257
|
"div",
|
|
1256
1258
|
{
|
|
@@ -1260,7 +1262,7 @@ function FileUploader({
|
|
|
1260
1262
|
onClick: handleClick,
|
|
1261
1263
|
className: `
|
|
1262
1264
|
relative border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-all
|
|
1263
|
-
${isDragging ? "border-blue-500 bg-blue-50 dark:bg-
|
|
1265
|
+
${isDragging ? "border-blue-500 bg-blue-50 dark:border-neutral-400 dark:bg-neutral-700/50" : "border-gray-300 dark:border-neutral-600 hover:border-gray-400 dark:hover:border-neutral-500"}
|
|
1264
1266
|
${disabled ? "opacity-50 cursor-not-allowed" : ""}
|
|
1265
1267
|
`,
|
|
1266
1268
|
children: [
|
|
@@ -1277,13 +1279,13 @@ function FileUploader({
|
|
|
1277
1279
|
}
|
|
1278
1280
|
),
|
|
1279
1281
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|
|
1280
|
-
/* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-full bg-gray-100 dark:bg-
|
|
1282
|
+
/* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-full bg-gray-100 dark:bg-neutral-800 flex items-center justify-center", children: /* @__PURE__ */ jsx("svg", { className: "w-6 h-6 text-gray-400 dark:text-neutral-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" }) }) }),
|
|
1281
1283
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1282
|
-
/* @__PURE__ */ jsxs("p", { className: "text-sm font-medium text-gray-900 dark:text-
|
|
1283
|
-
/* @__PURE__ */ jsx("span", { className: "text-blue-600 dark:text-
|
|
1284
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm font-medium text-gray-900 dark:text-neutral-100", children: [
|
|
1285
|
+
/* @__PURE__ */ jsx("span", { className: "text-blue-600 dark:text-neutral-200 dark:font-medium", children: "Click to upload" }),
|
|
1284
1286
|
" or drag and drop"
|
|
1285
1287
|
] }),
|
|
1286
|
-
/* @__PURE__ */ jsxs("p", { className: "text-xs text-gray-500 dark:text-
|
|
1288
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-gray-500 dark:text-neutral-400 mt-1", children: [
|
|
1287
1289
|
accept ? `Accepted: ${accept}` : "Any file type",
|
|
1288
1290
|
maxFileSize && ` \xB7 Max: ${formatFileSize(maxFileSize)}`
|
|
1289
1291
|
] })
|
|
@@ -1292,28 +1294,28 @@ function FileUploader({
|
|
|
1292
1294
|
]
|
|
1293
1295
|
}
|
|
1294
1296
|
),
|
|
1295
|
-
helperText && /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-gray-500 dark:text-
|
|
1296
|
-
showProgress && overallProgress && isUploading && /* @__PURE__ */ jsxs("div", { className: "mt-4 p-3 bg-gray-50 dark:bg-
|
|
1297
|
+
helperText && /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-gray-500 dark:text-neutral-400", children: helperText }),
|
|
1298
|
+
showProgress && overallProgress && isUploading && /* @__PURE__ */ jsxs("div", { className: "mt-4 p-3 bg-gray-50 dark:bg-neutral-800 rounded-lg", children: [
|
|
1297
1299
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm mb-2", children: [
|
|
1298
|
-
/* @__PURE__ */ jsxs("span", { className: "text-gray-700 dark:text-
|
|
1300
|
+
/* @__PURE__ */ jsxs("span", { className: "text-gray-700 dark:text-neutral-300", children: [
|
|
1299
1301
|
"Uploading ",
|
|
1300
1302
|
overallProgress.completedFiles + 1,
|
|
1301
1303
|
" of ",
|
|
1302
1304
|
overallProgress.totalFiles
|
|
1303
1305
|
] }),
|
|
1304
|
-
/* @__PURE__ */ jsxs("span", { className: "text-gray-500 dark:text-
|
|
1306
|
+
/* @__PURE__ */ jsxs("span", { className: "text-gray-500 dark:text-neutral-400", children: [
|
|
1305
1307
|
overallProgress.percentage,
|
|
1306
1308
|
"%"
|
|
1307
1309
|
] })
|
|
1308
1310
|
] }),
|
|
1309
|
-
/* @__PURE__ */ jsx("div", { className: "w-full h-2 bg-gray-200 dark:bg-
|
|
1311
|
+
/* @__PURE__ */ jsx("div", { className: "w-full h-2 bg-gray-200 dark:bg-neutral-700 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
1310
1312
|
"div",
|
|
1311
1313
|
{
|
|
1312
|
-
className: "h-full bg-blue-600 transition-all duration-300",
|
|
1314
|
+
className: "h-full bg-blue-600 dark:bg-neutral-300 transition-all duration-300",
|
|
1313
1315
|
style: { width: `${overallProgress.percentage}%` }
|
|
1314
1316
|
}
|
|
1315
1317
|
) }),
|
|
1316
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-gray-500 dark:text-
|
|
1318
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-gray-500 dark:text-neutral-400 mt-1", children: [
|
|
1317
1319
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
1318
1320
|
formatFileSize(overallProgress.bytesUploaded),
|
|
1319
1321
|
" / ",
|
|
@@ -1325,12 +1327,12 @@ function FileUploader({
|
|
|
1325
1327
|
showFileList && uploads.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-4 space-y-2", children: uploads.map((upload) => /* @__PURE__ */ jsxs(
|
|
1326
1328
|
"div",
|
|
1327
1329
|
{
|
|
1328
|
-
className: "flex items-center gap-3 p-3 bg-gray-50 dark:bg-
|
|
1330
|
+
className: "flex items-center gap-3 p-3 bg-gray-50 dark:bg-neutral-800 rounded-lg border border-gray-200 dark:border-neutral-700",
|
|
1329
1331
|
children: [
|
|
1330
|
-
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded bg-gray-200 dark:bg-
|
|
1332
|
+
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded bg-gray-200 dark:bg-neutral-700 flex items-center justify-center flex-shrink-0", children: upload.status === "uploading" ? /* @__PURE__ */ jsx(Spinner, { size: "sm" }) : upload.status === "completed" ? /* @__PURE__ */ jsx("svg", { className: "w-5 h-5 text-green-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }) : upload.status === "error" ? /* @__PURE__ */ jsx("svg", { className: "w-5 h-5 text-red-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) : /* @__PURE__ */ jsx("svg", { className: "w-5 h-5 text-gray-400 dark:text-neutral-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }) }),
|
|
1331
1333
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1332
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-gray-900 dark:text-
|
|
1333
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-
|
|
1334
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-gray-900 dark:text-neutral-100 truncate", children: upload.file.name }),
|
|
1335
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-neutral-400", children: [
|
|
1334
1336
|
/* @__PURE__ */ jsx("span", { children: formatFileSize(upload.file.size) }),
|
|
1335
1337
|
upload.status === "uploading" && /* @__PURE__ */ jsxs("span", { children: [
|
|
1336
1338
|
"\xB7 ",
|
|
@@ -1338,12 +1340,12 @@ function FileUploader({
|
|
|
1338
1340
|
"%"
|
|
1339
1341
|
] }),
|
|
1340
1342
|
upload.status === "error" && /* @__PURE__ */ jsx("span", { className: "text-red-500", children: upload.error }),
|
|
1341
|
-
upload.file.size >= multipartThreshold && upload.status === "pending" && /* @__PURE__ */ jsx("span", { className: "text-blue-500", children: "Multipart" })
|
|
1343
|
+
upload.file.size >= multipartThreshold && upload.status === "pending" && /* @__PURE__ */ jsx("span", { className: "text-blue-500 dark:text-neutral-300", children: "Multipart" })
|
|
1342
1344
|
] }),
|
|
1343
|
-
upload.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "w-full h-1 bg-gray-200 dark:bg-
|
|
1345
|
+
upload.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "w-full h-1 bg-gray-200 dark:bg-neutral-700 rounded-full mt-2 overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
1344
1346
|
"div",
|
|
1345
1347
|
{
|
|
1346
|
-
className: "h-full bg-blue-600 transition-all duration-300",
|
|
1348
|
+
className: "h-full bg-blue-600 dark:bg-neutral-300 transition-all duration-300",
|
|
1347
1349
|
style: { width: `${upload.progress}%` }
|
|
1348
1350
|
}
|
|
1349
1351
|
) })
|
|
@@ -1353,7 +1355,7 @@ function FileUploader({
|
|
|
1353
1355
|
"button",
|
|
1354
1356
|
{
|
|
1355
1357
|
onClick: () => handleRetry(upload),
|
|
1356
|
-
className: "p-1 text-gray-400 hover:text-blue-500 transition-colors",
|
|
1358
|
+
className: "p-1 text-gray-400 dark:text-neutral-400 hover:text-blue-500 dark:hover:text-neutral-200 transition-colors",
|
|
1357
1359
|
title: "Retry",
|
|
1358
1360
|
children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" }) })
|
|
1359
1361
|
}
|
|
@@ -1362,7 +1364,7 @@ function FileUploader({
|
|
|
1362
1364
|
"button",
|
|
1363
1365
|
{
|
|
1364
1366
|
onClick: () => handleRemoveFile(upload.id),
|
|
1365
|
-
className: "p-1 text-gray-400 hover:text-red-500 transition-colors",
|
|
1367
|
+
className: "p-1 text-gray-400 dark:text-neutral-400 hover:text-red-500 transition-colors",
|
|
1366
1368
|
title: "Remove",
|
|
1367
1369
|
children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
1368
1370
|
}
|