@soyfri/shared-library 3.0.0 → 3.2.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/ActionMenu-BXRVKopM.js +106 -0
- package/ActionMenu-BXRVKopM.js.map +1 -0
- package/ActionMenu-wNWkDZWh.cjs +105 -0
- package/ActionMenu-wNWkDZWh.cjs.map +1 -0
- package/AppBarMenuToggle-BpXBMeca.js +128 -0
- package/AppBarMenuToggle-BpXBMeca.js.map +1 -0
- package/AppBarMenuToggle-D_RJGtHO.cjs +127 -0
- package/AppBarMenuToggle-D_RJGtHO.cjs.map +1 -0
- package/{Autocomplete-CejWztBY.cjs → Autocomplete-Bd3bN4Cw.cjs} +16 -11
- package/Autocomplete-Bd3bN4Cw.cjs.map +1 -0
- package/{Autocomplete-C_lW1VER.js → Autocomplete-E5aSUGVK.js} +16 -11
- package/Autocomplete-E5aSUGVK.js.map +1 -0
- package/{Avatar-Dw5rzayR.cjs → Avatar-BjyfSNvP.cjs} +3 -7
- package/Avatar-BjyfSNvP.cjs.map +1 -0
- package/{Avatar-H8akSege.js → Avatar-C_C4bcb9.js} +3 -7
- package/Avatar-C_C4bcb9.js.map +1 -0
- package/{Checkbox-gB5YKkVo.js → Checkbox-BL4kvHFB.js} +3 -2
- package/Checkbox-BL4kvHFB.js.map +1 -0
- package/{Checkbox-BCqMFWt4.cjs → Checkbox-Bx4Asmg7.cjs} +3 -2
- package/Checkbox-Bx4Asmg7.cjs.map +1 -0
- package/{DatePicker-t7uDTZMl.cjs → DatePicker-CMcQddi1.cjs} +45 -42
- package/DatePicker-CMcQddi1.cjs.map +1 -0
- package/{DatePicker-_IGWc3I5.js → DatePicker-D__RSgs-.js} +45 -42
- package/DatePicker-D__RSgs-.js.map +1 -0
- package/{DateTimePicker-BxQyjTCY.cjs → DateTimePicker-BVJGq1A0.cjs} +7 -15
- package/DateTimePicker-BVJGq1A0.cjs.map +1 -0
- package/{DateTimePicker-CrmWav_j.js → DateTimePicker-LeaE716a.js} +7 -15
- package/DateTimePicker-LeaE716a.js.map +1 -0
- package/DrawerItem--OTb3X9v.cjs +270 -0
- package/DrawerItem--OTb3X9v.cjs.map +1 -0
- package/DrawerItem-DKlMQ-xs.js +271 -0
- package/DrawerItem-DKlMQ-xs.js.map +1 -0
- package/Flyout-DCcDBYKT.js +117 -0
- package/Flyout-DCcDBYKT.js.map +1 -0
- package/Flyout-fycujUVf.cjs +116 -0
- package/Flyout-fycujUVf.cjs.map +1 -0
- package/Gallery-ClBJxCMc.js +491 -0
- package/Gallery-ClBJxCMc.js.map +1 -0
- package/Gallery-Cn1Bj_ao.cjs +490 -0
- package/Gallery-Cn1Bj_ao.cjs.map +1 -0
- package/Icon-CUwK2c8z.js +108 -0
- package/Icon-CUwK2c8z.js.map +1 -0
- package/Icon-ChnAivGo.cjs +107 -0
- package/Icon-ChnAivGo.cjs.map +1 -0
- package/{Input-DP_fKl38.js → Input-BibHlnGN.js} +18 -11
- package/Input-BibHlnGN.js.map +1 -0
- package/{Input-CScC87J5.cjs → Input-Bpjw7qwq.cjs} +18 -11
- package/Input-Bpjw7qwq.cjs.map +1 -0
- package/InputGroup-BZ7cmAcg.cjs +140 -0
- package/InputGroup-BZ7cmAcg.cjs.map +1 -0
- package/InputGroup-D5pXKGjZ.js +141 -0
- package/InputGroup-D5pXKGjZ.js.map +1 -0
- package/MenuButton-C4s8rG05.cjs +79 -0
- package/MenuButton-C4s8rG05.cjs.map +1 -0
- package/MenuButton-CZRN4P6x.js +80 -0
- package/MenuButton-CZRN4P6x.js.map +1 -0
- package/README.md +0 -8
- package/{RadioGroup-Dd0rHXSX.cjs → RadioGroup-DVvmmDs3.cjs} +3 -2
- package/RadioGroup-DVvmmDs3.cjs.map +1 -0
- package/{RadioGroup-bO-ahP9T.js → RadioGroup-cKCpag8W.js} +3 -2
- package/RadioGroup-cKCpag8W.js.map +1 -0
- package/{Select-BY5Y0qZ1.js → Select-BaY3zJhq.js} +4 -3
- package/Select-BaY3zJhq.js.map +1 -0
- package/{Select-CURrHSyl.cjs → Select-WpHNCHHz.cjs} +4 -3
- package/Select-WpHNCHHz.cjs.map +1 -0
- package/{Switch-CQFOopYy.cjs → Switch-B4ex7yKR.cjs} +3 -2
- package/Switch-B4ex7yKR.cjs.map +1 -0
- package/{Switch-D72dpkH2.js → Switch-CY1Dd2ff.js} +3 -2
- package/Switch-CY1Dd2ff.js.map +1 -0
- package/{Table-C4OM6rrC.cjs → Table-DaNgX7PO.cjs} +8 -11
- package/{Table-C4OM6rrC.cjs.map → Table-DaNgX7PO.cjs.map} +1 -1
- package/{Table-C2LbW0B1.js → Table-aNFAOuQk.js} +8 -11
- package/{Table-C2LbW0B1.js.map → Table-aNFAOuQk.js.map} +1 -1
- package/TimelineItem-0jRPFT11.js +68 -0
- package/TimelineItem-0jRPFT11.js.map +1 -0
- package/TimelineItem-BbhUWJhU.cjs +84 -0
- package/TimelineItem-BbhUWJhU.cjs.map +1 -0
- package/Tooltip-BB77JBcg.js +42 -0
- package/Tooltip-BB77JBcg.js.map +1 -0
- package/Tooltip-DpAsWGpN.cjs +41 -0
- package/Tooltip-DpAsWGpN.cjs.map +1 -0
- package/components/ActionMenu/ActionMenu.cjs +4 -104
- package/components/ActionMenu/ActionMenu.cjs.map +1 -1
- package/components/ActionMenu/ActionMenu.js +4 -104
- package/components/ActionMenu/ActionMenu.js.map +1 -1
- package/components/AppBar/AppBar.cjs +6 -126
- package/components/AppBar/AppBar.cjs.map +1 -1
- package/components/AppBar/AppBar.js +6 -126
- package/components/AppBar/AppBar.js.map +1 -1
- package/components/Autocomplete/Autocomplete.cjs +1 -1
- package/components/Autocomplete/Autocomplete.js +1 -1
- package/components/Avatar/Avatar.cjs +1 -1
- package/components/Avatar/Avatar.js +1 -1
- package/components/Checkbox/Checkbox.cjs +1 -1
- package/components/Checkbox/Checkbox.js +1 -1
- package/components/DatePicker/DatePicker.cjs +1 -1
- package/components/DatePicker/DatePicker.js +1 -1
- package/components/DateTimePicker/DateTimePicker.cjs +1 -1
- package/components/DateTimePicker/DateTimePicker.js +1 -1
- package/components/Drawer/Drawer.cjs +5 -269
- package/components/Drawer/Drawer.cjs.map +1 -1
- package/components/Drawer/Drawer.js +5 -269
- package/components/Drawer/Drawer.js.map +1 -1
- package/components/Flyout/Flyout.cjs +2 -114
- package/components/Flyout/Flyout.cjs.map +1 -1
- package/components/Flyout/Flyout.js +2 -114
- package/components/Flyout/Flyout.js.map +1 -1
- package/components/Gallery/Gallery.cjs +3 -489
- package/components/Gallery/Gallery.cjs.map +1 -1
- package/components/Gallery/Gallery.js +3 -489
- package/components/Gallery/Gallery.js.map +1 -1
- package/components/Icon/Icon.cjs +3 -106
- package/components/Icon/Icon.cjs.map +1 -1
- package/components/Icon/Icon.js +3 -106
- package/components/Icon/Icon.js.map +1 -1
- package/components/Input/Input.cjs +1 -1
- package/components/Input/Input.d.ts +4 -0
- package/components/Input/Input.helpers.d.ts +2 -2
- package/components/Input/Input.js +1 -1
- package/components/InputGroup/InputGroup.cjs +3 -137
- package/components/InputGroup/InputGroup.cjs.map +1 -1
- package/components/InputGroup/InputGroup.js +3 -137
- package/components/InputGroup/InputGroup.js.map +1 -1
- package/components/MenuButton/MenuButton.cjs +2 -75
- package/components/MenuButton/MenuButton.cjs.map +1 -1
- package/components/MenuButton/MenuButton.d.ts +6 -0
- package/components/MenuButton/MenuButton.js +2 -75
- package/components/MenuButton/MenuButton.js.map +1 -1
- package/components/RadioGroup/RadioGroup.cjs +1 -1
- package/components/RadioGroup/RadioGroup.js +1 -1
- package/components/Select/Select.cjs +1 -1
- package/components/Select/Select.js +1 -1
- package/components/Switch/Switch.cjs +1 -1
- package/components/Switch/Switch.js +1 -1
- package/components/Table/Table.cjs +1 -1
- package/components/Table/Table.js +1 -1
- package/components/Timeline/Timeline.cjs +4 -83
- package/components/Timeline/Timeline.cjs.map +1 -1
- package/components/Timeline/Timeline.js +4 -66
- package/components/Timeline/Timeline.js.map +1 -1
- package/components/Tooltip/Tooltip.cjs +2 -39
- package/components/Tooltip/Tooltip.cjs.map +1 -1
- package/components/Tooltip/Tooltip.js +2 -39
- package/components/Tooltip/Tooltip.js.map +1 -1
- package/{formField.sx-BAX7KwMR.cjs → formField.sx-BZj7TaMa.cjs} +29 -4
- package/formField.sx-BZj7TaMa.cjs.map +1 -0
- package/{formField.sx-8_QRnKxv.js → formField.sx-DD1sxwWH.js} +29 -4
- package/formField.sx-DD1sxwWH.js.map +1 -0
- package/index.cjs +36 -10
- package/index.cjs.map +1 -1
- package/index.d.ts +11 -0
- package/index.js +36 -10
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/styles.css +375 -0
- package/theme/tokens.d.ts +12 -2
- package/{tokens-jaWWNk39.cjs → tokens-BGPazVFO.cjs} +4 -2
- package/tokens-BGPazVFO.cjs.map +1 -0
- package/{tokens-BRrcP_p_.js → tokens-DE2fV3a9.js} +12 -10
- package/tokens-DE2fV3a9.js.map +1 -0
- package/Autocomplete-C_lW1VER.js.map +0 -1
- package/Autocomplete-CejWztBY.cjs.map +0 -1
- package/Avatar-Dw5rzayR.cjs.map +0 -1
- package/Avatar-H8akSege.js.map +0 -1
- package/Checkbox-BCqMFWt4.cjs.map +0 -1
- package/Checkbox-gB5YKkVo.js.map +0 -1
- package/DatePicker-_IGWc3I5.js.map +0 -1
- package/DatePicker-t7uDTZMl.cjs.map +0 -1
- package/DateTimePicker-BxQyjTCY.cjs.map +0 -1
- package/DateTimePicker-CrmWav_j.js.map +0 -1
- package/Input-CScC87J5.cjs.map +0 -1
- package/Input-DP_fKl38.js.map +0 -1
- package/RadioGroup-Dd0rHXSX.cjs.map +0 -1
- package/RadioGroup-bO-ahP9T.js.map +0 -1
- package/Select-BY5Y0qZ1.js.map +0 -1
- package/Select-CURrHSyl.cjs.map +0 -1
- package/Switch-CQFOopYy.cjs.map +0 -1
- package/Switch-D72dpkH2.js.map +0 -1
- package/formField.sx-8_QRnKxv.js.map +0 -1
- package/formField.sx-BAX7KwMR.cjs.map +0 -1
- package/tokens-BRrcP_p_.js.map +0 -1
- package/tokens-jaWWNk39.cjs.map +0 -1
package/components/Icon/Icon.js
CHANGED
|
@@ -1,109 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { styled, Badge } from "@mui/material";
|
|
4
|
-
const sizeMap = {
|
|
5
|
-
xs: 18,
|
|
6
|
-
sm: 24,
|
|
7
|
-
md: 36,
|
|
8
|
-
lg: 48,
|
|
9
|
-
xl: 64
|
|
10
|
-
};
|
|
11
|
-
const StyledIcon = styled("span")(({ color, fontSize, spin, outlined }) => ({
|
|
12
|
-
display: "inline-flex",
|
|
13
|
-
alignItems: "center",
|
|
14
|
-
justifyContent: "center",
|
|
15
|
-
color,
|
|
16
|
-
fontSize,
|
|
17
|
-
width: fontSize,
|
|
18
|
-
height: fontSize,
|
|
19
|
-
animation: spin ? "spin 1s linear infinite" : void 0,
|
|
20
|
-
border: outlined ? "1px solid currentColor" : void 0,
|
|
21
|
-
borderRadius: "50%",
|
|
22
|
-
padding: outlined ? 4 : 0,
|
|
23
|
-
"@keyframes spin": {
|
|
24
|
-
"0%": { transform: "rotate(0deg)" },
|
|
25
|
-
"100%": { transform: "rotate(360deg)" }
|
|
26
|
-
},
|
|
27
|
-
"& svg": {
|
|
28
|
-
width: "100%",
|
|
29
|
-
height: "100%",
|
|
30
|
-
fill: "currentColor",
|
|
31
|
-
display: "block"
|
|
32
|
-
},
|
|
33
|
-
"& img": {
|
|
34
|
-
width: "100%",
|
|
35
|
-
height: "100%",
|
|
36
|
-
display: "block"
|
|
37
|
-
}
|
|
38
|
-
}));
|
|
39
|
-
const Icon = ({
|
|
40
|
-
children,
|
|
41
|
-
path,
|
|
42
|
-
url,
|
|
43
|
-
alt = "icon",
|
|
44
|
-
viewBox = "0 0 24 24",
|
|
45
|
-
color = "var(--primary-color)",
|
|
46
|
-
outlined = false,
|
|
47
|
-
spin = false,
|
|
48
|
-
badge,
|
|
49
|
-
badgeColor = "primary",
|
|
50
|
-
badgePosition = { vertical: "bottom", horizontal: "right" },
|
|
51
|
-
size = "sm",
|
|
52
|
-
black,
|
|
53
|
-
white,
|
|
54
|
-
className,
|
|
55
|
-
sx
|
|
56
|
-
}) => {
|
|
57
|
-
const finalColor = white ? "white" : black ? "black" : color;
|
|
58
|
-
const iconSize = sizeMap[size];
|
|
59
|
-
const content = useMemo(() => {
|
|
60
|
-
if (children) return children;
|
|
61
|
-
if (path) {
|
|
62
|
-
const trimmed = path.trim();
|
|
63
|
-
if (trimmed.startsWith("<svg")) {
|
|
64
|
-
return /* @__PURE__ */ jsx("span", { dangerouslySetInnerHTML: { __html: trimmed } });
|
|
65
|
-
}
|
|
66
|
-
return /* @__PURE__ */ jsx(
|
|
67
|
-
"svg",
|
|
68
|
-
{
|
|
69
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
70
|
-
viewBox,
|
|
71
|
-
fill: "currentColor",
|
|
72
|
-
"aria-hidden": "true",
|
|
73
|
-
children: /* @__PURE__ */ jsx("path", { d: trimmed })
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
if (url) {
|
|
78
|
-
return /* @__PURE__ */ jsx("img", { src: url, alt });
|
|
79
|
-
}
|
|
80
|
-
return null;
|
|
81
|
-
}, [children, path, url, alt, viewBox]);
|
|
82
|
-
return /* @__PURE__ */ jsx(
|
|
83
|
-
Badge,
|
|
84
|
-
{
|
|
85
|
-
badgeContent: badge,
|
|
86
|
-
color: badgeColor,
|
|
87
|
-
anchorOrigin: badgePosition,
|
|
88
|
-
invisible: badge === void 0,
|
|
89
|
-
sx: { ".MuiBadge-badge": { transform: "scale(1)" } },
|
|
90
|
-
children: /* @__PURE__ */ jsx(
|
|
91
|
-
StyledIcon,
|
|
92
|
-
{
|
|
93
|
-
color: finalColor,
|
|
94
|
-
fontSize: iconSize,
|
|
95
|
-
spin,
|
|
96
|
-
outlined,
|
|
97
|
-
className: `hsi-icon ${className || ""}`,
|
|
98
|
-
sx,
|
|
99
|
-
children: content
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
};
|
|
1
|
+
import { I, I as I2 } from "../../Icon-CUwK2c8z.js";
|
|
105
2
|
export {
|
|
106
|
-
Icon,
|
|
107
|
-
|
|
3
|
+
I as Icon,
|
|
4
|
+
I2 as default
|
|
108
5
|
};
|
|
109
6
|
//# sourceMappingURL=Icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sources":[
|
|
1
|
+
{"version":3,"file":"Icon.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const Input = require("../../Input-
|
|
3
|
+
const Input = require("../../Input-Bpjw7qwq.cjs");
|
|
4
4
|
exports.Input = Input.Input;
|
|
5
5
|
exports.default = Input.Input;
|
|
6
6
|
//# sourceMappingURL=Input.cjs.map
|
|
@@ -12,6 +12,10 @@ export interface BaseInputProps extends Omit<TextFieldProps, 'value' | 'onChange
|
|
|
12
12
|
/** "outside" = label arriba del campo (default). "floating" = label clásico MUI dentro del borde */
|
|
13
13
|
labelPosition?: LabelPosition;
|
|
14
14
|
readOnly?: boolean;
|
|
15
|
+
/** Contenido al inicio del input (ej. icono de búsqueda). Atajo de `slotProps.input.startAdornment`. */
|
|
16
|
+
startAdornment?: React.ReactNode;
|
|
17
|
+
/** Contenido al final del input (ej. botón clear). Atajo de `slotProps.input.endAdornment`. */
|
|
18
|
+
endAdornment?: React.ReactNode;
|
|
15
19
|
/**
|
|
16
20
|
* Nombre del preset de estilo registrado en `theme.styles.Input`.
|
|
17
21
|
* - `"default"` (o ausente) = estilo built-in del paquete.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InputHTMLAttributes } from 'react';
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { TextFieldProps } from '@mui/material';
|
|
3
3
|
import { InputType } from './Input';
|
|
4
4
|
/**
|
|
@@ -11,4 +11,4 @@ export declare const parseValue: (raw: string, type: InputType) => string | numb
|
|
|
11
11
|
* Construye los slotProps del TextField consolidando htmlInput + inputLabel.
|
|
12
12
|
* Maneja los atributos min/max cuando type="number", maxLength y readOnly.
|
|
13
13
|
*/
|
|
14
|
-
export declare const buildSlotProps: (type: InputType, min: number | undefined, max: number | undefined, maxLength: number | undefined, customSlotProps: TextFieldProps["slotProps"], customInputProps: InputHTMLAttributes<HTMLInputElement> | undefined, readOnly?: boolean) => TextFieldProps["slotProps"];
|
|
14
|
+
export declare const buildSlotProps: (type: InputType, min: number | undefined, max: number | undefined, maxLength: number | undefined, customSlotProps: TextFieldProps["slotProps"], customInputProps: InputHTMLAttributes<HTMLInputElement> | undefined, readOnly?: boolean, startAdornment?: ReactNode, endAdornment?: ReactNode) => TextFieldProps["slotProps"];
|
|
@@ -1,140 +1,6 @@
|
|
|
1
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
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const mergeSx = require("../../mergeSx-Dbccoo_H.cjs");
|
|
26
|
-
const tokens = require("../../tokens-jaWWNk39.cjs");
|
|
27
|
-
const InputGroup = ({
|
|
28
|
-
children,
|
|
29
|
-
sx,
|
|
30
|
-
slotSx,
|
|
31
|
-
borderRadius = 10,
|
|
32
|
-
disabled,
|
|
33
|
-
orientation = "horizontal",
|
|
34
|
-
className
|
|
35
|
-
}) => {
|
|
36
|
-
const radius = typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
|
|
37
|
-
const slots = React.Children.toArray(children).filter(React.isValidElement);
|
|
38
|
-
const isHorizontal = orientation === "horizontal";
|
|
39
|
-
const baseSx = {
|
|
40
|
-
// Respeta el label "outside" de Input/Select: los hijos pierden su marginTop
|
|
41
|
-
// (ver más abajo) y el grupo reserva el mismo espacio arriba para que los
|
|
42
|
-
// labels floten por encima del borde del grupo.
|
|
43
|
-
marginTop: tokens.LABEL_MARGIN_TOP,
|
|
44
|
-
display: "flex",
|
|
45
|
-
flexDirection: isHorizontal ? "row" : "column",
|
|
46
|
-
alignItems: "stretch",
|
|
47
|
-
width: "100%",
|
|
48
|
-
border: (theme) => `1px solid ${theme.palette.divider}`,
|
|
49
|
-
borderRadius: radius,
|
|
50
|
-
backgroundColor: "background.paper",
|
|
51
|
-
transition: "border-color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, box-shadow 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms",
|
|
52
|
-
"&:focus-within": {
|
|
53
|
-
borderColor: "primary.main",
|
|
54
|
-
boxShadow: (theme) => `0 0 0 1px ${theme.palette.primary.main}`
|
|
55
|
-
},
|
|
56
|
-
opacity: disabled ? 0.6 : 1,
|
|
57
|
-
pointerEvents: disabled ? "none" : "auto",
|
|
58
|
-
// Cancelar el marginTop que Input/Select reservan en labelPosition="outside".
|
|
59
|
-
// El grupo ya lo reservó en su nivel externo.
|
|
60
|
-
"& .MuiFormControl-root, & > [data-input-group-slot] > .MuiTextField-root, & > [data-input-group-slot] > .MuiFormControl-root": {
|
|
61
|
-
marginTop: 0
|
|
62
|
-
},
|
|
63
|
-
// Quitar el borde del notched outline interno: el borde visible es el del
|
|
64
|
-
// grupo, los separadores son los borderRight/borderBottom de cada slot.
|
|
65
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
|
66
|
-
border: "none"
|
|
67
|
-
},
|
|
68
|
-
// Forzar que todos los campos pinten sus esquinas cuadradas (las esquinas
|
|
69
|
-
// redondeadas se aplican solo al primer/último slot más abajo).
|
|
70
|
-
"& .MuiInputBase-root, & .MuiChip-root": {
|
|
71
|
-
borderRadius: 0
|
|
72
|
-
},
|
|
73
|
-
// Botones integrados: sin radius propio, altura completa, sin sombra.
|
|
74
|
-
"& .MuiButton-root": {
|
|
75
|
-
borderRadius: 0,
|
|
76
|
-
height: "100%",
|
|
77
|
-
boxShadow: "none",
|
|
78
|
-
border: "none"
|
|
79
|
-
},
|
|
80
|
-
// Slots: cada hijo vive en un slot neutro que lo centra verticalmente.
|
|
81
|
-
"& > [data-input-group-slot]": __spreadProps(__spreadValues({
|
|
82
|
-
flex: 1,
|
|
83
|
-
display: "flex",
|
|
84
|
-
alignItems: "center",
|
|
85
|
-
minWidth: 0
|
|
86
|
-
}, isHorizontal ? { borderRight: (theme) => `1px solid ${theme.palette.divider}` } : { borderBottom: (theme) => `1px solid ${theme.palette.divider}` }), {
|
|
87
|
-
"&:last-of-type": {
|
|
88
|
-
borderRight: "none",
|
|
89
|
-
borderBottom: "none"
|
|
90
|
-
}
|
|
91
|
-
}),
|
|
92
|
-
// Esquinas redondeadas: primer slot (izquierda o arriba).
|
|
93
|
-
"& > [data-input-group-slot]:first-of-type .MuiInputBase-root, & > [data-input-group-slot]:first-of-type .MuiButton-root, & > [data-input-group-slot]:first-of-type .MuiChip-root": isHorizontal ? {
|
|
94
|
-
borderTopLeftRadius: radius,
|
|
95
|
-
borderBottomLeftRadius: radius
|
|
96
|
-
} : {
|
|
97
|
-
borderTopLeftRadius: radius,
|
|
98
|
-
borderTopRightRadius: radius
|
|
99
|
-
},
|
|
100
|
-
// Esquinas redondeadas: último slot (derecha o abajo).
|
|
101
|
-
"& > [data-input-group-slot]:last-of-type .MuiInputBase-root, & > [data-input-group-slot]:last-of-type .MuiButton-root, & > [data-input-group-slot]:last-of-type .MuiChip-root": isHorizontal ? {
|
|
102
|
-
borderTopRightRadius: radius,
|
|
103
|
-
borderBottomRightRadius: radius
|
|
104
|
-
} : {
|
|
105
|
-
borderBottomLeftRadius: radius,
|
|
106
|
-
borderBottomRightRadius: radius
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
const baseSlotSx = {
|
|
110
|
-
flex: 1,
|
|
111
|
-
display: "flex",
|
|
112
|
-
alignItems: "center",
|
|
113
|
-
minWidth: 0
|
|
114
|
-
};
|
|
115
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
116
|
-
material.Box,
|
|
117
|
-
{
|
|
118
|
-
"data-testid": "input-group",
|
|
119
|
-
className,
|
|
120
|
-
"aria-disabled": disabled ? "true" : void 0,
|
|
121
|
-
sx: mergeSx.mergeSx(baseSx, sx),
|
|
122
|
-
children: slots.map((child, i) => {
|
|
123
|
-
var _a;
|
|
124
|
-
const slotKey = (_a = child.key) != null ? _a : i;
|
|
125
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
126
|
-
material.Box,
|
|
127
|
-
{
|
|
128
|
-
"data-input-group-slot": true,
|
|
129
|
-
sx: mergeSx.mergeSx(baseSlotSx, slotSx),
|
|
130
|
-
children: child
|
|
131
|
-
},
|
|
132
|
-
slotKey
|
|
133
|
-
);
|
|
134
|
-
})
|
|
135
|
-
}
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
exports.InputGroup = InputGroup;
|
|
139
|
-
exports.default = InputGroup;
|
|
3
|
+
const InputGroup = require("../../InputGroup-BZ7cmAcg.cjs");
|
|
4
|
+
exports.InputGroup = InputGroup.InputGroup;
|
|
5
|
+
exports.default = InputGroup.InputGroup;
|
|
140
6
|
//# sourceMappingURL=InputGroup.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.cjs","sources":[
|
|
1
|
+
{"version":3,"file":"InputGroup.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,140 +1,6 @@
|
|
|
1
|
-
|
|
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 { Children, isValidElement } from "react";
|
|
22
|
-
import { Box } from "@mui/material";
|
|
23
|
-
import { m as mergeSx } from "../../mergeSx-BXoNZjB_.js";
|
|
24
|
-
import { L as LABEL_MARGIN_TOP } from "../../tokens-BRrcP_p_.js";
|
|
25
|
-
const InputGroup = ({
|
|
26
|
-
children,
|
|
27
|
-
sx,
|
|
28
|
-
slotSx,
|
|
29
|
-
borderRadius = 10,
|
|
30
|
-
disabled,
|
|
31
|
-
orientation = "horizontal",
|
|
32
|
-
className
|
|
33
|
-
}) => {
|
|
34
|
-
const radius = typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
|
|
35
|
-
const slots = Children.toArray(children).filter(isValidElement);
|
|
36
|
-
const isHorizontal = orientation === "horizontal";
|
|
37
|
-
const baseSx = {
|
|
38
|
-
// Respeta el label "outside" de Input/Select: los hijos pierden su marginTop
|
|
39
|
-
// (ver más abajo) y el grupo reserva el mismo espacio arriba para que los
|
|
40
|
-
// labels floten por encima del borde del grupo.
|
|
41
|
-
marginTop: LABEL_MARGIN_TOP,
|
|
42
|
-
display: "flex",
|
|
43
|
-
flexDirection: isHorizontal ? "row" : "column",
|
|
44
|
-
alignItems: "stretch",
|
|
45
|
-
width: "100%",
|
|
46
|
-
border: (theme) => `1px solid ${theme.palette.divider}`,
|
|
47
|
-
borderRadius: radius,
|
|
48
|
-
backgroundColor: "background.paper",
|
|
49
|
-
transition: "border-color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, box-shadow 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms",
|
|
50
|
-
"&:focus-within": {
|
|
51
|
-
borderColor: "primary.main",
|
|
52
|
-
boxShadow: (theme) => `0 0 0 1px ${theme.palette.primary.main}`
|
|
53
|
-
},
|
|
54
|
-
opacity: disabled ? 0.6 : 1,
|
|
55
|
-
pointerEvents: disabled ? "none" : "auto",
|
|
56
|
-
// Cancelar el marginTop que Input/Select reservan en labelPosition="outside".
|
|
57
|
-
// El grupo ya lo reservó en su nivel externo.
|
|
58
|
-
"& .MuiFormControl-root, & > [data-input-group-slot] > .MuiTextField-root, & > [data-input-group-slot] > .MuiFormControl-root": {
|
|
59
|
-
marginTop: 0
|
|
60
|
-
},
|
|
61
|
-
// Quitar el borde del notched outline interno: el borde visible es el del
|
|
62
|
-
// grupo, los separadores son los borderRight/borderBottom de cada slot.
|
|
63
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
|
64
|
-
border: "none"
|
|
65
|
-
},
|
|
66
|
-
// Forzar que todos los campos pinten sus esquinas cuadradas (las esquinas
|
|
67
|
-
// redondeadas se aplican solo al primer/último slot más abajo).
|
|
68
|
-
"& .MuiInputBase-root, & .MuiChip-root": {
|
|
69
|
-
borderRadius: 0
|
|
70
|
-
},
|
|
71
|
-
// Botones integrados: sin radius propio, altura completa, sin sombra.
|
|
72
|
-
"& .MuiButton-root": {
|
|
73
|
-
borderRadius: 0,
|
|
74
|
-
height: "100%",
|
|
75
|
-
boxShadow: "none",
|
|
76
|
-
border: "none"
|
|
77
|
-
},
|
|
78
|
-
// Slots: cada hijo vive en un slot neutro que lo centra verticalmente.
|
|
79
|
-
"& > [data-input-group-slot]": __spreadProps(__spreadValues({
|
|
80
|
-
flex: 1,
|
|
81
|
-
display: "flex",
|
|
82
|
-
alignItems: "center",
|
|
83
|
-
minWidth: 0
|
|
84
|
-
}, isHorizontal ? { borderRight: (theme) => `1px solid ${theme.palette.divider}` } : { borderBottom: (theme) => `1px solid ${theme.palette.divider}` }), {
|
|
85
|
-
"&:last-of-type": {
|
|
86
|
-
borderRight: "none",
|
|
87
|
-
borderBottom: "none"
|
|
88
|
-
}
|
|
89
|
-
}),
|
|
90
|
-
// Esquinas redondeadas: primer slot (izquierda o arriba).
|
|
91
|
-
"& > [data-input-group-slot]:first-of-type .MuiInputBase-root, & > [data-input-group-slot]:first-of-type .MuiButton-root, & > [data-input-group-slot]:first-of-type .MuiChip-root": isHorizontal ? {
|
|
92
|
-
borderTopLeftRadius: radius,
|
|
93
|
-
borderBottomLeftRadius: radius
|
|
94
|
-
} : {
|
|
95
|
-
borderTopLeftRadius: radius,
|
|
96
|
-
borderTopRightRadius: radius
|
|
97
|
-
},
|
|
98
|
-
// Esquinas redondeadas: último slot (derecha o abajo).
|
|
99
|
-
"& > [data-input-group-slot]:last-of-type .MuiInputBase-root, & > [data-input-group-slot]:last-of-type .MuiButton-root, & > [data-input-group-slot]:last-of-type .MuiChip-root": isHorizontal ? {
|
|
100
|
-
borderTopRightRadius: radius,
|
|
101
|
-
borderBottomRightRadius: radius
|
|
102
|
-
} : {
|
|
103
|
-
borderBottomLeftRadius: radius,
|
|
104
|
-
borderBottomRightRadius: radius
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const baseSlotSx = {
|
|
108
|
-
flex: 1,
|
|
109
|
-
display: "flex",
|
|
110
|
-
alignItems: "center",
|
|
111
|
-
minWidth: 0
|
|
112
|
-
};
|
|
113
|
-
return /* @__PURE__ */ jsx(
|
|
114
|
-
Box,
|
|
115
|
-
{
|
|
116
|
-
"data-testid": "input-group",
|
|
117
|
-
className,
|
|
118
|
-
"aria-disabled": disabled ? "true" : void 0,
|
|
119
|
-
sx: mergeSx(baseSx, sx),
|
|
120
|
-
children: slots.map((child, i) => {
|
|
121
|
-
var _a;
|
|
122
|
-
const slotKey = (_a = child.key) != null ? _a : i;
|
|
123
|
-
return /* @__PURE__ */ jsx(
|
|
124
|
-
Box,
|
|
125
|
-
{
|
|
126
|
-
"data-input-group-slot": true,
|
|
127
|
-
sx: mergeSx(baseSlotSx, slotSx),
|
|
128
|
-
children: child
|
|
129
|
-
},
|
|
130
|
-
slotKey
|
|
131
|
-
);
|
|
132
|
-
})
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
};
|
|
1
|
+
import { I, I as I2 } from "../../InputGroup-D5pXKGjZ.js";
|
|
136
2
|
export {
|
|
137
|
-
InputGroup,
|
|
138
|
-
|
|
3
|
+
I as InputGroup,
|
|
4
|
+
I2 as default
|
|
139
5
|
};
|
|
140
6
|
//# sourceMappingURL=InputGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.js","sources":[
|
|
1
|
+
{"version":3,"file":"InputGroup.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,78 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const material = require("@mui/material");
|
|
6
|
-
const MenuButton = ({
|
|
7
|
-
buttonText,
|
|
8
|
-
buttonIcon,
|
|
9
|
-
options,
|
|
10
|
-
variant = "contained"
|
|
11
|
-
}) => {
|
|
12
|
-
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
13
|
-
const [menuWidth, setMenuWidth] = React.useState(0);
|
|
14
|
-
const open = Boolean(anchorEl);
|
|
15
|
-
const buttonRef = React.useRef(null);
|
|
16
|
-
const uniqueId = React.useId();
|
|
17
|
-
const buttonId = `menu-button-${uniqueId}`;
|
|
18
|
-
const menuId = `menu-content-${uniqueId}`;
|
|
19
|
-
const handleClick = (event) => {
|
|
20
|
-
setAnchorEl(event.currentTarget);
|
|
21
|
-
if (buttonRef.current) {
|
|
22
|
-
setMenuWidth(buttonRef.current.offsetWidth);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const handleClose = () => {
|
|
26
|
-
setAnchorEl(null);
|
|
27
|
-
};
|
|
28
|
-
const handleMenuItemClick = (action) => {
|
|
29
|
-
handleClose();
|
|
30
|
-
action();
|
|
31
|
-
};
|
|
32
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
33
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
-
material.Button,
|
|
35
|
-
{
|
|
36
|
-
ref: buttonRef,
|
|
37
|
-
variant,
|
|
38
|
-
id: buttonId,
|
|
39
|
-
"aria-controls": open ? menuId : void 0,
|
|
40
|
-
"aria-haspopup": "true",
|
|
41
|
-
"aria-expanded": open ? "true" : void 0,
|
|
42
|
-
onClick: handleClick,
|
|
43
|
-
startIcon: buttonIcon,
|
|
44
|
-
children: buttonText
|
|
45
|
-
}
|
|
46
|
-
),
|
|
47
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
48
|
-
material.Menu,
|
|
49
|
-
{
|
|
50
|
-
id: menuId,
|
|
51
|
-
anchorEl,
|
|
52
|
-
open,
|
|
53
|
-
onClose: handleClose,
|
|
54
|
-
MenuListProps: {
|
|
55
|
-
"aria-labelledby": buttonId
|
|
56
|
-
},
|
|
57
|
-
PaperProps: {
|
|
58
|
-
style: {
|
|
59
|
-
minWidth: menuWidth
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
children: options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
63
|
-
material.MenuItem,
|
|
64
|
-
{
|
|
65
|
-
onClick: () => handleMenuItemClick(option.action),
|
|
66
|
-
children: [
|
|
67
|
-
option.icon && /* @__PURE__ */ jsxRuntime.jsx(material.ListItemIcon, { children: option.icon }),
|
|
68
|
-
/* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "inherit", noWrap: true, children: option.label })
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
|
-
index
|
|
72
|
-
))
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
] });
|
|
76
|
-
};
|
|
77
|
-
exports.MenuButton = MenuButton;
|
|
3
|
+
const MenuButton = require("../../MenuButton-C4s8rG05.cjs");
|
|
4
|
+
exports.MenuButton = MenuButton.MenuButton;
|
|
78
5
|
//# sourceMappingURL=MenuButton.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.cjs","sources":[
|
|
1
|
+
{"version":3,"file":"MenuButton.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -10,6 +10,12 @@ interface MenuButtonProps {
|
|
|
10
10
|
buttonIcon?: ReactNode;
|
|
11
11
|
options: MenuOption[];
|
|
12
12
|
variant?: ButtonProps['variant'];
|
|
13
|
+
/**
|
|
14
|
+
* Nombre accesible del botón. Obligatorio en la práctica cuando el disparador
|
|
15
|
+
* es solo un ícono (`buttonText` vacío): sin esto el botón queda sin nombre
|
|
16
|
+
* para lectores de pantalla, que es el caso de los menús de acción por fila.
|
|
17
|
+
*/
|
|
18
|
+
'aria-label'?: string;
|
|
13
19
|
}
|
|
14
20
|
export declare const MenuButton: React.FC<MenuButtonProps>;
|
|
15
21
|
export default MenuButton;
|