@mirantes-micro/foundation-design-system 1.2.361 → 1.2.363

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +90 -88
  2. package/dist/index.js +211 -211
  3. package/package.json +212 -212
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { ReactNode, JSX, RefObject, InputHTMLAttributes, ChangeEvent, KeyboardEvent, FocusEvent } from 'react';
3
- import { AxiosInstance, GenericAbortSignal } from 'axios';
4
3
  import * as _tanstack_react_query from '@tanstack/react-query';
5
4
  import { QueryClient } from '@tanstack/react-query';
5
+ import { AxiosInstance, GenericAbortSignal } from 'axios';
6
6
  import { Socket } from 'socket.io-client';
7
7
  import * as zustand from 'zustand';
8
8
  import * as zustand_middleware from 'zustand/middleware';
@@ -27,64 +27,6 @@ interface ModalProps {
27
27
  }
28
28
  declare const MirantesModal: ({ isOpen, onClose, children, showCloseButton, hideCloseButton, closeOnClickOutside, className, header, footer, disableFullScreen, isLoading, size, showOverlay, asStacked, asSheet, }: ModalProps) => React__default.ReactPortal | null;
29
29
 
30
- type TLocale$1 = "pt" | "en" | "fr";
31
- type ToastVariant = "error" | "warning" | "info";
32
- interface IMirantesErrorHandlerConfig {
33
- onRedirect?: (path: string) => void;
34
- onLogout?: () => void;
35
- onRetry?: () => void;
36
- onCriticalError?: (title: string, message: string) => void;
37
- locale?: TLocale$1;
38
- }
39
-
40
- declare function handleError(error: unknown, toastFunctions?: {
41
- errorToast: (props: {
42
- title: string;
43
- message?: string;
44
- actionLabel?: string;
45
- onAction?: () => void;
46
- }) => void;
47
- warningToast: (props: {
48
- title: string;
49
- message?: string;
50
- }) => void;
51
- infoToast: (props: {
52
- title: string;
53
- message?: string;
54
- }) => void;
55
- }): void;
56
- declare function handleAxiosError(error: any, toastFunctions?: any): void;
57
- declare function handleGraphQLError(error: any, toastFunctions?: any): void;
58
-
59
- declare function useErrorHandler(): {
60
- handleError: (error: unknown) => void;
61
- handleAxiosError: (error: any) => void;
62
- handleGraphQLError: (error: any) => void;
63
- };
64
- declare function useAxiosErrorInterceptor(axiosInstance?: AxiosInstance): void;
65
-
66
- interface MirantesErrorBoundaryProps {
67
- children: React__default.ReactNode;
68
- locale?: TLocale$1;
69
- fallback?: React__default.ReactNode | ((error: Error, reset: () => void) => React__default.ReactNode);
70
- onError?: (error: Error, info: React__default.ErrorInfo) => void;
71
- }
72
- interface MirantesErrorBoundaryState {
73
- hasError: boolean;
74
- error: Error | null;
75
- }
76
- declare class MirantesErrorBoundary extends React__default.Component<MirantesErrorBoundaryProps, MirantesErrorBoundaryState> {
77
- constructor(props: MirantesErrorBoundaryProps);
78
- static getDerivedStateFromError(error: Error): MirantesErrorBoundaryState;
79
- componentDidCatch(error: Error, info: React__default.ErrorInfo): void;
80
- handleReset(): void;
81
- render(): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null | undefined;
82
- }
83
-
84
- declare function setErrorConfig(newConfig: IMirantesErrorHandlerConfig): void;
85
- declare function getErrorConfig(): IMirantesErrorHandlerConfig | null;
86
- declare function clearErrorConfig(): void;
87
-
88
30
  type ToastProps = {
89
31
  title: string;
90
32
  message?: ReactNode;
@@ -157,7 +99,7 @@ declare const useApiGetPage: (slug?: string) => {
157
99
  isGettingPage: boolean;
158
100
  };
159
101
 
160
- type TLocale = "pt" | "en" | "fr";
102
+ type TLocale$1 = "pt" | "en" | "fr";
161
103
  interface IMirantesFoundationProviderProps {
162
104
  children: ReactNode;
163
105
  Notification?: ReactNode;
@@ -204,7 +146,7 @@ interface IMirantesFoundationProviderProps {
204
146
  mirantesDomain?: string;
205
147
  openCageApiKey?: string;
206
148
  ocpSubscriptionKey?: string;
207
- locale?: TLocale;
149
+ locale?: TLocale$1;
208
150
  Link?: LinkComponent;
209
151
  usePathname?: UsePathname;
210
152
  user?: User$4;
@@ -235,7 +177,7 @@ interface IMirantesFoundationContext {
235
177
  socketRef?: RefObject<Socket | null>;
236
178
  mirantesDomain?: string;
237
179
  hostUrl?: string;
238
- locale?: TLocale;
180
+ locale?: TLocale$1;
239
181
  Link?: LinkComponent;
240
182
  usePathname?: UsePathname;
241
183
  user?: User$4;
@@ -593,31 +535,6 @@ declare function useSetChatVisibility(): {
593
535
  isPageContext: boolean;
594
536
  };
595
537
 
596
- type Language = 'pt' | 'en' | 'fr';
597
- interface DateOutput {
598
- day: string;
599
- month: string;
600
- year: string;
601
- formattedYMD: string | null;
602
- formattedDMY: string | null;
603
- isoString: string | null;
604
- }
605
- interface TripleInputDateProps {
606
- label?: string;
607
- required?: boolean;
608
- disabled?: boolean;
609
- error?: string;
610
- showDay?: boolean;
611
- showMonth?: boolean;
612
- showYear?: boolean;
613
- lang?: Language;
614
- value?: Date | string | null;
615
- minYear?: number;
616
- maxYear?: number;
617
- onChange?: (dateData: DateOutput) => void;
618
- }
619
- declare const TripleInputDate: ({ label, required, disabled, error, showDay, showMonth, showYear, lang, value, minYear, maxYear, onChange }: TripleInputDateProps) => React__default.JSX.Element;
620
-
621
538
  type ModalVariant = "expanded" | "minimized" | "center";
622
539
  interface ModalPosition {
623
540
  top?: string;
@@ -804,6 +721,31 @@ interface ExtendedDrawerProps extends IResponsiveDrawerProps {
804
721
  }
805
722
  declare function ResponsiveDrawer$1({ isOpen, onClose, title, header, footer, children, className, swipeable, }: ExtendedDrawerProps): React$1.JSX.Element;
806
723
 
724
+ type Language = "pt" | "en" | "fr";
725
+ interface DateOutput {
726
+ day: string;
727
+ month: string;
728
+ year: string;
729
+ formattedYMD: string | null;
730
+ formattedDMY: string | null;
731
+ isoString: string | null;
732
+ }
733
+ interface TripleInputDateProps {
734
+ label?: string;
735
+ required?: boolean;
736
+ disabled?: boolean;
737
+ error?: string;
738
+ showDay?: boolean;
739
+ showMonth?: boolean;
740
+ showYear?: boolean;
741
+ lang?: Language;
742
+ value?: Date | string | null;
743
+ minYear?: number;
744
+ maxYear?: number;
745
+ onChange?: (dateData: DateOutput) => void;
746
+ }
747
+ declare const TripleInputDate: ({ label, required, disabled, error, showDay, showMonth, showYear, lang, value, minYear, maxYear, onChange, }: TripleInputDateProps) => React__default.JSX.Element;
748
+
807
749
  interface AddressSuggestion {
808
750
  country?: string;
809
751
  city?: string;
@@ -1844,6 +1786,7 @@ type Post$1 = {
1844
1786
  linkPreview?: unknown;
1845
1787
  visibility?: string;
1846
1788
  sharedPost: Post$1;
1789
+ currentUserReaction?: string;
1847
1790
  title?: string;
1848
1791
  stats?: {
1849
1792
  reactionCount?: number;
@@ -2077,6 +2020,64 @@ declare const useJobTriggerStore: zustand.UseBoundStore<Omit<zustand.StoreApi<Jo
2077
2020
  };
2078
2021
  }>;
2079
2022
 
2023
+ type TLocale = "pt" | "en" | "fr";
2024
+ type ToastVariant = "error" | "warning" | "info";
2025
+ interface IMirantesErrorHandlerConfig {
2026
+ onRedirect?: (path: string) => void;
2027
+ onLogout?: () => void;
2028
+ onRetry?: () => void;
2029
+ onCriticalError?: (title: string, message: string) => void;
2030
+ locale?: TLocale;
2031
+ }
2032
+
2033
+ interface MirantesErrorBoundaryProps {
2034
+ children: React__default.ReactNode;
2035
+ locale?: TLocale;
2036
+ fallback?: React__default.ReactNode | ((error: Error, reset: () => void) => React__default.ReactNode);
2037
+ onError?: (error: Error, info: React__default.ErrorInfo) => void;
2038
+ }
2039
+ interface MirantesErrorBoundaryState {
2040
+ hasError: boolean;
2041
+ error: Error | null;
2042
+ }
2043
+ declare class MirantesErrorBoundary extends React__default.Component<MirantesErrorBoundaryProps, MirantesErrorBoundaryState> {
2044
+ constructor(props: MirantesErrorBoundaryProps);
2045
+ static getDerivedStateFromError(error: Error): MirantesErrorBoundaryState;
2046
+ componentDidCatch(error: Error, info: React__default.ErrorInfo): void;
2047
+ handleReset(): void;
2048
+ render(): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null | undefined;
2049
+ }
2050
+
2051
+ declare function setErrorConfig(newConfig: IMirantesErrorHandlerConfig): void;
2052
+ declare function getErrorConfig(): IMirantesErrorHandlerConfig | null;
2053
+ declare function clearErrorConfig(): void;
2054
+
2055
+ declare function handleError(error: unknown, toastFunctions?: {
2056
+ errorToast: (props: {
2057
+ title: string;
2058
+ message?: string;
2059
+ actionLabel?: string;
2060
+ onAction?: () => void;
2061
+ }) => void;
2062
+ warningToast: (props: {
2063
+ title: string;
2064
+ message?: string;
2065
+ }) => void;
2066
+ infoToast: (props: {
2067
+ title: string;
2068
+ message?: string;
2069
+ }) => void;
2070
+ }): void;
2071
+ declare function handleAxiosError(error: any, toastFunctions?: any): void;
2072
+ declare function handleGraphQLError(error: any, toastFunctions?: any): void;
2073
+
2074
+ declare function useErrorHandler(): {
2075
+ handleError: (error: unknown) => void;
2076
+ handleAxiosError: (error: any) => void;
2077
+ handleGraphQLError: (error: any) => void;
2078
+ };
2079
+ declare function useAxiosErrorInterceptor(axiosInstance?: AxiosInstance): void;
2080
+
2080
2081
  interface MirantesChatButtonProps {
2081
2082
  forMobile?: boolean;
2082
2083
  chatForPage?: boolean;
@@ -2250,8 +2251,9 @@ type AvatarRatingBadgeProps = {
2250
2251
  asPage?: boolean;
2251
2252
  isCommunity?: boolean;
2252
2253
  className?: string;
2254
+ slug?: string;
2253
2255
  };
2254
- declare function AvatarRatingBadge({ name, asPage, src, rating, isCommunity, className, }: AvatarRatingBadgeProps): React__default.JSX.Element;
2256
+ declare function AvatarRatingBadge({ name, asPage, src, rating, isCommunity, className, slug, }: AvatarRatingBadgeProps): React__default.JSX.Element;
2255
2257
 
2256
2258
  declare function RatingReviewsList({ variant, forPage, receiverPageId, receiverUserId, receiverCommunityId, inlinePreview, onOpenAllRatings, }: {
2257
2259
  variant?: "maximized" | "minimized";