@m4l/components 9.3.28 → 9.3.29-JT19112025.beta.2

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.
Files changed (151) hide show
  1. package/components/Color/Color.js +32 -131
  2. package/components/Color/Color.styles.js +6 -124
  3. package/components/Color/slots/ColorEnum.d.ts +1 -3
  4. package/components/Color/slots/ColorEnum.js +1 -3
  5. package/components/Color/slots/ColorSlots.d.ts +3 -18
  6. package/components/Color/slots/ColorSlots.js +6 -19
  7. package/components/Color/types.d.ts +6 -7
  8. package/components/DataGrid/DataGrid.js +1 -1
  9. package/components/DataGrid/Datagrid.styles.js +111 -39
  10. package/components/DataGrid/dictionary.d.ts +1 -0
  11. package/components/DataGrid/dictionary.js +2 -1
  12. package/components/DataGrid/formatters/ColumnColorFormatter/formatter.d.ts +6 -0
  13. package/components/DataGrid/formatters/ColumnColorFormatter/formatter.js +19 -0
  14. package/components/DataGrid/formatters/ColumnColorFormatter/index.d.ts +3 -0
  15. package/components/DataGrid/formatters/ColumnColorFormatter/index.js +1 -0
  16. package/components/DataGrid/formatters/ColumnColorFormatter/tests/ColumnColorFormatter.test.d.ts +1 -0
  17. package/components/DataGrid/formatters/ColumnColorFormatter/tests/useColumnColor.test.d.ts +1 -0
  18. package/components/DataGrid/formatters/ColumnColorFormatter/types.d.ts +12 -0
  19. package/components/DataGrid/formatters/ColumnColorFormatter/types.js +1 -0
  20. package/components/DataGrid/formatters/ColumnColorFormatter/useColumnColor.d.ts +14 -0
  21. package/components/DataGrid/formatters/ColumnColorFormatter/useColumnColor.js +22 -0
  22. package/components/DataGrid/formatters/ColumnTagsFormatter/tests/ColumnTagsFormatter.test.d.ts +1 -0
  23. package/components/DataGrid/formatters/ColumnTagsFormatter/tests/useColumnTags.test.d.ts +1 -0
  24. package/components/DataGrid/formatters/index.d.ts +1 -0
  25. package/components/DataGrid/icons.d.ts +1 -0
  26. package/components/DataGrid/icons.js +2 -1
  27. package/components/DataGrid/slots/DataGridEnum.d.ts +4 -1
  28. package/components/DataGrid/slots/DataGridEnum.js +3 -0
  29. package/components/DataGrid/slots/DataGridSlot.d.ts +3 -0
  30. package/components/DataGrid/slots/DataGridSlot.js +48 -33
  31. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -1
  32. package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +40 -5
  33. package/components/DataGrid/subcomponents/Cards/index.js +4 -2
  34. package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +34 -8
  35. package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +1 -1
  36. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +2 -2
  37. package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +5 -1
  38. package/components/DataGrid/subcomponents/Cards/types.d.ts +8 -0
  39. package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +1 -1
  40. package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
  41. package/components/DataGrid/subcomponents/HeaderActions/index.js +2 -2
  42. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
  43. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
  44. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
  45. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
  46. package/components/DataGrid/subcomponents/Table/index.js +1 -1
  47. package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +1 -0
  48. package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +39 -14
  49. package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
  50. package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
  51. package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
  52. package/components/DataGrid/tests/helpers/generators.d.ts +26 -0
  53. package/components/DataGrid/tests/helpers/types.d.ts +2 -0
  54. package/components/DataGrid/types.d.ts +8 -0
  55. package/components/DynamicFilter/subcomponents/DynamicFilterBase/DynamicFilterBase.js +1 -1
  56. package/components/DynamicSort/subcomponents/AppliedSorts/AppliedSorts.js +1 -1
  57. package/components/DynamicSort/subcomponents/DynamicSortBase/DynamicSortBase.js +1 -1
  58. package/components/Icon/Icon.js +1 -1
  59. package/components/Image/Image.js +1 -1
  60. package/components/Image/subcomponents/IntersectComponent/index.js +1 -1
  61. package/components/ImageText/ImageText.js +1 -1
  62. package/components/LanguagePopover/LanguagePopover.js +1 -1
  63. package/components/LinearProgressIndeterminate/LinearProgressIndeterminate.js +1 -1
  64. package/components/LoadingError/LoadingError.js +1 -1
  65. package/components/NumberInput/NumberInput.js +1 -1
  66. package/components/ObjectLogs/subcomponents/ObjectLogsByM4L/ObjectLogsByM4L.js +1 -1
  67. package/components/ObjectLogs/subcomponents/ObjectLogsByOthers/ObjectLogsByOthers.js +1 -1
  68. package/components/PDFViewer/PDFViewer.js +1 -1
  69. package/components/PrintingSystem/PrintingSystem.js +1 -1
  70. package/components/PropertyValue/PropertyValue.js +1 -1
  71. package/components/ToastContainer/ToastContainer.js +1 -1
  72. package/components/WindowBase/WindowBase.js +1 -1
  73. package/components/WindowConfirm/WindowConfirm.js +1 -1
  74. package/components/areas/components/AreasAdmin/AreasAdmin.js +1 -1
  75. package/components/areas/components/AreasViewer/AreasViewer.js +1 -1
  76. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +1 -1
  77. package/components/commercial/TopBar/TopBar.js +1 -1
  78. package/components/commercial/TopBar/component/ConteinItem/index.js +1 -1
  79. package/components/commercial/TopBar/component/ConteinItem/subcomponets/NavItem/index.js +1 -1
  80. package/components/extended/React-Spinners/PropagateLoaderSpinner/PropagateLoaderSpinner.js +1 -1
  81. package/components/extended/React-resizable-panels/SplitLayout.js +1 -1
  82. package/components/formatters/BooleanFormatter/BooleanFormatter.js +1 -1
  83. package/components/formatters/ColorFormatter/ColorFormatter.d.ts +18 -0
  84. package/components/formatters/ColorFormatter/ColorFormatter.js +35 -0
  85. package/components/formatters/ColorFormatter/ColorFormatter.styles.d.ts +2 -0
  86. package/components/formatters/ColorFormatter/ColorFormatter.styles.js +15 -0
  87. package/components/formatters/ColorFormatter/constants.d.ts +1 -0
  88. package/components/formatters/ColorFormatter/constants.js +4 -0
  89. package/components/formatters/ColorFormatter/index.d.ts +3 -0
  90. package/components/formatters/ColorFormatter/index.js +1 -0
  91. package/components/formatters/ColorFormatter/slots/ColorFormatterEnum.d.ts +3 -0
  92. package/components/formatters/ColorFormatter/slots/ColorFormatterEnum.js +7 -0
  93. package/components/formatters/ColorFormatter/slots/ColorFormatterSlots.d.ts +4 -0
  94. package/components/formatters/ColorFormatter/slots/ColorFormatterSlots.js +11 -0
  95. package/components/formatters/ColorFormatter/types.d.ts +24 -0
  96. package/components/formatters/ColorFormatter/types.js +1 -0
  97. package/components/formatters/ConcatenatedFormatter/ConcatenatedFormatter.js +1 -1
  98. package/components/formatters/DateFormatter/DateFormatter.js +1 -1
  99. package/components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.js +1 -1
  100. package/components/formatters/PeriodFormatter/PeriodFormatter.js +1 -1
  101. package/components/formatters/PointsFormatter/PointsFormatter.js +1 -1
  102. package/components/formatters/PriceFormatter/PriceFormatter.js +1 -1
  103. package/components/formatters/UncertaintyFormatter/UncertaintyFormatter.js +1 -1
  104. package/components/formatters/index.d.ts +1 -0
  105. package/components/hook-form/RHFColorPicker/RFHColorPicker.js +28 -36
  106. package/components/hook-form/RHFColorPicker/RHFColorPicker.styles.js +156 -0
  107. package/components/hook-form/RHFColorPicker/hooks/useColorPicker/index.d.ts +2 -0
  108. package/components/hook-form/RHFColorPicker/hooks/useColorPicker/types.d.ts +9 -0
  109. package/components/hook-form/RHFColorPicker/hooks/useColorPicker/useColorPicker.d.ts +41 -0
  110. package/components/hook-form/RHFColorPicker/hooks/useColorPicker/useColorPicker.js +50 -0
  111. package/components/hook-form/RHFColorPicker/slots/RHFColorPickerEnum.d.ts +4 -1
  112. package/components/hook-form/RHFColorPicker/slots/RHFColorPickerEnum.js +3 -0
  113. package/components/hook-form/RHFColorPicker/slots/RHFColorPickerSlots.d.ts +21 -0
  114. package/components/hook-form/RHFColorPicker/slots/RHFColorPickerSlots.js +19 -1
  115. package/components/hook-form/RHFColorPicker/slots/index.js +1 -0
  116. package/components/hook-form/RHFColorPicker/subcomponents/ColorPickerField/ColorPickerField.d.ts +33 -0
  117. package/components/hook-form/RHFColorPicker/subcomponents/ColorPickerField/ColorPickerField.js +147 -0
  118. package/components/hook-form/RHFColorPicker/subcomponents/ColorPickerField/index.d.ts +2 -0
  119. package/components/hook-form/RHFColorPicker/subcomponents/ColorPickerField/index.js +1 -0
  120. package/components/hook-form/RHFColorPicker/subcomponents/ColorPickerField/types.d.ts +20 -0
  121. package/components/hook-form/RHFColorPicker/subcomponents/ColorPickerField/types.js +1 -0
  122. package/components/hook-form/RHFDateTime/RHFDateTime.js +1 -1
  123. package/components/hook-form/RHFNumberInput/RHFNumberInput.js +1 -1
  124. package/components/hook-form/RHFPeriod/RHFPeriod.js +1 -1
  125. package/components/hook-form/RHFSelect/RHFSelect.js +1 -1
  126. package/components/hook-form/RHFTextField/RHFTextField.js +1 -1
  127. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.js +1 -1
  128. package/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.js +1 -1
  129. package/components/mui_extended/Accordion/Accordion.js +1 -1
  130. package/components/mui_extended/Avatar/Avatar.js +1 -1
  131. package/components/mui_extended/Avatar/subcomponents/SkeletonAvatar/index.js +1 -1
  132. package/components/mui_extended/Badge/Badge.js +1 -1
  133. package/components/mui_extended/CircularProgress/CircularProgress.js +1 -1
  134. package/components/mui_extended/DateTimePicker/DateTimePicker.js +1 -1
  135. package/components/mui_extended/Dialog/Dialog.js +1 -1
  136. package/components/mui_extended/ImageButton/ImageButton.js +1 -1
  137. package/components/mui_extended/MenuDivider/MenuDivider.js +1 -1
  138. package/components/mui_extended/NavLink/NavLink.js +1 -1
  139. package/components/mui_extended/Popover/Popover.js +1 -1
  140. package/components/mui_extended/Select/Select.js +1 -1
  141. package/components/mui_extended/Stack/Stack.js +1 -1
  142. package/components/mui_extended/TextField/TextField.js +1 -1
  143. package/components/mui_extended/ToggleButton/ToggleButton.js +1 -1
  144. package/components/mui_extended/ToggleIconButton/ToggleIconButton.js +1 -1
  145. package/components/mui_extended/Typography/Typography.js +1 -1
  146. package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +1 -1
  147. package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +1 -1
  148. package/index.js +58 -52
  149. package/package.json +2 -2
  150. package/test/getNameDataTestId.js +2 -2
  151. package/components/DataGrid/formatters/ColumnIconFormatter/constants.d.ts +0 -4
