analytica-frontend-lib 1.0.77 → 1.0.78
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/Auth/useApiConfig/index.d.mts +43 -0
- package/dist/Auth/useApiConfig/index.d.ts +43 -0
- package/dist/Auth/useApiConfig/index.js +39 -0
- package/dist/Auth/useApiConfig/index.js.map +1 -0
- package/dist/Auth/useApiConfig/index.mjs +14 -0
- package/dist/Auth/useApiConfig/index.mjs.map +1 -0
- package/dist/NotFound/index.d.mts +58 -0
- package/dist/NotFound/index.d.ts +58 -0
- package/dist/NotFound/index.js +233 -0
- package/dist/NotFound/index.js.map +1 -0
- package/dist/NotFound/index.mjs +210 -0
- package/dist/NotFound/index.mjs.map +1 -0
- package/dist/index.css +39 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +125 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +123 -12
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +39 -0
- package/dist/styles.css.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definition for API client with get method
|
|
3
|
+
*
|
|
4
|
+
* @template T - Type extending object with get method
|
|
5
|
+
*/
|
|
6
|
+
type ApiClient<T = unknown> = {
|
|
7
|
+
get: (endpoint: string, config?: T) => Promise<unknown>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Creates a memoized API configuration object compatible with useUrlAuthentication
|
|
11
|
+
*
|
|
12
|
+
* This hook wraps an API client instance to create a consistent interface
|
|
13
|
+
* for the useUrlAuthentication hook, ensuring proper memoization to prevent
|
|
14
|
+
* unnecessary re-renders.
|
|
15
|
+
*
|
|
16
|
+
* @template T - Generic type for API client configuration
|
|
17
|
+
* @param {ApiClient<T>} api - Axios instance or any API client with a get method
|
|
18
|
+
* @returns {object} Memoized API configuration object with get method
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { useApiConfig } from 'analytica-frontend-lib';
|
|
23
|
+
* import { useApi } from './services/apiService';
|
|
24
|
+
*
|
|
25
|
+
* function App() {
|
|
26
|
+
* const api = useApi();
|
|
27
|
+
* const apiConfig = useApiConfig(api);
|
|
28
|
+
*
|
|
29
|
+
* useUrlAuthentication({
|
|
30
|
+
* setTokens,
|
|
31
|
+
* setSessionInfo,
|
|
32
|
+
* setSelectedProfile,
|
|
33
|
+
* api: apiConfig,
|
|
34
|
+
* endpoint: '/auth/session-info',
|
|
35
|
+
* });
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
declare function useApiConfig<T = unknown>(api: ApiClient<T>): {
|
|
40
|
+
get: (endpoint: string, config: unknown) => Promise<unknown>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { useApiConfig };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definition for API client with get method
|
|
3
|
+
*
|
|
4
|
+
* @template T - Type extending object with get method
|
|
5
|
+
*/
|
|
6
|
+
type ApiClient<T = unknown> = {
|
|
7
|
+
get: (endpoint: string, config?: T) => Promise<unknown>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Creates a memoized API configuration object compatible with useUrlAuthentication
|
|
11
|
+
*
|
|
12
|
+
* This hook wraps an API client instance to create a consistent interface
|
|
13
|
+
* for the useUrlAuthentication hook, ensuring proper memoization to prevent
|
|
14
|
+
* unnecessary re-renders.
|
|
15
|
+
*
|
|
16
|
+
* @template T - Generic type for API client configuration
|
|
17
|
+
* @param {ApiClient<T>} api - Axios instance or any API client with a get method
|
|
18
|
+
* @returns {object} Memoized API configuration object with get method
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { useApiConfig } from 'analytica-frontend-lib';
|
|
23
|
+
* import { useApi } from './services/apiService';
|
|
24
|
+
*
|
|
25
|
+
* function App() {
|
|
26
|
+
* const api = useApi();
|
|
27
|
+
* const apiConfig = useApiConfig(api);
|
|
28
|
+
*
|
|
29
|
+
* useUrlAuthentication({
|
|
30
|
+
* setTokens,
|
|
31
|
+
* setSessionInfo,
|
|
32
|
+
* setSelectedProfile,
|
|
33
|
+
* api: apiConfig,
|
|
34
|
+
* endpoint: '/auth/session-info',
|
|
35
|
+
* });
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
declare function useApiConfig<T = unknown>(api: ApiClient<T>): {
|
|
40
|
+
get: (endpoint: string, config: unknown) => Promise<unknown>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { useApiConfig };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/Auth/useApiConfig.ts
|
|
21
|
+
var useApiConfig_exports = {};
|
|
22
|
+
__export(useApiConfig_exports, {
|
|
23
|
+
useApiConfig: () => useApiConfig
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(useApiConfig_exports);
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
function useApiConfig(api) {
|
|
28
|
+
return (0, import_react.useMemo)(
|
|
29
|
+
() => ({
|
|
30
|
+
get: (endpoint, config) => api.get(endpoint, config)
|
|
31
|
+
}),
|
|
32
|
+
[api]
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
useApiConfig
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Auth/useApiConfig.ts"],"sourcesContent":["import { useMemo } from 'react';\n\n/**\n * Type definition for API client with get method\n *\n * @template T - Type extending object with get method\n */\ntype ApiClient<T = unknown> = {\n get: (endpoint: string, config?: T) => Promise<unknown>;\n};\n\n/**\n * Creates a memoized API configuration object compatible with useUrlAuthentication\n *\n * This hook wraps an API client instance to create a consistent interface\n * for the useUrlAuthentication hook, ensuring proper memoization to prevent\n * unnecessary re-renders.\n *\n * @template T - Generic type for API client configuration\n * @param {ApiClient<T>} api - Axios instance or any API client with a get method\n * @returns {object} Memoized API configuration object with get method\n *\n * @example\n * ```typescript\n * import { useApiConfig } from 'analytica-frontend-lib';\n * import { useApi } from './services/apiService';\n *\n * function App() {\n * const api = useApi();\n * const apiConfig = useApiConfig(api);\n *\n * useUrlAuthentication({\n * setTokens,\n * setSessionInfo,\n * setSelectedProfile,\n * api: apiConfig,\n * endpoint: '/auth/session-info',\n * });\n * }\n * ```\n */\nexport function useApiConfig<T = unknown>(api: ApiClient<T>) {\n return useMemo(\n () => ({\n get: (endpoint: string, config: unknown) =>\n api.get(endpoint, config as T),\n }),\n [api]\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwB;AAyCjB,SAAS,aAA0B,KAAmB;AAC3D,aAAO;AAAA,IACL,OAAO;AAAA,MACL,KAAK,CAAC,UAAkB,WACtB,IAAI,IAAI,UAAU,MAAW;AAAA,IACjC;AAAA,IACA,CAAC,GAAG;AAAA,EACN;AACF;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/components/Auth/useApiConfig.ts
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
function useApiConfig(api) {
|
|
4
|
+
return useMemo(
|
|
5
|
+
() => ({
|
|
6
|
+
get: (endpoint, config) => api.get(endpoint, config)
|
|
7
|
+
}),
|
|
8
|
+
[api]
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
useApiConfig
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Auth/useApiConfig.ts"],"sourcesContent":["import { useMemo } from 'react';\n\n/**\n * Type definition for API client with get method\n *\n * @template T - Type extending object with get method\n */\ntype ApiClient<T = unknown> = {\n get: (endpoint: string, config?: T) => Promise<unknown>;\n};\n\n/**\n * Creates a memoized API configuration object compatible with useUrlAuthentication\n *\n * This hook wraps an API client instance to create a consistent interface\n * for the useUrlAuthentication hook, ensuring proper memoization to prevent\n * unnecessary re-renders.\n *\n * @template T - Generic type for API client configuration\n * @param {ApiClient<T>} api - Axios instance or any API client with a get method\n * @returns {object} Memoized API configuration object with get method\n *\n * @example\n * ```typescript\n * import { useApiConfig } from 'analytica-frontend-lib';\n * import { useApi } from './services/apiService';\n *\n * function App() {\n * const api = useApi();\n * const apiConfig = useApiConfig(api);\n *\n * useUrlAuthentication({\n * setTokens,\n * setSessionInfo,\n * setSelectedProfile,\n * api: apiConfig,\n * endpoint: '/auth/session-info',\n * });\n * }\n * ```\n */\nexport function useApiConfig<T = unknown>(api: ApiClient<T>) {\n return useMemo(\n () => ({\n get: (endpoint: string, config: unknown) =>\n api.get(endpoint, config as T),\n }),\n [api]\n );\n}\n"],"mappings":";AAAA,SAAS,eAAe;AAyCjB,SAAS,aAA0B,KAAmB;AAC3D,SAAO;AAAA,IACL,OAAO;AAAA,MACL,KAAK,CAAC,UAAkB,WACtB,IAAI,IAAI,UAAU,MAAW;AAAA,IACjC;AAAA,IACA,CAAC,GAAG;AAAA,EACN;AACF;","names":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Props interface for the NotFound component
|
|
5
|
+
*
|
|
6
|
+
* @interface NotFoundProps
|
|
7
|
+
* @property {string} [title] - Custom title text (default: "Página não encontrada")
|
|
8
|
+
* @property {string} [description] - Custom description text
|
|
9
|
+
* @property {string} [buttonText] - Custom button text (default: "Voltar")
|
|
10
|
+
* @property {() => void} [onButtonClick] - Callback function for button click
|
|
11
|
+
* @property {string} [className] - Additional CSS classes for the container
|
|
12
|
+
* @property {'404' | '500' | 'custom'} [errorType] - Type of error to display (default: '404')
|
|
13
|
+
* @property {string} [customErrorCode] - Custom error code when errorType is 'custom'
|
|
14
|
+
*/
|
|
15
|
+
interface NotFoundProps {
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
buttonText?: string;
|
|
19
|
+
onButtonClick?: () => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
errorType?: '404' | '500' | 'custom';
|
|
22
|
+
customErrorCode?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* NotFound component for displaying error pages
|
|
26
|
+
*
|
|
27
|
+
* A reusable component for displaying 404, 500, or custom error pages
|
|
28
|
+
* with configurable content and navigation button.
|
|
29
|
+
*
|
|
30
|
+
* @param {NotFoundProps} props - The component props
|
|
31
|
+
* @returns {JSX.Element} The NotFound component
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* // Basic 404 page
|
|
36
|
+
* <NotFound onButtonClick={() => navigate('/dashboard')} />
|
|
37
|
+
*
|
|
38
|
+
* // Custom error page
|
|
39
|
+
* <NotFound
|
|
40
|
+
* errorType="500"
|
|
41
|
+
* title="Erro interno do servidor"
|
|
42
|
+
* description="Algo deu errado. Tente novamente mais tarde."
|
|
43
|
+
* buttonText="Tentar novamente"
|
|
44
|
+
* onButtonClick={() => window.location.reload()}
|
|
45
|
+
* />
|
|
46
|
+
*
|
|
47
|
+
* // Custom error code
|
|
48
|
+
* <NotFound
|
|
49
|
+
* errorType="custom"
|
|
50
|
+
* customErrorCode="403"
|
|
51
|
+
* title="Acesso negado"
|
|
52
|
+
* description="Você não tem permissão para acessar esta página."
|
|
53
|
+
* />
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare const NotFound: ({ title, description, buttonText, onButtonClick, className, errorType, customErrorCode, }: NotFoundProps) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
58
|
+
export { type NotFoundProps, NotFound as default };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Props interface for the NotFound component
|
|
5
|
+
*
|
|
6
|
+
* @interface NotFoundProps
|
|
7
|
+
* @property {string} [title] - Custom title text (default: "Página não encontrada")
|
|
8
|
+
* @property {string} [description] - Custom description text
|
|
9
|
+
* @property {string} [buttonText] - Custom button text (default: "Voltar")
|
|
10
|
+
* @property {() => void} [onButtonClick] - Callback function for button click
|
|
11
|
+
* @property {string} [className] - Additional CSS classes for the container
|
|
12
|
+
* @property {'404' | '500' | 'custom'} [errorType] - Type of error to display (default: '404')
|
|
13
|
+
* @property {string} [customErrorCode] - Custom error code when errorType is 'custom'
|
|
14
|
+
*/
|
|
15
|
+
interface NotFoundProps {
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
buttonText?: string;
|
|
19
|
+
onButtonClick?: () => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
errorType?: '404' | '500' | 'custom';
|
|
22
|
+
customErrorCode?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* NotFound component for displaying error pages
|
|
26
|
+
*
|
|
27
|
+
* A reusable component for displaying 404, 500, or custom error pages
|
|
28
|
+
* with configurable content and navigation button.
|
|
29
|
+
*
|
|
30
|
+
* @param {NotFoundProps} props - The component props
|
|
31
|
+
* @returns {JSX.Element} The NotFound component
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* // Basic 404 page
|
|
36
|
+
* <NotFound onButtonClick={() => navigate('/dashboard')} />
|
|
37
|
+
*
|
|
38
|
+
* // Custom error page
|
|
39
|
+
* <NotFound
|
|
40
|
+
* errorType="500"
|
|
41
|
+
* title="Erro interno do servidor"
|
|
42
|
+
* description="Algo deu errado. Tente novamente mais tarde."
|
|
43
|
+
* buttonText="Tentar novamente"
|
|
44
|
+
* onButtonClick={() => window.location.reload()}
|
|
45
|
+
* />
|
|
46
|
+
*
|
|
47
|
+
* // Custom error code
|
|
48
|
+
* <NotFound
|
|
49
|
+
* errorType="custom"
|
|
50
|
+
* customErrorCode="403"
|
|
51
|
+
* title="Acesso negado"
|
|
52
|
+
* description="Você não tem permissão para acessar esta página."
|
|
53
|
+
* />
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare const NotFound: ({ title, description, buttonText, onButtonClick, className, errorType, customErrorCode, }: NotFoundProps) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
58
|
+
export { type NotFoundProps, NotFound as default };
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/NotFound/NotFound.tsx
|
|
21
|
+
var NotFound_exports = {};
|
|
22
|
+
__export(NotFound_exports, {
|
|
23
|
+
default: () => NotFound_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(NotFound_exports);
|
|
26
|
+
|
|
27
|
+
// src/components/Text/Text.tsx
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
var Text = ({
|
|
30
|
+
children,
|
|
31
|
+
size = "md",
|
|
32
|
+
weight = "normal",
|
|
33
|
+
color = "text-text-950",
|
|
34
|
+
as,
|
|
35
|
+
className = "",
|
|
36
|
+
...props
|
|
37
|
+
}) => {
|
|
38
|
+
let sizeClasses = "";
|
|
39
|
+
let weightClasses = "";
|
|
40
|
+
const sizeClassMap = {
|
|
41
|
+
"2xs": "text-2xs",
|
|
42
|
+
xs: "text-xs",
|
|
43
|
+
sm: "text-sm",
|
|
44
|
+
md: "text-md",
|
|
45
|
+
lg: "text-lg",
|
|
46
|
+
xl: "text-xl",
|
|
47
|
+
"2xl": "text-2xl",
|
|
48
|
+
"3xl": "text-3xl",
|
|
49
|
+
"4xl": "text-4xl",
|
|
50
|
+
"5xl": "text-5xl",
|
|
51
|
+
"6xl": "text-6xl"
|
|
52
|
+
};
|
|
53
|
+
sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
|
|
54
|
+
const weightClassMap = {
|
|
55
|
+
hairline: "font-hairline",
|
|
56
|
+
light: "font-light",
|
|
57
|
+
normal: "font-normal",
|
|
58
|
+
medium: "font-medium",
|
|
59
|
+
semibold: "font-semibold",
|
|
60
|
+
bold: "font-bold",
|
|
61
|
+
extrabold: "font-extrabold",
|
|
62
|
+
black: "font-black"
|
|
63
|
+
};
|
|
64
|
+
weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
|
|
65
|
+
const baseClasses = "font-primary";
|
|
66
|
+
const Component = as ?? "p";
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
68
|
+
Component,
|
|
69
|
+
{
|
|
70
|
+
className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
|
|
71
|
+
...props,
|
|
72
|
+
children
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
var Text_default = Text;
|
|
77
|
+
|
|
78
|
+
// src/components/Button/Button.tsx
|
|
79
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
80
|
+
var VARIANT_ACTION_CLASSES = {
|
|
81
|
+
solid: {
|
|
82
|
+
primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
83
|
+
positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
84
|
+
negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
85
|
+
},
|
|
86
|
+
outline: {
|
|
87
|
+
primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
88
|
+
positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
89
|
+
negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
90
|
+
},
|
|
91
|
+
link: {
|
|
92
|
+
primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
93
|
+
positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
94
|
+
negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
var SIZE_CLASSES = {
|
|
98
|
+
"extra-small": "text-xs px-3.5 py-2",
|
|
99
|
+
small: "text-sm px-4 py-2.5",
|
|
100
|
+
medium: "text-md px-5 py-2.5",
|
|
101
|
+
large: "text-lg px-6 py-3",
|
|
102
|
+
"extra-large": "text-lg px-7 py-3.5"
|
|
103
|
+
};
|
|
104
|
+
var Button = ({
|
|
105
|
+
children,
|
|
106
|
+
iconLeft,
|
|
107
|
+
iconRight,
|
|
108
|
+
size = "medium",
|
|
109
|
+
variant = "solid",
|
|
110
|
+
action = "primary",
|
|
111
|
+
className = "",
|
|
112
|
+
disabled,
|
|
113
|
+
type = "button",
|
|
114
|
+
...props
|
|
115
|
+
}) => {
|
|
116
|
+
const sizeClasses = SIZE_CLASSES[size];
|
|
117
|
+
const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
|
|
118
|
+
const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
120
|
+
"button",
|
|
121
|
+
{
|
|
122
|
+
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
123
|
+
disabled,
|
|
124
|
+
type,
|
|
125
|
+
...props,
|
|
126
|
+
children: [
|
|
127
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
|
|
128
|
+
children,
|
|
129
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
var Button_default = Button;
|
|
135
|
+
|
|
136
|
+
// src/components/NotFound/NotFound.tsx
|
|
137
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
138
|
+
var NotFound = ({
|
|
139
|
+
title,
|
|
140
|
+
description,
|
|
141
|
+
buttonText = "Voltar",
|
|
142
|
+
onButtonClick,
|
|
143
|
+
className = "",
|
|
144
|
+
errorType = "404",
|
|
145
|
+
customErrorCode
|
|
146
|
+
}) => {
|
|
147
|
+
const getErrorCode = () => {
|
|
148
|
+
if (errorType === "custom") {
|
|
149
|
+
return customErrorCode?.trim() || "ERROR";
|
|
150
|
+
}
|
|
151
|
+
return errorType;
|
|
152
|
+
};
|
|
153
|
+
const getDefaultTitle = () => {
|
|
154
|
+
switch (errorType) {
|
|
155
|
+
case "404":
|
|
156
|
+
return "P\xE1gina n\xE3o encontrada";
|
|
157
|
+
case "500":
|
|
158
|
+
return "Erro interno do servidor";
|
|
159
|
+
default:
|
|
160
|
+
return "Erro";
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const getDefaultDescription = () => {
|
|
164
|
+
switch (errorType) {
|
|
165
|
+
case "404":
|
|
166
|
+
return "Oops! A p\xE1gina que voc\xEA est\xE1 procurando n\xE3o existe ou foi removida.";
|
|
167
|
+
case "500":
|
|
168
|
+
return "Algo deu errado em nossos servidores. Tente novamente mais tarde.";
|
|
169
|
+
default:
|
|
170
|
+
return "Ocorreu um erro inesperado.";
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const handleButtonClick = (event) => {
|
|
174
|
+
event.preventDefault();
|
|
175
|
+
onButtonClick?.();
|
|
176
|
+
};
|
|
177
|
+
const errorTitle = title || getDefaultTitle();
|
|
178
|
+
const errorDescription = description || getDefaultDescription();
|
|
179
|
+
const errorCode = getErrorCode();
|
|
180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
181
|
+
"div",
|
|
182
|
+
{
|
|
183
|
+
className: `flex flex-col w-full h-screen items-center justify-center bg-background-50 px-4 ${className}`,
|
|
184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
185
|
+
"main",
|
|
186
|
+
{
|
|
187
|
+
role: "main",
|
|
188
|
+
"aria-labelledby": "error-title",
|
|
189
|
+
"aria-describedby": "error-description",
|
|
190
|
+
className: "flex flex-col items-center text-center max-w-md space-y-6",
|
|
191
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { "aria-label": `Erro ${errorCode}`, children: [
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
className: "text-8xl font-bold text-primary-300 select-none",
|
|
196
|
+
"aria-label": `C\xF3digo de erro: ${errorCode}`,
|
|
197
|
+
children: errorCode
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("header", { className: "space-y-2", children: [
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
202
|
+
Text_default,
|
|
203
|
+
{
|
|
204
|
+
size: "xl",
|
|
205
|
+
weight: "bold",
|
|
206
|
+
className: "text-text-950",
|
|
207
|
+
id: "error-title",
|
|
208
|
+
"aria-level": 1,
|
|
209
|
+
children: errorTitle
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text_default, { size: "md", className: "text-text-600", id: "error-description", children: errorDescription })
|
|
213
|
+
] }),
|
|
214
|
+
onButtonClick && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("nav", { "aria-label": "Navega\xE7\xE3o de erro", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
215
|
+
Button_default,
|
|
216
|
+
{
|
|
217
|
+
onClick: handleButtonClick,
|
|
218
|
+
variant: "solid",
|
|
219
|
+
size: "medium",
|
|
220
|
+
className: "mt-8",
|
|
221
|
+
"aria-describedby": "error-description",
|
|
222
|
+
"aria-label": `${buttonText}. ${errorDescription}`,
|
|
223
|
+
children: buttonText
|
|
224
|
+
}
|
|
225
|
+
) })
|
|
226
|
+
] })
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
};
|
|
232
|
+
var NotFound_default = NotFound;
|
|
233
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/NotFound/NotFound.tsx","../../src/components/Text/Text.tsx","../../src/components/Button/Button.tsx"],"sourcesContent":["import { MouseEvent } from 'react';\nimport Text from '../Text/Text';\nimport Button from '../Button/Button';\n\n/**\n * Props interface for the NotFound component\n *\n * @interface NotFoundProps\n * @property {string} [title] - Custom title text (default: \"Página não encontrada\")\n * @property {string} [description] - Custom description text\n * @property {string} [buttonText] - Custom button text (default: \"Voltar\")\n * @property {() => void} [onButtonClick] - Callback function for button click\n * @property {string} [className] - Additional CSS classes for the container\n * @property {'404' | '500' | 'custom'} [errorType] - Type of error to display (default: '404')\n * @property {string} [customErrorCode] - Custom error code when errorType is 'custom'\n */\nexport interface NotFoundProps {\n title?: string;\n description?: string;\n buttonText?: string;\n onButtonClick?: () => void;\n className?: string;\n errorType?: '404' | '500' | 'custom';\n customErrorCode?: string;\n}\n\n/**\n * NotFound component for displaying error pages\n *\n * A reusable component for displaying 404, 500, or custom error pages\n * with configurable content and navigation button.\n *\n * @param {NotFoundProps} props - The component props\n * @returns {JSX.Element} The NotFound component\n *\n * @example\n * ```typescript\n * // Basic 404 page\n * <NotFound onButtonClick={() => navigate('/dashboard')} />\n *\n * // Custom error page\n * <NotFound\n * errorType=\"500\"\n * title=\"Erro interno do servidor\"\n * description=\"Algo deu errado. Tente novamente mais tarde.\"\n * buttonText=\"Tentar novamente\"\n * onButtonClick={() => window.location.reload()}\n * />\n *\n * // Custom error code\n * <NotFound\n * errorType=\"custom\"\n * customErrorCode=\"403\"\n * title=\"Acesso negado\"\n * description=\"Você não tem permissão para acessar esta página.\"\n * />\n * ```\n */\nconst NotFound = ({\n title,\n description,\n buttonText = 'Voltar',\n onButtonClick,\n className = '',\n errorType = '404',\n customErrorCode,\n}: NotFoundProps) => {\n const getErrorCode = () => {\n if (errorType === 'custom') {\n return customErrorCode?.trim() || 'ERROR';\n }\n return errorType;\n };\n\n const getDefaultTitle = () => {\n switch (errorType) {\n case '404':\n return 'Página não encontrada';\n case '500':\n return 'Erro interno do servidor';\n default:\n return 'Erro';\n }\n };\n\n const getDefaultDescription = () => {\n switch (errorType) {\n case '404':\n return 'Oops! A página que você está procurando não existe ou foi removida.';\n case '500':\n return 'Algo deu errado em nossos servidores. Tente novamente mais tarde.';\n default:\n return 'Ocorreu um erro inesperado.';\n }\n };\n\n const handleButtonClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n onButtonClick?.();\n };\n\n const errorTitle = title || getDefaultTitle();\n const errorDescription = description || getDefaultDescription();\n const errorCode = getErrorCode();\n\n return (\n <div\n className={`flex flex-col w-full h-screen items-center justify-center bg-background-50 px-4 ${className}`}\n >\n <main\n role=\"main\"\n aria-labelledby=\"error-title\"\n aria-describedby=\"error-description\"\n className=\"flex flex-col items-center text-center max-w-md space-y-6\"\n >\n <section aria-label={`Erro ${errorCode}`}>\n {/* Error Code */}\n <div\n className=\"text-8xl font-bold text-primary-300 select-none\"\n aria-label={`Código de erro: ${errorCode}`}\n >\n {errorCode}\n </div>\n\n {/* Main message */}\n <header className=\"space-y-2\">\n <Text\n size=\"xl\"\n weight=\"bold\"\n className=\"text-text-950\"\n id=\"error-title\"\n aria-level={1}\n >\n {errorTitle}\n </Text>\n <Text size=\"md\" className=\"text-text-600\" id=\"error-description\">\n {errorDescription}\n </Text>\n </header>\n\n {/* Back button */}\n {onButtonClick && (\n <nav aria-label=\"Navegação de erro\">\n <Button\n onClick={handleButtonClick}\n variant=\"solid\"\n size=\"medium\"\n className=\"mt-8\"\n aria-describedby=\"error-description\"\n aria-label={`${buttonText}. ${errorDescription}`}\n >\n {buttonText}\n </Button>\n </nav>\n )}\n </section>\n </main>\n </div>\n );\n};\n\nexport default NotFound;\n","import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';\n\n/**\n * Base text component props\n */\ntype BaseTextProps = {\n /** Content to be displayed */\n children?: ReactNode;\n /** Text size variant */\n size?:\n | '2xs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | '4xl'\n | '5xl'\n | '6xl';\n /** Font weight variant */\n weight?:\n | 'hairline'\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold'\n | 'extrabold'\n | 'black';\n /** Color variant - white for light backgrounds, black for dark backgrounds */\n color?: string;\n /** Additional CSS classes to apply */\n className?: string;\n};\n\n/**\n * Polymorphic text component props that ensures type safety based on the 'as' prop\n */\ntype TextProps<T extends ElementType = 'p'> = BaseTextProps & {\n /** HTML tag to render */\n as?: T;\n} & Omit<ComponentPropsWithoutRef<T>, keyof BaseTextProps>;\n\n/**\n * Text component for Analytica Ensino platforms\n *\n * A flexible polymorphic text component with multiple sizes, weights, and colors.\n * Automatically adapts to dark and light themes with full type safety.\n *\n * @param children - The content to display\n * @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)\n * @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)\n * @param color - The color variant - adapts to theme\n * @param as - The HTML tag to render - determines allowed attributes via TypeScript\n * @param className - Additional CSS classes\n * @param props - HTML attributes valid for the chosen tag only\n * @returns A styled text element with type-safe attributes\n *\n * @example\n * ```tsx\n * <Text size=\"lg\" weight=\"bold\" color=\"text-info-800\">\n * This is a large, bold text\n * </Text>\n *\n * <Text as=\"a\" href=\"/link\" target=\"_blank\">\n * Link with type-safe anchor attributes\n * </Text>\n *\n * <Text as=\"button\" onClick={handleClick} disabled>\n * Button with type-safe button attributes\n * </Text>\n * ```\n */\nconst Text = <T extends ElementType = 'p'>({\n children,\n size = 'md',\n weight = 'normal',\n color = 'text-text-950',\n as,\n className = '',\n ...props\n}: TextProps<T>) => {\n let sizeClasses = '';\n let weightClasses = '';\n\n // Text size classes mapping\n const sizeClassMap = {\n '2xs': 'text-2xs',\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-md',\n lg: 'text-lg',\n xl: 'text-xl',\n '2xl': 'text-2xl',\n '3xl': 'text-3xl',\n '4xl': 'text-4xl',\n '5xl': 'text-5xl',\n '6xl': 'text-6xl',\n } as const;\n\n sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;\n\n // Font weight classes mapping\n const weightClassMap = {\n hairline: 'font-hairline',\n light: 'font-light',\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n extrabold: 'font-extrabold',\n black: 'font-black',\n } as const;\n\n weightClasses = weightClassMap[weight] ?? weightClassMap.normal;\n\n const baseClasses = 'font-primary';\n const Component = as ?? ('p' as ElementType);\n\n return (\n <Component\n className={`${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`}\n {...props}\n >\n {children}\n </Component>\n );\n};\n\nexport default Text;\n","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n 'bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n outline: {\n primary:\n 'bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n link: {\n primary:\n 'bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={`${baseClasses} ${variantClasses} ${sizeClasses} ${className}`}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":"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","names":["import_jsx_runtime","import_jsx_runtime"]}
|