@medixdeck/ui 0.1.9 → 0.1.13

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
@@ -302,6 +302,23 @@ export declare interface ButtonProps {
302
302
  rel?: string;
303
303
  }
304
304
 
305
+ /**
306
+ * MedixDeck Re-usable Calendar Component
307
+ *
308
+ * @example
309
+ * ```tsx
310
+ * <Calendar value={date} onChange={setDate} />
311
+ * ```
312
+ */
313
+ export declare function Calendar({ value, onChange, minDate, maxDate, ...props }: CalendarProps): JSX_2.Element;
314
+
315
+ export declare interface CalendarProps extends Omit<BoxProps, "onChange"> {
316
+ value?: Date | null;
317
+ onChange?: (date: Date) => void;
318
+ minDate?: Date;
319
+ maxDate?: Date;
320
+ }
321
+
305
322
  /**
306
323
  * MedixDeck Card
307
324
  *
@@ -543,7 +560,7 @@ export declare const colorTokens: {
543
560
  readonly value: "#DCFCE7";
544
561
  };
545
562
  readonly 500: {
546
- readonly value: "#1B7A38";
563
+ readonly value: "#16A34A";
547
564
  };
548
565
  readonly 600: {
549
566
  readonly value: "#166534";
@@ -847,9 +864,7 @@ export declare interface DataTableProps<T = Record<string, unknown>> {
847
864
  /**
848
865
  * MedixDeck DatePicker
849
866
  *
850
- * Styled wrapper around the native date/datetime-local input.
851
- * Colors use CSS custom properties (--medix-form-*) that cascade from any
852
- * .dark ancestor, so dark mode works without any JS theme hook.
867
+ * Uses the custom MedixDeck Calendar component.
853
868
  *
854
869
  * @example
855
870
  * ```tsx
@@ -885,7 +900,7 @@ export declare interface DatePickerProps {
885
900
  /**
886
901
  * MedixDeck DateRangePicker
887
902
  *
888
- * Styled wrapper around two native date inputs (start and end).
903
+ * Uses the custom MedixDeck Calendar component for picking start and end dates.
889
904
  *
890
905
  * @example
891
906
  * ```tsx
@@ -951,10 +966,13 @@ export declare interface DividerProps extends SeparatorProps {
951
966
  * @example
952
967
  * ```tsx
953
968
  * <DoctorCard
969
+ * variant="standard"
954
970
  * name="Dr. Amaka Okonkwo"
955
- * specialty="Cardiologist"
971
+ * specialty="General Practitioner"
972
+ * location="Lagos"
956
973
  * rating={4.9}
957
974
  * reviewCount={128}
975
+ * experience="8 yrs experience"
958
976
  * consultationFee="₦5,000"
959
977
  * isVerified
960
978
  * isAvailable
@@ -962,7 +980,7 @@ export declare interface DividerProps extends SeparatorProps {
962
980
  * />
963
981
  * ```
964
982
  */
965
- export declare function DoctorCard({ name, specialty, location, avatar, rating, reviewCount, consultationFee, isVerified, isAvailable, availabilityLabel, onBookClick, onViewClick, ...props }: DoctorCardProps): JSX_2.Element;
983
+ export declare function DoctorCard({ name, specialty, location, avatar, rating, reviewCount, experience, consultationFee, isVerified, isAvailable, availabilityLabel, onBookClick, onViewClick, variant, ...props }: DoctorCardProps): JSX_2.Element;
966
984
 
