@metaboliccode-dev/widget 0.2.0

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.
Files changed (180) hide show
  1. package/README.md +90 -0
  2. package/dist/MetabolicDashboard/MetabolicDashboard.d.ts +2 -0
  3. package/dist/MetabolicDashboard/api/builtInReportPagesApi.d.ts +4 -0
  4. package/dist/MetabolicDashboard/api/createHttpDashboardContentFetchers.d.ts +10 -0
  5. package/dist/MetabolicDashboard/api/fetchReportPage.d.ts +10 -0
  6. package/dist/MetabolicDashboard/api/index.d.ts +8 -0
  7. package/dist/MetabolicDashboard/api/mapReportPages.d.ts +1 -0
  8. package/dist/MetabolicDashboard/api/mappers/index.d.ts +9 -0
  9. package/dist/MetabolicDashboard/api/mappers/mapAlertLabSummaryPage.d.ts +3 -0
  10. package/dist/MetabolicDashboard/api/mappers/mapDashboardPage.d.ts +3 -0
  11. package/dist/MetabolicDashboard/api/mappers/mapLabAnalysisPage.d.ts +3 -0
  12. package/dist/MetabolicDashboard/api/mappers/mapLabResultsPage.d.ts +3 -0
  13. package/dist/MetabolicDashboard/api/mappers/mapQuestionnaireAnalysisPage.d.ts +3 -0
  14. package/dist/MetabolicDashboard/api/mappers/mapSuggestedProductsPage.d.ts +3 -0
  15. package/dist/MetabolicDashboard/api/mappers/mapSupplementSchedulePage.d.ts +3 -0
  16. package/dist/MetabolicDashboard/api/mappers/mapTotalPredictiveIndexPage.d.ts +3 -0
  17. package/dist/MetabolicDashboard/api/mappers/mapWellnessIndicatorsPage.d.ts +3 -0
  18. package/dist/MetabolicDashboard/api/mappers/shared.d.ts +20 -0
  19. package/dist/MetabolicDashboard/api/metabolicDashboardApiKey.d.ts +3 -0
  20. package/dist/MetabolicDashboard/api/reportPageTypes.d.ts +185 -0
  21. package/dist/MetabolicDashboard/constants.d.ts +2 -0
  22. package/dist/MetabolicDashboard/dashboardContentFetchers.d.ts +2 -0
  23. package/dist/MetabolicDashboard/dashboardTab/DashboardTabContentCacheContext.d.ts +16 -0
  24. package/dist/MetabolicDashboard/dashboardTab/DashboardTabLoadError.d.ts +4 -0
  25. package/dist/MetabolicDashboard/dashboardTab/DashboardTabRenderErrorBoundary.d.ts +17 -0
  26. package/dist/MetabolicDashboard/dashboardTab/chunks/alertLabSummary.d.ts +1 -0
  27. package/dist/MetabolicDashboard/dashboardTab/chunks/dashboard.d.ts +1 -0
  28. package/dist/MetabolicDashboard/dashboardTab/chunks/labAnalysis.d.ts +1 -0
  29. package/dist/MetabolicDashboard/dashboardTab/chunks/labResults.d.ts +1 -0
  30. package/dist/MetabolicDashboard/dashboardTab/chunks/questionnaireAnalysis.d.ts +1 -0
  31. package/dist/MetabolicDashboard/dashboardTab/chunks/suggestedProducts.d.ts +1 -0
  32. package/dist/MetabolicDashboard/dashboardTab/chunks/supplementSchedule.d.ts +1 -0
  33. package/dist/MetabolicDashboard/dashboardTab/chunks/totalPredictiveIndex.d.ts +1 -0
  34. package/dist/MetabolicDashboard/dashboardTab/chunks/wellnessIndicators.d.ts +1 -0
  35. package/dist/MetabolicDashboard/dashboardTab/dashboardPageSubtitles.d.ts +9 -0
  36. package/dist/MetabolicDashboard/dashboardTab/dashboardTabDefinitions.d.ts +52 -0
  37. package/dist/MetabolicDashboard/dashboardTab/dashboardTabLazyRegistry.d.ts +9 -0
  38. package/dist/MetabolicDashboard/dashboardTab/dashboardTabModel.d.ts +24 -0
  39. package/dist/MetabolicDashboard/dashboardTab/useDashboardTabContent.d.ts +22 -0
  40. package/dist/MetabolicDashboard/index.d.ts +13 -0
  41. package/dist/MetabolicDashboard/metabolicDashboard/MetabolicDashboardApiKeyError.d.ts +4 -0
  42. package/dist/MetabolicDashboard/metabolicDashboard/MetabolicDashboardDefaultMain.d.ts +9 -0
  43. package/dist/MetabolicDashboard/metabolicDashboard/MetabolicDashboardMainContent.d.ts +15 -0
  44. package/dist/MetabolicDashboard/metabolicDashboard/MetabolicDashboardShell.d.ts +9 -0
  45. package/dist/MetabolicDashboard/metabolicDashboard/MetabolicDashboardSimulationBoundary.d.ts +13 -0
  46. package/dist/MetabolicDashboard/metabolicDashboard/MetabolicDashboardView.d.ts +18 -0
  47. package/dist/MetabolicDashboard/metabolicDashboard/useMetabolicDashboardBranding.d.ts +5 -0
  48. package/dist/MetabolicDashboard/metabolicDashboard/useMetabolicDashboardResolvedContentSources.d.ts +12 -0
  49. package/dist/MetabolicDashboard/sideMenuLogo.d.ts +3 -0
  50. package/dist/MetabolicDashboard/simulation/MetabolicDashboardSimulationPatientList.d.ts +7 -0
  51. package/dist/MetabolicDashboard/simulation/MetabolicDashboardSimulationPatientReportList.d.ts +7 -0
  52. package/dist/MetabolicDashboard/simulation/MetabolicDashboardSimulationSideMenuFooter.d.ts +7 -0
  53. package/dist/MetabolicDashboard/simulation/SimulationScreenShell.d.ts +7 -0
  54. package/dist/MetabolicDashboard/simulation/constants.d.ts +14 -0
  55. package/dist/MetabolicDashboard/simulation/useMetabolicDashboardSimulation.d.ts +23 -0
  56. package/dist/MetabolicDashboard/simulation/useSimulatedData.d.ts +3 -0
  57. package/dist/MetabolicDashboard/useActiveNavItem.d.ts +10 -0
  58. package/dist/MetabolicEmbedRoot.d.ts +5 -0
  59. package/dist/ag-charts.js +20 -0
  60. package/dist/alertLabSummary-BAIlZ2_U.js +4 -0
  61. package/dist/branding/LogoPlaceholder.d.ts +1 -0
  62. package/dist/branding/brandingToStyle.d.ts +3 -0
  63. package/dist/branding/defaultSidebarWidth.d.ts +1 -0
  64. package/dist/branding/defaults.d.ts +2 -0
  65. package/dist/branding/index.d.ts +5 -0
  66. package/dist/branding/resolveBranding.d.ts +2 -0
  67. package/dist/branding/types.d.ts +118 -0
  68. package/dist/components/AlertLabSummaryTab/AlertLabSummaryTabSkeleton.d.ts +6 -0
  69. package/dist/components/AlertLabSummaryTab/index.d.ts +5 -0
  70. package/dist/components/Button/index.d.ts +10 -0
  71. package/dist/components/DashboardTab/DashboardTabSkeleton.d.ts +6 -0
  72. package/dist/components/DashboardTab/index.d.ts +4 -0
  73. package/dist/components/LabAnalysisTab/LabAnalysisTabSkeleton.d.ts +6 -0
  74. package/dist/components/LabAnalysisTab/index.d.ts +5 -0
  75. package/dist/components/LabResultsTab/LabResultsTabSkeleton.d.ts +6 -0
  76. package/dist/components/LabResultsTab/index.d.ts +5 -0
  77. package/dist/components/PageHeader/index.d.ts +7 -0
  78. package/dist/components/QuestionnaireAnalysisTab/QuestionnaireAnalysisTabSkeleton.d.ts +6 -0
  79. package/dist/components/QuestionnaireAnalysisTab/index.d.ts +5 -0
  80. package/dist/components/SkeletonPrimitives/index.d.ts +11 -0
  81. package/dist/components/SuggestedProductsTab/SuggestedProductsTabSkeleton.d.ts +6 -0
  82. package/dist/components/SuggestedProductsTab/fallbackData.d.ts +2 -0
  83. package/dist/components/SuggestedProductsTab/index.d.ts +5 -0
  84. package/dist/components/SupplementScheduleTab/SupplementScheduleTabSkeleton.d.ts +6 -0
  85. package/dist/components/SupplementScheduleTab/fallbackData.d.ts +2 -0
  86. package/dist/components/SupplementScheduleTab/index.d.ts +5 -0
  87. package/dist/components/Tooltip/index.d.ts +13 -0
  88. package/dist/components/TotalPredictiveIndexTab/TotalPredictiveIndexTabSkeleton.d.ts +6 -0
  89. package/dist/components/TotalPredictiveIndexTab/index.d.ts +5 -0
  90. package/dist/components/WellnessIndicatorsTab/WellnessIndicatorsTabSkeleton.d.ts +6 -0
  91. package/dist/components/WellnessIndicatorsTab/index.d.ts +5 -0
  92. package/dist/components/dashboard/components/base/Badge.d.ts +7 -0
  93. package/dist/components/dashboard/components/base/DashboardCard.d.ts +5 -0
  94. package/dist/components/dashboard/components/base/TriadMarkIcon.d.ts +4 -0
  95. package/dist/components/dashboard/components/base/index.d.ts +6 -0
  96. package/dist/components/dashboard/components/composite/DashboardCardSectionHeader.d.ts +8 -0
  97. package/dist/components/dashboard/components/composite/MetabolicScoreBar.d.ts +4 -0
  98. package/dist/components/dashboard/components/composite/MetaflammationGauge.d.ts +5 -0
  99. package/dist/components/dashboard/components/composite/PractitionerNoteRow.d.ts +4 -0
  100. package/dist/components/dashboard/components/composite/SegmentedRangeBar.d.ts +16 -0
  101. package/dist/components/dashboard/components/composite/SegmentedRangeBarIndicator.d.ts +3 -0
  102. package/dist/components/dashboard/components/composite/SupplementScheduleTableRow.d.ts +5 -0
  103. package/dist/components/dashboard/components/composite/SupplementTriadMarkGroup.d.ts +3 -0
  104. package/dist/components/dashboard/components/composite/TriadRadar.d.ts +6 -0
  105. package/dist/components/dashboard/components/composite/index.d.ts +10 -0
  106. package/dist/components/dashboard/components/sections/AlertLabSummaryCard.d.ts +2 -0
  107. package/dist/components/dashboard/components/sections/LabAnalysisTriadCard.d.ts +2 -0
  108. package/dist/components/dashboard/components/sections/LabMetricRangeCard.d.ts +7 -0
  109. package/dist/components/dashboard/components/sections/LabResultsIntroCard.d.ts +6 -0
  110. package/dist/components/dashboard/components/sections/MetabolicTriadCategoryPanel/bodies.d.ts +24 -0
  111. package/dist/components/dashboard/components/sections/MetabolicTriadCategoryPanel/index.d.ts +3 -0
  112. package/dist/components/dashboard/components/sections/MetabolicTriadCategoryPanel/primitives.d.ts +22 -0
  113. package/dist/components/dashboard/components/sections/MetabolicTriadCategoryPanel/types.d.ts +54 -0
  114. package/dist/components/dashboard/components/sections/MetabolicTriadCategoryPanel.d.ts +1 -0
  115. package/dist/components/dashboard/components/sections/MetabolicTriadCategoryPanelSkeleton.d.ts +19 -0
  116. package/dist/components/dashboard/components/sections/MetabolicTriadIntroCard.d.ts +4 -0
  117. package/dist/components/dashboard/components/sections/MetabolicTriadSectionCard.d.ts +11 -0
  118. package/dist/components/dashboard/components/sections/MetaflammationGaugeCard.d.ts +2 -0
  119. package/dist/components/dashboard/components/sections/OverallMetabolicScoreCard.d.ts +2 -0
  120. package/dist/components/dashboard/components/sections/PractitionerNotesCard.d.ts +2 -0
  121. package/dist/components/dashboard/components/sections/ProfileSummaryCard.d.ts +5 -0
  122. package/dist/components/dashboard/components/sections/SupplementScheduleCard.d.ts +2 -0
  123. package/dist/components/dashboard/components/sections/TriadRadarReportCard.d.ts +4 -0
  124. package/dist/components/dashboard/components/sections/WelcomeMessageCard.d.ts +8 -0
  125. package/dist/components/dashboard/components/sections/WellnessIndicatorCard.d.ts +6 -0
  126. package/dist/components/dashboard/components/sections/index.d.ts +16 -0
  127. package/dist/components/dashboard/constants.d.ts +2 -0
  128. package/dist/components/dashboard/data/contentTypes.d.ts +301 -0
  129. package/dist/components/dashboard/data/index.d.ts +2 -0
  130. package/dist/components/dashboard/index.d.ts +3 -0
  131. package/dist/components/dashboard/triadTrendIndicator.d.ts +12 -0
  132. package/dist/components/icons/ArrowRightIcon.d.ts +3 -0
  133. package/dist/components/icons/CalendarIcon.d.ts +3 -0
  134. package/dist/components/icons/ChevronRightIcon.d.ts +3 -0
  135. package/dist/components/icons/ClockIcon.d.ts +3 -0
  136. package/dist/components/icons/DownloadIcon.d.ts +3 -0
  137. package/dist/components/icons/FileTextIcon.d.ts +3 -0
  138. package/dist/components/icons/InfoIcon.d.ts +3 -0
  139. package/dist/components/icons/PlayIcon.d.ts +2 -0
  140. package/dist/components/icons/UserIcon.d.ts +3 -0
  141. package/dist/components/icons/UsersIcon.d.ts +3 -0
  142. package/dist/components/icons/index.d.ts +10 -0
  143. package/dist/components/index.d.ts +27 -0
  144. package/dist/dashboard-x4GA8cqi.js +4 -0
  145. package/dist/entry-ag-charts.d.ts +1 -0
  146. package/dist/hooks/useAgCharts.d.ts +2 -0
  147. package/dist/hooks/useBrandingChartTheme.d.ts +12 -0
  148. package/dist/iframe-config.d.ts +18 -0
  149. package/dist/index.css +1 -0
  150. package/dist/index.d.ts +13 -0
  151. package/dist/index.js +5254 -0
  152. package/dist/labAnalysis-CaOCpV2g.js +4 -0
  153. package/dist/labResults-CV9K31Os.js +4 -0
  154. package/dist/layout/ShellLayout.d.ts +2 -0
  155. package/dist/layout/SideMenu.d.ts +5 -0
  156. package/dist/layout/SideMenuFooter.d.ts +2 -0
  157. package/dist/layout/SideMenuUserProfileConfigError.d.ts +4 -0
  158. package/dist/layout/icons/AlertLabSummaryIcon.d.ts +1 -0
  159. package/dist/layout/icons/DashboardIcon.d.ts +1 -0
  160. package/dist/layout/icons/LabAnalysisIcon.d.ts +1 -0
  161. package/dist/layout/icons/LabResultsIcon.d.ts +1 -0
  162. package/dist/layout/icons/LogoutIcon.d.ts +1 -0
  163. package/dist/layout/icons/PredictiveIndexIcon.d.ts +1 -0
  164. package/dist/layout/icons/QuestionnaireIcon.d.ts +1 -0
  165. package/dist/layout/icons/SuggestedProductsIcon.d.ts +1 -0
  166. package/dist/layout/icons/SupplementScheduleIcon.d.ts +1 -0
  167. package/dist/layout/icons/WellnessIndicatorsIcon.d.ts +1 -0
  168. package/dist/layout/icons/iconBaseClass.d.ts +1 -0
  169. package/dist/layout/icons/index.d.ts +11 -0
  170. package/dist/layout/index.d.ts +5 -0
  171. package/dist/layout/sideMenuUserProfileMissingDisplayName.d.ts +2 -0
  172. package/dist/layout/types.d.ts +66 -0
  173. package/dist/mountMetabolicEmbed.d.ts +3 -0
  174. package/dist/questionnaireAnalysis-S3k2ZioO.js +4 -0
  175. package/dist/suggestedProducts-DJlYkHhQ.js +4 -0
  176. package/dist/supplementSchedule-D8PmXo88.js +4 -0
  177. package/dist/totalPredictiveIndex-DQdWbzgU.js +4 -0
  178. package/dist/vendor-ag-charts-BxXxUmfV.js +82654 -0
  179. package/dist/wellnessIndicators-CNQcbuvH.js +4 -0
  180. package/package.json +81 -0
