@m4l/components 8.1.0-beta.devDaniel.Icon → 8.1.0-beta.devDaniel.inputNumberSpinner
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/@types/types.d.ts +15 -10
- package/components/ControlIncrement/ControlIncrement.d.ts +5 -0
- package/components/ControlIncrement/ControlIncrement.styles.d.ts +8 -0
- package/components/ControlIncrement/constants.d.ts +25 -0
- package/components/ControlIncrement/slots/ControlIncrementEnum.d.ts +6 -0
- package/components/ControlIncrement/slots/ControltrolIncrementSlots.d.ts +14 -0
- package/components/ControlIncrement/slots/index.d.ts +2 -0
- package/components/ControlIncrement/stories/ControlClick/ControlIncrement.controlclick.stories.d.ts +13 -0
- package/components/ControlIncrement/stories/DefaultAndDisabled/ControlIncrement.defaultanddisabled.stories.d.ts +17 -0
- package/components/ControlIncrement/stories/Sizes/ControlIncrement.sizes.stories.d.ts +21 -0
- package/components/ControlIncrement/types.d.ts +56 -0
- package/components/DataGrid/classes/index.d.ts +1 -1
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +1 -1
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +1 -1
- package/components/GridLayout/classes/index.d.ts +1 -1
- package/components/HelperError/HelperError.js +2 -1
- package/components/HelperError/types.d.ts +4 -0
- package/components/Icon/Icon.d.ts +3 -0
- package/components/Icon/Icon.js +71 -54
- package/components/Icon/Icon.stories.d.ts +166 -0
- package/components/Icon/Icon.styles.js +31 -73
- package/components/Icon/slots/IconEnum.d.ts +1 -2
- package/components/Icon/slots/IconEnum.js +0 -1
- package/components/Icon/slots/IconSlots.d.ts +0 -3
- package/components/Icon/slots/IconSlots.js +1 -7
- package/components/Icon/types.d.ts +12 -16
- package/components/InputNumberSpinner/InputNumberSpinner.d.ts +5 -0
- package/components/InputNumberSpinner/InputNumberSpinner.styles.d.ts +8 -0
- package/components/InputNumberSpinner/constants.d.ts +9 -0
- package/components/InputNumberSpinner/hooks/types.d.ts +13 -0
- package/components/InputNumberSpinner/hooks/useInputNumberSpinner.d.ts +19 -0
- package/components/InputNumberSpinner/index.d.ts +2 -0
- package/components/InputNumberSpinner/slots/InputNumberSpinnerEnum.d.ts +7 -0
- package/components/InputNumberSpinner/slots/InputNumberSpinnerSlots.d.ts +15 -0
- package/components/InputNumberSpinner/slots/index.d.ts +2 -0
- package/components/InputNumberSpinner/stories/Default/InputNumberSpinner.default.stories.d.ts +25 -0
- package/components/InputNumberSpinner/stories/Error/InputNumberSpinner.error.stories.d.ts +25 -0
- package/components/InputNumberSpinner/stories/Sizes/InputNumberSpinner.sizes.stories.d.ts +41 -0
- package/components/InputNumberSpinner/stories/Variants/InputNumberSpinner.variants.stories.d.ts +25 -0
- package/components/InputNumberSpinner/types.d.ts +64 -0
- package/components/Label/Label.js +9 -1
- package/components/Label/slots/LabelSlots.d.ts +1 -1
- package/components/Label/types.d.ts +4 -0
- package/components/PropertyValue/classes/index.d.ts +1 -1
- package/components/SideBar/classes/index.d.ts +1 -1
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/styles.d.ts +1 -1
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/styles.d.ts +1 -1
- package/components/ToastContainer/subcomponents/ToastMessage/useToastMessage.d.ts +1 -1
- package/components/ToastContainer/subcomponents/ToastMessage/useToastMessage.js +1 -2
- package/components/extended/react-resizable/Resizable/slots/ResizableSlots.d.ts +1 -1
- package/components/extended/react-resizable/ResizableBox/slots/ResizableBoxSlots.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/classes/index.d.ts +1 -1
- package/components/hook-form/RHFCheckbox/styles.d.ts +1 -1
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/hook-form/RHFormContext/classes/index.d.ts +1 -1
- package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
- package/components/mui_extended/Button/styles.d.ts +1 -1
- package/components/mui_extended/IconButton/IconButton.js +3 -4
- package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +2 -2
- package/components/mui_extended/IconButton/types.d.ts +1 -1
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots.d.ts +1 -1
- package/components/mui_extended/Skeleton/Slots/skeletonSlots.d.ts +1 -1
- package/components/mui_extended/Tabs/styles.d.ts +1 -1
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/package.json +1 -1
- package/components/Icon/stories/DefaultWithProps/Icon.defaultWithProps.stories.d.ts +0 -35
- package/components/Icon/stories/Preset/Icon.preset.stories.d.ts +0 -16
- package/components/Icon/stories/Semantic/Icon.semantic.stories.d.ts +0 -30
- package/components/Icon/stories/Sizes/icon.sizes.stories.d.ts +0 -40
- package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.d.ts +0 -5
- package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.stories.d.ts +0 -21
- package/components/hook-form/RHFInputNumberSpinner/RHFInputNumberSpinner.styles.d.ts +0 -2
- package/components/hook-form/RHFInputNumberSpinner/constants.d.ts +0 -1
- package/components/hook-form/RHFInputNumberSpinner/index.d.ts +0 -1
- package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnerSlots.d.ts +0 -23
- package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnnerEnum.d.ts +0 -9
- package/components/hook-form/RHFInputNumberSpinner/slots/index.d.ts +0 -2
- package/components/hook-form/RHFInputNumberSpinner/subcomponents/SkeletonSpinner/index.d.ts +0 -4
- package/components/hook-form/RHFInputNumberSpinner/types.d.ts +0 -21
- package/components/hook-form/RHFInputNumberSpinner/useRHFInputNumberSpinner.d.ts +0 -13
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react/*';
|
|
2
|
+
import { Icon } from '.';
|
|
3
|
+
declare const meta: Meta<typeof Icon>;
|
|
4
|
+
type Story = StoryObj<typeof Icon>;
|
|
5
|
+
/**
|
|
6
|
+
* Icon in base mode
|
|
7
|
+
*/
|
|
8
|
+
export declare const Base: Story;
|
|
9
|
+
/**
|
|
10
|
+
* Icon in default src mode
|
|
11
|
+
*/
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
/**
|
|
14
|
+
* icon with the prop to rotate it
|
|
15
|
+
*/
|
|
16
|
+
export declare const Rotation: Story;
|
|
17
|
+
/**
|
|
18
|
+
* Icon with small size
|
|
19
|
+
*/
|
|
20
|
+
export declare const Small: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Icon with medium size
|
|
23
|
+
*/
|
|
24
|
+
export declare const Medium: Story;
|
|
25
|
+
/**
|
|
26
|
+
* Icon with large size
|
|
27
|
+
*/
|
|
28
|
+
export declare const Large: Story;
|
|
29
|
+
/**
|
|
30
|
+
* Icon with tooltip property
|
|
31
|
+
*/
|
|
32
|
+
export declare const WithTooltip: Story;
|
|
33
|
+
/**
|
|
34
|
+
* Icon with security area
|
|
35
|
+
*/
|
|
36
|
+
export declare const WithSecurityArea: Story;
|
|
37
|
+
/**
|
|
38
|
+
* Icon with Color 'primary.main'
|
|
39
|
+
*/
|
|
40
|
+
export declare const WithColorPrimaryMain: {
|
|
41
|
+
parameters: {
|
|
42
|
+
design: {
|
|
43
|
+
type: string;
|
|
44
|
+
url: string;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
args: {
|
|
48
|
+
src: string;
|
|
49
|
+
size: string;
|
|
50
|
+
color: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Icon with Color 'text.primary'
|
|
55
|
+
*/
|
|
56
|
+
export declare const WithColorTextPrimary: {
|
|
57
|
+
parameters: {
|
|
58
|
+
design: {
|
|
59
|
+
type: string;
|
|
60
|
+
url: string;
|
|
61
|
+
}[];
|
|
62
|
+
};
|
|
63
|
+
args: {
|
|
64
|
+
src: string;
|
|
65
|
+
size: string;
|
|
66
|
+
color: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Icon with Color 'contrast.text'
|
|
71
|
+
*/
|
|
72
|
+
export declare const WithColorContrastText: {
|
|
73
|
+
parameters: {
|
|
74
|
+
design: {
|
|
75
|
+
type: string;
|
|
76
|
+
url: string;
|
|
77
|
+
}[];
|
|
78
|
+
};
|
|
79
|
+
args: {
|
|
80
|
+
src: string;
|
|
81
|
+
size: string;
|
|
82
|
+
color: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Icon with Color 'error.main'
|
|
87
|
+
*/
|
|
88
|
+
export declare const WithColorErrorMain: {
|
|
89
|
+
parameters: {
|
|
90
|
+
design: {
|
|
91
|
+
type: string;
|
|
92
|
+
url: string;
|
|
93
|
+
}[];
|
|
94
|
+
};
|
|
95
|
+
args: {
|
|
96
|
+
src: string;
|
|
97
|
+
size: string;
|
|
98
|
+
color: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Icon with Color 'warning.main'
|
|
103
|
+
*/
|
|
104
|
+
export declare const WithColorWarningMain: {
|
|
105
|
+
parameters: {
|
|
106
|
+
design: {
|
|
107
|
+
type: string;
|
|
108
|
+
url: string;
|
|
109
|
+
}[];
|
|
110
|
+
};
|
|
111
|
+
args: {
|
|
112
|
+
src: string;
|
|
113
|
+
size: string;
|
|
114
|
+
color: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Icon with Color 'success.main'
|
|
119
|
+
*/
|
|
120
|
+
export declare const WithColorSuccessMain: {
|
|
121
|
+
parameters: {
|
|
122
|
+
design: {
|
|
123
|
+
type: string;
|
|
124
|
+
url: string;
|
|
125
|
+
}[];
|
|
126
|
+
};
|
|
127
|
+
args: {
|
|
128
|
+
src: string;
|
|
129
|
+
size: string;
|
|
130
|
+
color: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Icon with Color 'info.main'
|
|
135
|
+
*/
|
|
136
|
+
export declare const WithColorInfoMain: {
|
|
137
|
+
parameters: {
|
|
138
|
+
design: {
|
|
139
|
+
type: string;
|
|
140
|
+
url: string;
|
|
141
|
+
}[];
|
|
142
|
+
};
|
|
143
|
+
args: {
|
|
144
|
+
src: string;
|
|
145
|
+
size: string;
|
|
146
|
+
color: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Icon with disabled property''
|
|
151
|
+
*/
|
|
152
|
+
export declare const WithDisabled: {
|
|
153
|
+
parameters: {
|
|
154
|
+
design: {
|
|
155
|
+
type: string;
|
|
156
|
+
url: string;
|
|
157
|
+
}[];
|
|
158
|
+
};
|
|
159
|
+
args: {
|
|
160
|
+
src: string;
|
|
161
|
+
size: string;
|
|
162
|
+
color: string;
|
|
163
|
+
disabled: boolean;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
export default meta;
|
|
@@ -1,96 +1,54 @@
|
|
|
1
1
|
import { getPropertyByString } from "@m4l/core";
|
|
2
2
|
const iconStyles = {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* Este slot es responsable de definir el layout del ícono dentro de su contenedor,
|
|
6
|
-
* incluyendo propiedades de flexbox para centrar su contenido, y el tamaño
|
|
7
|
-
* dinámico basado en el dispositivo (móvil o desktop) y el tamaño del ícono
|
|
8
|
-
* ('small' o 'medium'). También incluye animaciones como la transición
|
|
9
|
-
* suave de transformación.
|
|
4
|
+
* TODO: Documentar
|
|
10
5
|
*/
|
|
11
6
|
root: ({ theme, ownerState }) => ({
|
|
12
|
-
display:
|
|
7
|
+
display: "flex",
|
|
13
8
|
justifyContent: "center",
|
|
14
9
|
alignItems: "center",
|
|
15
10
|
width: "fit-content",
|
|
16
11
|
transition: "transform 0.5s ease-in-out",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
height: theme.vars.size.mobile.medium.base
|
|
21
|
-
} : {
|
|
22
|
-
width: theme.vars.size.desktop.medium.base,
|
|
23
|
-
height: theme.vars.size.desktop.medium.base
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
...ownerState.iconSize === "small" && {
|
|
27
|
-
...theme.generalSettings.isMobile ? {
|
|
28
|
-
width: theme.vars.size.mobile.small.base,
|
|
29
|
-
height: theme.vars.size.mobile.small.base
|
|
30
|
-
} : {
|
|
31
|
-
width: theme.vars.size.desktop.small.base,
|
|
32
|
-
height: theme.vars.size.desktop.small.base
|
|
33
|
-
}
|
|
34
|
-
}
|
|
12
|
+
borderRadius: ownerState.skeleton ? "4px" : void 0,
|
|
13
|
+
backgroundColor: ownerState.skeleton ? `${theme.vars.palette.skeleton.default} !important` : void 0,
|
|
14
|
+
padding: ownerState.securityArea ? "8px" : "0px"
|
|
35
15
|
}),
|
|
16
|
+
tooltip: () => ({}),
|
|
36
17
|
/**
|
|
37
|
-
*
|
|
38
|
-
* Este slot gestiona cómo se carga y muestra el recurso gráfico en formato de máscara,
|
|
39
|
-
* incluyendo su posición, repetición y ajuste de tamaño. También controla la rotación
|
|
40
|
-
* del ícono basada en el ángulo de rotación proporcionado, y el color de fondo que
|
|
41
|
-
* se ajusta de acuerdo con el estado de deshabilitación o no del ícono.
|
|
18
|
+
* TODO: Documentar
|
|
42
19
|
*/
|
|
43
20
|
icon: ({ theme, ownerState }) => ({
|
|
44
21
|
maskPosition: "center",
|
|
45
22
|
maskRepeat: "no-repeat",
|
|
46
23
|
maskSize: "cover",
|
|
47
24
|
WebkitMaskRepeat: "no-repeat",
|
|
48
|
-
mask: `url(${ownerState.
|
|
49
|
-
WebkitMask: `url(${ownerState.
|
|
25
|
+
mask: `url(${ownerState.src})`,
|
|
26
|
+
WebkitMask: `url(${ownerState.src})`,
|
|
50
27
|
WebkitMaskSize: "cover",
|
|
51
|
-
...ownerState.
|
|
52
|
-
transform: `rotate(${ownerState.
|
|
28
|
+
...ownerState.rotationAngle && {
|
|
29
|
+
transform: `rotate(${ownerState.rotationAngle}deg)`
|
|
53
30
|
},
|
|
54
|
-
backgroundColor: !ownerState.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
* un contorno visible para indicar que la carga está en progreso. Incluye un
|
|
63
|
-
* borde redondeado y tamaño del ícono.
|
|
64
|
-
*/
|
|
65
|
-
iconSkeleton: ({ theme, ownerState }) => ({
|
|
66
|
-
"&.M4lclassCssSpecificity": {
|
|
67
|
-
borderRadius: theme.size.borderRadius.r1,
|
|
68
|
-
...ownerState.iconSize === "medium" && {
|
|
69
|
-
...theme.generalSettings.isMobile ? {
|
|
70
|
-
width: theme.vars.size.mobile.medium.base,
|
|
71
|
-
height: theme.vars.size.mobile.medium.base
|
|
72
|
-
} : {
|
|
73
|
-
width: theme.vars.size.desktop.medium.base,
|
|
74
|
-
height: theme.vars.size.desktop.medium.base
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
...ownerState.iconSize === "small" && {
|
|
78
|
-
...theme.generalSettings.isMobile ? {
|
|
79
|
-
width: theme.vars.size.mobile.small.base,
|
|
80
|
-
height: theme.vars.size.mobile.small.base
|
|
81
|
-
} : {
|
|
82
|
-
width: theme.vars.size.desktop.small.base,
|
|
83
|
-
height: theme.vars.size.desktop.small.base
|
|
84
|
-
}
|
|
31
|
+
backgroundColor: !ownerState.disabled ? getPropertyByString(theme.vars.palette, ownerState.color || "text.primary") : theme.vars.palette.text.disabled,
|
|
32
|
+
...ownerState.size === "medium" && {
|
|
33
|
+
...theme.generalSettings.isMobile ? {
|
|
34
|
+
minWidth: theme.vars.size.mobile.medium.base,
|
|
35
|
+
minHeight: theme.vars.size.mobile.medium.action
|
|
36
|
+
} : {
|
|
37
|
+
minWidth: theme.vars.size.desktop.medium.base,
|
|
38
|
+
minHeight: theme.vars.size.desktop.medium.base
|
|
85
39
|
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
40
|
+
},
|
|
41
|
+
...ownerState.size === "small" && {
|
|
42
|
+
...theme.generalSettings.isMobile ? {
|
|
43
|
+
minWidth: theme.vars.size.mobile.small.base,
|
|
44
|
+
minHeight: theme.vars.size.mobile.small.action
|
|
45
|
+
} : {
|
|
46
|
+
minWidth: theme.vars.size.desktop.small.base,
|
|
47
|
+
minHeight: theme.vars.size.desktop.small.base
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
variants: []
|
|
51
|
+
})
|
|
94
52
|
};
|
|
95
53
|
export {
|
|
96
54
|
iconStyles as i
|
|
@@ -7,6 +7,3 @@ export declare const TooltipStyled: import('@emotion/styled').StyledComponent<Pi
|
|
|
7
7
|
export declare const IconStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('..').IconOwnerState> & Record<string, unknown> & {
|
|
8
8
|
ownerState: Partial<import('..').IconOwnerState> & Record<string, unknown>;
|
|
9
9
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
10
|
-
export declare const IconSkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Skeleton/types').SkeletonProps, keyof import('../../mui_extended/Skeleton/types').SkeletonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('..').IconOwnerState> & Record<string, unknown> & {
|
|
11
|
-
ownerState: Partial<import('..').IconOwnerState> & Record<string, unknown>;
|
|
12
|
-
}, {}, {}>;
|
|
@@ -3,7 +3,6 @@ import { I as IconSlots } from "./IconEnum.js";
|
|
|
3
3
|
import { a as ICON_KEY_COMPONENT } from "../constants.js";
|
|
4
4
|
import { i as iconStyles } from "../Icon.styles.js";
|
|
5
5
|
import { T as Tooltip } from "../../mui_extended/Tooltip/Tooltip.js";
|
|
6
|
-
import { S as Skeleton } from "../../mui_extended/Skeleton/Skeleton.js";
|
|
7
6
|
const RootStyled = styled("div", {
|
|
8
7
|
name: ICON_KEY_COMPONENT,
|
|
9
8
|
slot: IconSlots.root
|
|
@@ -16,13 +15,8 @@ const IconStyled = styled("div", {
|
|
|
16
15
|
name: ICON_KEY_COMPONENT,
|
|
17
16
|
slot: IconSlots.icon
|
|
18
17
|
})(iconStyles?.icon);
|
|
19
|
-
const IconSkeletonStyled = styled(Skeleton, {
|
|
20
|
-
name: ICON_KEY_COMPONENT,
|
|
21
|
-
slot: IconSlots.iconSkeleton
|
|
22
|
-
})(iconStyles?.iconSkeleton);
|
|
23
18
|
export {
|
|
24
19
|
IconStyled as I,
|
|
25
20
|
RootStyled as R,
|
|
26
|
-
TooltipStyled as T
|
|
27
|
-
IconSkeletonStyled as a
|
|
21
|
+
TooltipStyled as T
|
|
28
22
|
};
|
|
@@ -5,10 +5,6 @@ import { ICON_KEY_COMPONENT } from './constants';
|
|
|
5
5
|
import { Sizes } from '@m4l/styles';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
7
|
import { TooltipProps } from '../mui_extended';
|
|
8
|
-
/**
|
|
9
|
-
* Define la lista de posibles colores que se pueden aplicar al componente icono.
|
|
10
|
-
*/
|
|
11
|
-
export type IconColors = 'primary.main' | 'text.primary' | 'primary.contrastText' | 'info.main' | 'success.main' | 'error.main' | 'warning.main';
|
|
12
8
|
export interface IconProps extends Pick<TooltipProps, 'placement'> {
|
|
13
9
|
/**
|
|
14
10
|
* URL o ruta de la imagen que se va a mostrar.
|
|
@@ -17,7 +13,7 @@ export interface IconProps extends Pick<TooltipProps, 'placement'> {
|
|
|
17
13
|
/**
|
|
18
14
|
* Tamaño del componente, puede ser uno de los valores definidos en 'small' , 'medium' , 'large'.
|
|
19
15
|
*/
|
|
20
|
-
size?:
|
|
16
|
+
size?: Sizes;
|
|
21
17
|
/**
|
|
22
18
|
* Ángulo de rotación de la imagen en grados.
|
|
23
19
|
*/
|
|
@@ -26,10 +22,18 @@ export interface IconProps extends Pick<TooltipProps, 'placement'> {
|
|
|
26
22
|
* Nombre del tooltip que se mostrará al pasar el cursor sobre el componente.
|
|
27
23
|
*/
|
|
28
24
|
tooltipContent?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Indica si se debe mostrar un esqueleto de carga en lugar de la imagen mientras esta se carga.
|
|
27
|
+
*/
|
|
28
|
+
skeleton?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Indica si se debe resaltar un área de seguridad en el componente.
|
|
31
|
+
*/
|
|
32
|
+
securityArea?: boolean;
|
|
29
33
|
/**
|
|
30
34
|
* Esquema de color a aplicar al componente de los valores definidos en 'ColorSchemeComponent'.
|
|
31
35
|
*/
|
|
32
|
-
color?:
|
|
36
|
+
color?: 'primary.main' | 'text.primary' | 'primary.contrastText' | 'info.main' | 'success.main' | 'error.main' | 'warning.main';
|
|
33
37
|
/**
|
|
34
38
|
* Clase externa
|
|
35
39
|
*/
|
|
@@ -44,16 +48,8 @@ export interface IconProps extends Pick<TooltipProps, 'placement'> {
|
|
|
44
48
|
*/
|
|
45
49
|
disabled?: boolean;
|
|
46
50
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*/
|
|
50
|
-
export interface IconOwnerState {
|
|
51
|
-
iconSize: Sizes;
|
|
52
|
-
iconRotationAngle?: number;
|
|
53
|
-
iconColor: IconColors;
|
|
54
|
-
iconDisabled?: boolean;
|
|
55
|
-
iconSrc: string;
|
|
56
|
-
isSkeleton: boolean;
|
|
51
|
+
export type OwnerState = Pick<IconProps, 'size' | 'rotationAngle' | 'skeleton' | 'securityArea' | 'color' | 'disabled'>;
|
|
52
|
+
export interface IconOwnerState extends IconProps, OwnerState {
|
|
57
53
|
}
|
|
58
54
|
export type IconSlotsType = keyof typeof IconSlots;
|
|
59
55
|
export type IconStyles = Partial<OverridesStyleRules<IconSlotsType, typeof ICON_KEY_COMPONENT, Theme> | undefined> | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InputNumberSpinnerProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Componente que permite la selección de un número a través de un input y dos botones de incremento y decremento.
|
|
4
|
+
*/
|
|
5
|
+
export declare const InputNumberSpinner: (props: InputNumberSpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InputNumberSpinnerStyles } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Estilos utilizados para el componente `InputNumberSpinner`.
|
|
4
|
+
* Este objeto define los estilos para los diferentes "slots" (partes) del componente,
|
|
5
|
+
* como el contenedor principal (`root`), el campo de entrada (`input`), el símbolo (`simbol`),
|
|
6
|
+
* el controlador de botones de incremento/decremento (`controlIncrement`), y el esqueleto (`skeleton`).
|
|
7
|
+
*/
|
|
8
|
+
export declare const inputNumberSpinnerStyles: InputNumberSpinnerStyles;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nombre de clase que se usa para dar identidad a los slots del componente.
|
|
3
|
+
*/
|
|
4
|
+
export declare const INPUTNUMBER_SPINNER_KEY_COMPONENT = "M4LInputNumberSpinner";
|
|
5
|
+
/**
|
|
6
|
+
* Nombre de clase creado para aportar especificidad a los estilos del componente. Es usado para sobreescribir los estilos de MUI sin
|
|
7
|
+
* tener la necesidad de agregar valores en !important.
|
|
8
|
+
*/
|
|
9
|
+
export declare const INPUTNUMBER_SPINNER_SPECIFY = "M4lclassCssSpecificity";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InputNumberSpinnerProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Props utilizadas para el hook `useInputNumberSpinner`, que maneja la lógica interna del componente `InputNumberSpinner`.
|
|
4
|
+
*
|
|
5
|
+
* Esta interfaz extiende parcialmente las propiedades de `InputNumberSpinnerProps`, seleccionando
|
|
6
|
+
* solo las propiedades relacionadas con los valores máximo y mínimo, los pasos, y el valor actual.
|
|
7
|
+
*/
|
|
8
|
+
export interface UseInputNumberSpinnerProps extends Pick<InputNumberSpinnerProps, 'maxValue' | 'minValue' | 'steps' | 'value'> {
|
|
9
|
+
/**
|
|
10
|
+
* Función opcional para establecer el valor del campo externamente (como en react-hook-form)
|
|
11
|
+
*/
|
|
12
|
+
onChange?: (...event: any[]) => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UseInputNumberSpinnerProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* customHook que permite la validacion de el incremento y decremento del input.
|
|
4
|
+
* @param maxValue Permite fijar un maximo valor para el input
|
|
5
|
+
* @param minValue Permite fijar un minimo valor para el input
|
|
6
|
+
* @param steps Permite definir de cuanto aumenta el input
|
|
7
|
+
* @param value Valor inicial del input
|
|
8
|
+
* @param setValue Función opcional para establecer el valor externamente (como en react-hook-form)
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare const useInputNumberSpinner: (props: UseInputNumberSpinnerProps) => {
|
|
12
|
+
onChangeUp: () => void;
|
|
13
|
+
onChangeDown: () => void;
|
|
14
|
+
evalsetInternalValue: (val: number, operation?: "increase" | "decrease") => void;
|
|
15
|
+
handleKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
16
|
+
isSkeleton: boolean;
|
|
17
|
+
internalValue: number;
|
|
18
|
+
theme: import('@mui/material').Theme;
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
2
|
+
ownerState: Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const InputStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
5
|
+
ownerState: Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
6
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, keyof import('react').ClassAttributes<HTMLInputElement> | keyof import('react').InputHTMLAttributes<HTMLInputElement>>, {}>;
|
|
7
|
+
export declare const SimbolStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
8
|
+
ownerState: Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export declare const ControlIncrementStyles: import('@emotion/styled').StyledComponent<Pick<import('../../ControlIncrement/types').ControlIncrementProps, keyof import('../../ControlIncrement/types').ControlIncrementProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
11
|
+
ownerState: Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
12
|
+
}, {}, {}>;
|
|
13
|
+
export declare const SkeletonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Skeleton/types').SkeletonProps, keyof import('../../mui_extended/Skeleton/types').SkeletonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown> & {
|
|
14
|
+
ownerState: Partial<import('../types').InputNumberSpinnerOwnerState> & Record<string, unknown>;
|
|
15
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { InputNumberSpinner } from '../../InputNumberSpinner';
|
|
3
|
+
declare const meta: Meta<typeof InputNumberSpinner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof InputNumberSpinner>;
|
|
6
|
+
/**
|
|
7
|
+
* Componente InputNumberSpinner en su modo por defecto
|
|
8
|
+
*/
|
|
9
|
+
export declare const Base: Story;
|
|
10
|
+
/**
|
|
11
|
+
* Componente InputNumberSpinner en su modo por defecto combinado con un icono
|
|
12
|
+
*/
|
|
13
|
+
export declare const DefaultWidthIcon: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Componente InputNumberSpinner en su modo por Disabled
|
|
16
|
+
*/
|
|
17
|
+
export declare const Disabled: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Componente InputNumberSpinner en su modo por Disabled combinado con un icono
|
|
20
|
+
*/
|
|
21
|
+
export declare const DisabledWidthIcon: Story;
|
|
22
|
+
/**
|
|
23
|
+
* Componente InputNumberSpinner en su modo de carga (Skeleton)
|
|
24
|
+
*/
|
|
25
|
+
export declare const WithSkeleton: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { InputNumberSpinner } from '../../InputNumberSpinner';
|
|
3
|
+
declare const meta: Meta<typeof InputNumberSpinner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof InputNumberSpinner>;
|
|
6
|
+
/**
|
|
7
|
+
* Componente InputNumberSpinner en su modo por defecto
|
|
8
|
+
*/
|
|
9
|
+
export declare const Base: Story;
|
|
10
|
+
/**
|
|
11
|
+
* Componente InputNumberSpinner en su modo por Error con la variante Outlined
|
|
12
|
+
*/
|
|
13
|
+
export declare const ErrorInOutlined: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Componente InputNumberSpinner en su modo por Error con la variante Outlined combinado con un icono
|
|
16
|
+
*/
|
|
17
|
+
export declare const ErrorInOutlinedWidthIcon: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Componente InputNumberSpinner en su modo por Error con la variante Text
|
|
20
|
+
*/
|
|
21
|
+
export declare const ErrorInText: Story;
|
|
22
|
+
/**
|
|
23
|
+
* Componente InputNumberSpinner en su modo por Error con la variante Text combinado con un icono
|
|
24
|
+
*/
|
|
25
|
+
export declare const ErrorInTextWidthIcon: Story;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { InputNumberSpinner } from '../../InputNumberSpinner';
|
|
3
|
+
declare const meta: Meta<typeof InputNumberSpinner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof InputNumberSpinner>;
|
|
6
|
+
/**
|
|
7
|
+
* Componente InputNumberSpinner en su modo por defecto
|
|
8
|
+
*/
|
|
9
|
+
export declare const Base: Story;
|
|
10
|
+
/**
|
|
11
|
+
* Componente InputNumberSpinner en su variante Outlined
|
|
12
|
+
*/
|
|
13
|
+
export declare const OutlinedInSmallSize: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Componente InputNumberSpinner en su variante Outlined combinado con icono
|
|
16
|
+
*/
|
|
17
|
+
export declare const OutlinedInSmallSizeWidthIcon: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Componente InputNumberSpinner en su variante Outlined
|
|
20
|
+
*/
|
|
21
|
+
export declare const OutlinedInMediumSize: Story;
|
|
22
|
+
/**
|
|
23
|
+
* Componente InputNumberSpinner en su variante Outlined combinado con icono
|
|
24
|
+
*/
|
|
25
|
+
export declare const OutlinedInMediumSizeWidthIcon: Story;
|
|
26
|
+
/**
|
|
27
|
+
* Componente InputNumberSpinner en su variante Text
|
|
28
|
+
*/
|
|
29
|
+
export declare const TextInSmallSize: Story;
|
|
30
|
+
/**
|
|
31
|
+
* Componente InputNumberSpinner en su variante Text combinado con icono
|
|
32
|
+
*/
|
|
33
|
+
export declare const TextInSmallSizeWidthIcon: Story;
|
|
34
|
+
/**
|
|
35
|
+
* Componente InputNumberSpinner en su variante Text
|
|
36
|
+
*/
|
|
37
|
+
export declare const TextInMediumSize: Story;
|
|
38
|
+
/**
|
|
39
|
+
* Componente InputNumberSpinner en su variante Text
|
|
40
|
+
*/
|
|
41
|
+
export declare const TextInMediumSizeWidthIcon: Story;
|
package/components/InputNumberSpinner/stories/Variants/InputNumberSpinner.variants.stories.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { InputNumberSpinner } from '../../InputNumberSpinner';
|
|
3
|
+
declare const meta: Meta<typeof InputNumberSpinner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof InputNumberSpinner>;
|
|
6
|
+
/**
|
|
7
|
+
* Componente InputNumberSpinner en su modo por defecto
|
|
8
|
+
*/
|
|
9
|
+
export declare const Base: Story;
|
|
10
|
+
/**
|
|
11
|
+
* Componente InputNumberSpinner en su variante Outlined
|
|
12
|
+
*/
|
|
13
|
+
export declare const Outlined: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Componente InputNumberSpinner en su variante Outlined combinado con icono
|
|
16
|
+
*/
|
|
17
|
+
export declare const OutlinedWidthIcon: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Componente InputNumberSpinner en su variante Text
|
|
20
|
+
*/
|
|
21
|
+
export declare const Text: Story;
|
|
22
|
+
/**
|
|
23
|
+
* Componente InputNumberSpinner en su variante Text combinado con icono
|
|
24
|
+
*/
|
|
25
|
+
export declare const TextWidthIcon: Story;
|