967
985
  export declare interface DoctorCardProps extends BoxProps {
968
986
  name: string;
@@ -971,12 +989,14 @@ export declare interface DoctorCardProps extends BoxProps {
971
989
  avatar?: string;
972
990
  rating?: number;
973
991
  reviewCount?: number;
992
+ experience?: string;
974
993
  consultationFee?: string;
975
994
  isVerified?: boolean;
976
995
  isAvailable?: boolean;
977
996
  availabilityLabel?: string;
978
997
  onBookClick?: () => void;
979
998
  onViewClick?: () => void;
999
+ variant?: "standard" | "compact" | "featured";
980
1000
  }
981
1001
 
982
1002
  /**
@@ -1547,6 +1567,40 @@ export declare interface NewsletterProps {
1547
1567
  buttonIcon?: default_2.ReactNode;
1548
1568
  }
1549
1569
 
1570
+ /**
1571
+ * MedixDeck NotFoundPage (404)
1572
+ *
1573
+ * A reusable 404 error page layout for applications to render in their Not Found routing.
1574
+ *
1575
+ * @example
1576
+ * ```tsx
1577
+ * // app/not-found.tsx (Next.js App Router)
1578
+ * import { NotFoundPage } from "@medixdeck/ui";
1579
+ * import { useRouter } from "next/navigation";
1580
+ *
1581
+ * export default function NotFound() {
1582
+ * const router = useRouter();
1583
+ * return <NotFoundPage onAction={() => router.push("/")} />;
1584
+ * }
1585
+ * ```
1586
+ */
1587
+ export declare function NotFoundPage({ title, description, actionLabel, onAction, secondaryLabel, onSecondaryAction, ...props }: NotFoundPageProps): JSX_2.Element;
1588
+
1589
+ export declare interface NotFoundPageProps extends BoxProps {
1590
+ /** Optional custom title. Defaults to "Page Not Found" */
1591
+ title?: string;
1592
+ /** Optional custom description. Defaults to "The page you are looking for doesn't exist or has been moved." */
1593
+ description?: string;
1594
+ /** CTA button label. Defaults to "Go back home" */
1595
+ actionLabel?: string;
1596
+ /** CTA button onClick handler */
1597
+ onAction?: () => void;
1598
+ /** Secondary button label. */
1599
+ secondaryLabel?: string;
1600
+ /** Secondary button onClick handler */
1601
+ onSecondaryAction?: () => void;
1602
+ }
1603
+
1550
1604
  /**
1551
1605
  * MedixDeck OTPInput / PinInput
1552
1606
  *
@@ -1563,11 +1617,13 @@ export declare interface NewsletterProps {
1563
1617
  * />
1564
1618
  * ```
1565
1619
  */
1566
- export declare function OTPInput({ length, value, onChange, onComplete, isInvalid, isDisabled, mask, label, helperText, errorMessage, }: OTPInputProps): JSX_2.Element;
1620
+ export declare function OTPInput({ length, value, defaultValue, onChange, onComplete, isInvalid, isDisabled, mask, label, helperText, errorMessage, }: OTPInputProps): JSX_2.Element;
1567
1621
 
1568
1622
  export declare interface OTPInputProps {
1569
1623
  /** Number of digits */
1570
1624
  length?: number;
1625
+ /** Default uncontrolled value */
1626
+ defaultValue?: string;
1571
1627
  /** Controlled value (joined string) */
1572
1628
  value?: string;
1573
1629
  onChange?: (value: string) => void;
@@ -1622,15 +1678,23 @@ export declare interface PaginationProps extends Omit<BoxProps, "onChange"> {
1622
1678
  *
1623
1679
  * @example
1624
1680
  * ```tsx
1681
+ * // Nigeria (default)
1625
1682
  * <PhoneInput
1626
1683
  * label="Phone number"
1627
1684
  * placeholder="80 000 0000"
1628
1685
  * defaultCountryCode="+234"
1629
1686
  * onChange={(val) => setValue(val)}
1630
1687
  * />
1688
+ *
1689
+ * // US (unambiguous ISO override — avoids picking AS for the shared +1 code)
1690
+ * <PhoneInput
1691
+ * label="Phone number"
1692
+ * defaultCountry="US"
1693
+ * onChange={(val) => setValue(val)}
1694
+ * />
1631
1695
  * ```
1632
1696
  */
1633
- export declare function PhoneInput({ value, onChange, showCountryCode, defaultCountryCode, placeholder, isInvalid, errorMessage, label, helperText, isDisabled, id, }: PhoneInputProps): JSX_2.Element;
1697
+ export declare function PhoneInput({ value, onChange, showCountryCode, showCountryFlag, defaultCountryCode, defaultCountry, placeholder, isInvalid, errorMessage, label, helperText, isDisabled, id, }: PhoneInputProps): JSX_2.Element;
1634
1698
 
1635
1699
  export declare interface PhoneInputProps {
1636
1700
  /** Controlled value (full number including country code prefix) */
@@ -1638,8 +1702,15 @@ export declare interface PhoneInputProps {
1638
1702
  onChange?: (value: string) => void;
1639
1703
  /** Show country code selector */
1640
1704
  showCountryCode?: boolean;
1641
- /** Default country code e.g. "+234" */
1705
+ /** Show the country flag SVG */
1706
+ showCountryFlag?: boolean;
1707
+ /** Default country calling code e.g. "+234". When multiple countries share
1708
+ * the same code (e.g. "+1"), prefer `defaultCountry` for an exact match. */
1642
1709
  defaultCountryCode?: string;
1710
+ /** Default country ISO 3166-1 alpha-2 code (e.g. "US", "NG"). Takes
1711
+ * precedence over `defaultCountryCode` and avoids ambiguity for shared
1712
+ * calling codes such as +1 (NANP) or +7 (Russia/Kazakhstan). */
1713
+ defaultCountry?: string;
1643
1714
  placeholder?: string;
1644
1715
  isInvalid?: boolean;
1645
1716
  errorMessage?: string;
@@ -1812,6 +1883,41 @@ export declare interface SelectProps extends Omit<NativeSelectRootProps, "size">
1812
1883
  children?: default_2.ReactNode;
1813
1884
  }
1814
1885
 
1886
+ /**
1887
+ * MedixDeck ServerErrorPage (500)
1888
+ *
1889
+ * A reusable 500 error page layout for applications to render in their global error routing.
1890
+ *
1891
+ * @example
1892
+ * ```tsx
1893
+ * // app/error.tsx (Next.js App Router)
1894
+ * "use client";
1895
+ * import { ServerErrorPage } from "@medixdeck/ui";
1896
+ *
1897
+ * export default function Error({ error, reset }: { error: Error; reset: () => void }) {
1898
+ * return <ServerErrorPage errorMessage={error.message} onAction={() => reset()} />;
1899
+ * }
1900
+ * ```
1901
+ */
1902
+ export declare function ServerErrorPage({ title, description, errorMessage, actionLabel, onAction, secondaryLabel, onSecondaryAction, ...props }: ServerErrorPageProps): JSX_2.Element;
1903
+
1904
+ export declare interface ServerErrorPageProps extends BoxProps {
1905
+ /** Optional custom title. Defaults to "Something went wrong" */
1906
+ title?: string;
1907
+ /** Optional custom description. Defaults to "An unexpected error occurred on our end. Please try again later." */
1908
+ description?: string;
1909
+ /** Optional error message details to display in a code block */
1910
+ errorMessage?: string;
1911
+ /** CTA button label. Defaults to "Try again" */
1912
+ actionLabel?: string;
1913
+ /** CTA button onClick handler (e.g. reset() in Next.js) */
1914
+ onAction?: () => void;
1915
+ /** Secondary button label. */
1916
+ secondaryLabel?: string;
1917
+ /** Secondary button onClick handler */
1918
+ onSecondaryAction?: () => void;
1919
+ }
1920
+
1815
1921
  export declare const shadowTokens: {
1816
1922
  readonly xs: {
1817
1923
  readonly value: "0 1px 2px 0 rgba(0, 0, 0, 0.05)";