@medixdeck/ui 0.1.14 → 0.1.16

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
@@ -3,6 +3,7 @@ import { Box } from '@chakra-ui/react';
3
3
  import { BoxProps } from '@chakra-ui/react';
4
4
  import { Center } from '@chakra-ui/react';
5
5
  import { default as default_2 } from 'react';
6
+ import { default as default_3 } from 'react-cookie-consent';
6
7
  import { Flex } from '@chakra-ui/react';
7
8
  import { Grid } from '@chakra-ui/react';
8
9
  import { GridItem } from '@chakra-ui/react';
@@ -662,6 +663,35 @@ export declare interface ContainerProps extends BoxProps {
662
663
  maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
663
664
  }
664
665
 
666
+ /**
667
+ * MedixDeck CookieConsentBanner
668
+ *
669
+ * A GDPR/NDPR compliant cookie consent banner powered by react-cookie-consent.
670
+ *
671
+ * @example
672
+ * ```tsx
673
+ * <CookieConsentBanner />
674
+ * ```
675
+ */
676
+ export declare function CookieConsentBanner({ title, acceptText, declineText, enableDeclineButton, children, ...props }: CookieConsentBannerProps): JSX_2.Element;
677
+
678
+ export declare namespace CookieConsentBanner {
679
+ var displayName: string;
680
+ }
681
+
682
+ export declare interface CookieConsentBannerProps extends Omit<CookieConsentComponentProps, "style" | "buttonStyle" | "declineButtonStyle" | "contentStyle"> {
683
+ /** Optional custom title for the banner */
684
+ title?: string;
685
+ /** Custom text for accept button. Defaults to "Accept All" */
686
+ acceptText?: string;
687
+ /** Custom text for decline button. Defaults to "Reject Non-Essential" */
688
+ declineText?: string;
689
+ /** Enables the decline button. Defaults to true for compliance. */
690
+ enableDeclineButton?: boolean;
691
+ }
692
+
693
+ declare type CookieConsentComponentProps = default_2.ComponentProps<typeof default_3>;
694
+
665
695
  export declare type DashboardColorScheme = "blue" | "purple";
666
696
 
