@m4l/components 9.1.70 → 9.1.72

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 (46) hide show
  1. package/@types/types.d.ts +9 -1
  2. package/components/Image/Image.js +8 -5
  3. package/components/Image/constant.d.ts +4 -0
  4. package/components/Image/constant.js +4 -0
  5. package/components/Image/image.styles.js +1 -1
  6. package/components/Image/slots/ImageEnum.d.ts +1 -1
  7. package/components/Image/slots/ImageEnum.js +1 -1
  8. package/components/Image/slots/ImageSlots.js +2 -2
  9. package/components/Image/types.d.ts +1 -0
  10. package/components/Label/types.d.ts +2 -1
  11. package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
  12. package/components/hook-form/RHFSelect/RHFSelect.d.ts +23 -0
  13. package/components/hook-form/RHFSelect/RHFSelect.js +77 -0
  14. package/components/hook-form/RHFSelect/RHFSelect.styles.d.ts +5 -0
  15. package/components/hook-form/RHFSelect/RHFSelect.styles.js +25 -0
  16. package/components/hook-form/RHFSelect/constants.d.ts +8 -0
  17. package/components/hook-form/RHFSelect/constants.js +8 -0
  18. package/components/hook-form/RHFSelect/index.d.ts +2 -0
  19. package/components/hook-form/RHFSelect/index.js +1 -0
  20. package/components/hook-form/RHFSelect/slots/RHFSelectEnum.d.ts +6 -0
  21. package/components/hook-form/RHFSelect/slots/RHFSelectEnum.js +10 -0
  22. package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +20 -0
  23. package/components/hook-form/RHFSelect/slots/RHFSlots.js +29 -0
  24. package/components/hook-form/RHFSelect/slots/index.d.ts +0 -0
  25. package/components/hook-form/RHFSelect/types.d.ts +60 -0
  26. package/components/mui_extended/MenuItem/MenuItem.styles.js +20 -34
  27. package/components/mui_extended/Select/Select.d.ts +1 -1
  28. package/components/mui_extended/Select/Select.js +106 -91
  29. package/components/mui_extended/Select/Select.styles.js +94 -230
  30. package/components/mui_extended/Select/constants.d.ts +23 -0
  31. package/components/mui_extended/Select/constants.js +11 -1
  32. package/components/mui_extended/Select/dictionary.d.ts +4 -2
  33. package/components/mui_extended/Select/dictionary.js +7 -0
  34. package/components/mui_extended/Select/slots/SelectEnum.d.ts +12 -7
  35. package/components/mui_extended/Select/slots/SelectEnum.js +14 -7
  36. package/components/mui_extended/Select/slots/SelectSlots.d.ts +15 -9
  37. package/components/mui_extended/Select/slots/SelectSlots.js +31 -20
  38. package/components/mui_extended/Select/slots/index.js +1 -0
  39. package/components/mui_extended/Select/test/Select.test.d.ts +1 -0
  40. package/components/mui_extended/Select/types.d.ts +41 -29
  41. package/components/mui_extended/TextField/TextField.js +1 -1
  42. package/index.js +1 -1
  43. package/package.json +1 -1
  44. package/components/hook-form/RHFSelect.d.ts +0 -10
  45. package/components/hook-form/RHFSelect.js +0 -29
  46. /package/components/{mui_extended/Select/Select.test.d.ts → hook-form/RHFSelect/test/RHFSelect.test.d.ts} +0 -0
package/@types/types.d.ts CHANGED
@@ -141,6 +141,7 @@ import { RHFAutocompleteOwnerState, RHFAutocompleteSlotsType } from '../componen
141
141
  import { PropagateLoaderSpinnerOwnerState, PropagateLoaderSpinnerType } from '../components/extended/React-Spinners/PropagateLoaderSpinner/types';
142
142
  import { LinearProgressIndeterminateOwnerState, LinearProgressIndeterminateType } from '../components/LinearProgressIndeterminate/types';
143
143
  import { MenuDividerOwnerState, MenuDividerSlotsType } from '../components/mui_extended/MenuDivider/types';
144
+ import { RHFSelectSlotsType, RHFSelectOwnerState } from '../components/hook-form/RHFSelect/types';
144
145
 
