remoraid 1.1.0 → 2.0.0

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.
@@ -0,0 +1,264 @@
1
+ import { PropsWithChildren as PropsWithChildren4, ReactNode as ReactNode5 } from "react";
2
+ import { AlertProps, IndicatorProps, MantineBreakpoint, MantineColorScheme, MantineSize, MantineTheme, ScrollAreaProps } from "@mantine/core";
3
+ import { Icon, IconProps } from "@tabler/icons-react";
4
+ import { ImageProps } from "next/image";
5
+ import { ReactNode } from "react";
6
+ type NavbarVariant = "minimal";
7
+ interface NavbarSettings {
8
+ hiddenPages: string[];
9
+ linkSize: string;
10
+ px: MantineSize | number;
11
+ py: MantineSize | number;
12
+ iconSize?: string | number;
13
+ }
14
+ interface UserExperience {
15
+ navbarVariant: NavbarVariant;
16
+ navbarSettings: NavbarSettings;
17
+ showWelcomeMessage: boolean;
18
+ }
19
+ type AlertCategory = "negative" | "neutral" | "positive";
20
+ interface RemoraidTheme {
21
+ complete: true;
22
+ transitionDurations: {
23
+ short: number
24
+ medium: number
25
+ long: number
26
+ };
27
+ breakpoints: {
28
+ buttonCollapse: MantineBreakpoint
29
+ badgeGroupCollapse: MantineBreakpoint
30
+ };
31
+ scrollAreaProps: ScrollAreaProps;
32
+ alertProps: { [C in AlertCategory] : AlertProps };
33
+ containerSize: MantineSize | number;
34
+ iconProps: {
35
+ tiny: IconProps
36
+ medium: IconProps
37
+ };
38
+ transparentBackground?: string;
39
+ primaryColor?: string;
40
+ spacingPx?: { [S in MantineSize] : number };
41
+ }
42
+ type RemoraidThemeCallback = (mantineTheme: MantineTheme, colorScheme: MantineColorScheme) => RemoraidTheme;
43
+ type PartialRemoraidTheme = Omit<Partial<RemoraidTheme>, "complete">;
44
+ type AppShellLogo = (props: Omit<ImageProps, "src" | "alt">) => ReactNode;
45
+ interface NavbarLink {
46
+ icon: Icon;
47
+ label: string;
48
+ href: string;
49
+ }
50
+ interface NavbarProps {
51
+ links: NavbarLink[];
52
+ settings?: NavbarSettings;
53
+ variant?: NavbarVariant;
54
+ linkIndicator?: (isHovering: boolean) => IndicatorProps;
55
+ logoIndicator?: (isHovering: boolean) => IndicatorProps;
56
+ onLogout?: () => void;
57
+ }
58
+ interface WidgetConfiguration {
59
+ widgetId: string;
60
+ name: string;
61
+ initialValue?: boolean;
62
+ allowUnregisteredPageUsage?: boolean;
63
+ }
64
+ interface PageConfiguration {
65
+ pageId: string;
66
+ name: string;
67
+ registerPageDirectly?: boolean;
68
+ }
69
+ declare const defaultNavbarSettings: { [V in NavbarVariant] : NavbarSettings };
70
+ declare const defaultUserExperience: UserExperience;
71
+ interface UserExperienceContext {
72
+ userExperience: UserExperience;
73
+ updateUserExperience: (p: UserExperience | ((prev: UserExperience) => UserExperience)) => void;
74
+ processedCookie: boolean;
75
+ }
76
+ declare const userExperienceCookieName = "remoraid-user-experience";
77
+ declare const useRemoraidUserExperience: () => UserExperienceContext;
78
+ interface UserExperienceProviderProps {
79
+ initialValue?: Partial<UserExperience>;
80
+ }
81
+ interface WidgetsContext {
82
+ widgets: {
83
+ [index: string]: {
84
+ [index: string]: {
85
+ name: string
86
+ selected: boolean
87
+ }
88
+ }
89
+ };
90
+ activeWidget: string | null;
91
+ updateActiveWidget: (widgetId: string | null) => void;
92
+ registerWidget: (pageId: string, widget: WidgetConfiguration) => void;
93
+ registerPage: (pageId: string, initialWidgets: WidgetConfiguration[]) => void;
94
+ isWidgetRegistered: (pageId: string, widgetId: string) => boolean;
95
+ isPageRegistered: (pageId: string) => boolean;
96
+ updateWidgetSelection: (pageId: string, widgetId: string, value: boolean) => void;
97
+ updateWidgetSelectionBulk: (pageId: string, selectedWidgetIds: string[]) => void;
98
+ isWidgetSelected: (pageId: string, widgetId: string) => boolean;
99
+ }
100
+ declare const useWidgets: () => WidgetsContext;
101
+ interface WidgetsProviderProps {}
102
+ import { MantineColorScheme as MantineColorScheme2, MantineTheme as MantineTheme2 } from "@mantine/core";
103
+ declare const createRemoraidTheme: (customTheme?: Partial<RemoraidTheme>, mantineTheme?: MantineTheme2, colorScheme?: MantineColorScheme2) => RemoraidTheme;
104
+ declare const useRemoraidTheme: () => RemoraidTheme;
105
+ interface ThemeProviderProps {
106
+ theme?: RemoraidTheme | RemoraidThemeCallback | PartialRemoraidTheme;
107
+ }
108
+ import { ReactCookieProps } from "react-cookie";
109
+ interface RemoraidProviderProps {
110
+ theme?: RemoraidTheme | RemoraidThemeCallback | PartialRemoraidTheme;
111
+ initialUserExperience?: Partial<UserExperience>;
112
+ componentsProps?: {
113
+ ThemeProvider?: ThemeProviderProps
114
+ UserExperienceProvider?: UserExperienceProviderProps
115
+ WidgetsProvider?: WidgetsProviderProps
116
+ CookiesProvider?: ReactCookieProps
117
+ };
118
+ }
119
+ declare function RemoraidProvider({ children, theme, initialUserExperience, componentsProps }: PropsWithChildren4<RemoraidProviderProps>): ReactNode5;
120
+ import { PropsWithChildren as PropsWithChildren5, ReactNode as ReactNode6 } from "react";
121
+ interface AppShellProps {
122
+ logo: AppShellLogo;
123
+ navbar: NavbarProps;
124
+ user?: {
125
+ name: string
126
+ } | null;
127
+ }
128
+ declare function AppShell({ children, logo, navbar, user }: PropsWithChildren5<AppShellProps>): ReactNode6;
129
+ import { MantineSize as MantineSize2 } from "@mantine/core";
130
+ import { ReactNode as ReactNode7 } from "react";
131
+ interface WidgetSelectionHeaderProps {
132
+ title?: string;
133
+ disabledWidgets?: string[];
134
+ mt?: MantineSize2 | number;
135
+ }
136
+ declare function WidgetSelectionHeader({ title, disabledWidgets, mt }: WidgetSelectionHeaderProps): ReactNode7;
137
+ import { ReactNode as ReactNode8 } from "react";
138
+ interface CloseButtonProps {
139
+ widgetId: string;
140
+ }
141
+ declare function CloseButton({ widgetId }: CloseButtonProps): ReactNode8;
142
+ import { BadgeProps as BadgeProps2, MantineBreakpoint as MantineBreakpoint2, MantineSize as MantineSize3, TooltipProps as TooltipProps2 } from "@mantine/core";
143
+ import { ReactNode as ReactNode10 } from "react";
144
+ import { BadgeProps, TooltipProps, TransitionProps } from "@mantine/core";
145
+ import { ReactNode as ReactNode9 } from "react";
146
+ interface BadgeMinimalProps {
147
+ label: string;
148
+ tooltip?: string;
149
+ mounted?: boolean;
150
+ componentsProps?: {
151
+ badge?: BadgeProps
152
+ transition?: Partial<Omit<TransitionProps, "mounted">>
153
+ tooltip?: TooltipProps
154
+ };
155
+ }
156
+ declare function BadgeMinimal(props: BadgeMinimalProps): ReactNode9;
157
+ interface BadgeGroupProps {
158
+ badges: (BadgeMinimalProps | ReactNode10)[];
159
+ gap?: MantineSize3 | number;
160
+ breakpoint?: MantineBreakpoint2;
161
+ componentsProps?: {
162
+ tooltip?: Partial<TooltipProps2>
163
+ cumulativeBadge?: Partial<Omit<BadgeProps2, "hiddenFrom" | "circle">>
164
+ };
165
+ }
166
+ declare function BadgeGroup({ badges, gap, breakpoint, componentsProps }: BadgeGroupProps): ReactNode10;
167
+ import { AlertProps as AlertProps2, MantineSize as MantineSize4, TransitionProps as TransitionProps2 } from "@mantine/core";
168
+ import { PropsWithChildren as PropsWithChildren6, ReactNode as ReactNode11 } from "react";
169
+ interface AlertMinimalProps {
170
+ category: AlertCategory;
171
+ title?: string;
172
+ text?: string;
173
+ onClose?: () => void;
174
+ mounted?: boolean;
175
+ mt?: MantineSize4 | number;
176
+ mb?: MantineSize4 | number;
177
+ componentsProps?: {
178
+ alert?: AlertProps2
179
+ transition?: Omit<TransitionProps2, "mounted">
180
+ };
181
+ }
182
+ declare function AlertMinimal({ children, title, category, text, onClose, mounted, mt, mb, componentsProps }: PropsWithChildren6<AlertMinimalProps>): ReactNode11;
183
+ import { ActionIconVariant, ButtonVariant, MantineBreakpoint as MantineBreakpoint3, TooltipProps as TooltipProps3 } from "@mantine/core";
184
+ import { Icon as Icon2 } from "@tabler/icons-react";
185
+ import { ReactNode as ReactNode12 } from "react";
186
+ interface ResponsiveButtonProps {
187
+ label: string;
188
+ icon?: Icon2;
189
+ onClick?: () => void;
190
+ breakpoint?: MantineBreakpoint3;
191
+ loading?: boolean;
192
+ variant?: Extract<ButtonVariant, ActionIconVariant>;
193
+ componentsProps?: {
194
+ tooltip?: Partial<TooltipProps3>
195
+ };
196
+ }
197
+ declare function ResponsiveButton(props: ResponsiveButtonProps): ReactNode12;
198
+ import { MantineSize as MantineSize5, PaperProps, TransitionProps as TransitionProps3 } from "@mantine/core";
199
+ import { PropsWithChildren as PropsWithChildren7, ReactNode as ReactNode13 } from "react";
200
+ interface WidgetWrapperComponentsProps {
201
+ container?: Partial<PaperProps>;
202
+ transition?: Partial<Omit<TransitionProps3, "mounted">>;
203
+ }
204
+ interface WidgetWrapperProps {
205
+ config: WidgetConfiguration;
206
+ mt?: MantineSize5 | number;
207
+ withCloseButton?: boolean;
208
+ componentsProps?: WidgetWrapperComponentsProps;
209
+ }
210
+ declare function WidgetWrapper({ children, config, mt, withCloseButton, componentsProps }: PropsWithChildren7<WidgetWrapperProps>): ReactNode13;
211
+ import { MantineSize as MantineSize6, LoaderProps } from "@mantine/core";
212
+ import { PropsWithChildren as PropsWithChildren8, ReactNode as ReactNode14 } from "react";
213
+ interface WidgetComponentsProps extends WidgetWrapperComponentsProps {
214
+ wrapper?: Partial<Omit<WidgetWrapperProps, "widgetId">>;
215
+ loader?: Partial<LoaderProps>;
216
+ badgeGroup?: Partial<BadgeGroupProps>;
217
+ }
218
+ interface WidgetProps {
219
+ id: string;
220
+ title: string;
221
+ config?: Partial<Omit<WidgetConfiguration, "widgetId">>;
222
+ badges?: (BadgeMinimalProps | ReactNode14)[];
223
+ buttons?: (ResponsiveButtonProps | ReactNode14)[];
224
+ alerts?: (AlertMinimalProps | ReactNode14)[];
225
+ gaps?: MantineSize6 | number | {
226
+ badges?: MantineSize6 | number
227
+ buttons?: MantineSize6 | number
228
+ alerts?: MantineSize6 | number
229
+ };
230
+ loading?: boolean;
231
+ mt?: MantineSize6 | number;
232
+ componentsProps?: WidgetComponentsProps;
233
+ }
234
+ declare function Widget({ children, id, config, title, badges, buttons, alerts, gaps, loading, mt, componentsProps }: PropsWithChildren8<WidgetProps>): ReactNode14;
235
+ import { ContainerProps, MantineSize as MantineSize7 } from "@mantine/core";
236
+ import { PropsWithChildren as PropsWithChildren9, ReactNode as ReactNode15 } from "react";
237
+ interface PageProps {
238
+ name?: string;
239
+ config?: Partial<Omit<PageConfiguration, "name">>;
240
+ pt?: MantineSize7 | number;
241
+ componentsProps?: {
242
+ container?: ContainerProps
243
+ };
244
+ }
245
+ declare function Page({ children, name, config, pt, componentsProps }: PropsWithChildren9<PageProps>): ReactNode15;
246
+ import { PropsWithChildren as PropsWithChildren10, ReactNode as ReactNode16 } from "react";
247
+ import { PageProps as PageProps2 } from "..";
248
+ interface NotFoundPageProps {
249
+ message?: string;
250
+ componentsProps?: {
251
+ page?: PageProps2
252
+ };
253
+ }
254
+ declare function NotFoundPage({ children, message, componentsProps }: PropsWithChildren10<NotFoundPageProps>): ReactNode16;
255
+ import { MantineSize as MantineSize8 } from "@mantine/core";
256
+ import { PropsWithChildren as PropsWithChildren11, ReactNode as ReactNode17 } from "react";
257
+ interface EnvironmentShellProps {
258
+ vars: string[];
259
+ message?: string;
260
+ m?: MantineSize8 | number;
261
+ mt?: MantineSize8 | number;
262
+ }
263
+ declare function EnvironmentShell({ children, vars, message, m, mt }: PropsWithChildren11<EnvironmentShellProps>): ReactNode17;
264
+ export { userExperienceCookieName, useWidgets, useRemoraidUserExperience, useRemoraidTheme, defaultUserExperience, defaultNavbarSettings, createRemoraidTheme, WidgetWrapper, WidgetSelectionHeader, Widget, ResponsiveButton, RemoraidProvider, Page, NotFoundPage, EnvironmentShell, CloseButton, BadgeMinimal, BadgeGroup, AppShell, AlertMinimal };