package/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # `@metaboliccode-dev/widget`
2
+
3
+ Publishable React library: shell layout, side navigation, lazy-loaded tabbed dashboard views, optional practitioner/patient simulation, token-based theming (`MetabolicDashboardConfig` → CSS variables), HTTP-backed default tabs (built-in API base URL and API key gate), and a standalone iframe build for embedding.
4
+
5
+ ## Requirements
6
+
7
+ - **Node.js** and npm
8
+ - **React 18+** / **react-dom 18+** (peer dependencies)
9
+
10
+ ## Development
11
+
12
+ ```bash
13
+ npm install
14
+ npm run dev:iframe
15
+ ```
16
+
17
+ Runs the iframe embed entry locally (see `vite.config.iframe.ts`).
18
+
19
+ ## Scripts
20
+
21
+ | Command | Description |
22
+ | --- | --- |
23
+ | `npm run build` | Library ESM + CSS + declarations (`dist/`) and iframe bundle (`dist-iframe/`) |
24
+ | `npm run build:lib` | Library only |
25
+ | `npm run build:iframe` | Iframe bundle only |
26
+ | `npm run preview:iframe` | Preview built iframe |
27
+ | `npm run typecheck` | `tsc` on `src/` |
28
+ | `npm run test` / `npm run test:run` | Vitest (`vitest.config.ts`) |
29
+ | `npm run lint` / `npm run lint:fix` | Biome |
30
+ | `npm run docs:api` | TypeDoc API docs |
31
+
32
+ ## Layout
33
+
34
+ | Path | Role |
35
+ | --- | --- |
36
+ | `src/` | Library source (`MetabolicDashboard`, tabs, branding, API mappers) |
37
+ | `src/__tests__/` | Vitest tests; JSON fixtures under `src/__tests__/fixtures/pages/` |
38
+ | `src/public/` | Default logos, triad icons, and placeholders bundled with the library |
39
+ | `dist/` | Published ESM library output |
40
+ | `dist-iframe/` | Static iframe app after `npm run build:iframe` |
41
+
42
+ ## Documentation
43
+
44
+ | Document | Description |
45
+ |----------|-------------|
46
+ | **[docs/](./docs/README.md)** | Documentation index |
47
+ | [Installation](./docs/installation.md) | Step-by-step guide to install in any project |
48
+ | [Quick Start](./docs/quick-start.md) | Minimal setup to render the dashboard |
49
+ | [API Reference](./docs/api-reference.md) | Props, built-in tabs, simulation, exports |
50
+ | [Configuration & Theming](./docs/configuration.md) | Config shape, CSS variables, branding |
51
+ | [HTTP API](./docs/http-api.md) | Report pages endpoint contract and DTO mappers |
52
+ | [Iframe Embed](./docs/iframe-embed.md) | Standalone iframe build and config delivery |
53
+ | [Development](./docs/development.md) | Local setup, testing, building, publishing |
54
+
55
+ ## Quick install
56
+
57
+ ```bash
58
+ # 1. Add .npmrc to your project
59
+ echo ‘@metaboliccode-dev:registry=https://npm.pkg.github.com
60
+ //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}’ > .npmrc
61
+
62
+ # 2. Set your GitHub token
63
+ export GITHUB_TOKEN=ghp_your_token_here
64
+
65
+ # 3. Install
66
+ npm install @metaboliccode-dev/widget
67
+ ```
68
+
69
+ See [Installation](./docs/installation.md) for the full guide (token generation, framework config, CI/CD, troubleshooting).
70
+
71
+ ## Quick usage
72
+
73
+ ```tsx
74
+ import { MetabolicDashboard, METABOLIC_DASHBOARD_STUB_API_KEY } from "@metaboliccode-dev/widget";
75
+
76
+ export function App() {
77
+ return (
78
+ <div className="h-screen">
79
+ <MetabolicDashboard
80
+ apiKey={METABOLIC_DASHBOARD_STUB_API_KEY}
81
+ sideMenuUserProfile={{ displayName: "User", email: "user@example.com" }}
82
+ />
83
+ </div>
84
+ );
85
+ }
86
+ ```
87
+
88
+ ## License notes
89
+
90
+ Charts use **AG Charts** (`ag-charts-community` + `ag-charts-enterprise`). For local builds, set **`VITE_AG_CHARTS_LICENSE_KEY`** in the environment if your team uses an enterprise key.
@@ -0,0 +1,2 @@
1
+ import type { MetabolicDashboardProps } from "../layout";
2
+ export declare function MetabolicDashboard({ config: configPartial, apiKey: apiKeyProp, viewerRole, sideMenuTitle, sideMenuLogo, sideMenuUserProfile, content, dashboardContentFetchers, onDashboardTabContentLoadError, renderMainContent, activeNavItemId: activeNavItemIdProp, defaultActiveNavItemId, onActiveNavItemChange, shellClassName, sideMenuClassName, mainClassName, sidebarWidthClassName, dashboardTabContentCacheTtlMs, }: MetabolicDashboardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { HttpDashboardContentFetchersConfig } from "./createHttpDashboardContentFetchers";
2
+ export declare function getBuiltInReportPagesApiBaseUrl(): string;
3
+ export declare function getBuiltInReportPagesApiDefaults(): HttpDashboardContentFetchersConfig;
4
+ export declare function mergeReportPagesApiWithBuiltIn(override?: Partial<HttpDashboardContentFetchersConfig>): HttpDashboardContentFetchersConfig;
@@ -0,0 +1,10 @@
1
+ import type { DashboardContentFetchers } from "../dashboardTab/dashboardTabModel";
2
+ import type { FetchReportPageOptions } from "./fetchReportPage";
3
+ export type HttpDashboardContentFetchersConfig = Omit<FetchReportPageOptions, "signal"> & {
4
+ apiKey?: string;
5
+ userId?: string;
6
+ simulateDelayMs?: number;
7
+ simulateFetchError?: boolean;
8
+ simulateFetchErrorMessage?: string;
9
+ };
10
+ export declare function createHttpDashboardContentFetchers(config: HttpDashboardContentFetchersConfig): DashboardContentFetchers;
@@ -0,0 +1,10 @@
1
+ import type { ReportPageDtoFor, ReportPageNavKey } from "./reportPageTypes";
2
+ export type FetchReportPageOptions = {
3
+ baseUrl: string;
4
+ reportId?: string;
5
+ headers?: HeadersInit;
6
+ fetchImpl?: typeof fetch;
7
+ signal?: AbortSignal;
8
+ };
9
+ export declare function buildReportPageUrl(baseUrl: string, pageId: ReportPageNavKey, reportId?: string): string;
10
+ export declare function fetchReportPage<K extends ReportPageNavKey>(pageId: K, options: FetchReportPageOptions): Promise<ReportPageDtoFor<K>>;
@@ -0,0 +1,8 @@
1
+ export { getBuiltInReportPagesApiBaseUrl, getBuiltInReportPagesApiDefaults, mergeReportPagesApiWithBuiltIn, } from "./builtInReportPagesApi";
2
+ export type { HttpDashboardContentFetchersConfig } from "./createHttpDashboardContentFetchers";
3
+ export { createHttpDashboardContentFetchers } from "./createHttpDashboardContentFetchers";
4
+ export type { FetchReportPageOptions } from "./fetchReportPage";
5
+ export { buildReportPageUrl, fetchReportPage } from "./fetchReportPage";
6
+ export { mapAlertLabSummaryDtoToTabContent, mapDashboardPageDtoToTabContent, mapLabAnalysisDtoToTabContent, mapLabResultsDtoToTabContent, mapQuestionnaireAnalysisDtoToTabContent, mapSuggestedProductsDtoToTabContent, mapSupplementScheduleDtoToTabContent, mapTotalPredictiveIndexDtoToTabContent, mapWellnessIndicatorsDtoToTabContent, } from "./mapReportPages";
7
+ export { isMetabolicDashboardApiKeyAccepted, METABOLIC_DASHBOARD_STUB_API_KEY, METABOLIC_REPORT_PAGES_API_BASE_URL, } from "./metabolicDashboardApiKey";
8
+ export type { AlertLabMetricDto, AlertLabSummaryPageDto, DashboardPageDto, LabAnalysisPageDto, LabResultsPageDto, QuestionnaireAnalysisPageDto, ReportPageDtoByNavId, ReportPageDtoFor, ReportPageNavKey, SuggestedProductsPageDto, SupplementSchedulePageDto, TotalPredictiveIndexPageDto, WellnessIndicatorsPageDto, } from "./reportPageTypes";
@@ -0,0 +1 @@
1
+ export { mapAlertLabSummaryDtoToTabContent, mapDashboardPageDtoToTabContent, mapLabAnalysisDtoToTabContent, mapLabResultsDtoToTabContent, mapQuestionnaireAnalysisDtoToTabContent, mapSuggestedProductsDtoToTabContent, mapSupplementScheduleDtoToTabContent, mapTotalPredictiveIndexDtoToTabContent, mapWellnessIndicatorsDtoToTabContent, } from "./mappers";
@@ -0,0 +1,9 @@
1
+ export { mapAlertLabSummaryDtoToTabContent } from "./mapAlertLabSummaryPage";
2
+ export { mapDashboardPageDtoToTabContent } from "./mapDashboardPage";
3
+ export { mapLabAnalysisDtoToTabContent } from "./mapLabAnalysisPage";
4
+ export { mapLabResultsDtoToTabContent } from "./mapLabResultsPage";
5
+ export { mapQuestionnaireAnalysisDtoToTabContent } from "./mapQuestionnaireAnalysisPage";
6
+ export { mapSuggestedProductsDtoToTabContent } from "./mapSuggestedProductsPage";
7
+ export { mapSupplementScheduleDtoToTabContent } from "./mapSupplementSchedulePage";
8
+ export { mapTotalPredictiveIndexDtoToTabContent } from "./mapTotalPredictiveIndexPage";
9
+ export { mapWellnessIndicatorsDtoToTabContent } from "./mapWellnessIndicatorsPage";
@@ -0,0 +1,3 @@
1
+ import type { AlertLabSummaryTabContent } from "../../../components/dashboard/data/contentTypes";
2
+ import type { AlertLabSummaryPageDto } from "../reportPageTypes";
3
+ export declare function mapAlertLabSummaryDtoToTabContent(dto: AlertLabSummaryPageDto): AlertLabSummaryTabContent;
@@ -0,0 +1,3 @@
1
+ import type { DashboardTabContent } from "../../../components/dashboard/data/contentTypes";
2
+ import type { DashboardPageDto } from "../reportPageTypes";
3
+ export declare function mapDashboardPageDtoToTabContent(dto: DashboardPageDto): DashboardTabContent;
@@ -0,0 +1,3 @@
1
+ import type { LabAnalysisTabContent } from "../../../components/dashboard/data/contentTypes";
2
+ import type { LabAnalysisPageDto } from "../reportPageTypes";
3
+ export declare function mapLabAnalysisDtoToTabContent(dto: LabAnalysisPageDto): LabAnalysisTabContent;
@@ -0,0 +1,3 @@
1
+ import type { LabResultsTabContent } from "../../../components/dashboard/data/contentTypes";
2
+ import type { LabResultsPageDto } from "../reportPageTypes";
3
+ export declare function mapLabResultsDtoToTabContent(dto: LabResultsPageDto): LabResultsTabContent;
@@ -0,0 +1,3 @@
1
+ import type { QuestionnaireAnalysisTabContent } from "../../../components/dashboard/data/contentTypes";
2
+ import type { QuestionnaireAnalysisPageDto } from "../reportPageTypes";
3
+ export declare function mapQuestionnaireAnalysisDtoToTabContent(dto: QuestionnaireAnalysisPageDto): QuestionnaireAnalysisTabContent;
@@ -0,0 +1,3 @@
1
+ import type { SuggestedProductsTabContent } from "../../../components/dashboard/data/contentTypes";
2
+ import type { SuggestedProductsPageDto } from "../reportPageTypes";
3
+ export declare function mapSuggestedProductsDtoToTabContent(dto: SuggestedProductsPageDto): SuggestedProductsTabContent;
@@ -0,0 +1,3 @@
1
+ import type { SupplementScheduleTabContent } from "../../../components/dashboard/data/contentTypes";
2
+ import type { SupplementSchedulePageDto } from "../reportPageTypes";
3
+ export declare function mapSupplementScheduleDtoToTabContent(dto: SupplementSchedulePageDto): SupplementScheduleTabContent;
@@ -0,0 +1,3 @@
1
+ import type { TotalPredictiveIndexTabContent } from "../../../components/dashboard/data/contentTypes";
2
+ import type { TotalPredictiveIndexPageDto } from "../reportPageTypes";
3
+ export declare function mapTotalPredictiveIndexDtoToTabContent(dto: TotalPredictiveIndexPageDto): TotalPredictiveIndexTabContent;
@@ -0,0 +1,3 @@
1
+ import type { WellnessIndicatorsTabContent } from "../../../components/dashboard/data/contentTypes";
2
+ import type { WellnessIndicatorsPageDto } from "../reportPageTypes";
3
+ export declare function mapWellnessIndicatorsDtoToTabContent(dto: WellnessIndicatorsPageDto): WellnessIndicatorsTabContent;
@@ -0,0 +1,20 @@
1
+ import type { QuestionnaireTrendZone } from "../../../components/dashboard/data/contentTypes";
2
+ import type { NumericRangeDto, SupplementDto } from "../reportPageTypes";
3
+ export declare const TRIAD_RADAR_STYLES: readonly [{
4
+ readonly fill: "rgb(225 203 127 / 0.35)";
5
+ readonly stroke: "#C4A94A";
6
+ }, {
7
+ readonly fill: "rgb(134 205 149 / 0.35)";
8
+ readonly stroke: "#5BA86C";
9
+ }];
10
+ export declare const METABOLIC_TRIAD_INTRO: readonly string[];
11
+ export declare const LAB_RESULTS_INTRO_BY_TRIAD: Record<number, readonly [string, string, string]>;
12
+ export declare const LAB_ANALYSIS_COPY: Record<number, readonly [string, string]>;
13
+ export declare const SCHEDULE_LABELS: readonly [keyof SupplementDto["schedule"], string][];
14
+ export declare function patientInitials(name: string): string;
15
+ export declare function formatGender(g?: string | null): string;
16
+ export declare function formatRange(r: NumericRangeDto | null, unit: string): string;
17
+ export declare function formatMetricValue(value: number, unit: string): string;
18
+ export declare function mapTrendZone(z?: string | null): QuestionnaireTrendZone;
19
+ export declare function directionToArrows(direction: string): string;
20
+ export declare function interpretationStatusLabel(interpretation: string): string;
@@ -0,0 +1,3 @@
1
+ export declare const METABOLIC_REPORT_PAGES_API_BASE_URL: string | undefined;
2
+ export declare const METABOLIC_DASHBOARD_STUB_API_KEY: string | undefined;
3
+ export declare function isMetabolicDashboardApiKeyAccepted(apiKey: string | undefined): boolean;
@@ -0,0 +1,185 @@
1
+ export type ReportPatientDto = {
2
+ name: string;
3
+ gender?: string | null;
4
+ chrono_age?: number | null;
5
+ bio_age?: number | null;
6
+ };
7
+ export type NumericRangeDto = {
8
+ low: number;
9
+ high: number;
10
+ };
11
+ export type DashboardPageDto = {
12
+ patient: ReportPatientDto;
13
+ overall_score?: number | null;
14
+ metaflammation: {
15
+ value: number;
16
+ max: number;
17
+ };
18
+ labs_last_date?: string | null;
19
+ triads: readonly DashboardTriadDto[];
20
+ lab_metrics: readonly DashboardLabMetricDto[];
21
+ };
22
+ export type DashboardTriadDto = {
23
+ number: number;
24
+ name: string;
25
+ organs: readonly {
26
+ name: string;
27
+ normalized_score: number;
28
+ }[];
29
+ };
30
+ export type DashboardLabMetricDto = {
31
+ name: string;
32
+ value: number;
33
+ unit: string;
34
+ normal_range: NumericRangeDto | null;
35
+ treatment_range: NumericRangeDto | null;
36
+ indicator_percent: number;
37
+ };
38
+ export type TotalPredictiveIndexPageDto = {
39
+ triads: readonly TotalPredictiveTriadDto[];
40
+ };
41
+ export type TotalPredictiveTriadDto = {
42
+ number: number;
43
+ name: string;
44
+ score: number;
45
+ interpretation?: string | null;
46
+ categories: readonly TotalPredictiveCategoryDto[];
47
+ };
48
+ export type TotalPredictiveCategoryDto = {
49
+ name: string;
50
+ symptom_score?: number | null;
51
+ lab_score?: number | null;
52
+ total_score?: number | null;
53
+ previous_symptom_score?: number | null;
54
+ previous_lab_score?: number | null;
55
+ previous_total_score?: number | null;
56
+ };
57
+ export type WellnessIndicatorsPageDto = {
58
+ indicators: readonly WellnessIndicatorDto[];
59
+ };
60
+ export type WellnessIndicatorDto = {
61
+ name: string;
62
+ score: number;
63
+ zones: {
64
+ low: {
65
+ min: number;
66
+ max: number;
67
+ };
68
+ moderate: {
69
+ min: number;
70
+ max: number;
71
+ };
72
+ high: {
73
+ min: number;
74
+ max: number;
75
+ };
76
+ };
77
+ };
78
+ export type QuestionnaireAnalysisPageDto = {
79
+ triads: readonly QuestionnaireTriadDto[];
80
+ };
81
+ export type QuestionnaireTriadDto = {
82
+ number: number;
83
+ name: string;
84
+ survey_score?: number | null;
85
+ categories: readonly QuestionnaireCategoryDto[];
86
+ };
87
+ export type QuestionnaireCategoryDto = {
88
+ name: string;
89
+ symptom_score?: number | null;
90
+ trend_zone?: string | null;
91
+ previous_symptom_score?: number | null;
92
+ };
93
+ export type SupplementSchedulePageDto = {
94
+ supplements: readonly SupplementDto[];
95
+ practitioner_notes?: readonly string[] | null;
96
+ };
97
+ export type SupplementDto = {
98
+ name: string;
99
+ triad_numbers: readonly number[];
100
+ image_url?: string | null;
101
+ schedule: {
102
+ morning?: string | null;
103
+ noon?: string | null;
104
+ afternoon?: string | null;
105
+ dinner?: string | null;
106
+ bedtime?: string | null;
107
+ };
108
+ };
109
+ export type LabResultsPageDto = {
110
+ groups: readonly LabResultsGroupDto[];
111
+ };
112
+ export type LabResultsGroupDto = {
113
+ triad_number: number;
114
+ triad_name: string;
115
+ organ_name: string;
116
+ metrics: readonly LabResultsMetricDto[];
117
+ };
118
+ export type LabResultsMetricDto = {
119
+ name: string;
120
+ value: number;
121
+ unit: string;
122
+ normal_range: NumericRangeDto | null;
123
+ treatment_range: NumericRangeDto | null;
124
+ previous_value?: number | null;
125
+ indicator_percent: number;
126
+ interpretation?: string | null;
127
+ };
128
+ export type SuggestedProductsPageDto = {
129
+ triad_number: number;
130
+ triad_name: string;
131
+ organ_metrics: readonly {
132
+ name: string;
133
+ score: number;
134
+ indicator_percent: number;
135
+ }[];
136
+ symptoms: readonly string[];
137
+ products: readonly {
138
+ name: string;
139
+ sku?: string | null;
140
+ image_url?: string | null;
141
+ tagline?: string | null;
142
+ }[];
143
+ };
144
+ export type LabAnalysisPageDto = {
145
+ triads: readonly LabAnalysisTriadDto[];
146
+ };
147
+ export type LabAnalysisTriadDto = {
148
+ number: number;
149
+ name: string;
150
+ lab_score?: number | null;
151
+ interpretation?: string | null;
152
+ systems: readonly string[];
153
+ markers: readonly {
154
+ name: string;
155
+ direction: string;
156
+ }[];
157
+ };
158
+ export type AlertLabSummaryPageDto = {
159
+ alerts: readonly AlertLabMetricDto[];
160
+ dind_conditions?: readonly {
161
+ name: string;
162
+ description: string;
163
+ }[];
164
+ };
165
+ export type AlertLabMetricDto = {
166
+ name: string;
167
+ value: number;
168
+ unit: string;
169
+ interpretation: string;
170
+ normal_range: NumericRangeDto;
171
+ indicator_percent: number;
172
+ };
173
+ export type ReportPageDtoByNavId = {
174
+ dashboard: DashboardPageDto;
175
+ "total-predictive-index": TotalPredictiveIndexPageDto;
176
+ "wellness-indicators": WellnessIndicatorsPageDto;
177
+ "questionnaire-analysis": QuestionnaireAnalysisPageDto;
178
+ "supplement-schedule": SupplementSchedulePageDto;
179
+ "lab-results": LabResultsPageDto;
180
+ "suggested-products": SuggestedProductsPageDto;
181
+ "lab-analysis": LabAnalysisPageDto;
182
+ "alert-lab-summary": AlertLabSummaryPageDto;
183
+ };
184
+ export type ReportPageNavKey = keyof ReportPageDtoByNavId;
185
+ export type ReportPageDtoFor<K extends ReportPageNavKey> = ReportPageDtoByNavId[K];
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_SIDE_MENU_BUTTON_LABEL = "Action";
2
+ export declare const DEFAULT_ACTIVE_NAV_ITEM_ID = "dashboard";
@@ -0,0 +1,2 @@
1
+ import type { DashboardContentFetchers } from "./dashboardTab/dashboardTabModel";
2
+ export declare function mergeDashboardContentFetchers(base: DashboardContentFetchers, partial?: Partial<DashboardContentFetchers>): DashboardContentFetchers;
@@ -0,0 +1,16 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ContentByNavId, DashboardContentFetchers, DashboardNavItemId } from "./dashboardTabModel";
3
+ export declare const DEFAULT_DASHBOARD_TAB_CONTENT_CACHE_TTL_MS = 300000;
4
+ export type DashboardTabContentCacheContextValue = {
5
+ loadTab: <K extends DashboardNavItemId>(id: K, signal: AbortSignal) => Promise<ContentByNavId[K]>;
6
+ readValid: (id: DashboardNavItemId) => unknown | undefined;
7
+ invalidate: (id?: DashboardNavItemId) => void;
8
+ prefetch: (id: DashboardNavItemId) => void;
9
+ };
10
+ export declare function useDashboardTabContentCache(): DashboardTabContentCacheContextValue | null;
11
+ export declare function useInvalidateDashboardTabContentCache(): () => void;
12
+ export declare function DashboardTabContentCacheProvider({ children, fetchers, ttlMs, }: {
13
+ children: ReactNode;
14
+ fetchers: DashboardContentFetchers;
15
+ ttlMs: number;
16
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export type DashboardTabLoadErrorProps = {
2
+ onRetry: () => void;
3
+ };
4
+ export declare function DashboardTabLoadError({ onRetry }: DashboardTabLoadErrorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { Component, type ErrorInfo, type ReactNode } from "react";
2
+ export type DashboardTabRenderErrorBoundaryProps = {
3
+ resetKey: string;
4
+ onRecover: () => void;
5
+ children: ReactNode;
6
+ };
7
+ type State = {
8
+ error: Error | null;
9
+ };
10
+ export declare class DashboardTabRenderErrorBoundary extends Component<DashboardTabRenderErrorBoundaryProps, State> {
11
+ state: State;
12
+ static getDerivedStateFromError(error: Error): State;
13
+ componentDidCatch(error: Error, info: ErrorInfo): void;
14
+ componentDidUpdate(prevProps: DashboardTabRenderErrorBoundaryProps): void;
15
+ render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
16
+ }
17
+ export {};
@@ -0,0 +1 @@
1
+ export { AlertLabSummaryTab } from "../../../components/AlertLabSummaryTab";
@@ -0,0 +1 @@
1
+ export { DashboardTab } from "../../../components/DashboardTab";
@@ -0,0 +1 @@
1
+ export { LabAnalysisTab } from "../../../components/LabAnalysisTab";
@@ -0,0 +1 @@
1
+ export { LabResultsTab } from "../../../components/LabResultsTab";
@@ -0,0 +1 @@
1
+ export { QuestionnaireAnalysisTab } from "../../../components/QuestionnaireAnalysisTab";
@@ -0,0 +1 @@
1
+ export { SuggestedProductsTab } from "../../../components/SuggestedProductsTab";
@@ -0,0 +1 @@
1
+ export { SupplementScheduleTab } from "../../../components/SupplementScheduleTab";
@@ -0,0 +1 @@
1
+ export { TotalPredictiveIndexTab } from "../../../components/TotalPredictiveIndexTab";
@@ -0,0 +1 @@
1
+ export { WellnessIndicatorsTab } from "../../../components/WellnessIndicatorsTab";
@@ -0,0 +1,9 @@
1
+ export declare const DASHBOARD_SUBTITLE = "Your metabolic overview brings together triad priorities, key metrics, and next steps in one place.";
2
+ export declare const TOTAL_PREDICTIVE_TRENDS_SUBTITLE = "Trends and predictive signals help you see how your metabolic trajectory may evolve over time.";
3
+ export declare const WELLNESS_INDICATORS_SUBTITLE = "Track the wellness signals that reflect how your body is responding to your plan.";
4
+ export declare const QUESTIONNAIRE_ANALYSIS_SUBTITLE = "Your answers are synthesized into themes and insights that inform your personalized recommendations.";
5
+ export declare const SUPPLEMENT_SCHEDULE_SUBTITLE = "Your personalized supplement timing helps you align intake with your metabolic rhythm and triad priorities.";
6
+ export declare const LAB_RESULTS_SUBTITLE = "Review your laboratory values with reference context and ordering details.";
7
+ export declare const SUGGESTED_PRODUCTS_SUBTITLE = "Discover products selected to support your metabolic goals and triad priorities.";
8
+ export declare const LAB_ANALYSIS_SUBTITLE = "Deeper interpretation connects your lab patterns to your overall metabolic picture.";
9
+ export declare const ALERT_LAB_SUMMARY_SUBTITLE = "Focus on labs that are out of range or flagged so you can address them with your care team.";
@@ -0,0 +1,52 @@
1
+ import type { ComponentType, ReactNode } from "react";
2
+ import { type FetchReportPageOptions } from "../api/fetchReportPage";
3
+ import type { ReportPageNavKey } from "../api/reportPageTypes";
4
+ export type DashboardTabStaticPageHeader = {
5
+ title: string;
6
+ subtitle: string;
7
+ };
8
+ type RunPage = <T>(signal: AbortSignal, execute: () => Promise<T>) => Promise<T>;
9
+ type OptsFactory = (signal: AbortSignal) => FetchReportPageOptions;
10
+ export type DashboardTabPluginDefinition = {
11
+ id: ReportPageNavKey;
12
+ sideMenuLabel: string;
13
+ icon: ReactNode;
14
+ pageHeader: DashboardTabStaticPageHeader;
15
+ Tab: ComponentType<{
16
+ content: never;
17
+ }>;
18
+ Skeleton: ComponentType<{
19
+ pageHeader: DashboardTabStaticPageHeader;
20
+ }>;
21
+ createHttpFetcher: (runPage: RunPage, opts: OptsFactory) => (signal: AbortSignal) => Promise<unknown>;
22
+ };
23
+ export declare const DASHBOARD_TAB_PLUGINS: readonly [DashboardTabPluginDefinition, DashboardTabPluginDefinition, DashboardTabPluginDefinition, DashboardTabPluginDefinition, DashboardTabPluginDefinition, DashboardTabPluginDefinition, DashboardTabPluginDefinition, DashboardTabPluginDefinition, DashboardTabPluginDefinition];
24
+ export type DashboardTabDefinitionId = (typeof DASHBOARD_TAB_PLUGINS)[number]["id"];
25
+ export declare const defaultSideMenuItems: {
26
+ id: keyof import("..").ReportPageDtoByNavId;
27
+ label: string;
28
+ icon: ReactNode;
29
+ }[];
30
+ export declare const DASHBOARD_TAB_REGISTRY: { [K in DashboardTabDefinitionId]: {
31
+ Tab: ComponentType<{
32
+ content: never;
33
+ }>;
34
+ Skeleton: ComponentType<{
35
+ pageHeader: DashboardTabStaticPageHeader;
36
+ }>;
37
+ pageHeader: DashboardTabStaticPageHeader;
38
+ }; };
39
+ export declare function getDashboardTabStaticPageHeader(id: DashboardTabDefinitionId): DashboardTabStaticPageHeader;
40
+ type PluginDef = (typeof DASHBOARD_TAB_PLUGINS)[number];
41
+ type TabContentOf<P> = P extends {
42
+ Tab: ComponentType<{
43
+ content: infer C;
44
+ }>;
45
+ } ? C : never;
46
+ export type HttpDashboardContentFetchersResult = {
47
+ [K in DashboardTabDefinitionId]: (signal: AbortSignal) => Promise<TabContentOf<Extract<PluginDef, {
48
+ id: K;
49
+ }>>>;
50
+ };
51
+ export declare function buildHttpDashboardContentFetchersFromPlugins(runPage: RunPage, opts: OptsFactory): HttpDashboardContentFetchersResult;
52
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const LazyDashboardTab: import("react").LazyExoticComponent<typeof import("./chunks/dashboard").DashboardTab>;
2
+ export declare const LazyTotalPredictiveIndexTab: import("react").LazyExoticComponent<typeof import("./chunks/totalPredictiveIndex").TotalPredictiveIndexTab>;
3
+ export declare const LazyWellnessIndicatorsTab: import("react").LazyExoticComponent<typeof import("./chunks/wellnessIndicators").WellnessIndicatorsTab>;
4
+ export declare const LazyQuestionnaireAnalysisTab: import("react").LazyExoticComponent<typeof import("./chunks/questionnaireAnalysis").QuestionnaireAnalysisTab>;
5
+ export declare const LazySupplementScheduleTab: import("react").LazyExoticComponent<typeof import("./chunks/supplementSchedule").SupplementScheduleTab>;
6
+ export declare const LazyLabResultsTab: import("react").LazyExoticComponent<typeof import("./chunks/labResults").LabResultsTab>;
7
+ export declare const LazySuggestedProductsTab: import("react").LazyExoticComponent<typeof import("./chunks/suggestedProducts").SuggestedProductsTab>;
8
+ export declare const LazyLabAnalysisTab: import("react").LazyExoticComponent<typeof import("./chunks/labAnalysis").LabAnalysisTab>;
9
+ export declare const LazyAlertLabSummaryTab: import("react").LazyExoticComponent<typeof import("./chunks/alertLabSummary").AlertLabSummaryTab>;
@@ -0,0 +1,24 @@
1
+ import type { ComponentType } from "react";
2
+ import { DASHBOARD_TAB_PLUGINS } from "./dashboardTabDefinitions";
3
+ type Plugin = (typeof DASHBOARD_TAB_PLUGINS)[number];
4
+ type TabContentOf<P> = P extends {
5
+ Tab: ComponentType<{
6
+ content: infer C;
7
+ }>;
8
+ } ? C : never;
9
+ export type DashboardNavItemId = Plugin["id"];
10
+ export type ContentByNavId = {
11
+ [K in Plugin["id"]]: TabContentOf<Extract<Plugin, {
12
+ id: K;
13
+ }>>;
14
+ };
15
+ export declare const DASHBOARD_TAB_NAV_IDS: readonly DashboardNavItemId[];
16
+ export type DashboardContentFetchers = {
17
+ [K in DashboardNavItemId]: (signal: AbortSignal) => Promise<ContentByNavId[K]>;
18
+ };
19
+ export type DashboardTabContentLoadErrorInfo = {
20
+ navItemId: DashboardNavItemId;
21
+ error: Error;
22
+ };
23
+ export declare function isDashboardNavItemId(id: string): id is DashboardNavItemId;
24
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { ContentByNavId, DashboardContentFetchers, DashboardNavItemId, DashboardTabContentLoadErrorInfo } from "./dashboardTabModel";
2
+ type TabState<T> = {
3
+ status: "idle";
4
+ } | {
5
+ status: "loading";
6
+ } | {
7
+ status: "success";
8
+ data: T;
9
+ } | {
10
+ status: "error";
11
+ error: Error;
12
+ };
13
+ export type UseDashboardTabContentResult<T> = TabState<T> & {
14
+ refetch: () => void;
15
+ loadGeneration: number;
16
+ };
17
+ export type UseDashboardTabContentOptions = {
18
+ fetchers: DashboardContentFetchers;
19
+ onLoadError?: (info: DashboardTabContentLoadErrorInfo) => void;
20
+ };
21
+ export declare function useDashboardTabContent<K extends DashboardNavItemId>(navItemId: K, options: UseDashboardTabContentOptions): UseDashboardTabContentResult<ContentByNavId[K]>;
22
+ export {};
@@ -0,0 +1,13 @@
1
+ export type { MetabolicDashboardProps } from "../layout";
2
+ export type { AlertLabMetricDto, AlertLabSummaryPageDto, DashboardPageDto, FetchReportPageOptions, HttpDashboardContentFetchersConfig, LabAnalysisPageDto, LabResultsPageDto, QuestionnaireAnalysisPageDto, ReportPageDtoByNavId, ReportPageDtoFor, ReportPageNavKey, SuggestedProductsPageDto, SupplementSchedulePageDto, TotalPredictiveIndexPageDto, WellnessIndicatorsPageDto, } from "./api";
3
+ export { buildReportPageUrl, createHttpDashboardContentFetchers, fetchReportPage, getBuiltInReportPagesApiBaseUrl, getBuiltInReportPagesApiDefaults, isMetabolicDashboardApiKeyAccepted, METABOLIC_DASHBOARD_STUB_API_KEY, METABOLIC_REPORT_PAGES_API_BASE_URL, mapAlertLabSummaryDtoToTabContent, mapDashboardPageDtoToTabContent, mapLabAnalysisDtoToTabContent, mapLabResultsDtoToTabContent, mapQuestionnaireAnalysisDtoToTabContent, mapSuggestedProductsDtoToTabContent, mapSupplementScheduleDtoToTabContent, mapTotalPredictiveIndexDtoToTabContent, mapWellnessIndicatorsDtoToTabContent, mergeReportPagesApiWithBuiltIn, } from "./api";
4
+ export { mergeDashboardContentFetchers } from "./dashboardContentFetchers";
5
+ export type { DashboardTabContentCacheContextValue } from "./dashboardTab/DashboardTabContentCacheContext";
6
+ export { DashboardTabContentCacheProvider, DEFAULT_DASHBOARD_TAB_CONTENT_CACHE_TTL_MS, useInvalidateDashboardTabContentCache, } from "./dashboardTab/DashboardTabContentCacheContext";
7
+ export type { DashboardTabDefinitionId, DashboardTabPluginDefinition, DashboardTabStaticPageHeader, } from "./dashboardTab/dashboardTabDefinitions";
8
+ export { DASHBOARD_TAB_PLUGINS, getDashboardTabStaticPageHeader, } from "./dashboardTab/dashboardTabDefinitions";
9
+ export type { ContentByNavId, DashboardContentFetchers, DashboardNavItemId, DashboardTabContentLoadErrorInfo, } from "./dashboardTab/dashboardTabModel";
10
+ export { DASHBOARD_TAB_NAV_IDS, isDashboardNavItemId } from "./dashboardTab/dashboardTabModel";
11
+ export { type UseDashboardTabContentOptions, type UseDashboardTabContentResult, useDashboardTabContent, } from "./dashboardTab/useDashboardTabContent";
12
+ export { MetabolicDashboard } from "./MetabolicDashboard";
13
+ export { MetabolicDashboardDefaultMain } from "./metabolicDashboard/MetabolicDashboardDefaultMain";
@@ -0,0 +1,4 @@
1
+ export type MetabolicDashboardApiKeyErrorProps = {
2
+ className?: string;
3
+ };
4
+ export declare function MetabolicDashboardApiKeyError({ className }: MetabolicDashboardApiKeyErrorProps): import("react/jsx-runtime").JSX.Element;