@alphinex/business
v1.1.10
Published
Domain-shaped business components (Lookups, Timelines, ActivityFeed, ApprovalWorkflow, DashboardKPI/StatCard) built on generic prop shapes — no api/auth coupling.
Readme
@alphinex/business
Domain-shaped business components — Lookups, Timelines, ActivityFeed, ApprovalWorkflow,
DashboardKPI/StatCard. Every component takes a generic prop shape supplied by the app; none of
them import @alphinex/api, @alphinex/api-laravel, @alphinex/auth, or
@alphinex/permissions — data fetching and domain wiring stay in the app, exactly like
@alphinex/table and @alphinex/charts.
StatCard
A single dashboard metric with an optional delta/trend indicator.
import { StatCard } from "@alphinex/business";
<StatCard label="Revenue" value="$12,400" delta={12.5} />;AuditTimeline / PaymentTimeline
import { AuditTimeline, PaymentTimeline } from "@alphinex/business";
<AuditTimeline
events={[
{ id: "1", actor: "Ada Lovelace", action: "approved the invoice", timestamp: "2026-01-05" },
]}
/>;
<PaymentTimeline events={[{ id: "1", dueDate: "2026-02-01", amount: 1240, status: "overdue" }]} />;ActivityFeed
import { ActivityFeed } from "@alphinex/business";
<ActivityFeed
items={[
{ id: "1", actor: "Grace Hopper", description: "closed the ticket", timestamp: "2026-01-05" },
]}
/>;ApprovalWorkflow
import { ApprovalWorkflow } from "@alphinex/business";
<ApprovalWorkflow
steps={[{ id: "1", actor: "Ada Lovelace", status: "approved", timestamp: "2026-01-05" }]}
/>;Lookup<Entity>
A generic async-search field. Compose it into domain-specific components
(CustomerLookup, ProductLookup, ...) by supplying fetchCandidates:
import { Lookup } from "@alphinex/business";
function CustomerLookup(props: { value: Customer | null; onChange: (c: Customer | null) => void }) {
return (
<Lookup<Customer>
{...props}
label="Customer"
fetchCandidates={(query) => api.searchCustomers(query)}
getLabel={(customer) => customer.name}
getKey={(customer) => customer.id}
/>
);
}Keyboard navigation (arrow keys) is deferred — mouse/touch selection only for now; Escape closes the dropdown.
See documentation/ARCHITECTURE.md and documentation/PRODUCT-RESEARCH-MASTER-PLAN.md §8 for the full package contract and design rationale.
