@medixdeck/ui 0.1.25 → 0.1.27

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/index.d.ts CHANGED
@@ -755,6 +755,22 @@ export declare interface CookieConsentBannerProps extends Omit<CookieConsentComp
755
755
 
756
756
  declare type CookieConsentComponentProps = default_2.ComponentProps<typeof default_3>;
757
757
 
758
+ /**
759
+ * Visual + band metadata for every backend-supported MedixScore tier.
760
+ *
761
+ * Score bands (backend `MEDIX_SCORE_TIER`):
762
+ * Bronze 0–999 · Silver 1,000–4,999 · Gold 5,000–14,999 ·
763
+ * Platinum 15,000–39,999 · Elite I 40,000–59,999 · Elite II 60,000–79,999 ·
764
+ * Elite III 80,000–119,999 · Elite IV 120,000–199,999 · Elite V 200,000+.
765
+ *
766
+ * Base tiers keep their established colours; Elite I–V use a violet/purple
767
+ * prestige ramp culminating in brand purple (`#7700CC`) and deep royal tones.
768
+ */
769
+ export declare const DASHBOARD_MEDIX_TIER_CONFIG: Record<DashboardMedixScoreTier, DashboardMedixScoreTierMeta>;
770
+
771
+ /** Tier keys ordered by ascending level (Bronze → Elite V). */
772
+ export declare const DASHBOARD_MEDIX_TIER_ORDER: DashboardMedixScoreTier[];
773
+
758
774
  export declare type DashboardColorScheme = 'blue' | 'purple';
759
775
 
760
776
  export declare interface DashboardDropdownItem {
@@ -1027,7 +1043,7 @@ export declare interface DashboardLayoutProps extends Omit<BoxProps, 'children'>
1027
1043
  * role: "Cardiologist",
1028
1044
  * avatarSrc: "/dr-okedi.jpg",
1029
1045
  * tier: "gold",
1030
- * medixScore: 847,
1046
+ * medixScore: 8470,
1031
1047
  * link: "/doctor/profile",
1032
1048
  * }}
