@medixdeck/ui 0.1.21 → 0.1.22
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 +203 -18
- package/dist/index.cjs +46 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +163 -50
- package/dist/index.js +7729 -6383
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -758,6 +758,47 @@ export declare interface DashboardDropdownItem {
|
|
|
758
758
|
isDanger?: boolean;
|
|
759
759
|
}
|
|
760
760
|
|
|
761
|
+
export declare type DashboardEnvironment = 'auto' | 'production' | 'live' | 'sandbox' | 'test' | 'development' | 'staging' | 'preview';
|
|
762
|
+
|
|
763
|
+
export declare interface DashboardEnvironmentBannerConfig {
|
|
764
|
+
/**
|
|
765
|
+
* Override environment classification for the banner.
|
|
766
|
+
* @default "auto"
|
|
767
|
+
*/
|
|
768
|
+
environment?: DashboardEnvironment;
|
|
769
|
+
/**
|
|
770
|
+
* Title badge label (e.g. "SANDBOX MODE", "TEST ENVIRONMENT").
|
|
771
|
+
* Automatically inferred if omitted.
|
|
772
|
+
*/
|
|
773
|
+
badgeLabel?: string;
|
|
774
|
+
/**
|
|
775
|
+
* Custom descriptive message.
|
|
776
|
+
* Defaults to a standard non-production notice.
|
|
777
|
+
*/
|
|
778
|
+
message?: string;
|
|
779
|
+
/**
|
|
780
|
+
* Visual status theme variant.
|
|
781
|
+
* @default "warning"
|
|
782
|
+
*/
|
|
783
|
+
status?: DashboardEnvironmentBannerStatus;
|
|
784
|
+
/**
|
|
785
|
+
* Action link or button rendered on the right side of the banner.
|
|
786
|
+
* @example <a href="https://app.medixdeck.com">Switch to Live →</a>
|
|
787
|
+
*/
|
|
788
|
+
action?: default_2.ReactNode;
|
|
789
|
+
/**
|
|
790
|
+
* Whether the banner includes a dismiss (✕) button.
|
|
791
|
+
* @default false
|
|
792
|
+
*/
|
|
793
|
+
dismissible?: boolean;
|
|
794
|
+
/**
|
|
795
|
+
* Called when the dismiss button is clicked.
|
|
796
|
+
*/
|
|
797
|
+
onDismiss?: () => void;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
export declare type DashboardEnvironmentBannerStatus = 'warning' | 'info' | 'error' | 'neutral';
|
|
801
|
+
|
|
761
802
|
/**
|
|
762
803
|
* MedixDeck DashboardLayout
|
|
763
804
|
*
|
|
@@ -765,6 +806,11 @@ export declare interface DashboardDropdownItem {
|
|
|
765
806
|
* scrollable main content area. Fully responsive — the sidebar is hidden on
|
|
766
807
|
* mobile and revealed via a hamburger toggle.
|
|
767
808
|
*
|
|
809
|
+
* ### Collapsible Sidebar
|
|
810
|
+
* On desktop (`md+`), the sidebar can be collapsed into a compact icon rail (68px)
|
|
811
|
+
* or expanded (220px). Supports both controlled (`isCollapsed`, `onCollapseChange`)
|
|
812
|
+
* and uncontrolled (`defaultCollapsed`, `collapsible`) operation.
|
|
813
|
+
*
|
|
768
814
|
* ### Router integration
|
|
769
815
|
* Pass `renderLink` to use your router's `<Link>` component without bringing
|
|
770
816
|
* router dependencies into the library (mirrors the `Navbar` pattern).
|
|
@@ -809,6 +855,8 @@ export declare interface DashboardDropdownItem {
|
|
|
809
855
|
* <DashboardLayout
|
|
810
856
|
* navGroups={groups}
|
|
811
857
|
* user={{ name: "Daniel", email: "daniel@medixdeck.com" }}
|
|
858
|
+
* collapsible={true}
|
|
859
|
+
* defaultCollapsed={false}
|
|
812
860
|
* onLogout={() => auth.signOut()}
|
|
813
861
|
* renderLink={(item, children) => <Link to={item.href}>{children}</Link>}
|
|
814
862
|
* >
|
|
@@ -818,7 +866,7 @@ export declare interface DashboardDropdownItem {
|
|
|
818
866
|
* }
|
|
819
867
|
* ```
|
|
820
868
|
*/
|
|
821
|
-
export declare function DashboardLayout({ children, logo, navGroups, user, greeting, greetingSubtext, onLogout, renderLink, dropdownItems, topBarSlot, sidebarWidth, colorScheme, mobileNavItems, scoreCard, ...rest }: DashboardLayoutProps): JSX_2.Element;
|
|
869
|
+
export declare function DashboardLayout({ children, logo, navGroups, user, greeting, greetingSubtext, onLogout, renderLink, dropdownItems, topBarSlot, sidebarWidth, collapsedSidebarWidth, collapsible, defaultCollapsed, isCollapsed: controlledIsCollapsed, onCollapseChange, collapsedLogo, collapseTogglePlacement, colorScheme, mobileNavItems, scoreCard, environment, showEnvironmentBanner, environmentBanner, environmentBannerSlot, ...rest }: DashboardLayoutProps): JSX_2.Element;
|
|
822
870
|
|
|
823
871
|
export declare namespace DashboardLayout {
|
|
824
872
|
var displayName: string;
|
|
@@ -891,10 +939,48 @@ export declare interface DashboardLayoutProps extends Omit<BoxProps, 'children'>
|
|
|
891
939
|
*/
|
|
892
940
|
topBarSlot?: default_2.ReactNode;
|
|
893
941
|
/**
|
|
894
|
-
* Width of the sidebar in pixels.
|
|
942
|
+
* Width of the sidebar in pixels when expanded on desktop.
|
|
895
943
|
* @default 220
|
|
896
944
|
*/
|
|
897
945
|
sidebarWidth?: number;
|
|
946
|
+
/**
|
|
947
|
+
* Width of the sidebar rail in pixels when collapsed on desktop.
|
|
948
|
+
* @default 68
|
|
949
|
+
*/
|
|
950
|
+
collapsedSidebarWidth?: number;
|
|
951
|
+
/**
|
|
952
|
+
* Whether the desktop sidebar can be collapsed into a compact icon rail.
|
|
953
|
+
* Set to `false` to disable the collapsible behavior.
|
|
954
|
+
* @default true
|
|
955
|
+
*/
|
|
956
|
+
collapsible?: boolean;
|
|
957
|
+
/**
|
|
958
|
+
* Initial collapsed state for uncontrolled usage.
|
|
959
|
+
* @default false
|
|
960
|
+
*/
|
|
961
|
+
defaultCollapsed?: boolean;
|
|
962
|
+
/**
|
|
963
|
+
* Controlled collapsed state.
|
|
964
|
+
*/
|
|
965
|
+
isCollapsed?: boolean;
|
|
966
|
+
/**
|
|
967
|
+
* Callback fired when the sidebar collapse state changes.
|
|
968
|
+
*/
|
|
969
|
+
onCollapseChange?: (collapsed: boolean) => void;
|
|
970
|
+
/**
|
|
971
|
+
* Custom logo displayed in the sidebar header when collapsed.
|
|
972
|
+
* Defaults to `<Logo type="icon" variant={colorScheme} height={26} />`.
|
|
973
|
+
*/
|
|
974
|
+
collapsedLogo?: default_2.ReactNode;
|
|
975
|
+
/**
|
|
976
|
+
* Placement of the sidebar collapse/expand toggle buttons.
|
|
977
|
+
* - `'sidebar-header'`: in the top header of the sidebar (next to logo when expanded, below logo when collapsed).
|
|
978
|
+
* - `'topbar'`: on the left of the sticky topbar.
|
|
979
|
+
* - `'both'`: visible in both sidebar header and topbar.
|
|
980
|
+
* - `'none'`: hides built-in toggle buttons (for external control).
|
|
981
|
+
* @default "sidebar-header"
|
|
982
|
+
*/
|
|
983
|
+
collapseTogglePlacement?: 'sidebar-header' | 'topbar' | 'both' | 'none';
|
|
898
984
|
/**
|
|
899
985
|
* Brand accent applied to active nav items, logo, badge backgrounds, and the
|
|
900
986
|
* theme toggle active state.
|
|
@@ -937,6 +1023,28 @@ export declare interface DashboardLayoutProps extends Omit<BoxProps, 'children'>
|
|
|
937
1023
|
* ```
|
|
938
1024
|
*/
|
|
939
1025
|
scoreCard?: DashboardScoreCardData;
|
|
1026
|
+
/**
|
|
1027
|
+
* Environment setting for automatic banner detection.
|
|
1028
|
+
* When 'auto' (default), automatically detects local development, test, staging, and sandbox environments.
|
|
1029
|
+
* Set to 'production' or 'live' to suppress the banner.
|
|
1030
|
+
* @default "auto"
|
|
1031
|
+
*/
|
|
1032
|
+
environment?: DashboardEnvironment;
|
|
1033
|
+
/**
|
|
1034
|
+
* Explicitly force or suppress the environment banner.
|
|
1035
|
+
* - `false`: Always hide the banner.
|
|
1036
|
+
* - `true`: Always show the banner.
|
|
1037
|
+
* - `undefined`: Automatically determined by `environment`.
|
|
1038
|
+
*/
|
|
1039
|
+
showEnvironmentBanner?: boolean;
|
|
1040
|
+
/**
|
|
1041
|
+
* Detailed configuration for the environment banner.
|
|
1042
|
+
*/
|
|
1043
|
+
environmentBanner?: DashboardEnvironmentBannerConfig;
|
|
1044
|
+
/**
|
|
1045
|
+
* Custom slot to completely override the environment banner UI while preserving layout flow.
|
|
1046
|
+
*/
|
|
1047
|
+
environmentBannerSlot?: default_2.ReactNode;
|
|
940
1048
|
}
|
|
941
1049
|
|
|
942
1050
|
export declare interface DashboardMobileNavItem {
|
|
@@ -1736,9 +1844,10 @@ export declare type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
|
1736
1844
|
/**
|
|
1737
1845
|
* MedixDeck Navbar
|
|
1738
1846
|
*
|
|
1739
|
-
* Responsive navigation bar with smooth Framer Motion animations:
|
|
1740
|
-
* -
|
|
1741
|
-
* -
|
|
1847
|
+
* Responsive navigation bar with multi-level dropdowns and smooth Framer Motion animations:
|
|
1848
|
+
* - Desktop hover/click dropdown panels with rich descriptions, icons, and badges
|
|
1849
|
+
* - Mobile menu accordion slide-down with nested expandable submenus
|
|
1850
|
+
* - Nav links stagger-fade on mobile open
|
|
1742
1851
|
* - CTA buttons slide up after links
|
|
1743
1852
|
* - Hamburger ↔ Close icon crossfades
|
|
1744
1853
|
*
|
|
@@ -1753,51 +1862,24 @@ export declare type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
|
1753
1862
|
*
|
|
1754
1863
|
* ## Examples
|
|
1755
1864
|
*
|
|
1756
|
-
* ###
|
|
1757
|
-
* ```tsx
|
|
1758
|
-
* <Navbar ctaLabel="Talk to a Doctor" ctaHref="/consult" isSticky />
|
|
1759
|
-
* ```
|
|
1760
|
-
*
|
|
1761
|
-
* ### Click-handler (SPA / modal trigger)
|
|
1762
|
-
* ```tsx
|
|
1763
|
-
* <Navbar ctaLabel="Talk to a Doctor" onCtaClick={() => router.push("/consult")} isSticky />
|
|
1764
|
-
* ```
|
|
1765
|
-
*
|
|
1766
|
-
* ### Different destinations for label vs icon button
|
|
1865
|
+
* ### With Dropdown Links
|
|
1767
1866
|
* ```tsx
|
|
1768
1867
|
* <Navbar
|
|
1868
|
+
* navItems={[
|
|
1869
|
+
* { label: "Home", href: "/" },
|
|
1870
|
+
* {
|
|
1871
|
+
* label: "Services",
|
|
1872
|
+
* children: [
|
|
1873
|
+
* { label: "Doctor Consultations", href: "/services/doctors", description: "Talk to top specialists online" },
|
|
1874
|
+
* { label: "Homecare Visits", href: "/services/homecare", description: "Clinical nursing at your doorstep", badge: "Popular" },
|
|
1875
|
+
* { label: "Medical Outreach", href: "/services/outreach", description: "Community healthcare programs" },
|
|
1876
|
+
* ]
|
|
1877
|
+
* },
|
|
1878
|
+
* { label: "About Us", href: "/about" },
|
|
1879
|
+
* ]}
|
|
1769
1880
|
* ctaLabel="Talk to a Doctor"
|
|
1770
1881
|
* ctaHref="/consult"
|
|
1771
|
-
*
|
|
1772
|
-
* onCtaIconClick={() => analytics.track("app_opened")}
|
|
1773
|
-
* />
|
|
1774
|
-
* ```
|
|
1775
|
-
*
|
|
1776
|
-
* ### With Sign In secondary CTA
|
|
1777
|
-
* ```tsx
|
|
1778
|
-
* <Navbar
|
|
1779
|
-
* ctaLabel="Talk to a Doctor" ctaHref="/consult"
|
|
1780
|
-
* secondaryCtaLabel="Sign In" secondaryCtaHref="/login"
|
|
1781
|
-
* />
|
|
1782
|
-
* ```
|
|
1783
|
-
*
|
|
1784
|
-
* ### Custom CTA slot
|
|
1785
|
-
* ```tsx
|
|
1786
|
-
* <Navbar
|
|
1787
|
-
* ctaSlot={
|
|
1788
|
-
* <Box display="flex" gap="2">
|
|
1789
|
-
* <Button variant="ghost" colorScheme="blue" onClick={() => router.push("/login")}>Sign In</Button>
|
|
1790
|
-
* <Button variant="solid" colorScheme="purple" onClick={() => router.push("/signup")}>Get Started</Button>
|
|
1791
|
-
* </Box>
|
|
1792
|
-
* }
|
|
1793
|
-
* />
|
|
1794
|
-
* ```
|
|
1795
|
-
*
|
|
1796
|
-
* ### React Router / Next.js link integration
|
|
1797
|
-
* ```tsx
|
|
1798
|
-
* <Navbar
|
|
1799
|
-
* renderLink={(item, children) => <Link href={item.href}>{children}</Link>}
|
|
1800
|
-
* navItems={[...]}
|
|
1882
|
+
* isSticky
|
|
1801
1883
|
* />
|
|
1802
1884
|
* ```
|
|
1803
1885
|
*/
|
|
@@ -1808,7 +1890,7 @@ export declare type NavbarColorScheme = 'blue' | 'purple';
|
|
|
1808
1890
|
export declare interface NavbarProps extends Omit<BoxProps, 'children'> {
|
|
1809
1891
|
/** Logo element. Defaults to `<Logo />` when omitted. */
|
|
1810
1892
|
logo?: default_2.ReactNode;
|
|
1811
|
-
/** Navigation items to display. */
|
|
1893
|
+
/** Navigation items to display. Supports nested dropdowns via `children`. */
|
|
1812
1894
|
navItems?: NavItem[];
|
|
1813
1895
|
/**
|
|
1814
1896
|
* Alignment of the navigation items on desktop.
|
|
@@ -1821,9 +1903,9 @@ export declare interface NavbarProps extends Omit<BoxProps, 'children'> {
|
|
|
1821
1903
|
* @example
|
|
1822
1904
|
* ```tsx
|
|
1823
1905
|
* // Next.js
|
|
1824
|
-
* renderLink={(item, children) => <Link href={item.href}>{children}</Link>}
|
|
1906
|
+
* renderLink={(item, children) => <Link href={item.href ?? '#'}>{children}</Link>}
|
|
1825
1907
|
* // React Router
|
|
1826
|
-
* renderLink={(item, children) => <RouterLink to={item.href}>{children}</RouterLink>}
|
|
1908
|
+
* renderLink={(item, children) => <RouterLink to={item.href ?? '#'}>{children}</RouterLink>}
|
|
1827
1909
|
* ```
|
|
1828
1910
|
*/
|
|
1829
1911
|
renderLink?: (item: NavItem, children: default_2.ReactNode) => default_2.ReactNode;
|
|
@@ -1891,10 +1973,41 @@ export declare interface NavbarProps extends Omit<BoxProps, 'children'> {
|
|
|
1891
1973
|
}
|
|
1892
1974
|
|
|
1893
1975
|
export declare interface NavItem {
|
|
1976
|
+
/** The display label for the navigation item */
|
|
1894
1977
|
label: string;
|
|
1895
|
-
|
|
1978
|
+
/**
|
|
1979
|
+
* Destination URL. Optional when item is purely a dropdown trigger category.
|
|
1980
|
+
* @default "#"
|
|
1981
|
+
*/
|
|
1982
|
+
href?: string;
|
|
1983
|
+
/** Marks the item as active for current route styling */
|
|
1896
1984
|
isActive?: boolean;
|
|
1985
|
+
/**
|
|
1986
|
+
* Child items rendered inside a dropdown menu (Desktop) or accordion (Mobile).
|
|
1987
|
+
*/
|
|
1897
1988
|
children?: NavItem[];
|
|
1989
|
+
/**
|
|
1990
|
+
* Optional short description or subtitle rendered beneath the label in rich dropdown menus.
|
|
1991
|
+
*/
|
|
1992
|
+
description?: string;
|
|
1993
|
+
/**
|
|
1994
|
+
* Optional leading icon (React element or SVG).
|
|
1995
|
+
*/
|
|
1996
|
+
icon?: default_2.ReactNode;
|
|
1997
|
+
/**
|
|
1998
|
+
* Optional badge / tag text or element (e.g. "New", "Beta", 12).
|
|
1999
|
+
*/
|
|
2000
|
+
badge?: string | number | default_2.ReactNode;
|
|
2001
|
+
/**
|
|
2002
|
+
* If true, opens in a new tab with rel="noopener noreferrer" and displays an external arrow indicator.
|
|
2003
|
+
*/
|
|
2004
|
+
isExternal?: boolean;
|
|
2005
|
+
/** Link target attribute */
|
|
2006
|
+
target?: string;
|
|
2007
|
+
/** Link rel attribute */
|
|
2008
|
+
rel?: string;
|
|
2009
|
+
/** Optional custom click handler */
|
|
2010
|
+
onClick?: () => void;
|
|
1898
2011
|
}
|
|
1899
2012
|
|
|
1900
2013
|
export declare interface NewsletterProps {
|