145
146
  declare module '@mui/material/styles' {
146
147
  // Define the slots in the theme
@@ -198,6 +199,7 @@ declare module '@mui/material/styles' {
198
199
  M4LRHFTextFieldPassword: RHFTextFieldPasswordType;
199
200
  M4LLinearProgressIndeterminate: LinearProgressIndeterminateType;
200
201
  M4LMenuDivider: MenuDividerSlotsType;
202
+ M4LRHFSelect: RHFSelectSlotsType;
201
203
  }
202
204
 
203
205
  interface ComponentsPropsList {
@@ -255,6 +257,7 @@ declare module '@mui/material/styles' {
255
257
  M4LRHFTextFieldPassword: Partial<RHFTextFieldPasswordOwnerState>;
256
258
  M4LLinearProgressIndeterminate: Partial<LinearProgressIndeterminateOwnerState>;
257
259
  M4LMenuDivider: Partial<MenuDividerOwnerState>;
260
+ M4LRHFSelect: Partial<RHFSelectOwnerState>;
258
261
  }
259
262
 
260
263
  interface Components {
@@ -522,6 +525,11 @@ declare module '@mui/material/styles' {
522
525
  defaultProps?: ComponentsPropsList['M4LMenuDivider'];
523
526
  styleOverrides?: ComponentsOverrides<Theme>['M4LMenuDivider'];
524
527
  variants?: ComponentsVariants['M4LMenuDivider'];
525
- };
528
+ };
529
+ M4LRHFSelect?: {
530
+ defaultProps?: ComponentsPropsList['M4LRHFSelect'];
531
+ styleOverrides?: ComponentsOverrides<Theme>['M4LRHFSelect'];
532
+ variants?: ComponentsVariants['M4LRHFSelect'];
533
+ };
526
534
  }
527
535
  }
@@ -1,16 +1,18 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
- import { useModuleSkeleton } from "@m4l/core";
3
2
  import { useMemo } from "react";
3
+ import { useModuleSkeleton } from "@m4l/core";
4
+ import clsx from "clsx";
4
5
  import { L as LazyLoadComponent } from "./subcomponents/LazyLoadComponent/index.js";
5
6
  import { D as DivContainerSkeletonStyled, I as ImgSkeleton, a as ImgStyled } from "./slots/ImageSlots.js";
6
7
  import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
7
- import { s as svgDataUriSkeleton, I as IMAGE_KEY_COMPONENT } from "./constant.js";
8
+ import { s as svgDataUriSkeleton, I as IMAGE_KEY_COMPONENT, a as IMAGE_CLASSES } from "./constant.js";
8
9
  import { I as ImageSlots } from "./slots/ImageEnum.js";
9
10
  function Image(props) {
10
11
  const {
11
12
  enableIntersectionObserver = true,
12
13
  threshold = 100,
13
14
  dataTestId,
15
+ className,
14
16
  ...others
15
17
  } = props;
16
18
  const isSkeleton = useModuleSkeleton();
@@ -35,13 +37,14 @@ function Image(props) {
35
37
  ImgStyled,
36
38
  {
37
39
  ownerState: { ...ownerState },
38
- ...getPropDataTestId(IMAGE_KEY_COMPONENT, ImageSlots.img, dataTestId),
39
- ...others
40
+ ...getPropDataTestId(IMAGE_KEY_COMPONENT, ImageSlots.root, dataTestId),
41
+ ...others,
42
+ className: clsx(IMAGE_CLASSES.root, className)
40
43
  }
41
44
  ) })
42
45
  }
43
46
  );
44
- }, [dataTestId, enableIntersectionObserver, others, ownerState, threshold]);
47
+ }, [dataTestId, enableIntersectionObserver, others, ownerState, threshold, className]);
45
48
  return lazyLoadComponent;
46
49
  }