1033
1049
  * ```
@@ -1057,6 +1073,33 @@ export declare interface DashboardLayoutProps extends Omit<BoxProps, 'children'>
1057
1073
  environmentBannerSlot?: default_2.ReactNode;
1058
1074
  }
1059
1075
 
1076
+ /**
1077
+ * MedixScore clinician tier key.
1078
+ *
1079
+ * Mirrors the backend `MEDIX_SCORE_TIER` bands
1080
+ * (`medixdeck-backend/src/utils/medixScore.constants.ts`):
1081
+ * Bronze (L1) → Silver (L2) → Gold (L3) → Platinum (L4) →
1082
+ * Elite I (L5) → Elite II (L6) → Elite III (L7) → Elite IV (L8) → Elite V (L9).
1083
+ */
1084
+ export declare type DashboardMedixScoreTier = 'bronze' | 'silver' | 'gold' | 'platinum' | 'elite-i' | 'elite-ii' | 'elite-iii' | 'elite-iv' | 'elite-v';
1085
+
1086
+ export declare interface DashboardMedixScoreTierMeta {
1087
+ /** Display name — matches backend tier `NAME` exactly (e.g. "Elite I"). */
1088
+ label: string;
1089
+ /** Tier level 1–9 — matches backend tier `LEVEL`. */
1090
+ level: number;
1091
+ /** Inclusive lower score bound — matches backend `MIN_SCORE`. */
1092
+ minScore: number;
1093
+ /** Inclusive upper score bound — matches backend `MAX_SCORE` (`null` = unbounded, Elite V). */
1094
+ maxScore: number | null;
1095
+ /** Label / badge text colour. */
1096
+ color: string;
1097
+ /** Avatar gradient-ring colour. */
1098
+ ring: string;
1099
+ /** Avatar fallback / tint background. */
1100
+ bg: string;
1101
+ }
1102
+
1060
1103
  export declare interface DashboardMobileNavItem {
1061
1104
  /** Label shown below the icon in the mobile bottom bar. */
1062
1105
  label: string;
@@ -1116,7 +1159,7 @@ export declare interface DashboardScoreCardData {
1116
1159
  /** Optional href to navigate to the doctor's profile when the card is clicked. */
1117
1160
  link?: string;
1118
1161
  /** Clinician tier — determines avatar ring colour and badge text colour. */
1119
- tier: 'bronze' | 'silver' | 'gold' | 'platinum' | 'diamond';
1162
+ tier: DashboardMedixScoreTier;
1120
1163
  /** Numeric MedixScore displayed next to the tier label. */
1121
1164
  medixScore: number;
1122
1165
  }
@@ -1572,6 +1615,25 @@ export declare function getEffectiveStorageKey(storageKey?: string, id?: string,
1572
1615
  */
1573
1616
  export declare function getEffectiveTextareaStorageKey(storageKey?: string, id?: string, name?: string, placeholder?: string): string;
1574
1617
 
1618
+ /**
1619
+ * Resolve the tier key for a raw MedixScore balance using backend bands.
1620
+ * Negative / NaN inputs floor to `bronze`; Elite V has no upper bound.
1621
+ *
1622
+ * @example
1623
+ * ```ts
1624
+ * getMedixScoreTierForScore(0) // "bronze"
1625
+ * getMedixScoreTierForScore(5000) // "gold"
1626
+ * getMedixScoreTierForScore(250000) // "elite-v"
1627
+ * ```
1628
+ */
1629
+ export declare function getMedixScoreTierForScore(score: number): DashboardMedixScoreTier;
1630
+
1631
+ /**
1632
+ * Safe tier metadata accessor — falls back to Bronze for unknown keys
1633
+ * (e.g. stale persisted values such as the removed `diamond` tier).
1634
+ */
1635
+ export declare function getMedixScoreTierMeta(tier: DashboardMedixScoreTier | (string & {})): DashboardMedixScoreTierMeta;
1636
+
1575
1637
  /**
1576
1638
  * Safely retrieves a saved draft from localStorage.
1577
1639
  */
@@ -1590,9 +1652,7 @@ export { Heading }
1590
1652
 
1591
1653
  export { HStack }
1592
1654
 
1593
- /**
1594
- * Converts HTML content to clean, standard Markdown text.
1595
- */
1655
+ /** Convert existing editor HTML identically in browsers and DOM-free SSR. */
1596
1656
  export declare function htmlToMarkdown(html: string): string;
1597
1657
 
1598
1658
  /**
@@ -1747,6 +1807,9 @@ export declare type LogoType = 'full' | 'icon';
1747
1807
 
1748
1808
  export declare type LogoVariant = 'blue' | 'purple' | 'black' | 'white';
1749
1809
 
1810
+ /**
1811
+ * Converts HTML content to clean, standard Markdown text.
1812
+ */
1750
1813
  /**
1751
1814
  * Converts standard Markdown text to HTML.
1752
1815
  */
@@ -2072,11 +2135,11 @@ export declare interface NewsletterProps {
2072
2135
  *
2073
2136
  * export default function NotFound() {
2074
2137
  * const router = useRouter();
2075
- * return <NotFoundPage onAction={() => router.push("/")} />;
2138
+ * return <NotFoundPage onAction={() => router.push("/")} colorScheme="purple" />;
2076
2139
  * }
2077
2140
  * ```
2078
2141
  */
2079
- export declare function NotFoundPage({ title, description, errorMessage, actionLabel, onAction, secondaryLabel, onSecondaryAction, ...props }: NotFoundPageProps): JSX_2.Element;
2142
+ export declare function NotFoundPage({ title, description, errorMessage, actionLabel, onAction, secondaryLabel, onSecondaryAction, colorScheme, ...props }: NotFoundPageProps): JSX_2.Element;
2080
2143
 
