@medixdeck/ui 0.1.14 → 0.1.15
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 +153 -1
- package/dist/index.cjs +59 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +227 -14
- package/dist/index.js +3738 -2539
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
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
|
|
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,74 @@ 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
|
+
* />
|
|
1940
|
+
* ```
|
|
1941
|
+
*/
|
|
1942
|
+
export declare function PWAInstallPrompt({ title, description, installLabel, dismissLabel, cooldownDays, onInstall, onDismiss, appName, icon, position, forceVisible, forceIOS, }: PWAInstallPromptProps): JSX_2.Element;
|
|
1943
|
+
|
|
1944
|
+
export declare namespace PWAInstallPrompt {
|
|
1945
|
+
var displayName: string;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
export declare interface PWAInstallPromptProps {
|
|
1949
|
+
/** Title of the install banner. */
|
|
1950
|
+
title?: string;
|
|
1951
|
+
/** Body message explaining why the user should install. */
|
|
1952
|
+
description?: string;
|
|
1953
|
+
/** Label for the install button. */
|
|
1954
|
+
installLabel?: string;
|
|
1955
|
+
/** Label for the dismiss button. */
|
|
1956
|
+
dismissLabel?: string;
|
|
1957
|
+
/** Number of days to suppress the prompt after dismissal. @default 14 */
|
|
1958
|
+
cooldownDays?: number;
|
|
1959
|
+
/** Callback fired when the user accepts the install. */
|
|
1960
|
+
onInstall?: () => void;
|
|
1961
|
+
/** Callback fired when the user dismisses the prompt. */
|
|
1962
|
+
onDismiss?: () => void;
|
|
1963
|
+
/**
|
|
1964
|
+
* The app name used in iOS instructions (e.g. "MedixDeck").
|
|
1965
|
+
* @default "this app"
|
|
1966
|
+
*/
|
|
1967
|
+
appName?: string;
|
|
1968
|
+
/**
|
|
1969
|
+
* Custom icon element (e.g. a `<Logo />` or an `<img />`).
|
|
1970
|
+
* When omitted, a default app icon is rendered.
|
|
1971
|
+
*/
|
|
1972
|
+
icon?: default_2.ReactNode;
|
|
1973
|
+
/**
|
|
1974
|
+
* Position of the banner on screen.
|
|
1975
|
+
* @default "bottom"
|
|
1976
|
+
*/
|
|
1977
|
+
position?: "top" | "bottom";
|
|
1978
|
+
/**
|
|
1979
|
+
* For documentation/storybook purposes. Forces the banner to be visible.
|
|
1980
|
+
*/
|
|
1981
|
+
forceVisible?: boolean;
|
|
1982
|
+
/**
|
|
1983
|
+
* For documentation/storybook purposes. Forces the iOS rendering mode.
|
|
1984
|
+
*/
|
|
1985
|
+
forceIOS?: boolean;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1786
1988
|
export declare const radiiTokens: {
|
|
1787
1989
|
readonly none: {
|
|
1788
1990
|
readonly value: "0px";
|
|
@@ -1915,6 +2117,8 @@ export declare interface SelectProps extends Omit<NativeSelectRootProps, "size">
|
|
|
1915
2117
|
errorMessage?: string;
|
|
1916
2118
|
size?: "sm" | "md" | "lg";
|
|
1917
2119
|
children?: default_2.ReactNode;
|
|
2120
|
+
/** Optional icon to render on the left side of the select field */
|
|
2121
|
+
icon?: default_2.ReactNode;
|
|
1918
2122
|
}
|
|
1919
2123
|
|
|
1920
2124
|
/**
|
|
@@ -2439,6 +2643,15 @@ export declare interface TooltipProps extends Omit<TooltipRootProps, "content">
|
|
|
2439
2643
|
* MedixDeck Typography Tokens
|
|
2440
2644
|
* Font: Satoshi (from Fontshare)
|
|
2441
2645
|
* Scale derived from style guide.
|
|
2646
|
+
*
|
|
2647
|
+
* Font sizes use CSS clamp() for fluid, responsive scaling.
|
|
2648
|
+
* Formula: clamp(min-size, preferred-fluid, max-size)
|
|
2649
|
+
* - min-size : smallest the text will ever be (mobile)
|
|
2650
|
+
* - preferred : viewport-relative growth (vw + rem mix)
|
|
2651
|
+
* - max-size : largest the text will ever be (desktop)
|
|
2652
|
+
*
|
|
2653
|
+
* Consuming components automatically get responsive text by
|
|
2654
|
+
* referencing any token — no media queries needed.
|
|
2442
2655
|
*/
|
|
2443
2656
|
export declare const typographyTokens: {
|
|
2444
2657
|
readonly fonts: {
|
|
@@ -2454,37 +2667,37 @@ export declare const typographyTokens: {
|
|
|
2454
2667
|
};
|
|
2455
2668
|
readonly fontSizes: {
|
|
2456
2669
|
readonly "2xs": {
|
|
2457
|
-
readonly value: "0.625rem";
|
|
2670
|
+
readonly value: "clamp(0.5625rem, 0.5rem + 0.2vw, 0.625rem)";
|
|
2458
2671
|
};
|
|
2459
2672
|
readonly xs: {
|
|
2460
|
-
readonly value: "0.
|
|
2673
|
+
readonly value: "clamp(0.625rem, 0.5625rem + 0.25vw, 0.75rem)";
|
|
2461
2674
|
};
|
|
2462
2675
|
readonly sm: {
|
|
2463
|
-
readonly value: "0.
|
|
2676
|
+
readonly value: "clamp(0.6875rem, 0.625rem + 0.3vw, 0.8125rem)";
|
|
2464
2677
|
};
|
|
2465
2678
|
readonly md: {
|
|
2466
|
-
readonly value: "0.
|
|
2679
|
+
readonly value: "clamp(0.8125rem, 0.75rem + 0.35vw, 0.9375rem)";
|
|
2467
2680
|
};
|
|
2468
2681
|
readonly lg: {
|
|
2469
|
-
readonly value: "
|
|
2682
|
+
readonly value: "clamp(0.9375rem, 0.875rem + 0.4vw, 1.0625rem)";
|
|
2470
2683
|
};
|
|
2471
2684
|
readonly xl: {
|
|
2472
|
-
readonly value: "1.
|
|
2685
|
+
readonly value: "clamp(1rem, 0.9375rem + 0.5vw, 1.1875rem)";
|
|
2473
2686
|
};
|
|
2474
2687
|
readonly "2xl": {
|
|
2475
|
-
readonly value: "1.
|
|
2688
|
+
readonly value: "clamp(1.125rem, 1rem + 0.6vw, 1.4375rem)";
|
|
2476
2689
|
};
|
|
2477
2690
|
readonly "3xl": {
|
|
2478
|
-
readonly value: "1.
|
|
2691
|
+
readonly value: "clamp(1.25rem, 1.125rem + 0.75vw, 1.625rem)";
|
|
2479
2692
|
};
|
|
2480
2693
|
readonly "4xl": {
|
|
2481
|
-
readonly value: "1.
|
|
2694
|
+
readonly value: "clamp(1.5rem, 1.25rem + 1vw, 2rem)";
|
|
2482
2695
|
};
|
|
2483
2696
|
readonly "5xl": {
|
|
2484
|
-
readonly value: "2.
|
|
2697
|
+
readonly value: "clamp(1.75rem, 1.5rem + 1.5vw, 2.5rem)";
|
|
2485
2698
|
};
|
|
2486
2699
|
readonly "6xl": {
|
|
2487
|
-
readonly value: "3.
|
|
2700
|
+
readonly value: "clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem)";
|
|
2488
2701
|
};
|
|
2489
2702
|
};
|
|
2490
2703
|
readonly fontWeights: {
|