@codebit-programando-solucoes/codebit-web-antd 1.1.16 → 1.1.21

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.css CHANGED
@@ -1,3 +1,63 @@
1
+ .listCard-ISftFd {
2
+ width: 100%;
3
+ height: 100%;
4
+ }
5
+
6
+ .listCard-ISftFd .headerRow-UsZAzP {
7
+ margin-bottom: var(--antd-padding-lg);
8
+ }
9
+
10
+ .listCard-ISftFd .headerRow-UsZAzP .actions-ig53s2 {
11
+ justify-content: flex-end;
12
+ gap: var(--antd-margin-xs);
13
+ display: flex;
14
+ }
15
+
16
+ .listCard-ISftFd .headerRow-UsZAzP h4 {
17
+ margin: 0;
18
+ }
19
+
20
+ .listCard-ISftFd .filtersRow-f3Xk5a {
21
+ margin-bottom: var(--antd-padding-lg);
22
+ }
23
+
24
+ .listCard-ISftFd .filtersRow-f3Xk5a .ant-col > * {
25
+ width: 100%;
26
+ }
27
+
28
+ .listCard-ISftFd .ant-card-body {
29
+ flex-direction: column;
30
+ width: 100%;
31
+ height: 100%;
32
+ display: flex;
33
+ }
34
+
35
+ .listCard-ISftFd .expandArea-czOoFS {
36
+ background-color: var(--antd-color-bg-container);
37
+ flex: 1;
38
+ position: relative;
39
+ overflow: hidden;
40
+ }
41
+
42
+ .listCard-ISftFd .ant-pagination {
43
+ margin: 0 !important;
44
+ }
45
+
46
+ .listCard-ISftFd .ant-table-pagination {
47
+ padding-top: var(--antd-padding-lg);
48
+ background: var(--antd-color-bg-container);
49
+ }
50
+
51
+ .tableContainer-EhNwOm {
52
+ flex: 1;
53
+ width: 100%;
54
+ height: 100%;
55
+ }
56
+
57
+ .tableContainer-EhNwOm .ant-table-body {
58
+ height: 100vh;
59
+ }
60
+
1
61
  .layout-mL5o6I {
2
62
  height: 100vh;
3
63
  position: fixed;
@@ -113,66 +173,6 @@
113
173
  position: relative;
114
174
  }
115
175
 