47
50
  export {
@@ -1,2 +1,6 @@
1
1
  export declare const IMAGE_KEY_COMPONENT = "M4LImage";
2
2
  export declare const svgDataUriSkeleton = "data:image/svg+xml,%3Csvg width='36' height='37' viewBox='0 0 36 37' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Union'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M25.0001 14.7416C24.26 15.2361 23.39 15.5 22.5 15.5C21.3065 15.5 20.1619 15.0259 19.318 14.182C18.4741 13.3381 18 12.1935 18 11C18 10.11 18.2639 9.23996 18.7584 8.49994C19.2529 7.75992 19.9557 7.18314 20.7779 6.84254C21.6002 6.50195 22.505 6.41283 23.3779 6.58647C24.2508 6.7601 25.0526 7.18868 25.682 7.81802C26.3113 8.44736 26.7399 9.24918 26.9135 10.1221C27.0872 10.995 26.9981 11.8998 26.6575 12.7221C26.3169 13.5443 25.7401 14.2471 25.0001 14.7416ZM23.3334 9.7528C23.0867 9.58798 22.7967 9.5 22.5 9.5C22.1022 9.5 21.7206 9.65804 21.4393 9.93934C21.158 10.2206 21 10.6022 21 11C21 11.2967 21.088 11.5867 21.2528 11.8334C21.4176 12.08 21.6519 12.2723 21.926 12.3858C22.2001 12.4994 22.5017 12.5291 22.7926 12.4712C23.0836 12.4133 23.3509 12.2704 23.5607 12.0607C23.7704 11.8509 23.9133 11.5836 23.9712 11.2926C24.0291 11.0017 23.9994 10.7001 23.8858 10.426C23.7723 10.1519 23.58 9.91762 23.3334 9.7528Z' fill='%23091E42' fill-opacity='0.08'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3 0.5H33C33.7957 0.5 34.5587 0.81607 35.1213 1.37868C35.6839 1.94129 36 2.70435 36 3.5V33.5C36 34.2957 35.6839 35.0587 35.1213 35.6213C34.5587 36.1839 33.7957 36.5 33 36.5H3C2.20435 36.5 1.44129 36.1839 0.87868 35.6213C0.31607 35.0587 0 34.2957 0 33.5V3.5C0 2.70435 0.31607 1.94129 0.87868 1.37868C1.44129 0.81607 2.20435 0.5 3 0.5ZM3 24.5V33.5H33V30.5L25.5 23L23.115 25.385C22.5529 25.9438 21.7926 26.2574 21 26.2574C20.2074 26.2574 19.4471 25.9438 18.885 25.385L10.5 17L3 24.5ZM27.615 20.87L33 26.255V3.5H3V20.255L8.385 14.87C8.94709 14.3112 9.70744 13.9976 10.5 13.9976C11.2926 13.9976 12.0529 14.3112 12.615 14.87L21 23.255L23.385 20.87C23.9471 20.3112 24.7074 19.9976 25.5 19.9976C26.2926 19.9976 27.0529 20.3112 27.615 20.87Z' fill='%23091E42' fill-opacity='0.08'/%3E%3C/g%3E%3C/svg%3E%0A";
3
+ /**
4
+ * Clases de los slots del componente Image
5
+ */
6
+ export declare const IMAGE_CLASSES: Record<string, string>;
@@ -1,6 +1,10 @@
1
+ import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
2
+ import { I as ImageSlots } from "./slots/ImageEnum.js";
1
3
  const IMAGE_KEY_COMPONENT = "M4LImage";
2
4
  const svgDataUriSkeleton = `data:image/svg+xml,%3Csvg width='36' height='37' viewBox='0 0 36 37' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Union'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M25.0001 14.7416C24.26 15.2361 23.39 15.5 22.5 15.5C21.3065 15.5 20.1619 15.0259 19.318 14.182C18.4741 13.3381 18 12.1935 18 11C18 10.11 18.2639 9.23996 18.7584 8.49994C19.2529 7.75992 19.9557 7.18314 20.7779 6.84254C21.6002 6.50195 22.505 6.41283 23.3779 6.58647C24.2508 6.7601 25.0526 7.18868 25.682 7.81802C26.3113 8.44736 26.7399 9.24918 26.9135 10.1221C27.0872 10.995 26.9981 11.8998 26.6575 12.7221C26.3169 13.5443 25.7401 14.2471 25.0001 14.7416ZM23.3334 9.7528C23.0867 9.58798 22.7967 9.5 22.5 9.5C22.1022 9.5 21.7206 9.65804 21.4393 9.93934C21.158 10.2206 21 10.6022 21 11C21 11.2967 21.088 11.5867 21.2528 11.8334C21.4176 12.08 21.6519 12.2723 21.926 12.3858C22.2001 12.4994 22.5017 12.5291 22.7926 12.4712C23.0836 12.4133 23.3509 12.2704 23.5607 12.0607C23.7704 11.8509 23.9133 11.5836 23.9712 11.2926C24.0291 11.0017 23.9994 10.7001 23.8858 10.426C23.7723 10.1519 23.58 9.91762 23.3334 9.7528Z' fill='%23091E42' fill-opacity='0.08'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3 0.5H33C33.7957 0.5 34.5587 0.81607 35.1213 1.37868C35.6839 1.94129 36 2.70435 36 3.5V33.5C36 34.2957 35.6839 35.0587 35.1213 35.6213C34.5587 36.1839 33.7957 36.5 33 36.5H3C2.20435 36.5 1.44129 36.1839 0.87868 35.6213C0.31607 35.0587 0 34.2957 0 33.5V3.5C0 2.70435 0.31607 1.94129 0.87868 1.37868C1.44129 0.81607 2.20435 0.5 3 0.5ZM3 24.5V33.5H33V30.5L25.5 23L23.115 25.385C22.5529 25.9438 21.7926 26.2574 21 26.2574C20.2074 26.2574 19.4471 25.9438 18.885 25.385L10.5 17L3 24.5ZM27.615 20.87L33 26.255V3.5H3V20.255L8.385 14.87C8.94709 14.3112 9.70744 13.9976 10.5 13.9976C11.2926 13.9976 12.0529 14.3112 12.615 14.87L21 23.255L23.385 20.87C23.9471 20.3112 24.7074 19.9976 25.5 19.9976C26.2926 19.9976 27.0529 20.3112 27.615 20.87Z' fill='%23091E42' fill-opacity='0.08'/%3E%3C/g%3E%3C/svg%3E%0A`;
5
+ const IMAGE_CLASSES = getComponentClasses(IMAGE_KEY_COMPONENT, ImageSlots);
3
6
  export {
4
7
  IMAGE_KEY_COMPONENT as I,
8
+ IMAGE_CLASSES as a,
5
9
  svgDataUriSkeleton as s
6
10
  };
@@ -3,7 +3,7 @@ const imageStyles = {
3
3
  * Estilos para Image.
4
4
  * @createdAt 2024-12-27 08:27:30 - automatic
5
5
  */
6
- img: {
6
+ root: {
7
7
  display: "flex",
8
8
  flexDirection: "column",
9
9
  alignItems: "flex-start"
@@ -1,5 +1,5 @@
1
1
  export declare enum ImageSlots {
2
- img = "img",
2
+ root = "root",
3
3
  intersectComponent = "intersectComponent",
4
4
  scrollIntersectRoot = "scrollIntersectRoot",
5
5
  skeletonComponent = "skeletonComponent",
@@ -1,5 +1,5 @@
1
1
  var ImageSlots = /* @__PURE__ */ ((ImageSlots2) => {
2
- ImageSlots2["img"] = "img";
2
+ ImageSlots2["root"] = "root";
3
3
  ImageSlots2["intersectComponent"] = "intersectComponent";
4
4
  ImageSlots2["scrollIntersectRoot"] = "scrollIntersectRoot";
5
5
  ImageSlots2["skeletonComponent"] = "skeletonComponent";
@@ -5,8 +5,8 @@ import { i as imageStyles } from "../image.styles.js";
5
5
  import { S as Skeleton } from "../../mui_extended/Skeleton/Skeleton.js";
6
6
  const ImgStyled = styled("img", {
7
7
  name: IMAGE_KEY_COMPONENT,
8
- slot: ImageSlots.img
9
- })(imageStyles?.img);
8
+ slot: ImageSlots.root
9
+ })(imageStyles?.root);
10
10
  const ImgSkeleton = styled("img", {
11
11
  name: IMAGE_KEY_COMPONENT,
12
12
  slot: ImageSlots.imgSkeleton
@@ -29,6 +29,7 @@ export interface ImageProps extends Omit<IntersectComponentProps, 'setIsVisible'
29
29
  alt?: string;
30
30
  threshold?: number;
31
31
  enableIntersectionObserver?: boolean;
32
+ className?: string;
32
33
  dataTestId?: string;
33
34
  }
34
35
  export type ImageSlotsType = keyof typeof ImageSlots;
@@ -3,8 +3,9 @@ import { OverridesStyleRules } from '@mui/material/styles/overrides';
3
3
  import { Theme } from '@mui/material';
4
4
  import { LABEL_KEY_COMPONENT } from './constants';
5
5
  import { Sizes } from '@m4l/styles';
6
+ import { TypographyProps } from '../mui_extended/Typography/types';
6
7
  export type LabelVariants = 'standard';
7
- export interface LabelProps {
8
+ export interface LabelProps extends Pick<TypographyProps, 'skeletonWidth'> {
8
9
  /** Mesanje de ayuda opcional que se visualiza cuando se interactua con el tooltip del Icono de informacion */
9
10
  helperMessage?: string | undefined;
10
11
  /** Es la etiqueta de texto principal del componente.*/
@@ -1,4 +1,4 @@
1
1
  export declare const RHFPeriodRootStyled: 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').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
2
2
  export declare const PeriodRootStyled: 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').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
3
3
  export declare const TextFieldStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../mui_extended/TextField/types').TextFieldProps, "ref"> & import('react').RefAttributes<HTMLDivElement>, "children" | "value" | "title" | "component" | "size" | "name" | "error" | "select" | "rows" | "id" | "type" | "hidden" | "content" | "style" | "disabled" | "variant" | "margin" | "translate" | "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" | "label" | keyof import('react').RefAttributes<HTMLDivElement> | "autoComplete" | "placeholder" | "required" | "dataTestId" | "maxRows" | "fullWidth" | "focused" | "hiddenLabel" | "InputProps" | "FormHelperTextProps" | "helperText" | "InputLabelProps" | "inputProps" | "inputRef" | "multiline" | "minRows" | "SelectProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
4
- export declare const SelectStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../mui_extended/Select').SelectProps, keyof import('../../../mui_extended/Select').SelectProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
4
+ export declare const SelectStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../mui_extended/Select').SelectProps<any>, "ref"> & import('react').RefAttributes<HTMLDivElement>, "children" | "value" | "onClose" | "title" | "size" | "name" | "error" | "input" | "options" | "rows" | "id" | "type" | "components" | "hidden" | "content" | "style" | "open" | "multiple" | "disabled" | "variant" | "margin" | "translate" | "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" | "componentsProps" | "onOpen" | "slotProps" | "slots" | "label" | keyof import('react').RefAttributes<HTMLDivElement> | "autoComplete" | "placeholder" | "readOnly" | "required" | "dataTestId" | "maxRows" | "fullWidth" | "inputProps" | "inputRef" | "multiline" | "minRows" | "disableInjectingGlobalStyles" | "endAdornment" | "inputComponent" | "renderSuffix" | "startAdornment" | "disableUnderline" | "autoWidth" | "defaultOpen" | "displayEmpty" | "IconComponent" | "labelId" | "MenuProps" | "native" | "renderValue" | "SelectDisplayProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
@@ -0,0 +1,23 @@
1
+ import { RHFSelectProps } from './types';
2
+ /**
3
+ * RHFSelect is a custom select component integrated with React Hook Form.
4
+ * It renders a select input with optional label, helper text, and error message.
5
+ * @template T - The type of the options.
6
+ * @param {RHFSelectProps<T>} props - The properties for the RHFSelect component.
7
+ * @param {string} props.name - The name of the field.
8
+ * @param {Array} props.options - The options to be displayed in the select input.
9
+ * @param {string} [props.label] - The label for the select input.
10
+ * @param {number} [props.labelSkeletonWidth] - The width of the skeleton for the label.
11
+ * @param {number} [props.helperErrorSkeletonWidth] - The width of the skeleton for the helper error message.
12
+ * @param {string} [props.helperMessage] - The helper message to be displayed.
13
+ * @param {string} [props.helperText] - The helper text to be displayed.
14
+ * @param {boolean} [props.mandatory] - Whether the field is mandatory.
15
+ * @param {string} [props.mandatoryMessage] - The message to be displayed if the field is mandatory.
16
+ * @param {boolean} [props.disabled] - Whether the select input is disabled.
17
+ * @param {string} [props.size] - The size of the select input.
18
+ * @param {string} [props.variant] - The variant of the select input.
19
+ * @param {string} [props.className] - Additional class names for the root element.
20
+ * @param {string} [props.dataTestId] - The data test ID for the select input.
21
+ * @returns {JSX.Element} The rendered RHFSelect component.
22
+ */
23
+ export declare const RHFSelect: <T>(props: RHFSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,77 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import { R as RHFSELECT_CLASSES, a as RHFSELECT_COMPONENT_KEY } from "./constants.js";
4
+ import { R as RHFSelectEnum } from "./slots/RHFSelectEnum.js";
5
+ import { R as RootStyled, L as LabelStyled, S as SelectStyled, H as HelperErrorStyled } from "./slots/RHFSlots.js";
6
+ import { useFormContext, Controller } from "react-hook-form";
7
+ import { g as getPropDataTestId } from "../../../test/getNameDataTestId.js";
8
+ import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
9
+ const RHFSelect = (props) => {
10
+ const {
11
+ name,
12
+ options,
13
+ label,
14
+ labelSkeletonWidth,
15
+ helperErrorSkeletonWidth,
16
+ helperMessage,
17
+ helperText,
18
+ mandatory,
19
+ mandatoryMessage,
20
+ placeholder,
21
+ disabled,
22
+ size = "medium",
23
+ variant = "outlined",
24
+ className,
25
+ dataTestId
26
+ } = props;
27
+ const { currentSize } = useComponentSize(size);
28
+ const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
29
+ const { control } = useFormContext();
30
+ return /* @__PURE__ */ jsx(RootStyled, { ownerState: {}, className: clsx(RHFSELECT_CLASSES.root, className), children: /* @__PURE__ */ jsx(
31
+ Controller,
32
+ {
33
+ name,
34
+ control,
35
+ render: ({ field: { value, onChange, ref }, fieldState: { error } }) => {
36
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
37
+ label && /* @__PURE__ */ jsx(
38
+ LabelStyled,
39
+ {
40
+ htmlFor: name,
41
+ label,
42
+ mandatory,
43
+ mandatoryMessage,
44
+ helperMessage,
45
+ helperText,
46
+ size: adjustedSize,
47
+ skeletonWidth: labelSkeletonWidth,
48
+ error: Boolean(error),
49
+ disabled
50
+ }
51
+ ),
52
+ /* @__PURE__ */ jsx(
53
+ SelectStyled,
54
+ {
55
+ ref,
56
+ options,
57
+ id: name,
58
+ size: adjustedSize,
59
+ variant,
60
+ value,
61
+ onChange: (opt) => onChange(opt.id),
62
+ disabled,
63
+ className: RHFSELECT_CLASSES.select,
64
+ error: Boolean(error),
65
+ placeholder,
66
+ ...getPropDataTestId(RHFSELECT_COMPONENT_KEY, RHFSelectEnum.select, dataTestId)
67
+ }
68
+ ),
69
+ error?.message && /* @__PURE__ */ jsx(HelperErrorStyled, { size: adjustedSize, message: error.message, skeletonWidth: helperErrorSkeletonWidth })
70
+ ] });
71
+ }
72
+ }
73
+ ) });
74
+ };
75
+ export {
76
+ RHFSelect as R
77
+ };
@@ -0,0 +1,5 @@
1
+ import { RHFSelectStyles } from './types';
2
+ /**
3
+ * Conjunto de estilos para el componente `RHFSelect`.
4
+ */
5
+ export declare const rhfSelectStyles: RHFSelectStyles;
@@ -0,0 +1,25 @@
1
+ const rhfSelectStyles = {
2
+ /**
3
+ * Estilos para el contenedor principal del componente.
4
+ */
5
+ root: ({ theme }) => ({
6
+ display: "flex",
7
+ flexDirection: "column",
8
+ gap: theme.vars.size.baseSpacings.sp1
9
+ }),
10
+ /**
11
+ * Estilos del Label.
12
+ */
13
+ label: {},
14
+ /**
15
+ * Estilos del Select.
16
+ */
17
+ select: {},
18
+ /**
19
+ * Estilos del HelperError.
20
+ */
21
+ helperError: {}
22
+ };
23
+ export {
24
+ rhfSelectStyles as r
25
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Key del componente RHFSelect usado para identificar el componente en el registro de componentes.
3
+ */
4
+ export declare const RHFSELECT_COMPONENT_KEY = "RHFSelect";
5
+ /**
6
+ * Clases CSS generadas dinámicamente para el componente RHFSelect.
7
+ */
8
+ export declare const RHFSELECT_CLASSES: Record<string, string>;
@@ -0,0 +1,8 @@
1
+ import { g as getComponentClasses } from "../../../utils/getComponentSlotRoot.js";
2
+ import { R as RHFSelectEnum } from "./slots/RHFSelectEnum.js";
3
+ const RHFSELECT_COMPONENT_KEY = "RHFSelect";
4
+ const RHFSELECT_CLASSES = getComponentClasses(RHFSELECT_COMPONENT_KEY, RHFSelectEnum);
5
+ export {
6
+ RHFSELECT_CLASSES as R,
7
+ RHFSELECT_COMPONENT_KEY as a
8
+ };
@@ -0,0 +1,2 @@
1
+ export type { RHFSelectProps } from './types';
2
+ export { RHFSelect } from './RHFSelect';
@@ -0,0 +1,6 @@
1
+ export declare enum RHFSelectEnum {
2
+ root = "root",
3
+ label = "label",
4
+ select = "select",
5
+ helperError = "helperError"
6
+ }
@@ -0,0 +1,10 @@
1
+ var RHFSelectEnum = /* @__PURE__ */ ((RHFSelectEnum2) => {
2
+ RHFSelectEnum2["root"] = "root";
3
+ RHFSelectEnum2["label"] = "label";
4
+ RHFSelectEnum2["select"] = "select";
5
+ RHFSelectEnum2["helperError"] = "helperError";
6
+ return RHFSelectEnum2;
7
+ })(RHFSelectEnum || {});
8
+ export {
9
+ RHFSelectEnum as R
10
+ };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Elemento div de react construido a través de styled,
3
+ * sirve para agrupar el contenido del componente `RHFSelect`
4
+ */
5
+ export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
6
+ /**
7
+ * Elemento Label construido a través de styled,
8
+ * sirve para mostrar el label del componente `RHFSelect`
9
+ */
10
+ export declare const LabelStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../Label').LabelProps, keyof import('../../../Label').LabelProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, {}, {}>;
11
+ /**
12
+ * Elemento HelperError construido a través de styled,
13
+ * sirve para mostrar el mensaje de error del componente `RHFSelect`
14
+ */
15
+ export declare const SelectStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../mui_extended/Select').SelectProps<any>, "ref"> & import('react').RefAttributes<HTMLDivElement>, "children" | "value" | "onClose" | "title" | "size" | "name" | "error" | "input" | "options" | "rows" | "id" | "type" | "components" | "hidden" | "content" | "style" | "open" | "multiple" | "disabled" | "variant" | "margin" | "translate" | "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" | "componentsProps" | "onOpen" | "slotProps" | "slots" | "label" | keyof import('react').RefAttributes<HTMLDivElement> | "autoComplete" | "placeholder" | "readOnly" | "required" | "dataTestId" | "maxRows" | "fullWidth" | "inputProps" | "inputRef" | "multiline" | "minRows" | "disableInjectingGlobalStyles" | "endAdornment" | "inputComponent" | "renderSuffix" | "startAdornment" | "disableUnderline" | "autoWidth" | "defaultOpen" | "displayEmpty" | "IconComponent" | "labelId" | "MenuProps" | "native" | "renderValue" | "SelectDisplayProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, {}, {}>;
16
+ /**
17
+ * Elemento HelperError construido a través de styled,
18
+ * sirve para mostrar el mensaje de error del componente `RHFSelect`
19
+ */
20
+ export declare const HelperErrorStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../HelperError').HelperErrorProps, keyof import('../../../HelperError').HelperErrorProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown>, {}, {}>;
@@ -0,0 +1,29 @@
1
+ import { styled } from "@mui/material";
2
+ import { a as RHFSELECT_COMPONENT_KEY } from "../constants.js";
3
+ import { R as RHFSelectEnum } from "./RHFSelectEnum.js";
4
+ import { r as rhfSelectStyles } from "../RHFSelect.styles.js";
5
+ import { L as Label } from "../../../Label/Label.js";
6
+ import { S as Select } from "../../../mui_extended/Select/Select.js";
7
+ import { H as HelperError } from "../../../HelperError/HelperError.js";
8
+ const RootStyled = styled("div", {
9
+ name: RHFSELECT_COMPONENT_KEY,
10
+ slot: RHFSelectEnum.root
11
+ })(rhfSelectStyles?.root);
12
+ const LabelStyled = styled(Label, {
13
+ name: RHFSELECT_COMPONENT_KEY,
14
+ slot: RHFSelectEnum.label
15
+ })(rhfSelectStyles?.label);
16
+ const SelectStyled = styled(Select, {
17
+ name: RHFSELECT_COMPONENT_KEY,
18
+ slot: RHFSelectEnum.select
19
+ })(rhfSelectStyles?.select);
20
+ const HelperErrorStyled = styled(HelperError, {
21
+ name: RHFSELECT_COMPONENT_KEY,
22
+ slot: RHFSelectEnum.helperError
23
+ })(rhfSelectStyles?.helperError);
24
+ export {
25
+ HelperErrorStyled as H,
26
+ LabelStyled as L,
27
+ RootStyled as R,
28
+ SelectStyled as S
29
+ };
@@ -0,0 +1,60 @@
1
+ import { HelperErrorProps } from 'src/components/HelperError';
2
+ import { LabelProps } from '../../Label/types';
3
+ import { SelectProps } from '../../mui_extended/Select/types';
4
+ import { Sizes } from '@m4l/styles';
5
+ import { M4LOverridesStyleRules } from 'src/@types/augmentations';
6
+ import { RHFSelectEnum } from './slots/RHFSelectEnum';
7
+ import { RHFSELECT_COMPONENT_KEY } from './constants';
8
+ import { Theme } from '@mui/material';
9
+ /**
10
+ * Props para el componente RHFSelect, incluye las propedades esceciales del Select, Label,
11
+ * así como las propiedades requeridas por react hook form.
12
+ */
13
+ export interface RHFSelectProps<T> extends Pick<SelectProps<T>, 'options' | 'placeholder' | 'variant'>, Omit<LabelProps, 'dataTestId' | 'error' | 'children' | 'id' | 'className' | 'disabled' | 'size' | 'skeletonWidth'> {
14
+ /**
15
+ * Identificador para el manejo de campos en react hook form.
16
+ */
17
+ name: string;
18
+ /**
19
+ * Tamaño del componente
20
+ */
21
+ size?: Extract<Sizes, 'small' | 'medium'>;
22
+ /**
23
+ * Propiedad que deshabilita la interacción del componente.
24
+ */
25
+ disabled?: boolean;
26
+ /**
27
+ * Nombre de clase CSS personalizada que se aplicará al componente.
28
+ */
29
+ className?: string;
30
+ /**
31
+ * Propiedad usada para facilitar la identificación del componente en las pruebas.
32
+ */
33
+ dataTestId?: string;
34
+ /**
35
+ * medida de anchura para el esqueleto del label
36
+ */
37
+ labelSkeletonWidth?: LabelProps['skeletonWidth'];
38
+ /**
39
+ * medida de anchura para el esqueleto del helperError
40
+ */
41
+ helperErrorSkeletonWidth?: HelperErrorProps['skeletonWidth'];
42
+ }
43
+ /**
44
+ * Define el estado del componente `RHFSelect`.
45
+ */
46
+ export interface RHFSelectOwnerState {
47
+ }
48
+ /**
49
+ * Define las claves del objeto `RHFSelectSlotsType`, que se utilizan para
50
+ * hacer referencia a los diferentes slots disponibles para estilizar el componente
51
+ * `RHFSelect`.
52
+ */
53
+ export type RHFNumberInputSlotsType = keyof typeof RHFSelectEnum;
54
+ /**
55
+ * Define los estilos del componente `RHFNumberInputStyles`. Permite la personalización parcial
56
+ * de las reglas de estilo mediante `OverridesStyleRules`.
57
+ *
58
+ * Puede ser parcial o estar indefinido.
59
+ */
60
+ export type RHFSelectStyles = M4LOverridesStyleRules<RHFSelectEnum, typeof RHFSELECT_COMPONENT_KEY, Theme>;
@@ -2,49 +2,22 @@ import { g as getHeightSizeStyles } from "../../../utils/getHeightSizeStyles.js"
2
2
  const menuItemStyles = {
3
3
  /**
4
4
  * Estilos para el contenedor de los items del menú
5
- * <<<<<<< HEAD
6
5
  * @updatedUser Andrés Quintero - automatic
7
6
  * @updatedAt 2025-01-08 10:36:41 - automatic
8
7
  * @createdAt 2025-01-08 10:36:40 - automatic
9
8
  * @author Andrés Quintero - automatic
10
- * @updatedUser Andrés Quintero - automatic
11
- * @updatedAt 2025-01-08 10:36:41 - automatic
12
- * @createdAt 2025-01-03 11:42:11 - automatic
13
- * @author Andrés Quintero - automatic
14
- * @updatedUser Andrés Quintero - automatic
15
- * @updatedAt 2025-01-08 10:36:41 - automatic
16
- * @createdAt 2024-12-31 11:23:51 - automatic
17
- * @author Andrés Quintero - automatic
18
- * @updatedUser Andrés Quintero - automatic
19
- * @updatedAt 2025-01-08 10:36:41 - automatic
20
- * @createdAt 2024-12-30 14:36:06 - automatic
21
- * @author Andrés Quintero - automatic
22
- * @updatedUser Andrés Quintero - automatic
23
- * @updatedAt 2025-01-08 10:36:41 - automatic
24
- * =======
25
- * @updatedUser cesar - automatic
26
- * @updatedAt 2025-01-10 16:51:28 - automatic
27
- * @createdAt 2025-01-10 16:51:28 - automatic
28
- * @author cesar - automatic
29
- * @updatedUser cesar - automatic
30
- * @updatedAt 2025-01-10 16:51:28 - automatic
31
- * @createdAt 2024-12-31 11:23:51 - automatic
32
- * @author Andrés Quintero - automatic
33
- * @updatedUser cesar - automatic
34
- * @updatedAt 2025-01-10 16:51:28 - automatic
35
- * @createdAt 2024-12-30 14:36:06 - automatic
36
- * @author Andrés Quintero - automatic
37
- * @updatedUser cesar - automatic
38
- * @updatedAt 2025-01-10 16:51:28 - automatic
39
- * >>>>>>> c15c4888 (Add checkable prop to MenuItem and update checked icon visibility logic)
40
- * @createdAt 2024-12-27 08:28:33 - automatic
41
- * @author Andrés Quintero - automatic
42
9
  */
43
10
  root: ({ theme, ownerState }) => ({
44
11
  width: "100%",
45
12
  gap: theme.vars.size.baseSpacings.sp3,
46
- padding: theme.vars.size.baseSpacings.sp1,
13
+ paddingTop: theme.vars.size.baseSpacings.sp1,
14
+ paddingBottom: theme.vars.size.baseSpacings.sp1,
15
+ paddingLeft: theme.vars.size.baseSpacings.sp4,
16
+ paddingRight: theme.vars.size.baseSpacings.sp4,
47
17
  borderRadius: theme.vars.size.borderRadius.r0,
18
+ "& .M4LTypography-root": {
19
+ paddingLeft: theme.vars.size.baseSpacings.sp1
20
+ },
48
21
  ...ownerState.selected && {
49
22
  borderLeft: theme.vars.size.borderStroke.container,
50
23
  borderColor: ownerState.paletteColor?.main,
@@ -108,6 +81,19 @@ const menuItemStyles = {
108
81
  backgroundColor: theme.vars.palette.text.disabled
109
82
  }
110
83
  },
84
+ "& .M4LImage-root": {
85
+ ...getHeightSizeStyles(
86
+ theme.generalSettings.isMobile,
87
+ ownerState.size || "medium",
88
+ "base",
89
+ (val) => {
90
+ return {
91
+ height: val,
92
+ width: val
93
+ };
94
+ }
95
+ )
96
+ },
111
97
  ...getHeightSizeStyles(
112
98
  theme.generalSettings.isMobile,
113
99
  ownerState.size || "medium",
@@ -8,4 +8,4 @@ import { SelectProps } from './types';
8
8
  * @updatedAt 2025-01-03 11:42:15 - automatic
9
9
  * @updatedUser Andrés Quintero - automatic
10
10
  */
11
- export declare const Select: (props: SelectProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const Select: import('react').ForwardRefExoticComponent<Omit<SelectProps<any>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;