@m4l/components 9.1.60 → 9.1.61
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/Icon/types.d.ts +1 -1
- package/components/hook-form/RHFCheckbox/RHFCheckbox.js +1 -1
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/MapSourcesTool/index.js +1 -1
- package/components/mui_extended/CheckBox/CheckBox.d.ts +1 -1
- package/components/mui_extended/CheckBox/CheckBox.js +42 -34
- package/components/mui_extended/CheckBox/CheckBox.styles.js +60 -68
- package/components/mui_extended/CheckBox/slots/CheckBoxEnum.d.ts +4 -2
- package/components/mui_extended/CheckBox/slots/CheckBoxEnum.js +3 -1
- package/components/mui_extended/CheckBox/slots/CheckBoxSlots.d.ts +7 -1
- package/components/mui_extended/CheckBox/slots/CheckBoxSlots.js +20 -9
- package/components/mui_extended/CheckBox/test/CheckBox.test.d.ts +1 -0
- package/components/mui_extended/CheckBox/types.d.ts +11 -18
- package/components/mui_extended/Typography/Typography.js +6 -4
- package/components/mui_extended/Typography/types.d.ts +8 -5
- package/components/mui_extended/Typography/typography.styles.js +6 -6
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import { TooltipProps } from '../mui_extended/Tooltip/types';
|
|
|
8
8
|
/**
|
|
9
9
|
* Define la lista de posibles colores que se pueden aplicar al componente icono.
|
|
10
10
|
*/
|
|
11
|
-
export type IconColors = 'primary.main' | 'text.primary' | 'primary.contrastText' | 'info.main' | 'success.main' | 'error.main' | 'warning.main' | string;
|
|
11
|
+
export type IconColors = 'primary.main' | 'text.primary' | 'text.disabled' | 'primary.contrastText' | 'info.main' | 'success.main' | 'error.main' | 'warning.main' | string;
|
|
12
12
|
export interface IconProps extends Pick<TooltipProps, 'placement'> {
|
|
13
13
|
/**
|
|
14
14
|
* URL o ruta de la imagen que se va a mostrar.
|
|
@@ -109,7 +109,7 @@ function MapSourcesTool() {
|
|
|
109
109
|
{
|
|
110
110
|
disabled: currentMapSourceId !== mapSourceOption.id,
|
|
111
111
|
checked: mapSourceOption.roadSeletedOptions?.bicyclingLayer || false,
|
|
112
|
-
|
|
112
|
+
inlineText: "Bycicle",
|
|
113
113
|
onChange: (_e, checked) => {
|
|
114
114
|
setMapSourceRoadMapOptions({ bicyclingLayer: checked });
|
|
115
115
|
}
|
|
@@ -21,4 +21,4 @@ import { CheckboxProps } from './types';
|
|
|
21
21
|
* />
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
export declare const CheckBox: import('react').ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & import('react').RefAttributes<
|
|
24
|
+
export declare const CheckBox: import('react').ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,66 +1,74 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { useModuleSkeleton,
|
|
4
|
-
import {
|
|
2
|
+
import { forwardRef, useId } from "react";
|
|
3
|
+
import { useModuleSkeleton, useEnvironment } from "@m4l/core";
|
|
4
|
+
import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
|
|
5
|
+
import { C as CHECK_BOX_KEY_COMPONENT } from "./constants.js";
|
|
6
|
+
import clsx from "clsx";
|
|
5
7
|
import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
|
|
6
|
-
import { C as CheckBoxRootStyled, M as MUICheckboxStyled,
|
|
7
|
-
|
|
8
|
+
import { C as CheckBoxRootStyled, M as MUICheckboxStyled, I as IconCheckedStyled, a as IconStyled, T as TypographyStyled, S as SkeletonStyled } from "./slots/CheckBoxSlots.js";
|
|
9
|
+
import { C as CheckBoxSlots } from "./slots/CheckBoxEnum.js";
|
|
10
|
+
const CheckBox = forwardRef((props) => {
|
|
8
11
|
const {
|
|
9
12
|
className,
|
|
10
|
-
size = "
|
|
13
|
+
size = "medium",
|
|
11
14
|
disabled,
|
|
12
|
-
color = "
|
|
13
|
-
label,
|
|
15
|
+
color = "default",
|
|
14
16
|
mandatory,
|
|
15
17
|
mandatoryMessage,
|
|
16
18
|
helperMessage,
|
|
19
|
+
id,
|
|
17
20
|
htmlFor,
|
|
18
21
|
error,
|
|
22
|
+
inlineText,
|
|
23
|
+
checked,
|
|
19
24
|
...others
|
|
20
25
|
} = props;
|
|
21
26
|
const { currentSize } = useComponentSize(size);
|
|
22
|
-
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
23
27
|
const isSkeleton = useModuleSkeleton();
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
29
|
+
const classes = getComponentClasses(CHECK_BOX_KEY_COMPONENT, CheckBoxSlots);
|
|
30
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
31
|
+
const hookId = useId();
|
|
32
|
+
const finalId = id || hookId;
|
|
33
|
+
const checkedIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/checked.svg`;
|
|
34
|
+
const uncheckedIconUrl = `${host_static_assets}/${environment_assets}/frontend/components/check_box/assets/icons/unchecked.svg`;
|
|
30
35
|
const ownerState = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
disabled,
|
|
37
|
+
color,
|
|
38
|
+
error,
|
|
39
|
+
size,
|
|
40
|
+
checked
|
|
36
41
|
};
|
|
37
|
-
return /* @__PURE__ */ jsx(CheckBoxRootStyled, {
|
|
42
|
+
return /* @__PURE__ */ jsx(CheckBoxRootStyled, { ownerState: { ...ownerState }, className: clsx(className, classes.root), children: !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
43
|
/* @__PURE__ */ jsx(
|
|
39
44
|
MUICheckboxStyled,
|
|
40
45
|
{
|
|
41
|
-
ownerState: { ownerState },
|
|
46
|
+
ownerState: { ...ownerState },
|
|
42
47
|
disableRipple: true,
|
|
43
|
-
id:
|
|
44
|
-
|
|
48
|
+
id: finalId,
|
|
49
|
+
checked,
|
|
50
|
+
checkedIcon: /* @__PURE__ */ jsx(IconCheckedStyled, { src: checkedIconUrl, size: currentSize, color: disabled ? "text.disabled" : error ? "error.main" : "primary.main", ownerState: { ...ownerState } }),
|
|
51
|
+
icon: /* @__PURE__ */ jsx(IconStyled, { src: uncheckedIconUrl, size: currentSize, ownerState: { ...ownerState }, color: disabled ? "text.disabled" : error ? "error.main" : "text.primary" }),
|
|
52
|
+
disabled,
|
|
53
|
+
inputProps: { "aria-labelledby": finalId, "aria-invalid": error ? "true" : void 0 },
|
|
45
54
|
...others
|
|
46
55
|
}
|
|
47
56
|
),
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
inlineText && /* @__PURE__ */ jsx(
|
|
58
|
+
TypographyStyled,
|
|
50
59
|
{
|
|
60
|
+
component: "label",
|
|
61
|
+
htmlFor: finalId,
|
|
62
|
+
variant: "body",
|
|
51
63
|
ownerState: { ...ownerState },
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
mandatoryMessage,
|
|
56
|
-
helperMessage,
|
|
57
|
-
htmlFor,
|
|
58
|
-
disabled
|
|
64
|
+
size: adjustedSize,
|
|
65
|
+
disabled,
|
|
66
|
+
children: inlineText
|
|
59
67
|
}
|
|
60
68
|
)
|
|
61
69
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
70
|
/* @__PURE__ */ jsx(SkeletonStyled, { ownerState: {}, variant: "rounded", width: "24px", height: "24px" }),
|
|
63
|
-
|
|
71
|
+
inlineText ? /* @__PURE__ */ jsx(SkeletonStyled, { ownerState: {}, variant: "text", width: "100px", height: "24px" }) : null
|
|
64
72
|
] }) });
|
|
65
73
|
});
|
|
66
74
|
export {
|
|
@@ -1,92 +1,84 @@
|
|
|
1
1
|
const checkBoxStyles = {
|
|
2
2
|
/**
|
|
3
3
|
* Estilos generales para el checkbox
|
|
4
|
-
* @author Andrés Quintero - automatic
|
|
5
|
-
* @createdAt 2024-12-30 14:36:06 - automatic
|
|
6
|
-
* @updatedAt 2024-12-30 14:36:10 - automatic
|
|
7
|
-
* @updatedUser Andrés Quintero - automatic
|
|
8
4
|
*/
|
|
9
|
-
root: ({ theme
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
root: ({ theme }) => {
|
|
6
|
+
return {
|
|
7
|
+
display: "flex",
|
|
8
|
+
alignItems: "center",
|
|
9
|
+
outline: "none",
|
|
10
|
+
paddingRight: theme.vars.size.baseSpacings.sp1,
|
|
11
|
+
overflow: "visible",
|
|
12
|
+
boxSizing: "border-box",
|
|
13
|
+
gap: theme.vars.size.baseSpacings.sp1
|
|
14
|
+
// height: theme.vars.size[device][size].action,
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Componente MuiCheckBox, FocusVisible para cuando esta seleccionado el CheckBox
|
|
19
|
+
*/
|
|
20
|
+
muiCheckBox: ({ theme, ownerState }) => {
|
|
21
|
+
const color = ownerState.error ? "error" : "primary";
|
|
22
|
+
const opacityColor = ownerState.error ? "error" : "default";
|
|
23
|
+
const device = theme.generalSettings.isMobile ? "mobile" : "desktop";
|
|
24
|
+
const size = ownerState.size ?? "medium";
|
|
25
|
+
return {
|
|
26
|
+
overflow: "visible",
|
|
27
|
+
height: theme.vars.size[device][size].action,
|
|
28
|
+
width: theme.vars.size[device][size].action,
|
|
20
29
|
borderRadius: theme.size.borderRadius.r1,
|
|
30
|
+
"&:hover": {
|
|
31
|
+
backgroundColor: theme.vars.palette[opacityColor].hoverOpacity
|
|
32
|
+
},
|
|
21
33
|
"&:active": {
|
|
22
|
-
|
|
23
|
-
backgroundColor: ownerState.CheckBoxPaletteColor?.activeOpacity
|
|
34
|
+
backgroundColor: theme.vars.palette[opacityColor].activeOpacity
|
|
24
35
|
},
|
|
25
36
|
"&.Mui-checked": {
|
|
26
|
-
borderRadius: theme.size.borderRadius.r1,
|
|
27
|
-
color: ownerState.CheckBoxPaletteColor?.main,
|
|
28
|
-
"&:active": {
|
|
29
|
-
color: ownerState.CheckBoxPaletteColor?.active,
|
|
30
|
-
backgroundColor: ownerState.CheckBoxPaletteColor?.activeOpacity
|
|
31
|
-
},
|
|
32
37
|
"&:hover": {
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
backgroundColor: theme.vars.palette[color].hoverOpacity,
|
|
39
|
+
"& .M4LIcon-icon": {
|
|
40
|
+
backgroundColor: theme.vars.palette[color].hover
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"&:active": {
|
|
44
|
+
backgroundColor: theme.vars.palette[color].activeOpacity,
|
|
45
|
+
"& .M4LIcon-icon": {
|
|
46
|
+
backgroundColor: theme.vars.palette[color].active
|
|
47
|
+
}
|
|
35
48
|
}
|
|
36
49
|
},
|
|
50
|
+
"&.Mui-focusVisible, &:focus-visible": {
|
|
51
|
+
outline: `1px solid ${theme.vars.palette["primary"].focusVisible}`,
|
|
52
|
+
outlineOffset: 2
|
|
53
|
+
},
|
|
37
54
|
// Historia Disabled para CheckBox
|
|
38
|
-
...ownerState.
|
|
39
|
-
|
|
40
|
-
pointerEvents: ownerState.CheckBoxDisabled ? "none" : "auto",
|
|
55
|
+
...ownerState.disabled && {
|
|
56
|
+
pointerEvents: ownerState.disabled ? "none" : "auto",
|
|
41
57
|
"&:hover": {
|
|
42
|
-
pointerEvents: ownerState.
|
|
58
|
+
pointerEvents: ownerState.disabled ? "none" : "auto"
|
|
43
59
|
}
|
|
44
60
|
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
"& .MuiTypography-root": {
|
|
48
|
-
...ownerState.CheckBoxDisabled && {
|
|
49
|
-
color: `${theme.vars.palette?.text.disabled} !important`
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
//Clase de estilo para cuando esta en estado hover pero no esta seleccionado el CheckBox
|
|
53
|
-
"& .MuiCheckbox-root:not(.Mui-checked):hover": {
|
|
54
|
-
backgroundColor: theme.palette.action.selected
|
|
55
|
-
}
|
|
56
|
-
}),
|
|
61
|
+
};
|
|
62
|
+
},
|
|
57
63
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @author Andrés Quintero - automatic
|
|
60
|
-
* @createdAt 2024-12-30 14:36:06 - automatic
|
|
61
|
-
* @updatedAt 2024-12-30 14:36:10 - automatic
|
|
62
|
-
* @updatedUser Andrés Quintero - automatic
|
|
64
|
+
* Estilos para el inline-text del CheckBox
|
|
63
65
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"&::before": {
|
|
68
|
-
content: '""',
|
|
69
|
-
position: "absolute",
|
|
70
|
-
inset: "0px",
|
|
71
|
-
border: theme.vars.size.borderStroke.container,
|
|
72
|
-
color: theme.vars.palette.primary.main,
|
|
73
|
-
borderRadius: theme.vars.size.borderRadius.r1,
|
|
74
|
-
boxSizing: "border-box"
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"&.MuiButtonBase-root": {}
|
|
66
|
+
skeletonStyled: ({ theme }) => ({
|
|
67
|
+
borderRadius: theme.vars.size.borderRadius.r1,
|
|
68
|
+
backgroundColor: theme.vars.palette?.skeleton.default
|
|
78
69
|
}),
|
|
70
|
+
/**
|
|
71
|
+
* El estilado de este slot, se hace en muiCheckBox, debido a que el input absorve los psuedo selectore, entonces hay que hacerlos desde el nodo padre.
|
|
72
|
+
*/
|
|
73
|
+
icon: {},
|
|
74
|
+
/**
|
|
75
|
+
* El estilado de este slot, se hace en muiCheckBox, debido a que el input absorve los psuedo selectore, entonces hay que hacerlos desde el nodo padre.
|
|
76
|
+
*/
|
|
77
|
+
iconChecked: {},
|
|
79
78
|
/**
|
|
80
79
|
* Estilos para el label del CheckBox
|
|
81
|
-
* @author Andrés Quintero - automatic
|
|
82
|
-
* @createdAt 2024-12-30 14:36:06 - automatic
|
|
83
|
-
* @updatedAt 2024-12-30 14:36:10 - automatic
|
|
84
|
-
* @updatedUser Andrés Quintero - automatic
|
|
85
80
|
*/
|
|
86
|
-
|
|
87
|
-
borderRadius: theme.vars.size.borderRadius.r1
|
|
88
|
-
}),
|
|
89
|
-
labelCheckBox: {}
|
|
81
|
+
typographyStyled: {}
|
|
90
82
|
};
|
|
91
83
|
export {
|
|
92
84
|
checkBoxStyles as c
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare enum CheckBoxSlots {
|
|
2
2
|
root = "root",
|
|
3
3
|
muiCheckBox = "muiCheckBox",
|
|
4
|
-
|
|
5
|
-
skeletonStyled = "skeletonStyled"
|
|
4
|
+
typographyStyled = "typographyStyled",
|
|
5
|
+
skeletonStyled = "skeletonStyled",
|
|
6
|
+
iconChecked = "iconChecked",
|
|
7
|
+
icon = "icon"
|
|
6
8
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
var CheckBoxSlots = /* @__PURE__ */ ((CheckBoxSlots2) => {
|
|
2
2
|
CheckBoxSlots2["root"] = "root";
|
|
3
3
|
CheckBoxSlots2["muiCheckBox"] = "muiCheckBox";
|
|
4
|
-
CheckBoxSlots2["
|
|
4
|
+
CheckBoxSlots2["typographyStyled"] = "typographyStyled";
|
|
5
5
|
CheckBoxSlots2["skeletonStyled"] = "skeletonStyled";
|
|
6
|
+
CheckBoxSlots2["iconChecked"] = "iconChecked";
|
|
7
|
+
CheckBoxSlots2["icon"] = "icon";
|
|
6
8
|
return CheckBoxSlots2;
|
|
7
9
|
})(CheckBoxSlots || {});
|
|
8
10
|
export {
|
|
@@ -4,7 +4,7 @@ export declare const CheckBoxRootStyled: import('@emotion/styled').StyledCompone
|
|
|
4
4
|
export declare const MUICheckboxStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').CheckboxProps, keyof import('@mui/material').CheckboxProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').CheckBoxOwnerState> & Record<string, unknown> & {
|
|
5
5
|
ownerState: Partial<import('../types').CheckBoxOwnerState> & Record<string, unknown>;
|
|
6
6
|
}, {}, {}>;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const TypographyStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Typography/types').TypographyProps, keyof import('../../Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').CheckBoxOwnerState> & Record<string, unknown> & {
|
|
8
8
|
ownerState: Partial<import('../types').CheckBoxOwnerState> & Record<string, unknown>;
|
|
9
9
|
}, {}, {}>;
|
|
10
10
|
export declare const SkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').SkeletonOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
@@ -12,3 +12,9 @@ export declare const SkeletonStyled: import('@emotion/styled').StyledComponent<P
|
|
|
12
12
|
}, "children" | "style" | "variant" | "width" | "height" | "animation" | "sx" | "classes" | "className">, "children" | "ref" | "title" | "id" | "hidden" | "color" | "content" | "style" | "variant" | "width" | "height" | "translate" | "animation" | "sx" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "slot" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').CheckBoxOwnerState> & Record<string, unknown> & {
|
|
13
13
|
ownerState: Partial<import('../types').CheckBoxOwnerState> & Record<string, unknown>;
|
|
14
14
|
}, {}, {}>;
|
|
15
|
+
export declare const IconCheckedStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Icon').IconProps, keyof import('../../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').CheckBoxOwnerState> & Record<string, unknown> & {
|
|
16
|
+
ownerState: Partial<import('../types').CheckBoxOwnerState> & Record<string, unknown>;
|
|
17
|
+
}, {}, {}>;
|
|
18
|
+
export declare const IconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Icon').IconProps, keyof import('../../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').CheckBoxOwnerState> & Record<string, unknown> & {
|
|
19
|
+
ownerState: Partial<import('../types').CheckBoxOwnerState> & Record<string, unknown>;
|
|
20
|
+
}, {}, {}>;
|
|
@@ -3,26 +3,37 @@ import { Checkbox, Skeleton } from "@mui/material";
|
|
|
3
3
|
import { C as CheckBoxSlots } from "./CheckBoxEnum.js";
|
|
4
4
|
import { C as CHECK_BOX_KEY_COMPONENT } from "../constants.js";
|
|
5
5
|
import { c as checkBoxStyles } from "../CheckBox.styles.js";
|
|
6
|
-
import {
|
|
6
|
+
import { T as Typography } from "../../Typography/Typography.js";
|
|
7
|
+
import { I as Icon } from "../../../Icon/Icon.js";
|
|
7
8
|
const CheckBoxRootStyled = styled("div", {
|
|
8
9
|
name: CHECK_BOX_KEY_COMPONENT,
|
|
9
10
|
slot: CheckBoxSlots.root
|
|
10
|
-
})(checkBoxStyles
|
|
11
|
+
})(checkBoxStyles.root);
|
|
11
12
|
const MUICheckboxStyled = styled(Checkbox, {
|
|
12
13
|
name: CHECK_BOX_KEY_COMPONENT,
|
|
13
14
|
slot: CheckBoxSlots.muiCheckBox
|
|
14
|
-
})(checkBoxStyles
|
|
15
|
-
const
|
|
15
|
+
})(checkBoxStyles.muiCheckBox);
|
|
16
|
+
const TypographyStyled = styled(Typography, {
|
|
16
17
|
name: CHECK_BOX_KEY_COMPONENT,
|
|
17
|
-
slot: CheckBoxSlots.
|
|
18
|
-
})(checkBoxStyles
|
|
18
|
+
slot: CheckBoxSlots.typographyStyled
|
|
19
|
+
})(checkBoxStyles.typographyStyled);
|
|
19
20
|
const SkeletonStyled = styled(Skeleton, {
|
|
20
21
|
name: CHECK_BOX_KEY_COMPONENT,
|
|
21
22
|
slot: CheckBoxSlots.skeletonStyled
|
|
22
|
-
})(checkBoxStyles
|
|
23
|
+
})(checkBoxStyles.skeletonStyled);
|
|
24
|
+
const IconCheckedStyled = styled(Icon, {
|
|
25
|
+
name: CHECK_BOX_KEY_COMPONENT,
|
|
26
|
+
slot: CheckBoxSlots.iconChecked
|
|
27
|
+
})(checkBoxStyles.iconChecked);
|
|
28
|
+
const IconStyled = styled(Icon, {
|
|
29
|
+
name: CHECK_BOX_KEY_COMPONENT,
|
|
30
|
+
slot: CheckBoxSlots.icon
|
|
31
|
+
})(checkBoxStyles.icon);
|
|
23
32
|
export {
|
|
24
33
|
CheckBoxRootStyled as C,
|
|
25
|
-
|
|
34
|
+
IconCheckedStyled as I,
|
|
26
35
|
MUICheckboxStyled as M,
|
|
27
|
-
SkeletonStyled as S
|
|
36
|
+
SkeletonStyled as S,
|
|
37
|
+
TypographyStyled as T,
|
|
38
|
+
IconStyled as a
|
|
28
39
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckboxProps as MUICheckboxProps,
|
|
1
|
+
import { CheckboxProps as MUICheckboxProps, Theme } from '@mui/material';
|
|
2
2
|
import { LabelProps } from '../../Label/types';
|
|
3
3
|
import { ComponentPalletColor, Sizes } from '@m4l/styles';
|
|
4
4
|
import { CheckBoxSlots } from './slots';
|
|
@@ -10,38 +10,31 @@ export type OwnerState = Pick<CheckboxProps, 'size' | 'disabled'>;
|
|
|
10
10
|
*/
|
|
11
11
|
export type CheckBoxVariants = 'standard';
|
|
12
12
|
export interface CheckboxProps extends MUICheckboxProps, Omit<LabelProps, 'label' | 'size'> {
|
|
13
|
-
|
|
14
|
-
color?: Extract<ComponentPalletColor, '
|
|
13
|
+
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
14
|
+
color?: Extract<ComponentPalletColor, 'default'>;
|
|
15
|
+
inlineText?: string;
|
|
15
16
|
}
|
|
16
17
|
export interface CheckBoxOwnerState {
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
CheckBoxDisabled?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Color de la paleta de CheckBox.
|
|
19
|
+
* Si está checkedo o no.
|
|
23
20
|
*/
|
|
24
|
-
|
|
21
|
+
checked?: boolean;
|
|
25
22
|
/**
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
CheckBoxVariant?: CheckBoxVariants;
|
|
29
|
-
/**
|
|
30
|
-
* Color de la paleta del componente del CheckBox.
|
|
23
|
+
* Indica si el CheckBox está deshabilitado.
|
|
31
24
|
*/
|
|
32
|
-
|
|
25
|
+
disabled?: boolean;
|
|
33
26
|
/**
|
|
34
27
|
* Tamaño de CheckBox.
|
|
35
28
|
*/
|
|
36
|
-
|
|
29
|
+
size: Extract<Sizes, 'small' | 'medium'>;
|
|
37
30
|
/**
|
|
38
31
|
* Indica si CheckBox es error.
|
|
39
32
|
*/
|
|
40
|
-
|
|
33
|
+
error?: boolean;
|
|
41
34
|
/**
|
|
42
35
|
* Color del campo de CheckBox.
|
|
43
36
|
*/
|
|
44
|
-
|
|
37
|
+
color: Extract<ComponentPalletColor, 'default'>;
|
|
45
38
|
}
|
|
46
39
|
export type CheckBoxSlotsType = keyof typeof CheckBoxSlots;
|
|
47
40
|
export type CheckBoxStyles = OverridesStyleRules<CheckBoxSlotsType, typeof CHECK_BOX_KEY_COMPONENT, Theme>;
|
|
@@ -16,16 +16,18 @@ function Typography(props) {
|
|
|
16
16
|
className,
|
|
17
17
|
dataTestid,
|
|
18
18
|
children,
|
|
19
|
+
disabled,
|
|
19
20
|
...other
|
|
20
21
|
} = props;
|
|
21
22
|
const isSkeleton = useModuleSkeleton();
|
|
22
23
|
const { currentSize } = useComponentSize(size);
|
|
23
24
|
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
24
25
|
const ownerState = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
disabled,
|
|
27
|
+
color,
|
|
28
|
+
size: adjustedSize,
|
|
29
|
+
skeletonRows,
|
|
30
|
+
variant
|
|
29
31
|
};
|
|
30
32
|
return /* @__PURE__ */ jsx(
|
|
31
33
|
StyledMUITypography,
|
|
@@ -41,15 +41,18 @@ export interface TypographyProps extends Omit<MUITypographyProps, 'color' | 'var
|
|
|
41
41
|
dataTestid?: string;
|
|
42
42
|
/** Sirve para vincular un elemento de etiqueta con un elemento de formulario, como un campo de entrada, lo que permite que al hacer clic en el texto de la etiqueta, se active el campo correspondiente*/
|
|
43
43
|
htmlFor?: string | undefined;
|
|
44
|
+
/** Si esta disabled, el texto pasa a text.disabled */
|
|
45
|
+
disabled?: boolean;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Define valores de estado necesarios para estilar el componente.
|
|
47
49
|
*/
|
|
48
50
|
export interface TypographyOwnerState {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
color: TypographyProps['color'];
|
|
53
|
+
variant: TypographyProps['variant'];
|
|
54
|
+
size: TypographyProps['size'];
|
|
55
|
+
skeletonRows: TypographyProps['skeletonRows'];
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
58
|
* Agrupa la lista de slots del componente.
|
|
@@ -59,4 +62,4 @@ export type TypographySlotsType = keyof typeof TypographySlots;
|
|
|
59
62
|
* Define las capacidades de estilos css disponibles para los slots del componente,
|
|
60
63
|
* también asocia la clase TYPOGRAPHY_KEY_COMPONENT a cada slot.
|
|
61
64
|
*/
|
|
62
|
-
export type TypographyStyles =
|
|
65
|
+
export type TypographyStyles = OverridesStyleRules<TypographySlotsType, typeof TYPOGRAPHY_KEY_COMPONENT, Theme>;
|
|
@@ -14,27 +14,27 @@ const typographyStyles = {
|
|
|
14
14
|
// Estilos generales 🌐
|
|
15
15
|
// skeleton spacing when multiple rows 🦴
|
|
16
16
|
fontFamily: theme.typography.fontFamily,
|
|
17
|
-
...ownerState.
|
|
17
|
+
...ownerState.skeletonRows && ownerState.skeletonRows > 1 && {
|
|
18
18
|
display: "flex",
|
|
19
19
|
flexDirection: "column"
|
|
20
20
|
},
|
|
21
21
|
// Override de estilos generales de MUI 🚫
|
|
22
22
|
// color text.primary 🎨
|
|
23
|
-
...ownerState.
|
|
23
|
+
...ownerState.color === "text.primary" && {
|
|
24
24
|
color: theme.vars.palette.text.primary
|
|
25
25
|
},
|
|
26
26
|
// color text.secondary 🎨
|
|
27
|
-
...ownerState.
|
|
27
|
+
...ownerState.color === "text.secondary" && {
|
|
28
28
|
color: theme.vars.palette.text.secondary
|
|
29
29
|
},
|
|
30
30
|
// color text.disabled 🎨
|
|
31
|
-
...ownerState.
|
|
31
|
+
...(ownerState.disabled || ownerState.color === "text.disabled") && {
|
|
32
32
|
color: theme.vars.palette.text.disabled
|
|
33
33
|
},
|
|
34
34
|
...getTypographyStyles(
|
|
35
35
|
theme.generalSettings.isMobile,
|
|
36
|
-
ownerState.
|
|
37
|
-
ownerState.
|
|
36
|
+
ownerState.size || "medium",
|
|
37
|
+
ownerState.variant || "body"
|
|
38
38
|
)
|
|
39
39
|
}
|
|
40
40
|
}),
|