116
- .listCard-ISftFd {
117
- width: 100%;
118
- height: 100%;
119
- }
120
-
121
- .listCard-ISftFd .headerRow-UsZAzP {
122
- margin-bottom: var(--antd-padding-lg);
123
- }
124
-
125
- .listCard-ISftFd .headerRow-UsZAzP .actions-ig53s2 {
126
- justify-content: flex-end;
127
- gap: var(--antd-margin-xs);
128
- display: flex;
129
- }
130
-
131
- .listCard-ISftFd .headerRow-UsZAzP h4 {
132
- margin: 0;
133
- }
134
-
135
- .listCard-ISftFd .filtersRow-f3Xk5a {
136
- margin-bottom: var(--antd-padding-lg);
137
- }
138
-
139
- .listCard-ISftFd .filtersRow-f3Xk5a .ant-col > * {
140
- width: 100%;
141
- }
142
-
143
- .listCard-ISftFd .ant-card-body {
144
- flex-direction: column;
145
- width: 100%;
146
- height: 100%;
147
- display: flex;
148
- }
149
-
150
- .listCard-ISftFd .expandArea-czOoFS {
151
- background-color: var(--antd-color-bg-container);
152
- flex: 1;
153
- position: relative;
154
- overflow: hidden;
155
- }
156
-
157
- .listCard-ISftFd .ant-pagination {
158
- margin: 0 !important;
159
- }
160
-
161
- .listCard-ISftFd .ant-table-pagination {
162
- padding-top: var(--antd-padding-lg);
163
- background: var(--antd-color-bg-container);
164
- }
165
-
166
- .tableContainer-EhNwOm {
167
- flex: 1;
168
- width: 100%;
169
- height: 100%;
170
- }
171
-
172
- .tableContainer-EhNwOm .ant-table-body {
173
- height: 100vh;
174
- }
175
-
176
176
  .containerRow-lnjnDt {
177
177
  min-height: 100vh;
178
178
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './components/index';
2
2
  export * from './contexts/index';
3
3
  export * from './public-pages/index';
4
- export * from './theme';
4
+ export * from './hooks';
@@ -1,35 +1,47 @@
1
- import * as React from 'react';
2
- import { LocalLoginConfContext } from './Login';
3
-
4
- /** Props for the ChangePassword component (none required) */
5
- export interface ChangePasswordProps {
6
- /** Validates password reset token in the current context */
7
- checkToken: (context: LocalLoginConfContext) => Promise<Boolean>;
8
-
9
- /** Submits new password using validated token from context */
10
- submitChangePassword?: (
11
- password: string,
12
- context: LocalLoginConfContext,
13
- ) => Promise<LocalLoginChangePasswordResult>;
14
- }
1
+ import React = require('react');
15
2
 
3
+ /**
4
+ * Possible results for password change operations.
5
+ *
6
+ * @remarks
7
+ * Represents the outcome of a password change attempt.
8
+ */
16
9
  export enum LocalLoginChangePasswordResult {
17
10
  INVALID_TOKEN = 'INVALID_TOKEN',
18
11
  SUCCESS = 'SUCCESS',
19
12
  }
20
13
 
21
14
  /**
22
- * React component for password change functionality.
15
+ * Context interface for login flow navigation and parameters.
23
16
  *
24
- * Handles the complete password reset workflow including:
17
+ * @property navigate - Function to redirect to different routes
18
+ * @property params - URL parameters from React Router
19
+ */
20
+ export interface LocalLoginConfContext {
21
+ navigate: (to: string) => void;
22
+ params: Record<string, string | undefined>;
23
+ }
24
+
25
+ /**
26
+ * Props for the ChangePassword component.
25
27
  *
26
- * - Token validation
27
- * - Password strength validation
28
- * - Form submission
29
- * - Success/error messaging
28
+ * @property navigateToLogin - Callback to redirect to login screen
29
+ * @property checkToken - Validates the password reset token
30
+ * @property submitChangePassword - Submits new password with token validation
31
+ */
32
+ export interface ChangePasswordProps {
33
+ navigateToLogin: (context: LocalLoginConfContext) => Promise<void>;
34
+ checkToken: (context: LocalLoginConfContext) => Promise<boolean>;
35
+ submitChangePassword: (
36
+ password: string,
37
+ context: LocalLoginConfContext,
38
+ ) => Promise<LocalLoginChangePasswordResult>;
39
+ }
40
+
41
+ /**
42
+ * Password change interface component.
30
43
  *
31
- * @param props - Component props (none required)
32
- * @returns JSX element with password change interface
33
- * @throws Error if used outside CodebitConfigProvider context
44
+ * @remarks
45
+ * Handles user password reset with token validation and form submission. Requires implementation of all callback functions for authentication flow.
34
46
  */
35
- export function ChangePassword(props: ChangePasswordProps): React.JSX.Element;
47
+ export declare const ChangePassword: React.FC<ChangePasswordProps>;
@@ -1,37 +1,45 @@
1
1
  import * as React from 'react';
2
- import { LocalLoginConfContext } from './Login';
3
2
 
4
- /** Props for the ForgotPassword component */
3
+ /** Enumeration of possible statuses for password recovery operations. */
4
+ export declare enum LocalLoginRecoveryPasswordResult {
5
+ INVALID_EMAIL = 'INVALID_EMAIL',
6
+ RECAPTCHA_VALIDATION_FAIL = 'RECAPTCHA_VALIDATION_FAIL',
7
+ SUCCESS = 'SUCCESS',
8
+ }
9
+
10
+ /** Context object used for navigation within authentication flows. Contains navigation functions to redirect between authentication screens. */
11
+ export interface LocalLoginConfContext {
12
+ /**
13
+ * Redirects to the specified route path.
14
+ *
15
+ * @param path - Target navigation path
16
+ * @param ...args - Additional navigation parameters
17
+ */
18
+ navigate: (path: string, ...args: any[]) => void;
19
+ }
20
+
21
+ /** Properties for the ForgotPassword component. */
5
22
  export interface ForgotPasswordProps {
6
- /** Navigates to the login screen when authentication is required */
7
- navigateToLogin: (context: LocalLoginConfContext) => Promise<void>;
23
+ /**
24
+ * Optional callback to handle navigation back to login screen.
25
+ *
26
+ * @param context - Navigation context for redirects
27
+ * @returns Promise resolving when navigation completes
28
+ */
29
+ navigateToLogin?: (context: LocalLoginConfContext) => Promise<void>;
8
30
 
9
- /** Submits password recovery request for the specified email */
10
- submitRecoveryPassword?: (
31
+ /**
32
+ * Submits password recovery request for specified email.
33
+ *
34
+ * @param email - User's email address for recovery
35
+ * @param context - Navigation context for post-submission actions
36
+ * @returns Promise with recovery operation status
37
+ */
38
+ submitRecoveryPassword: (
11
39
  email: string,
12
40
  context: LocalLoginConfContext,
13
41
  ) => Promise<LocalLoginRecoveryPasswordResult>;
14
42
  }
15
43
 
16
- export enum LocalLoginRecoveryPasswordResult {
17
- INVALID_EMAIL = 'INVALID_EMAIL',
18
- RECAPTCHA_VALIDATION_FAIL = 'RECAPTCHA_VALIDATION_FAIL',
19
- SUCCESS = 'SUCCESS',
20
- }
21
-
22
- /**
23
- * Password reset component for initiating account recovery.
24
- *
25
- * Handles the complete password reset workflow:
26
- *
27
- * - Email address input
28
- * - Reset link request
29
- * - Success/error messaging
30
- *
31
- * Requires usage within `CodebitConfigProvider` context to access authentication settings.
32
- *
33
- * @param props - Component props
34
- * @returns JSX element with password reset interface
35
- * @throws Error if used outside CodebitConfigProvider context
36
- */
37
- export function ForgotPassword(props: ForgotPasswordProps): React.JSX.Element;
44
+ /** Renders a password recovery form with email validation and submission handling. Integrates with authentication flows to manage state transitions. */
45
+ export declare const ForgotPassword: React.FC<ForgotPasswordProps>;
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
2
 
3
- /** Props for the HandleError component */
4
3
  export interface HandleErrorProps {
5
- /** Optional title to display above the error message */
4
+ /** Optional title to display above the error message. */
6
5
  title?: string;
7
6
  }
8
7
 
@@ -12,6 +11,6 @@ export interface HandleErrorProps {
12
11
  * Displays an error page based on the route error status (404, 403, 500, or generic error). Provides a button to navigate back to the home page.
13
12
  *
14
13
  * @param props - Component props
15
- * @returns JSX.Element - Error page layout
14
+ * @returns React JSX element representing the error page layout
16
15
  */
17
16
  export function HandleError(props: HandleErrorProps): React.JSX.Element;
@@ -1,54 +1,57 @@
1
1
  import * as React from 'react';
2
- import { NavigateFunction, Params } from 'react-router';
3
2
 
3
+ /** Enumeration of possible authentication result codes. */
4
4
  export enum LocalLoginAuthenticationResult {
5
- /** Email is invalid or not registered */
6
5
  INVALID_EMAIL = 'INVALID_EMAIL',
7
- /** Password is incorrect */
8
6
  INVALID_PASSWORD = 'INVALID_PASSWORD',
9
- /** Email or password combination is invalid */
10
7
  INVALID_EMAIL_OR_PASSWORD = 'INVALID_EMAIL_OR_PASSWORD',
11
- /** ReCAPTCHA validation failed */
12
8
  RECAPTCHA_VALIDATION_FAIL = 'RECAPTCHA_VALIDATION_FAIL',
13
- /** User account is disabled */
14
9
  USER_DISABLED = 'USER_DISABLED',
15
- /** Authentication was successful */
16
10
  SUCCESS = 'SUCCESS',
17
11
  }
18
12
 
19
- /** Context for local login configuration */
20
- export type LocalLoginConfContext = {
21
- navigate: NavigateFunction;
22
- params?: Readonly<Params<string>>;
23
- };
13
+ /** Context object passed to navigation and authentication callback functions. */
14
+ export interface LocalLoginConfContext {
15
+ /**
16
+ * Function to navigate to another route.
17
+ *
18
+ * @param path - The path to navigate to.
19
+ */
20
+ navigate: (path: string) => void;
21
+ }
24
22
 
25
- /** Props for the Login component */
23
+ /** Props for the Login component. */
26
24
  export interface LoginProps {
27
- /** Optional title for the login screen (overrides localized default) */
25
+ /** Optional title for the login container. */
28
26
  title?: string | React.ReactNode;
29
-
30
- /** OAuth callback URL for authentication */
27
+ /** URL for the OAuth callback when using Google login. */
31
28
  oauthCallbackUrl?: string;
32
-
33
- /** Function to authenticate a local user */
29
+ /**
30
+ * Callback function to navigate to password recovery flow.
31
+ *
32
+ * @param context - Navigation context for route handling
33
+ */
34
+ navigateToForgotPassword?: (
35
+ context: LocalLoginConfContext,
36
+ ) => Promise<void>;
37
+ /**
38
+ * Handles local user authentication process.
39
+ *
40
+ * @param email - User's email address
41
+ * @param password - User's password
42
+ * @param context - Navigation context
43
+ * @returns Authentication status result
44
+ */
34
45
  submitAuthenticateLocalUser?: (
35
46
  email: string,
36
47
  password: string,
37
48
  context: LocalLoginConfContext,
38
49
  ) => Promise<LocalLoginAuthenticationResult>;
39
-
40
- /** Optional function to initiate password recovery process. When omitted, password reset functionality will be disabled. */
41
- navigateToForgotPassword?: (
42
- context: LocalLoginConfContext,
43
- ) => Promise<void>;
44
50
  }
45
51
 
46
52
  /**
47
- * Login component that renders both Google OAuth and email/password login options.
48
- *
49
- * This component displays both Google login button and local authentication form (when configured), requiring usage within CodebitConfigProvider to access authentication settings.
53
+ * Login component providing both local and OAuth authentication methods.
50
54
  *
51
- * @param props - Component props
52
- * @returns JSX element with complete login interface
55
+ * @param props - Login configuration parameters
53
56
  */
54
- export function Login(props: LoginProps): React.JSX.Element;
57
+ export declare const Login: React.FunctionComponent<LoginProps>;
@@ -1,20 +1,20 @@
1
1
  import * as React from 'react';
2
2
 
3
- /** Props for the LoginContainer component */
4
- export interface LoginContainerProps {
5
- /** Title to display in the login container */
6
- title: string | React.ReactNode;
7
- /** Child components to render inside the container */
8
- children?: React.ReactNode;
9
- }
10
-
11
3
  /**
12
4
  * Container component for login screens.
13
5
  *
14
- * Provides a centered card layout with theme toggle and title display. It must be used within a CodebitConfigProvider context to access theme settings.
6
+ * Provides a centered card layout with theme toggle and title display. Must be used within a CodebitConfigProvider context to access theme settings.
15
7
  *
16
- * @param props - Component props
17
- * @returns JSX.Element - Login container layout
18
- * @throws Error if used outside CodebitConfigProvider context
8
+ * @param props - Configuration for the login container
9
+ * @returns JSX element for login layout
10
+ * @throws {Error} When used outside of CodebitThemeContext
19
11
  */
20
- export function LoginContainer(props: LoginContainerProps): React.JSX.Element;
12
+ export function LoginContainer(props: LoginContainerProps): React.ReactElement;
13
+
14
+ /** Props interface for LoginContainer component */
15
+ export interface LoginContainerProps {
16
+ /** Title to display in the login container (string or React node) */
17
+ title: string | React.ReactNode;
18
+ /** Child components to render inside the container */
19
+ children?: React.ReactNode;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebit-programando-solucoes/codebit-web-antd",
3
- "version": "1.1.16",
3
+ "version": "1.1.21",
4
4
  "main": "./dist/index.cjs",
5
5
  "type": "module",
6
6
  "types": "./src/index.d.ts",
@@ -20,15 +20,19 @@
20
20
  "./dist/*.css": "./dist/*.css"
21
21
  },
22
22
  "dependencies": {
23
- "@ant-design/icons": "^6.1.0",
24
- "@codebit-programando-solucoes/codebit-web": "",
25
- "@sentry/react": "^10.26.0",
26
- "antd": "^5.28.1",
27
23
  "i18next": "^25.6.2",
28
- "prop-types": "^15.8.1",
29
- "react-i18next": "^16.3.5",
30
- "react-router": "7.12.0",
31
- "sass": "^1.94.0"
24
+ "react-i18next": "^16.3.5"
25
+ },
26
+ "peerDependencies": {
27
+ "@codebit-programando-solucoes/codebit-web": ">=1.1.6",
28
+ "react": ">=19.2.0",
29
+ "react-dom": ">=19.2.0",
30
+ "react-router": ">=7.12.0",
31
+ "prop-types": ">=15.8.1",
32
+ "antd": ">=5.29.3",
33
+ "@ant-design/icons": ">=6.1.0",
34
+ "@sentry/react": ">=10.26.0",
35
+ "sass": ">=1.94.0"
32
36
  },
33
37
  "devDependencies": {
34
38
  "@eslint/js": "^9.39.2",
@@ -36,8 +40,6 @@
36
40
  "@rsbuild/plugin-sass": "1.4.1",
37
41
  "@rslib/core": "^0.18.0",
38
42
  "@swc/core": "^1.13.5",
39
- "react": "^19.2.0",
40
- "react-dom": "^19.2.0",
41
43
  "cross-env": "^10.0.0",
42
44
  "css-loader": "^7.1.2",
43
45
  "del-cli": "^6.0.0",
@@ -1,5 +0,0 @@
1
- import { ConfigProviderProps } from 'antd';
2
- import { FC } from 'react';
3
-
4
- /** A theme provider component that configures Ant Design with Codebit's custom theme Handles both light and dark mode variants */
5
- export declare const CodebitTheme: FC<ConfigProviderProps>;
@@ -1 +0,0 @@
1
- export * from './CodebitTheme';