@mindbill/react 0.28.0 → 0.28.2
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/README.md +9 -7
- package/dist/index.d.ts +25 -2
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,11 @@ import { ConnectedBillLifecycle } from "@mindbill/react";
|
|
|
20
20
|
/>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
Sandbox and live responses use the same component contract. Simulation controls
|
|
24
|
+
are hidden by default, including when the connected organization is a sandbox.
|
|
25
|
+
Only a dedicated developer playground should opt in with
|
|
26
|
+
`sandboxControls={true}`; production applications should omit the prop.
|
|
27
|
+
|
|
23
28
|
## Appearance
|
|
24
29
|
|
|
25
30
|
Choose a complete preset, then override only the tokens your design system owns. The preset applies to review, payer search, attachments, submission, status, EOR, payment, denial, resubmission, and close states.
|
|
@@ -27,16 +32,13 @@ Choose a complete preset, then override only the tokens your design system owns.
|
|
|
27
32
|
```tsx
|
|
28
33
|
<ConnectedBillLifecycle
|
|
29
34
|
billId={billId}
|
|
30
|
-
appearance={{
|
|
31
|
-
preset: "orange-bright",
|
|
32
|
-
accentColor: "#ff4f0a",
|
|
33
|
-
fontFamily: "Inter, sans-serif",
|
|
34
|
-
borderRadius: "8px",
|
|
35
|
-
}}
|
|
35
|
+
appearance={{ preset: "midnight-cyan" }}
|
|
36
36
|
/>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
`midnight-cyan` gives every billing surface a spacious pale-blue canvas, crisp white panels, midnight actions and typography, cyan-compatible accents, and pill-shaped controls. No extra CSS is required.
|
|
40
|
+
|
|
41
|
+
Available presets are `mindbill`, `qme-companion`, `orange-bright`, `clinical-blue`, and `midnight-cyan`. Preset names describe visual styles rather than customer or partner brands. Supported overrides include accent, accent text, background, surface, input background, text, muted text, border, font, panel radius, control radius, shadow, danger, success, and warning colors.
|
|
40
42
|
|
|
41
43
|
Add one authenticated route to your app. It maps the signed-in user's role to billing permissions, then mints an exact-origin token for that user in your MindBill organization. The Partner API key stays on the server.
|
|
42
44
|
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { CSSProperties, ReactElement, ReactNode } from 'react';
|
|
|
4
4
|
import { BillReviewData as BillReviewData$1, BillLifecycleDelivery, BillReviewAttachment as BillReviewAttachment$1, BrowserBillSubmissionResult, BillLifecycleSessionProvider, BillReviewPayer as BillReviewPayer$1, BrowserBillSubmissionDocument, BillRemittanceSummary, BillEorDocument, BillPaymentRecord, BillLifecycleAction, BillLifecycleData, BillLifecycleClientOptions, BillLifecycleClient } from '@mindbill/browser';
|
|
5
5
|
export { BillActivityRecord, BillClaimsAdministratorContact, BillClaimsAdministratorDirectory, BillClaimsAdministratorMailingAddress, BillClaimsAdministratorPattern, BillEorDocument, BillLifecycleAction, BillLifecycleActionId, BillLifecycleClient, BillLifecycleClientOptions, BillLifecycleData, BillLifecycleDelivery, BillLifecycleSession, BillLifecycleSessionProvider, BillLifecycleSessionRequest, BillPaymentRecord, BillRemittanceSummary, BrowserBillSubmissionResult, CloseBillInput, PostBillPaymentInput, ReopenBillInput, SubmitSecondReviewInput, createBillLifecycleClient } from '@mindbill/browser';
|
|
6
6
|
|
|
7
|
-
type MindBillThemePreset = "mindbill" | "qme-companion" | "orange-bright" | "clinical-blue";
|
|
7
|
+
type MindBillThemePreset = "mindbill" | "qme-companion" | "orange-bright" | "clinical-blue" | "midnight-cyan";
|
|
8
8
|
type MindBillReactAppearance = MindBillAppearance & {
|
|
9
9
|
/** A complete starting point. Individual tokens below always win. */
|
|
10
10
|
preset?: MindBillThemePreset;
|
|
@@ -84,6 +84,23 @@ declare const mindBillThemePresets: {
|
|
|
84
84
|
readonly warningColor: "#d48806";
|
|
85
85
|
readonly fontFamily: "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif";
|
|
86
86
|
};
|
|
87
|
+
readonly "midnight-cyan": {
|
|
88
|
+
readonly accentColor: "#05092e";
|
|
89
|
+
readonly accentTextColor: "#ffffff";
|
|
90
|
+
readonly backgroundColor: "#edf6ff";
|
|
91
|
+
readonly surfaceColor: "#ffffff";
|
|
92
|
+
readonly inputBackgroundColor: "#ffffff";
|
|
93
|
+
readonly textColor: "#05092e";
|
|
94
|
+
readonly mutedColor: "#596078";
|
|
95
|
+
readonly borderColor: "#d9dae1";
|
|
96
|
+
readonly borderRadius: "0px";
|
|
97
|
+
readonly controlRadius: "999px";
|
|
98
|
+
readonly shadow: "0 1px 2px rgba(5,9,46,.04)";
|
|
99
|
+
readonly dangerColor: "#b42318";
|
|
100
|
+
readonly successColor: "#167a58";
|
|
101
|
+
readonly warningColor: "#9a6418";
|
|
102
|
+
readonly fontFamily: "Geist, Inter, ui-sans-serif, system-ui, sans-serif";
|
|
103
|
+
};
|
|
87
104
|
};
|
|
88
105
|
declare function resolveMindBillAppearance(appearance: MindBillReactAppearance | undefined): MindBillReactAppearance;
|
|
89
106
|
declare function mindBillAppearanceStyle(appearance: MindBillReactAppearance | undefined, style?: CSSProperties): CSSProperties;
|
|
@@ -844,13 +861,19 @@ type UseBillLifecycleResult = {
|
|
|
844
861
|
declare function useBillLifecycle({ billId: providedBillId, sessionEndpoint, getSession, apiBaseUrl, refreshInterval, enabled, fetch: fetchOverride, }: UseBillLifecycleOptions): UseBillLifecycleResult;
|
|
845
862
|
type ConnectedBillLifecycleProps = UseBillLifecycleOptions & {
|
|
846
863
|
appearance?: MindBillReactAppearance;
|
|
864
|
+
/**
|
|
865
|
+
* Exposes payer-response simulation controls for an explicit sandbox
|
|
866
|
+
* playground. Sandbox responses remain indistinguishable from live
|
|
867
|
+
* lifecycle responses to ordinary host applications.
|
|
868
|
+
*/
|
|
869
|
+
sandboxControls?: boolean;
|
|
847
870
|
className?: string;
|
|
848
871
|
style?: CSSProperties;
|
|
849
872
|
loadingFallback?: ReactNode;
|
|
850
873
|
errorFallback?: (error: Error, retry: () => Promise<void>) => ReactNode;
|
|
851
874
|
onChanged?: (data: BillLifecycleData) => void;
|
|
852
875
|
};
|
|
853
|
-
declare function ConnectedBillLifecycle({ appearance, className, style, loadingFallback, errorFallback, onChanged, ...options }: ConnectedBillLifecycleProps): ReactElement;
|
|
876
|
+
declare function ConnectedBillLifecycle({ appearance, sandboxControls, className, style, loadingFallback, errorFallback, onChanged, ...options }: ConnectedBillLifecycleProps): ReactElement;
|
|
854
877
|
|
|
855
878
|
type MindBillWidgetProps = {
|
|
856
879
|
sessionToken: string;
|
package/dist/index.js
CHANGED
|
@@ -72,6 +72,23 @@ var mindBillThemePresets = {
|
|
|
72
72
|
successColor: "#389e0d",
|
|
73
73
|
warningColor: "#d48806",
|
|
74
74
|
fontFamily: "Inter, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
75
|
+
},
|
|
76
|
+
"midnight-cyan": {
|
|
77
|
+
accentColor: "#05092e",
|
|
78
|
+
accentTextColor: "#ffffff",
|
|
79
|
+
backgroundColor: "#edf6ff",
|
|
80
|
+
surfaceColor: "#ffffff",
|
|
81
|
+
inputBackgroundColor: "#ffffff",
|
|
82
|
+
textColor: "#05092e",
|
|
83
|
+
mutedColor: "#596078",
|
|
84
|
+
borderColor: "#d9dae1",
|
|
85
|
+
borderRadius: "0px",
|
|
86
|
+
controlRadius: "999px",
|
|
87
|
+
shadow: "0 1px 2px rgba(5,9,46,.04)",
|
|
88
|
+
dangerColor: "#b42318",
|
|
89
|
+
successColor: "#167a58",
|
|
90
|
+
warningColor: "#9a6418",
|
|
91
|
+
fontFamily: "Geist, Inter, ui-sans-serif, system-ui, sans-serif"
|
|
75
92
|
}
|
|
76
93
|
};
|
|
77
94
|
function resolveMindBillAppearance(appearance) {
|
|
@@ -3566,7 +3583,10 @@ function sandboxScenarios(state) {
|
|
|
3566
3583
|
];
|
|
3567
3584
|
return [];
|
|
3568
3585
|
}
|
|
3569
|
-
function
|
|
3586
|
+
function shouldShowSandboxControls(environment, enabled = false) {
|
|
3587
|
+
return enabled && environment === "sandbox";
|
|
3588
|
+
}
|
|
3589
|
+
function ConnectedBillLifecycle({ appearance, sandboxControls = false, className, style, loadingFallback, errorFallback, onChanged, ...options }) {
|
|
3570
3590
|
const lifecycle = useBillLifecycle(options);
|
|
3571
3591
|
const { data } = lifecycle;
|
|
3572
3592
|
const [tab, setTab] = useState6("details");
|
|
@@ -3615,7 +3635,8 @@ function ConnectedBillLifecycle({ appearance, className, style, loadingFallback,
|
|
|
3615
3635
|
const viewEor = data.lifecycle.actions.find((action) => action.id === "view_eor" && action.enabled);
|
|
3616
3636
|
const supportedActions = /* @__PURE__ */ new Set(["resubmit", "second_review", "post_payment", "close", "reopen"]);
|
|
3617
3637
|
const actions = data.lifecycle.actions.filter((action) => action.enabled && supportedActions.has(action.id));
|
|
3618
|
-
const
|
|
3638
|
+
const showSandboxControls = shouldShowSandboxControls(data.environment, sandboxControls);
|
|
3639
|
+
const simulations = showSandboxControls ? sandboxScenarios(data.lifecycle.state) : [];
|
|
3619
3640
|
return /* @__PURE__ */ jsxs7("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
|
|
3620
3641
|
/* @__PURE__ */ jsx7("style", { children: CONNECTED_LIFECYCLE_STYLES }),
|
|
3621
3642
|
/* @__PURE__ */ jsx7(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
|
|
@@ -3639,7 +3660,7 @@ function ConnectedBillLifecycle({ appearance, className, style, loadingFallback,
|
|
|
3639
3660
|
] }),
|
|
3640
3661
|
tab === "details" ? /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
|
|
3641
3662
|
data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx7(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
|
|
3642
|
-
|
|
3663
|
+
showSandboxControls ? /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
|
|
3643
3664
|
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3644
3665
|
/* @__PURE__ */ jsx7("span", { children: "Sandbox demo controls" }),
|
|
3645
3666
|
/* @__PURE__ */ jsx7("h3", { children: "Simulate the next payer response" }),
|