@@ -4,7 +4,7 @@ import { u as useAreasStore } from "../../hooks/useAreas/index.js";
4
4
  import { A as AreaMemonizedWindowModal } from "./subcomponents/Area/subcomponents/WindowModal/WindowModal.js";
5
5
  import { shallow } from "zustand/shallow";
6
6
  import { L as LoadingError } from "../../../LoadingError/LoadingError.js";
7
- import { a as getNameDataTestId, g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
7
+ import { g as getNameDataTestId, a as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
8
8
  import { A as AREAS_VIEWER_CLASS_NAME } from "../../constants.js";
9
9
  import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
10
10
  import { A as AreasViewerRootStyled } from "./slots/AreasViewerSlots.js";
@@ -3,7 +3,7 @@ import React from "react";
3
3
  import { M as MemonizedWindowBaseMicroFrontend } from "../../../../../../../WindowBase/subcomponents/MicroFrontend/MicroFrontend.js";
4
4
  import { W as WindowBaseComponent } from "../../../../../../../WindowBase/subcomponents/Component/index.js";
5
5
  import { T as TEST_PROP_ID } from "../../../../../../../../test/constants_no_mock.js";
6
- import { a as getNameDataTestId } from "../../../../../../../../test/getNameDataTestId.js";
6
+ import { g as getNameDataTestId } from "../../../../../../../../test/getNameDataTestId.js";
7
7
  import { A as AREAS_VIEWER_CLASS_NAME } from "../../../../../../constants.js";
8
8
  import { u as useWindow } from "./hooks/useWindow.js";
9
9
  import { W as WindowBaseStyled } from "../../../../slots/AreasViewerSlots.js";
@@ -4,7 +4,7 @@ import { g as getTopBarClassesUtilityClass } from "./classes/index.js";
4
4
  import { C as ConteinItem } from "./component/ConteinItem/index.js";
5
5
  import { T as TopBarProvider } from "./context/index.js";
6
6
  import { T as TopBarRoot } from "./style.js";
7
- import { a as getNameDataTestId } from "../../../test/getNameDataTestId.js";
7
+ import { g as getNameDataTestId } from "../../../test/getNameDataTestId.js";
8
8
  import { c as componentName } from "./classes/constants.js";
9
9
  const TopBar = (props) => {
10
10
  const { dataMenu: DataMenu, dataTestId } = props;
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { u as useTopBar } from "../../hook/topBarContext/index.js";
3
3
  import { N as NavItemRoot } from "./subcomponets/NavItem/index.js";
4
4
  import { T as TEST_PROP_ID } from "../../../../../test/constants_no_mock.js";
5
- import { a as getNameDataTestId } from "../../../../../test/getNameDataTestId.js";
5
+ import { g as getNameDataTestId } from "../../../../../test/getNameDataTestId.js";
6
6
  import { c as componentName } from "../../classes/constants.js";
7
7
  const ConteinItem = () => {
8
8
  const { dataMenu: DataMenu, classes, dataTestId } = useTopBar();
@@ -7,7 +7,7 @@ import clsx from "clsx";
7
7
  import { i as isActive } from "../../../../utils/isActive/index.js";
8
8
  import { T as TopBarClasses } from "../../../../classes/index.js";
9
9
  import { T as TEST_PROP_ID } from "../../../../../../../test/constants_no_mock.js";
10
- import { a as getNameDataTestId } from "../../../../../../../test/getNameDataTestId.js";
10
+ import { g as getNameDataTestId } from "../../../../../../../test/getNameDataTestId.js";
11
11
  import { c as componentName } from "../../../../classes/constants.js";
12
12
  import { A as Accordion } from "../../../../../../mui_extended/Accordion/Accordion.js";
13
13
  import { B as Button } from "../../../../../../mui_extended/Button/Button.js";
@@ -3,7 +3,7 @@ import { useTheme } from "@mui/material";
3
3
  import { P as PropagateLoaderSpinnerStyled, L as LoaderStyled } from "./slots/PropagateLoaderSpinnerSlots.js";
4
4
  import { P as PROPAGATE_LOADER_SPINNER_KEY_COMPONENT } from "./constants.js";
5
5
  import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
6
- import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
6
+ import { a as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
7
7
  import clsx from "clsx";
8
8
  import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
9
9
  import { P as PropagateLoaderSpinnerSlots } from "./slots/PropagateLoaderSpinnerEnum.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
- import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
3
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
4
4
  import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
5
5
  import { S as SPLIT_LAYOUT_KEY_COMPONENT, a as SPLIT_LAYOUT_ICONS } from "./constants.js";
6
6
  import { S as SplitLayoutSlots } from "./slots/SplitLayoutEnum.js";
@@ -5,7 +5,7 @@ import { L as LABEL_BOOLEAN_YES, a as LABEL_BOOLEAN_NO, b as LABEL_BOOLEAN_TRUE,
5
5
  import clsx from "clsx";
6
6
  import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
7
7
  import { B as BOOLEAN_FORMATTER_KEY_COMPONENT } from "./constants.js";
8
- import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
8
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
9
9
  import { B as BooleanFormatterRootStyled, a as BooleanFormatterIconStyled, b as BooleanFormatterIconCheckFalseStyled, c as BooleanFormatterChipStyled } from "./slots/BooleanFormatterSlots.js";
10
10
  import { B as BooleanFormatterSlots } from "./slots/BooleanFormatterEnum.js";
11
11
  function getFormatBoolean(presentationType, value = false, getLabel) {
@@ -0,0 +1,18 @@
1
+ import { ColorFormatterProps } from './types';
2
+ /**
3
+ * ColorFormatter
4
+ * Componente para formatear y mostrar colores en diferentes contextos (tablas, listas, etc.)
5
+ * @param {ColorFormatterProps} props - Las propiedades del componente.
6
+ * @param {string} [props.value] - El valor del color en formato hexadecimal
7
+ * @param {string} [props.size] - Tamaño del componente ('small' | 'medium')
8
+ * @param {string} [props.dataTestId] - ID para pruebas
9
+ * @param {string} [props.className] - Clases CSS personalizadas
10
+ * @example
11
+ * <ColorFormatter value="#FF0000" />
12
+ * // Renderiza un cuadrado con el color rojo
13
+ *
14
+ * <ColorFormatter value={null} />
15
+ * // Renderiza el ícono "out_of" cuando no hay valor
16
+ * @returns JSX.Element
17
+ */
18
+ export declare function ColorFormatter(props: ColorFormatterProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import clsx from "clsx";
4
+ import { C as ColorFormatterRootStyled } from "./slots/ColorFormatterSlots.js";
5
+ import { C as ColorFormatterSlots } from "./slots/ColorFormatterEnum.js";
6
+ import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
7
+ import { C as COLOR_FORMATTER_KEY_COMPONENT } from "./constants.js";
8
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
9
+ import { C as Color } from "../../Color/Color.js";
10
+ function ColorFormatter(props) {
11
+ const { value, dataTestId, className, size = "medium" } = props;
12
+ const ownerState = { value };
13
+ const colorComponent = useMemo(() => {
14
+ return /* @__PURE__ */ jsx(Color, { value, size });
15
+ }, [value, size]);
16
+ return /* @__PURE__ */ jsx(
17
+ ColorFormatterRootStyled,
18
+ {
19
+ className: clsx(
20
+ getComponentSlotRoot(COLOR_FORMATTER_KEY_COMPONENT),
21
+ className
22
+ ),
23
+ ...getPropDataTestId(
24
+ COLOR_FORMATTER_KEY_COMPONENT,
25
+ ColorFormatterSlots.root,
26
+ dataTestId
27
+ ),
28
+ ownerState,
29
+ children: colorComponent
30
+ }
31
+ );
32
+ }
33
+ export {
34
+ ColorFormatter as C
35
+ };
@@ -0,0 +1,2 @@
1
+ import { ColorFormatterStyles } from './types';
2
+ export declare const colorFormatterStyles: ColorFormatterStyles;
@@ -0,0 +1,15 @@
1
+ const colorFormatterStyles = {
2
+ /**
3
+ * Estilo base del componente ColorFormatter
4
+ */
5
+ root: () => ({
6
+ display: "flex",
7
+ alignItems: "center",
8
+ justifyContent: "center",
9
+ width: "100%",
10
+ height: "100%"
11
+ })
12
+ };
13
+ export {
14
+ colorFormatterStyles as c
15
+ };
@@ -0,0 +1 @@
1
+ export declare const COLOR_FORMATTER_KEY_COMPONENT = "ColorFormatter";
@@ -0,0 +1,4 @@
1
+ const COLOR_FORMATTER_KEY_COMPONENT = "ColorFormatter";
2
+ export {
3
+ COLOR_FORMATTER_KEY_COMPONENT as C
4
+ };
@@ -0,0 +1,3 @@
1
+ export { ColorFormatter } from './ColorFormatter';
2
+ export * from './constants';
3
+ export * from './types';
@@ -0,0 +1,3 @@
1
+ export declare enum ColorFormatterSlots {
2
+ root = "root"
3
+ }
@@ -0,0 +1,7 @@
1
+ var ColorFormatterSlots = /* @__PURE__ */ ((ColorFormatterSlots2) => {
2
+ ColorFormatterSlots2["root"] = "root";
3
+ return ColorFormatterSlots2;
4
+ })(ColorFormatterSlots || {});
5
+ export {
6
+ ColorFormatterSlots as C
7
+ };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Componente raíz estilizado para el ColorFormatter
3
+ */
4
+ export declare const ColorFormatterRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
@@ -0,0 +1,11 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { c as colorFormatterStyles } from "../ColorFormatter.styles.js";
3
+ import { C as COLOR_FORMATTER_KEY_COMPONENT } from "../constants.js";
4
+ import { C as ColorFormatterSlots } from "./ColorFormatterEnum.js";
5
+ const ColorFormatterRootStyled = styled("div", {
6
+ name: COLOR_FORMATTER_KEY_COMPONENT,
7
+ slot: ColorFormatterSlots.root
8
+ })(colorFormatterStyles?.root);
9
+ export {
10
+ ColorFormatterRootStyled as C
11
+ };
@@ -0,0 +1,24 @@
1
+ import { OverridesStyleRules } from '@mui/material/styles/overrides';
2
+ import { Theme } from '@mui/material';
3
+ import { Sizes } from '@m4l/styles';
4
+ import { COLOR_FORMATTER_KEY_COMPONENT } from './constants';
5
+ import { ColorFormatterSlots } from './slots/ColorFormatterEnum';
6
+ /**
7
+ * Props para el componente ColorFormatter.
8
+ */
9
+ export interface ColorFormatterProps {
10
+ value?: string | null;
11
+ size?: Extract<Sizes, 'small' | 'medium'>;
12
+ dataTestId?: string;
13
+ className?: string;
14
+ }
15
+ /**
16
+ * Props del estado del componente ColorFormatter.
17
+ */
18
+ export interface ColorFormatterOwnerState {
19
+ value?: string | null;
20
+ }
21
+ /**
22
+ * Props para estilizar el componente ColorFormatter.
23
+ */
24
+ export type ColorFormatterStyles = OverridesStyleRules<ColorFormatterSlots, typeof COLOR_FORMATTER_KEY_COMPONENT, Theme>;
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
3
  import React, { useMemo } from "react";
4
- import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
4
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
5
5
  import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
6
6
  import { C as ConcatenatedFormatterRootStyled } from "./slots/ConcatenatedFormatterSlots.js";
7
7
  import { C as CONTATENATED_FORMATTER_KEY_COMPONENT } from "./constants.js";
@@ -5,7 +5,7 @@ import { D as DateFormatterRootStyled } from "./slots/DateFormatterSlots.js";
5
5
  import { D as DateFormatterSlots } from "./slots/DateFormatterEnum.js";
6
6
  import clsx from "clsx";
7
7
  import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
8
- import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
8
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
9
9
  import { D as DATE_FORMATTER_KEY_COMPONENT } from "./constants.js";
10
10
  function getFormatDate(presentationType, value, dateFormatter, format) {
11
11
  let finalFormat = format || dateFormatter.datetimeFormat;
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import clsx from "clsx";
4
4
  import { R as RootStyled } from "./slots/DistanceToNowFormatterSlots.js";
5
- import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
5
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
6
6
  import { C as COMPONET_KEY_COMPONENT } from "./constants.js";
7
7
  import { D as DistanceToNowFormatterSlots } from "./slots/slots.js";
8
8
  import { u as useDistanceToNowFormatter } from "./hooks/useDistanceToNowFormatter.js";
@@ -4,7 +4,7 @@ import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
4
4
  import { P as PERIOD_FORMATTER_KEY_COMPONENT } from "./constants.js";
5
5
  import clsx from "clsx";
6
6
  import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
7
- import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
7
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
8
8
  import { d as dictionary } from "./dictionary.js";
9
9
  import { P as PeriodFormatterRootStyled, a as PeriodFormatterSkeletonStyled } from "./slots/PeriodFormatterSlots.js";
10
10
  import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
@@ -3,7 +3,7 @@ import { getPropertyByString } from "@m4l/core";
3
3
  import React, { useMemo } from "react";
4
4
  import { P as PointsFormatterRootStyled } from "./slots/ointsFormatterSlots.js";
5
5
  import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
6
- import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
6
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
7
7
  import clsx from "clsx";
8
8
  import { P as POINTS_FORMATTER_KEY_COMPONENT } from "./constants.js";
9
9
  import { P as PointsFormatterSlots } from "./slots/PointsFormatterEnum.js";
@@ -4,7 +4,7 @@ import { clsx } from "clsx";
4
4
  import { getPropertyByString } from "@m4l/core";
5
5
  import { useFormatter } from "@m4l/graphics";
6
6
  import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
7
- import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
7
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
8
8
  import { P as PriceFormatterRootStyled } from "./slots/PriceFormatterSlots.js";
9
9
  import { P as PRICE_FORMATTER_KEY_COMPONENT } from "./constants.js";
10
10
  import { P as PriceFormatterSlots } from "./slots/PriceFormatterEnum.js";
@@ -3,7 +3,7 @@ import React, { useMemo } from "react";
3
3
  import { clsx } from "clsx";
4
4
  import { getPropertyByString } from "@m4l/core";
5
5
  import { U as UncertaintyFormatterRootStyled } from "./slots/UncertaintyFormatterSlots.js";
6
- import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
6
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
7
7
  import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.js";
8
8
  import { U as UNCERTAINTY_FORMATTER_KEY_COMPONENT } from "./constants.js";
9
9
  import { U as UncertaintyFormatterSlots } from "./slots/UncertaintyFormatterEnum.js";
@@ -9,3 +9,4 @@ export { PriceFormatter, getFormatPrice, } from './PriceFormatter/PriceFormatter
9
9
  export * from './DistanceToNowFormatter';
10
10
  export type { UncertaintyRange } from './UncertaintyFormatter/types';
11
11
  export { TagsFormatter } from './TagsFormatter';
12
+ export { ColorFormatter } from './ColorFormatter';
@@ -1,16 +1,14 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { useFormContext, Controller } from "react-hook-form";
3
3
  import { clsx } from "clsx";
4
4
  import { useModuleSkeleton } from "@m4l/core";
5
- import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
5
+ import { a as getPropDataTestId } from "../../../test/getNameDataTestId.js";
6
6
  import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
7
7
  import { R as RHFCOLOR_PICKER_KEY_COMPONENT } from "./constants.js";
8
8
  import { R as RHFColorPickerSlots } from "./slots/RHFColorPickerEnum.js";
9
- import { R as RootStyled } from "./slots/RHFColorPickerSlots.js";
10
9
  import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
11
- import { L as Label } from "../../Label/Label.js";
12
- import { C as Color } from "../../Color/Color.js";
13
- import { H as HelperError } from "../../HelperError/HelperError.js";
10
+ import { R as RootStyled } from "./slots/RHFColorPickerSlots.js";
11
+ import { C as ColorPickerField } from "./subcomponents/ColorPickerField/ColorPickerField.js";
14
12
  const RHFColorPicker = (props) => {
15
13
  const {
16
14
  name,
@@ -35,7 +33,11 @@ const RHFColorPicker = (props) => {
35
33
  {
36
34
  className: clsx(className, classes.root),
37
35
  role: isSkeleton ? "presentation" : void 0,
38
- ...getPropDataTestId(RHFCOLOR_PICKER_KEY_COMPONENT, RHFColorPickerSlots.root, instaceDataTestId),
36
+ ...getPropDataTestId(
37
+ RHFCOLOR_PICKER_KEY_COMPONENT,
38
+ RHFColorPickerSlots.root,
39
+ instaceDataTestId
40
+ ),
39
41
  ownerState: { ownerState },
40
42
  children: /* @__PURE__ */ jsx(
41
43
  Controller,
@@ -43,35 +45,25 @@ const RHFColorPicker = (props) => {
43
45
  name,
44
46
  control,
45
47
  defaultValue: "",
46
- render: ({ field: { value, onChange }, fieldState: { error } }) => /* @__PURE__ */ jsxs(Fragment, { children: [
47
- label && /* @__PURE__ */ jsx(
48
- Label,
49
- {
50
- size,
51
- label,
52
- mandatory,
53
- mandatoryMessage,
54
- helperMessage
55
- }
56
- ),
57
- /* @__PURE__ */ jsx(
58
- Color,
59
- {
60
- size,
61
- onChange,
62
- value,
63
- error: !!error,
64
- disabled: isSkeleton ? true : disabled
65
- }
66
- ),
67
- error?.message && /* @__PURE__ */ jsx(
68
- HelperError,
69
- {
70
- size,
71
- message: error?.message + ""
72
- }
73
- )
74
- ] })
48
+ render: ({ field: { value, onChange }, fieldState: { error } }) => /* @__PURE__ */ jsx(
49
+ ColorPickerField,
50
+ {
51
+ value,
52
+ onChange,
53
+ error,
54
+ size,
55
+ label,
56
+ mandatory,
57
+ mandatoryMessage,
58
+ helperMessage,
59
+ disabled,
60
+ isSkeleton,
61
+ className,
62
+ instaceDataTestId,
63
+ currentSize,
64
+ classes
65
+ }
66
+ )
75
67
  }
76
68
  )
77
69
  }
@@ -8,6 +8,162 @@ const rhfcolorPickerStyles = {
8
8
  flexDirection: "column",
9
9
  gap: theme.vars.size.baseSpacings["sp0-5"],
10
10
  width: "100%"
11
+ }),
12
+ /**
13
+ * Estilos para el IconButton que abre el color picker
14
+ */
15
+ iconButton: ({ theme, ownerState }) => ({
16
+ // Estructura y layout básico
17
+ display: "flex",
18
+ justifyContent: "center",
19
+ width: "fit-content",
20
+ height: "fit-content",
21
+ cursor: ownerState?.disabled ? "not-allowed" : "pointer",
22
+ color: theme.vars.palette.text.primary,
23
+ pointerEvents: ownerState?.disabled ? "none" : "auto",
24
+ // Espaciado
25
+ padding: 0,
26
+ // Radio de borde
27
+ borderRadius: theme.size.borderRadius.r1,
28
+ border: ownerState?.error ? `1px solid ${theme.vars.palette.error.enabled}` : void 0,
29
+ // Pseudoclases
30
+ "&:hover": {
31
+ background: ownerState?.error ? theme.vars.palette.error.hoverOpacity : theme.vars.palette.default.hoverOpacity
32
+ },
33
+ "&:active": {
34
+ background: ownerState?.error ? theme.vars.palette.error.activeOpacity : theme.vars.palette.default.activeOpacity
35
+ },
36
+ "&:focus-visible": {
37
+ outline: `1px solid ${theme.vars.palette.primary.focusVisible}`,
38
+ outlineOffset: 2
39
+ },
40
+ // Sizes medium
41
+ ...ownerState?.size === "medium" && {
42
+ ...theme.generalSettings.isMobile ? {
43
+ width: theme.vars.size.mobile.medium.action,
44
+ height: theme.vars.size.mobile.medium.action
45
+ } : {
46
+ width: theme.vars.size.desktop.medium.action,
47
+ height: theme.vars.size.desktop.medium.action
48
+ }
49
+ },
50
+ // Sizes small
51
+ ...ownerState?.size === "small" && {
52
+ ...theme.generalSettings.isMobile ? {
53
+ width: theme.vars.size.mobile.small.action,
54
+ height: theme.vars.size.mobile.small.action
55
+ } : {
56
+ width: theme.vars.size.desktop.small.action,
57
+ height: theme.vars.size.desktop.small.action
58
+ }
59
+ }
60
+ }),
61
+ /**
62
+ * Popover
63
+ */
64
+ popover: ({ theme, ownerState }) => ({
65
+ "& .MuiPaper-root": {
66
+ padding: theme.vars.size.baseSpacings.sp3,
67
+ border: theme.vars.size.borderStroke.container,
68
+ borderColor: ownerState?.error ? theme.vars.palette.border.error : theme.vars.palette.border.secondary,
69
+ borderRadius: `${theme.vars.size.borderRadius.r3} !important`,
70
+ "& .MuiButtonBase-root": {
71
+ // Ajuste específico de estilo para el contenido de los botones
72
+ justifyContent: "center"
73
+ },
74
+ boxShadow: "0 8px 24px -10px rgba(95, 108, 125, 0.16), 0 20px 60px 0 rgba(109, 124, 146, 0.12)"
75
+ }
76
+ }),
77
+ /**
78
+ * estilos en picker
79
+ */
80
+ sketchPicker: ({ theme }) => ({
81
+ display: "flex",
82
+ flexDirection: "column",
83
+ gap: theme.vars.size.baseSpacings.sp3,
84
+ boxShadow: "none !important",
85
+ background: `${theme.vars.palette.background.default} !important`,
86
+ padding: "0px !important",
87
+ "& > div": {
88
+ // Caja de selección de color
89
+ "&:nth-of-type(1)": {
90
+ borderRadius: `${theme.vars.size.borderRadius.r2} !important`
91
+ },
92
+ // Caja de selección horizontal de color
93
+ "&:nth-of-type(2)": {
94
+ display: "flex !important",
95
+ justifyContent: "center !important",
96
+ alignItems: "center !important",
97
+ gap: theme.vars.size.baseSpacings.sp3,
98
+ "& > div:nth-of-type(1)": {
99
+ padding: "0px !important",
100
+ "& > div:nth-of-type(1)": {
101
+ height: `${theme.vars.size.baseSpacings.sp3}!important`,
102
+ borderRadius: `${theme.vars.size.borderRadius.r1} !important`,
103
+ "& > div > div > div > div": {
104
+ height: "10px !important"
105
+ }
106
+ }
107
+ },
108
+ "& > div:nth-of-type(2)": {
109
+ margin: "0px !important",
110
+ borderRadius: `${theme.vars.size.borderRadius.r1} !important`,
111
+ height: `${theme.vars.size.desktop.medium.base} !important`,
112
+ width: `${theme.vars.size.desktop.medium.base} !important`,
113
+ "& div": {
114
+ borderRadius: `${theme.vars.size.borderRadius.r1} !important`,
115
+ boxShadow: "none !important"
116
+ }
117
+ }
118
+ },
119
+ // Inputs para el cambio de color mediante a texto( hexadecimal o rgb )
120
+ "&:nth-of-type(3)": {
121
+ padding: "0px !important",
122
+ "& > div": {
123
+ // Estilos compartidos para las cajas de color
124
+ "&:nth-of-type(1), &:nth-of-type(2), &:nth-of-type(3), &:nth-of-type(4), &:nth-of-type(5)": {
125
+ padding: "0px !important",
126
+ "& div": {
127
+ display: "flex !important",
128
+ flexDirection: "column-reverse !important",
129
+ "& label": {
130
+ textAlign: "left !important",
131
+ color: `${theme.vars.palette.text.secondary} !important`,
132
+ textTransform: "uppercase !important",
133
+ padding: "0px !important"
134
+ },
135
+ "& input": {
136
+ outline: `1px solid ${theme.vars.palette.border.secondary}`,
137
+ borderRadius: theme.vars.size.borderRadius.r1,
138
+ background: theme.vars.palette.background.default,
139
+ color: theme.vars.palette.text.primary,
140
+ boxShadow: "none !important",
141
+ "&:hover": {
142
+ background: theme.vars.palette.primary.hoverOpacity
143
+ },
144
+ "&:focus-visible": {
145
+ outlineColor: theme.vars.palette.primary.focusVisible
146
+ },
147
+ "&:active": {
148
+ outlineColor: theme.vars.palette.primary.active
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
154
+ },
155
+ //Colores en grid varios del componente de react-color
156
+ "&:nth-of-type(4)": {
157
+ paddingTop: "0px !important",
158
+ "& > div > span > div": {
159
+ borderRadius: `${theme.vars.size.borderRadius["r1-5"]} !important`,
160
+ borderColor: theme.vars.palette.border.secondary
161
+ }
162
+ }
163
+ },
164
+ "& .flexbox-fix": {
165
+ border: "0px !important"
166
+ }
11
167
  })
12
168
  };
13
169
  export {
@@ -0,0 +1,2 @@
1
+ export { useColorPicker } from './useColorPicker';
2
+ export * from './types';
@@ -0,0 +1,9 @@
1
+ import { Sizes } from '@m4l/styles';
2
+ export interface UseColorPickerProps {
3
+ value: string;
4
+ onChange: (value: string | null) => void;
5
+ error?: boolean;
6
+ disabled?: boolean;
7
+ isSkeleton?: boolean;
8
+ currentSize: Extract<Sizes, 'small' | 'medium'>;
9
+ }
@@ -0,0 +1,41 @@
1
+ import { ColorResult } from 'react-color';
2
+ import { UseColorPickerProps } from './types';
3
+ /**
4
+ * Hook que gestiona la lógica del color picker
5
+ *
6
+ * Este hook encapsula toda la funcionalidad de selección de color, incluyendo:
7
+ * - Gestión del estado del popover (abrir/cerrar)
8
+ * - Confirmación o cancelación de cambios
9
+ * - Generación del ownerState para estilos
10
+ * @param {UseColorPickerProps} props - Propiedades del hook
11
+ * @param {string} props.value - Valor actual del color
12
+ * @param {function} props.onChange - Callback ejecutado al confirmar un color
13
+ * @param {boolean} [props.error] - Indica si hay error de validación
14
+ * @param {boolean} [props.disabled] - Indica si el picker está deshabilitado
15
+ * @param {boolean} [props.isSkeleton] - Indica si está en modo skeleton
16
+ * @param {('small'|'medium')} props.currentSize - Tamaño del componente
17
+ * @returns {object} Objeto con estados y handlers
18
+ * @returns {HTMLElement|null} anchorEl - Elemento ancla para el Popover
19
+ * @returns {string|undefined} tempColor - Color temporal antes de confirmar
20
+ * @returns {object} iconButtonOwnerState - Estado para estilos del botón
21
+ * @returns {function} handleOpenPicker - Handler para abrir el picker
22
+ * @returns {function} handleClosePicker - Handler para cerrar el picker
23
+ * @returns {function} handleColorChange - Handler para cambio de color
24
+ * @returns {function} handleConfirm - Handler para confirmar selección
25
+ * @returns {function} handleCancel - Handler para cancelar selección
26
+ */
27
+ export declare const useColorPicker: (props: UseColorPickerProps) => {
28
+ anchorEl: HTMLElement | null;
29
+ tempColor: string | undefined;
30
+ iconButtonOwnerState: {
31
+ size: "small" | "medium";
32
+ disabled: boolean | undefined;
33
+ value: string;
34
+ error: boolean;
35
+ };
36
+ handleOpenPicker: (event: React.MouseEvent<HTMLElement>) => void;
37
+ handleClosePicker: () => void;
38
+ handleColorChange: (color: ColorResult) => void;
39
+ handleConfirm: () => void;
40
+ handleCancel: () => void;
41
+ };