667
697
  export declare interface DashboardDropdownItem {
@@ -735,7 +765,7 @@ export declare interface DashboardDropdownItem {
735
765
  * }
736
766
  * ```
737
767
  */
738
- export declare function DashboardLayout({ children, logo, navGroups, user, greeting, onLogout, renderLink, dropdownItems, topBarSlot, sidebarWidth, colorScheme, ...rest }: DashboardLayoutProps): JSX_2.Element;
768
+ export declare function DashboardLayout({ children, logo, navGroups, user, greeting, greetingSubtext, onLogout, renderLink, dropdownItems, topBarSlot, sidebarWidth, colorScheme, mobileNavItems, scoreCard, ...rest }: DashboardLayoutProps): JSX_2.Element;
739
769
 
740
770
  export declare namespace DashboardLayout {
741
771
  var displayName: string;
@@ -770,6 +800,17 @@ export declare interface DashboardLayoutProps extends Omit<BoxProps, "children">
770
800
  * @example greeting="Welcome back"
771
801
  */
772
802
  greeting?: string;
803
+ /**
804
+ * Optional subtitle rendered below the greeting in the top bar.
805
+ * Use it to surface contextual info like the date or a daily summary.
806
+ * Note: The top bar height remains fixed at 64px (`h="16"`) even when the subtitle is present.
807
+ *
808
+ * @example
809
+ * ```tsx
810
+ * greetingSubtext="Thursday, 15 May 2026 · 8 consultations scheduled today"
811
+ * ```
812
+ */
813
+ greetingSubtext?: string;
773
814
  /** Called when the sidebar logout button is clicked. */
774
815
  onLogout?: () => void;
775
816
  /**
@@ -807,6 +848,55 @@ export declare interface DashboardLayoutProps extends Omit<BoxProps, "children">
807
848
  * @default "blue"
808
849
  */
809
850
  colorScheme?: DashboardColorScheme;
851
+ /**
852
+ * Optional flat list of up to 5 items for the mobile bottom navigation bar.
853
+ * When provided, a fixed bottom tab bar is shown on mobile (hidden on md+).
854
+ * Each item requires an `icon` and a `label`. Set `isActive` on the current
855
+ * route's item to highlight it.
856
+ *
857
+ * The same `renderLink` prop is used to wrap each tab, so router integration
858
+ * works out-of-the-box.
859
+ *
860
+ * @example
861
+ * ```tsx
862
+ * mobileNavItems={[
863
+ * { label: "Home", href: "/", icon: <HomeIcon />, isActive: true },
864
+ * { label: "Messages", href: "/messages", icon: <ChatIcon />, badge: 3 },
865
+ * { label: "Profile", href: "/profile", icon: <UserIcon /> },
866
+ * ]}
867
+ * ```
868
+ */
869
+ mobileNavItems?: DashboardMobileNavItem[];
870
+ /**
871
+ * Optional doctor identity / score card shown at the top of the sidebar
872
+ * (desktop only). Pass this when the authenticated user is a doctor.
873
+ *
874
+ * @example
875
+ * ```tsx
876
+ * scoreCard={{
877
+ * name: "Okedi Williams",
878
+ * role: "Cardiologist",
879
+ * avatarSrc: "/dr-okedi.jpg",
880
+ * tier: "gold",
881
+ * medixScore: 847,
882
+ * link: "/doctor/profile",
883
+ * }}
884
+ * ```
885
+ */
886
+ scoreCard?: DashboardScoreCardData;
887
+ }
888
+
889
+ export declare interface DashboardMobileNavItem {
890
+ /** Label shown below the icon in the mobile bottom bar. */
891
+ label: string;
892
+ /** href used by `renderLink` and as a unique key. */
893
+ href: string;
894
+ /** Icon element rendered above the label (recommended: 22×22 SVG). */
895
+ icon: default_2.ReactNode;
896
+ /** Mark this tab as active. */
897
+ isActive?: boolean;
898
+ /** Numeric count badge shown on the icon (capped at 99+). */
899
+ badge?: number;
810
900
  }
811
901
 
812
902
  export declare interface DashboardNavGroup {
@@ -833,6 +923,25 @@ export declare interface DashboardNavItem {
833
923
  subItems?: DashboardNavItem[];
834
924
  }
835
925
 
926
+ /**
927
+ * Data for the doctor identity card shown at the top of the sidebar.
928
+ * Only rendered when this prop is supplied — intended for doctor-role users.
929
+ */
930
+ export declare interface DashboardScoreCardData {
931
+ /** Doctor's full name. */
932
+ name: string;
933
+ /** Doctor's specialty / role shown as the primary label (e.g. "Cardiologist"). */
934
+ role: string;
935
+ /** Optional avatar image URL. Falls back to initials. */
936
+ avatarSrc?: string;
937
+ /** Optional href to navigate to the doctor's profile when the card is clicked. */
938
+ link?: string;
939
+ /** Clinician tier — determines avatar ring colour and badge text colour. */
940
+ tier: "bronze" | "silver" | "gold" | "platinum" | "diamond";
941
+ /** Numeric MedixScore displayed next to the tier label. */
942
+ medixScore: number;
943
+ }
944
+
836
945
  export declare interface DashboardUser {
837
946
  /** Display name shown in the top bar greeting and dropdown. */
838
947
  name: string;
@@ -1132,12 +1241,23 @@ export { Flex }
1132
1241
  * />
1133
1242
  * ```
1134
1243
  */
1135
- export declare function Footer({ description, logo, sections, socialLinks, copyright, bottomLinks, newsletter, renderLink, colorScheme, ...props }: FooterProps): JSX_2.Element;
1244
+ export declare function Footer({ description, logo, sections, socialLinks, copyright, bottomLinks, newsletter, renderLink, colorScheme, certifications, ...props }: FooterProps): JSX_2.Element;
1136
1245
 
1137
1246
  export declare namespace Footer {
1138
1247
  var displayName: string;
1139
1248
  }
1140
1249
 
1250
+ export declare interface FooterCertification {
1251
+ /** Certification name displayed alongside the badge (e.g. "NDPR Compliant"). */
1252
+ name: string;
1253
+ /** Optional URL to a verification or info page. */
1254
+ href?: string;
1255
+ /** Open the link in a new tab. @default true */
1256
+ isExternal?: boolean;
1257
+ /** Badge/logo image URL. When omitted a generic shield icon is rendered. */
1258
+ imageSrc?: string;
1259
+ }
1260
+
1141
1261
  export declare type FooterColorScheme = "blue" | "purple";
1142
1262
 
1143
1263
  export declare interface FooterLink {
@@ -1155,7 +1275,7 @@ export declare interface FooterProps extends Omit<BoxProps, "children"> {
1155
1275
  sections?: FooterSection[];
1156
1276
  /** Social media links */
1157
1277
  socialLinks?: SocialLink[];
1158
- /** Copyright text. Defaults to "© {year} MedixDeck. MDCN & FMoH Certified Platform." */
1278
+ /** Copyright text. Defaults to "© {year} MedixDeck Health Solution Ltd. All Rights Reserved." */
1159
1279
  copyright?: string;
1160
1280
  /** Links at the bottom right corner */
1161
1281
  bottomLinks?: BottomLink[];
@@ -1171,6 +1291,20 @@ export declare interface FooterProps extends Omit<BoxProps, "children"> {
1171
1291
  * @default "blue"
1172
1292
  */
1173
1293
  colorScheme?: FooterColorScheme;
1294
+ /**
1295
+ * Compliance certifications displayed in a horizontal row above the copyright bar.
1296
+ * Each item shows a badge image (or a fallback shield icon) + certification name.
1297
+ *
1298
+ * @example
1299
+ * ```tsx
1300
+ * certifications={[
1301
+ * { name: "NDPR Compliant", imageSrc: "/badges/ndpr.png", href: "https://nitda.gov.ng/ndpr" },
1302
+ * { name: "ISO 27001", imageSrc: "/badges/iso.png" },
1303
+ * { name: "MDCN Certified", href: "https://mdcn.gov.ng" },
1304
+ * ]}
1305
+ * ```
1306
+ */
1307
+ certifications?: FooterCertification[];
1174
1308
  }
1175
1309
 
1176
1310
  export declare interface FooterSection {
@@ -1783,6 +1917,80 @@ export declare interface ProgressProps extends BoxProps {
1783
1917
  isIndeterminate?: boolean;
1784
1918
  }
1785
1919
 
1920
+ /**
1921
+ * MedixDeck PWAInstallPrompt
1922
+ *
1923
+ * A cross-platform Progressive Web App install nudge that handles both
1924
+ * Android/Chromium (via `beforeinstallprompt`) and iOS Safari (manual
1925
+ * "Add to Home Screen" instructions).
1926
+ *
1927
+ * Features:
1928
+ * - Respects user dismissals with a configurable cooldown (default 14 days)
1929
+ * - Auto-hides when the app is already in standalone / installed mode
1930
+ * - Smooth entrance / exit animations via Framer Motion
1931
+ * - Fully themed with MedixDeck design tokens
1932
+ *
1933
+ * @example
1934
+ * ```tsx
1935
+ * <PWAInstallPrompt
1936
+ * appName="MedixDeck"
1937
+ * title="Install MedixDeck"
1938
+ * description="Get faster access and offline support."
1939
+ * delaySeconds={5}
1940
+ * />
1941
+ * ```
1942
+ */
1943
+ export declare function PWAInstallPrompt({ title, description, installLabel, dismissLabel, cooldownDays, onInstall, onDismiss, appName, icon, position, delaySeconds, forceVisible, forceIOS, }: PWAInstallPromptProps): JSX_2.Element;
1944
+
1945
+ export declare namespace PWAInstallPrompt {
1946
+ var displayName: string;
1947
+ }
1948
+
1949
+ export declare interface PWAInstallPromptProps {
1950
+ /** Title of the install banner. */
1951
+ title?: string;
1952
+ /** Body message explaining why the user should install. */
1953
+ description?: string;
1954
+ /** Label for the install button. */
1955
+ installLabel?: string;
1956
+ /** Label for the dismiss button. */
1957
+ dismissLabel?: string;
1958
+ /** Number of days to suppress the prompt after dismissal. @default 14 */
1959
+ cooldownDays?: number;
1960
+ /** Callback fired when the user accepts the install. */
1961
+ onInstall?: () => void;
1962
+ /** Callback fired when the user dismisses the prompt. */
1963
+ onDismiss?: () => void;
1964
+ /**
1965
+ * The app name used in iOS instructions (e.g. "MedixDeck").
1966
+ * @default "this app"
1967
+ */
1968
+ appName?: string;
1969
+ /**
1970
+ * Custom icon element (e.g. a `<Logo />` or an `<img />`).
1971
+ * When omitted, a default app icon is rendered.
1972
+ */
1973
+ icon?: default_2.ReactNode;
1974
+ /**
1975
+ * Position of the banner on screen.
1976
+ * @default "bottom"
1977
+ */
1978
+ position?: "top" | "bottom";
1979
+ /**
1980
+ * Number of seconds to delay the prompt after the conditions are met.
1981
+ * @default 0
1982
+ */
1983
+ delaySeconds?: number;
1984
+ /**
1985
+ * For documentation/storybook purposes. Forces the banner to be visible.
1986
+ */
1987
+ forceVisible?: boolean;
1988
+ /**
1989
+ * For documentation/storybook purposes. Forces the iOS rendering mode.
1990
+ */
1991
+ forceIOS?: boolean;
1992
+ }
1993
+
1786
1994
  export declare const radiiTokens: {
1787
1995
  readonly none: {
1788
1996
  readonly value: "0px";
@@ -1915,6 +2123,8 @@ export declare interface SelectProps extends Omit<NativeSelectRootProps, "size">
1915
2123
  errorMessage?: string;
1916
2124
  size?: "sm" | "md" | "lg";
1917
2125
  children?: default_2.ReactNode;
2126
+ /** Optional icon to render on the left side of the select field */
2127
+ icon?: default_2.ReactNode;
1918
2128
  }
1919
2129
 
1920
2130
  /**
@@ -2439,6 +2649,15 @@ export declare interface TooltipProps extends Omit<TooltipRootProps, "content">
2439
2649
  * MedixDeck Typography Tokens
2440
2650
  * Font: Satoshi (from Fontshare)
2441
2651
  * Scale derived from style guide.
2652
+ *
2653
+ * Font sizes use CSS clamp() for fluid, responsive scaling.
2654
+ * Formula: clamp(min-size, preferred-fluid, max-size)
2655
+ * - min-size : smallest the text will ever be (mobile)
2656
+ * - preferred : viewport-relative growth (vw + rem mix)
2657
+ * - max-size : largest the text will ever be (desktop)
2658
+ *
2659
+ * Consuming components automatically get responsive text by
2660
+ * referencing any token — no media queries needed.
2442
2661
  */
2443
2662
  export declare const typographyTokens: {
2444
2663
  readonly fonts: {
@@ -2454,37 +2673,37 @@ export declare const typographyTokens: {
2454
2673
  };
2455
2674
  readonly fontSizes: {
2456
2675
  readonly "2xs": {
2457
- readonly value: "0.625rem";
2676
+ readonly value: "clamp(0.5625rem, 0.5rem + 0.2vw, 0.625rem)";
2458
2677
  };
2459
2678
  readonly xs: {
2460
- readonly value: "0.6875rem";
2679
+ readonly value: "clamp(0.625rem, 0.5625rem + 0.25vw, 0.75rem)";
2461
2680
  };
2462
2681
  readonly sm: {
2463
- readonly value: "0.75rem";
2682
+ readonly value: "clamp(0.6875rem, 0.625rem + 0.3vw, 0.8125rem)";
2464
2683
  };
2465
2684
  readonly md: {
2466
- readonly value: "0.875rem";
2685
+ readonly value: "clamp(0.8125rem, 0.75rem + 0.35vw, 0.9375rem)";
2467
2686
  };
2468
2687
  readonly lg: {
2469
- readonly value: "1rem";
2688
+ readonly value: "clamp(0.9375rem, 0.875rem + 0.4vw, 1.0625rem)";
2470
2689
  };
2471
2690
  readonly xl: {
2472
- readonly value: "1.125rem";
2691
+ readonly value: "clamp(1rem, 0.9375rem + 0.5vw, 1.1875rem)";
2473
2692
  };
2474
2693
  readonly "2xl": {
2475
- readonly value: "1.3125rem";
2694
+ readonly value: "clamp(1.125rem, 1rem + 0.6vw, 1.4375rem)";
2476
2695
  };
2477
2696
  readonly "3xl": {
2478
- readonly value: "1.5rem";
2697
+ readonly value: "clamp(1.25rem, 1.125rem + 0.75vw, 1.625rem)";
2479
2698
  };
2480
2699
  readonly "4xl": {
2481
- readonly value: "1.75rem";
2700
+ readonly value: "clamp(1.5rem, 1.25rem + 1vw, 2rem)";
2482
2701
  };
2483
2702
  readonly "5xl": {
2484
- readonly value: "2.25rem";
2703
+ readonly value: "clamp(1.75rem, 1.5rem + 1.5vw, 2.5rem)";
2485
2704
  };
2486
2705
  readonly "6xl": {
2487
- readonly value: "3.25rem";
2706
+ readonly value: "clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem)";
2488
2707
  };
2489
2708
  };
2490
2709
  readonly fontWeights: {