@soyfri/shared-library 1.3.17 → 1.4.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.
- package/components/Tooltip/Tooltip.cjs +42 -0
- package/components/Tooltip/Tooltip.cjs.map +1 -0
- package/components/Tooltip/Tooltip.d.ts +23 -0
- package/components/Tooltip/Tooltip.js +42 -0
- package/components/Tooltip/Tooltip.js.map +1 -0
- package/components/Tooltip/index.d.ts +1 -0
- package/components/Tooltip.d.ts +2 -0
- package/package.json +6 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
22
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
const MuiTooltip = require("@mui/material/Tooltip");
|
|
24
|
+
const Typography = require("@mui/material/Typography");
|
|
25
|
+
const Box = require("@mui/material/Box");
|
|
26
|
+
const Tooltip = ({ text, maxWidth, children, sx }) => {
|
|
27
|
+
const tooltipContentStyle = __spreadProps(__spreadValues({}, maxWidth && { maxWidth }), {
|
|
28
|
+
padding: "4px 8px",
|
|
29
|
+
textAlign: "center"
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
MuiTooltip,
|
|
33
|
+
{
|
|
34
|
+
title: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", component: "span", sx: tooltipContentStyle, children: text }),
|
|
35
|
+
placement: "top",
|
|
36
|
+
arrow: true,
|
|
37
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: __spreadValues({ display: "inline-block" }, sx), children })
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
exports.Tooltip = Tooltip;
|
|
42
|
+
//# sourceMappingURL=Tooltip.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.cjs","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React from 'react';\nimport MuiTooltip from '@mui/material/Tooltip'; \nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\nimport { SxProps, Theme } from '@mui/material';\n\n/**\n * Propiedades del componente Tooltip.\n * @param {string} text - El texto a mostrar dentro del Tooltip.\n * @param {number} [maxWidth] - El ancho máximo opcional del Tooltip en píxeles.\n * @param {React.ReactNode} children - El elemento al que se le aplicará el Tooltip.\n * @param {SxProps<Theme>} [sx] - Estilos opcionales para el Box contenedor.\n */\ninterface TooltipProps {\n text: string;\n maxWidth?: number;\n children: React.ReactNode;\n sx?: SxProps<Theme>;\n}\n\n/**\n * Componente Tooltip reutilizable.\n * Muestra un texto al pasar el ratón sobre su elemento hijo, \n * permitiendo un ancho máximo configurable.\n * * @param {TooltipProps} props - Propiedades del Tooltip.\n */\nconst Tooltip: React.FC<TooltipProps> = ({ text, maxWidth, children, sx }) => {\n \n const tooltipContentStyle: SxProps<Theme> = {\n \n ...(maxWidth && { maxWidth: maxWidth }), \n padding: '4px 8px', \n textAlign: 'center',\n \n };\n\n return (\n \n <MuiTooltip\n title={\n \n <Typography variant=\"caption\" component=\"span\" sx={tooltipContentStyle}>\n {text}\n </Typography>\n }\n \n placement=\"top\" \n arrow \n >\n \n <Box component=\"span\" sx={{ display: 'inline-block', ...sx }}>\n {children}\n </Box>\n </MuiTooltip>\n );\n};\n\nexport default Tooltip;"],"names":["jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,UAAkC,CAAC,EAAE,MAAM,UAAU,UAAU,SAAS;AAE5E,QAAM,sBAAsC,iCAEtC,YAAY,EAAE,SAAA,IAFwB;AAAA,IAG1C,SAAS;AAAA,IACT,WAAW;AAAA,EAAA;AAIb,SAEEA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,sCAEG,YAAA,EAAW,SAAQ,WAAU,WAAU,QAAO,IAAI,qBAChD,UAAA,KAAA,CACH;AAAA,MAGF,WAAU;AAAA,MACV,OAAK;AAAA,MAGL,UAAAA,2BAAAA,IAAC,KAAA,EAAI,WAAU,QAAO,IAAI,iBAAE,SAAS,kBAAmB,KACrD,SAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
/**
|
|
4
|
+
* Propiedades del componente Tooltip.
|
|
5
|
+
* @param {string} text - El texto a mostrar dentro del Tooltip.
|
|
6
|
+
* @param {number} [maxWidth] - El ancho máximo opcional del Tooltip en píxeles.
|
|
7
|
+
* @param {React.ReactNode} children - El elemento al que se le aplicará el Tooltip.
|
|
8
|
+
* @param {SxProps<Theme>} [sx] - Estilos opcionales para el Box contenedor.
|
|
9
|
+
*/
|
|
10
|
+
interface TooltipProps {
|
|
11
|
+
text: string;
|
|
12
|
+
maxWidth?: number;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
sx?: SxProps<Theme>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Componente Tooltip reutilizable.
|
|
18
|
+
* Muestra un texto al pasar el ratón sobre su elemento hijo,
|
|
19
|
+
* permitiendo un ancho máximo configurable.
|
|
20
|
+
* * @param {TooltipProps} props - Propiedades del Tooltip.
|
|
21
|
+
*/
|
|
22
|
+
declare const Tooltip: React.FC<TooltipProps>;
|
|
23
|
+
export default Tooltip;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { jsx } from "react/jsx-runtime";
|
|
21
|
+
import MuiTooltip from "@mui/material/Tooltip";
|
|
22
|
+
import Typography from "@mui/material/Typography";
|
|
23
|
+
import Box from "@mui/material/Box";
|
|
24
|
+
const Tooltip = ({ text, maxWidth, children, sx }) => {
|
|
25
|
+
const tooltipContentStyle = __spreadProps(__spreadValues({}, maxWidth && { maxWidth }), {
|
|
26
|
+
padding: "4px 8px",
|
|
27
|
+
textAlign: "center"
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
MuiTooltip,
|
|
31
|
+
{
|
|
32
|
+
title: /* @__PURE__ */ jsx(Typography, { variant: "caption", component: "span", sx: tooltipContentStyle, children: text }),
|
|
33
|
+
placement: "top",
|
|
34
|
+
arrow: true,
|
|
35
|
+
children: /* @__PURE__ */ jsx(Box, { component: "span", sx: __spreadValues({ display: "inline-block" }, sx), children })
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
Tooltip
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import React from 'react';\nimport MuiTooltip from '@mui/material/Tooltip'; \nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\nimport { SxProps, Theme } from '@mui/material';\n\n/**\n * Propiedades del componente Tooltip.\n * @param {string} text - El texto a mostrar dentro del Tooltip.\n * @param {number} [maxWidth] - El ancho máximo opcional del Tooltip en píxeles.\n * @param {React.ReactNode} children - El elemento al que se le aplicará el Tooltip.\n * @param {SxProps<Theme>} [sx] - Estilos opcionales para el Box contenedor.\n */\ninterface TooltipProps {\n text: string;\n maxWidth?: number;\n children: React.ReactNode;\n sx?: SxProps<Theme>;\n}\n\n/**\n * Componente Tooltip reutilizable.\n * Muestra un texto al pasar el ratón sobre su elemento hijo, \n * permitiendo un ancho máximo configurable.\n * * @param {TooltipProps} props - Propiedades del Tooltip.\n */\nconst Tooltip: React.FC<TooltipProps> = ({ text, maxWidth, children, sx }) => {\n \n const tooltipContentStyle: SxProps<Theme> = {\n \n ...(maxWidth && { maxWidth: maxWidth }), \n padding: '4px 8px', \n textAlign: 'center',\n \n };\n\n return (\n \n <MuiTooltip\n title={\n \n <Typography variant=\"caption\" component=\"span\" sx={tooltipContentStyle}>\n {text}\n </Typography>\n }\n \n placement=\"top\" \n arrow \n >\n \n <Box component=\"span\" sx={{ display: 'inline-block', ...sx }}>\n {children}\n </Box>\n </MuiTooltip>\n );\n};\n\nexport default Tooltip;"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,UAAkC,CAAC,EAAE,MAAM,UAAU,UAAU,SAAS;AAE5E,QAAM,sBAAsC,iCAEtC,YAAY,EAAE,SAAA,IAFwB;AAAA,IAG1C,SAAS;AAAA,IACT,WAAW;AAAA,EAAA;AAIb,SAEE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,2BAEG,YAAA,EAAW,SAAQ,WAAU,WAAU,QAAO,IAAI,qBAChD,UAAA,KAAA,CACH;AAAA,MAGF,WAAU;AAAA,MACV,OAAK;AAAA,MAGL,UAAA,oBAAC,KAAA,EAAI,WAAU,QAAO,IAAI,iBAAE,SAAS,kBAAmB,KACrD,SAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Tooltip } from './Tooltip';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soyfri/shared-library",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
"types": "./index.d.ts"
|
|
39
39
|
},
|
|
40
40
|
"./package.json": "./package.json",
|
|
41
|
+
"./components/Tooltip": {
|
|
42
|
+
"import": "./components/Tooltip/Tooltip.js",
|
|
43
|
+
"require": "./components/Tooltip/Tooltip.cjs",
|
|
44
|
+
"types": "./components/Tooltip/Tooltip.d.ts"
|
|
45
|
+
},
|
|
41
46
|
"./components/Timeline": {
|
|
42
47
|
"import": "./components/Timeline/Timeline.js",
|
|
43
48
|
"require": "./components/Timeline/Timeline.cjs",
|