@ssplib/react-components 0.0.329 → 0.0.331

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.
@@ -1,4 +1,5 @@
1
- export default function NavBar({ links, title, img, pos, next, el, menuItems, paddingBottom, logoutMsg, logoutFunc, ...props }: {
1
+ import { LoginOptions, LogoutOptions } from '../../types/auth';
2
+ export default function NavBar({ links, title, img, pos, next, el, menuItems, paddingBottom, logoutMsg, logoutFunc, loginOptions, logoutOptions, ...props }: {
2
3
  links: {
3
4
  name: string;
4
5
  path: string;
@@ -10,6 +11,11 @@ export default function NavBar({ links, title, img, pos, next, el, menuItems, pa
10
11
  next?: boolean;
11
12
  el?: JSX.Element;
12
13
  logoutMsg?: string;
14
+ /** @deprecated Use logoutOptions.onBeforeLogout instead */
13
15
  logoutFunc?: () => Promise<void>;
14
16
  pos?: 'fixed' | 'inherit';
17
+ /** Opções para configurar o comportamento do login (redirectUri, callbacks, etc) */
18
+ loginOptions?: LoginOptions;
19
+ /** Opções para configurar o comportamento do logout (redirectUri, callbacks, etc) */
20
+ logoutOptions?: LogoutOptions;
15
21
  }): JSX.Element;
@@ -1,4 +1,5 @@
1
- export default function TabNavBar({ links, title, img, pos, next, el, menuItems, color, route, paddingBottom, logoutMsg, customBgColor, logoutFunc, ...props }: {
1
+ import { LoginOptions, LogoutOptions } from '../../types/auth';
2
+ export default function TabNavBar({ links, title, img, pos, next, el, menuItems, color, route, paddingBottom, logoutMsg, customBgColor, logoutFunc, loginOptions, logoutOptions, ...props }: {
2
3
  links: {
3
4
  name: string;
4
5
  path: string;
@@ -12,7 +13,12 @@ export default function TabNavBar({ links, title, img, pos, next, el, menuItems,
12
13
  next?: boolean;
13
14
  el?: JSX.Element;
14
15
  logoutMsg?: string;
16
+ /** @deprecated Use logoutOptions.onBeforeLogout instead */
15
17
  logoutFunc?: () => Promise<void>;
16
18
  pos?: 'fixed' | 'inherit';
17
19
  customBgColor?: string;
20
+ /** Opções para configurar o comportamento do login (redirectUri, callbacks, etc) */
21
+ loginOptions?: LoginOptions;
22
+ /** Opções para configurar o comportamento do logout (redirectUri, callbacks, etc) */
23
+ logoutOptions?: LogoutOptions;
18
24
  }): JSX.Element;
@@ -20,6 +20,8 @@ interface KeycloakAuthProviderProps {
20
20
  onAuthSuccess?: (user: User) => void;
21
21
  /** Callback executado quando autenticação falha */
22
22
  onAuthError?: (error: Error) => void;
23
+ /** Callback executado quando logout é concluído com sucesso (após o redirect de volta) */
24
+ onLogoutSuccess?: () => void;
23
25
  /** Habilita logs de debug (apenas em desenvolvimento) */
24
26
  enableDebugLogs?: boolean;
25
27
  }
@@ -32,5 +34,5 @@ interface KeycloakAuthProviderProps {
32
34
  * - Login e logout com callbacks personalizáveis
33
35
  * - Verificação de roles
34
36
  */
35
- export declare function KeycloakAuthProvider({ url, realm, clientId, children, type, resource_name, redirectUri, onAuthSuccess, onAuthError, enableDebugLogs, }: KeycloakAuthProviderProps): JSX.Element;
37
+ export declare function KeycloakAuthProvider({ url, realm, clientId, children, type, resource_name, redirectUri, onAuthSuccess, onAuthError, onLogoutSuccess, enableDebugLogs, }: KeycloakAuthProviderProps): JSX.Element;
36
38
  export {};