2081
2144
  export declare interface NotFoundPageProps extends BoxProps {
2082
2145
  /** Optional custom title. Defaults to "Page Not Found" */
@@ -2093,6 +2156,11 @@ export declare interface NotFoundPageProps extends BoxProps {
2093
2156
  secondaryLabel?: string;
2094
2157
  /** Secondary button onClick handler */
2095
2158
  onSecondaryAction?: () => void;
2159
+ /**
2160
+ * Brand accent for the CTA buttons and the "404" watermark.
2161
+ * @default "blue"
2162
+ */
2163
+ colorScheme?: 'blue' | 'purple';
2096
2164
  }
2097
2165
 
2098
2166
  /**
@@ -2371,10 +2439,11 @@ export declare interface ProgressProps extends BoxProps {
2371
2439
  * title="Install MedixDeck"
2372
2440
  * description="Get faster access and offline support."
2373
2441
  * delaySeconds={5}
2442
+ * colorScheme="purple"
2374
2443
  * />
2375
2444
  * ```
2376
2445
  */
2377
- export declare function PWAInstallPrompt({ title, description, installLabel, dismissLabel, cooldownDays, onInstall, onDismiss, appName, icon, position, delaySeconds, forceVisible, forceIOS, }: PWAInstallPromptProps): JSX_2.Element;
2446
+ export declare function PWAInstallPrompt({ title, description, installLabel, dismissLabel, cooldownDays, onInstall, onDismiss, appName, icon, position, colorScheme, delaySeconds, forceVisible, forceIOS, }: PWAInstallPromptProps): JSX_2.Element;
2378
2447
 
2379
2448
  export declare namespace PWAInstallPrompt {
2380
2449
  var displayName: string;
@@ -2410,6 +2479,11 @@ export declare interface PWAInstallPromptProps {
2410
2479
  * @default "bottom"
2411
2480
  */
2412
2481
  position?: 'top' | 'bottom';
2482
+ /**
2483
+ * Brand accent for the install button, iOS share icon, and step badges.
2484
+ * @default "blue"
2485
+ */
2486
+ colorScheme?: 'blue' | 'purple';
2413
2487
  /**
2414
2488
  * Number of seconds to delay the prompt after the conditions are met.
2415
2489
  * @default 0
@@ -2729,11 +2803,11 @@ export declare interface SelectProps {
2729
2803
  * import { ServerErrorPage } from "@medixdeck/ui";
2730
2804
  *
2731
2805
  * export default function Error({ error, reset }: { error: Error; reset: () => void }) {
2732
- * return <ServerErrorPage errorMessage={error.message} onAction={() => reset()} />;
2806
+ * return <ServerErrorPage errorMessage={error.message} onAction={() => reset()} colorScheme="purple" />;
2733
2807
  * }
2734
2808
  * ```
2735
2809
  */
2736
- export declare function ServerErrorPage({ title, description, errorMessage, actionLabel, onAction, secondaryLabel, onSecondaryAction, ...props }: ServerErrorPageProps): JSX_2.Element;
2810
+ export declare function ServerErrorPage({ title, description, errorMessage, actionLabel, onAction, secondaryLabel, onSecondaryAction, colorScheme, ...props }: ServerErrorPageProps): JSX_2.Element;
2737
2811
 
2738
2812
  export declare interface ServerErrorPageProps extends BoxProps {
2739
2813
  /** Optional custom title. Defaults to "Something went wrong" */
@@ -2750,6 +2824,12 @@ export declare interface ServerErrorPageProps extends BoxProps {
2750
2824
  secondaryLabel?: string;
2751
2825
  /** Secondary button onClick handler */
2752
2826
  onSecondaryAction?: () => void;
2827
+ /**
2828
+ * Brand accent for the CTA buttons.
2829
+ * The error icon stays red as a status color on all schemes.
2830
+ * @default "blue"
2831
+ */
2832
+ colorScheme?: 'blue' | 'purple';
2753
2833
  }
2754
2834
 
2755
2835
  export declare const shadowTokens: {