@m4l/components 9.2.21 → 9.2.23

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.
@@ -58,9 +58,14 @@ const windowBaseStyles = {
58
58
  }
59
59
  },
60
60
  ...ownerState?.selected ? {
61
- background: theme.vars.palette["default"].selectedOpacity
61
+ background: theme.vars.palette["primary"].enabledOpacity
62
62
  } : {
63
- background: theme.vars.palette["default"].opacity
63
+ background: theme.vars.palette.background.default
64
+ },
65
+ ...ownerState?.selected ? {
66
+ borderBottom: `1px solid ${theme.vars.palette.border.disabled}`
67
+ } : {
68
+ borderBottom: `1px solid ${theme.vars.palette.border.default}`
64
69
  }
65
70
  }),
66
71
  /**
@@ -79,9 +84,13 @@ const windowBaseStyles = {
79
84
  /**
80
85
  * Styles for the title of the header of the window base component.
81
86
  */
82
- headerTitleWindowBase: ({ theme }) => ({
87
+ headerTitleWindowBase: ({ theme, ownerState }) => ({
83
88
  minWidth: "30px",
84
- color: theme.vars.palette.text.primary,
89
+ ...ownerState?.selected ? {
90
+ color: `${theme.vars.palette["primary"].semanticText} !important`
91
+ } : {
92
+ color: `${theme.vars.palette.text.secondary} !important`
93
+ },
85
94
  fontWeight: `${theme.typography.fontWeightBold} !important`,
86
95
  whiteSpace: "nowrap",
87
96
  overflow: "hidden",
@@ -125,20 +134,30 @@ const windowBaseStyles = {
125
134
  /**
126
135
  * Styles for the subtitle of the header of the window base component.
127
136
  */
128
- headerSubTitleWindowBase: ({ theme }) => ({
137
+ headerSubTitleWindowBase: ({ theme, ownerState }) => ({
129
138
  width: "auto !important",
130
139
  height: "auto !important",
131
- color: `${theme.vars.palette.text.primary} !important`
140
+ ...ownerState?.selected ? {
141
+ color: `${theme.vars.palette["primary"].semanticText} !important`
142
+ } : {
143
+ color: `${theme.vars.palette.text.secondary} !important`
144
+ }
132
145
  }),
133
146
  /**
134
147
  * Styles for the icon of the header of the window base component.
135
148
  */
136
- headerIconWindowBase: ({ theme }) => ({
149
+ headerIconWindowBase: ({ theme, ownerState }) => ({
137
150
  display: "flex",
138
151
  alignItems: "center",
139
152
  justifyContent: "center",
140
153
  borderRadius: theme.vars.size.borderRadius["r0-5"],
141
- color: theme.vars.palette.text.primary
154
+ "& .M4LIcon-icon": {
155
+ ...ownerState?.selected ? {
156
+ backgroundColor: `${theme.vars.palette["primary"].semanticText} !important`
157
+ } : {
158
+ backgroundColor: `${theme.vars.palette.text.secondary} !important`
159
+ }
160
+ }
142
161
  }),
143
162
  /**
144
163
  * Styles for the icons wrapper of the window base component.
@@ -155,7 +174,13 @@ const windowBaseStyles = {
155
174
  * Styles for the dot icon of the window base component.
156
175
  */
157
176
  pointIcon: ({ theme, ownerState }) => ({
158
- color: theme.vars.palette.text.primary,
177
+ "& .M4LIcon-icon": {
178
+ ...ownerState?.selected ? {
179
+ backgroundColor: `${theme.vars.palette["primary"].semanticText} !important`
180
+ } : {
181
+ backgroundColor: `${theme.vars.palette.text.secondary} !important`
182
+ }
183
+ },
159
184
  ...theme.generalSettings.isMobile ? {
160
185
  ...ownerState.size === "small" && {
161
186
  height: theme.vars.size.mobile.small.base
@@ -175,8 +200,15 @@ const windowBaseStyles = {
175
200
  /**
176
201
  * Styles for the menu actions of the window base component.
177
202
  */
178
- menuActionsWindowBase: () => ({
179
- left: "-50px"
203
+ menuActionsWindowBase: ({ theme, ownerState }) => ({
204
+ left: "-50px",
205
+ "& .M4LIcon-icon": {
206
+ ...ownerState?.selected ? {
207
+ backgroundColor: `${theme.vars.palette["primary"].semanticText} !important`
208
+ } : {
209
+ backgroundColor: `${theme.vars.palette.text.secondary} !important`
210
+ }
211
+ }
180
212
  }),
181
213
  /**
182
214
  * Styles for the linear progress of the window base component.
@@ -30,7 +30,8 @@ const TextField = forwardRef(function TextField2(props, ref) {
30
30
  disabled,
31
31
  paletteColor,
32
32
  variant,
33
- error
33
+ error,
34
+ color: error ? "error" : "default"
34
35
  };
35
36
  const isSkeleton = useModuleSkeleton();
36
37
  if (isSkeleton) {
@@ -117,6 +117,21 @@ const textFieldStyles = {
117
117
  borderRight: 0,
118
118
  borderBottom: theme.vars.size.borderStroke.actionInput
119
119
  }
120
+ },
121
+ // Variant Contained TextField
122
+ ...ownerState.variant === "contained" && {
123
+ [`&.${TEXT_FIELD_CLASSES.contained} .MuiInputBase-root`]: {
124
+ border: "none",
125
+ backgroundColor: theme.vars.palette[ownerState.color || "default"][ownerState.error ? "toneOpacity" : "enabled"]
126
+ },
127
+ ...ownerState.error && {
128
+ border: theme.vars.size.borderStroke.actionInput,
129
+ borderColor: `${ownerState.paletteColor?.enabled}!important`
130
+ },
131
+ "&:focus-within": {
132
+ border: theme.vars.size.borderStroke.actionInput,
133
+ borderColor: `${ownerState.paletteColor?.enabled}!important`
134
+ }
120
135
  }
121
136
  }),
122
137
  /**
@@ -3,6 +3,7 @@ export declare const TEXT_FIELD_KEY_COMPONENT = "M4LTextField";
3
3
  export declare const COMBINATED_TEXTFIELD_ENUMS: {
4
4
  outlined: TexFieldComplementaryClasses.outlined;
5
5
  text: TexFieldComplementaryClasses.text;
6
+ contained: TexFieldComplementaryClasses.contained;
6
7
  root: TextFieldSlots.root;
7
8
  skeleton: TextFieldSlots.skeleton;
8
9
  };
@@ -4,5 +4,6 @@ export declare enum TextFieldSlots {
4
4
  }
5
5
  export declare enum TexFieldComplementaryClasses {
6
6
  outlined = "outlined",
7
- text = "text"
7
+ text = "text",
8
+ contained = "contained"
8
9
  }
@@ -6,6 +6,7 @@ var TextFieldSlots = /* @__PURE__ */ ((TextFieldSlots2) => {
6
6
  var TexFieldComplementaryClasses = /* @__PURE__ */ ((TexFieldComplementaryClasses2) => {
7
7
  TexFieldComplementaryClasses2["outlined"] = "outlined";
8
8
  TexFieldComplementaryClasses2["text"] = "text";
9
+ TexFieldComplementaryClasses2["contained"] = "contained";
9
10
  return TexFieldComplementaryClasses2;
10
11
  })(TexFieldComplementaryClasses || {});
11
12
  export {
@@ -2,12 +2,12 @@ import { TextFieldProps as MUITextFieldProps } from '@mui/material/TextField';
2
2
  import { Theme, PaletteColor } from '@mui/material';
3
3
  import { TextFieldSlots } from './slots/TextFieldEnum';
4
4
  import { TEXT_FIELD_KEY_COMPONENT } from './constants';
5
- import { Sizes } from '@m4l/styles';
5
+ import { ComponentPalletColor, Sizes } from '@m4l/styles';
6
6
  import { M4LOverridesStyleRules } from '../../../@types/augmentations';
7
7
  /**
8
8
  * Variants for the TextField component.
9
9
  */
10
- export type TextFieldVariants = 'outlined' | 'text';
10
+ export type TextFieldVariants = 'outlined' | 'text' | 'contained';
11
11
  /**
12
12
  * Variants for the Skeleton component.
13
13
  */
@@ -61,6 +61,7 @@ export interface TextFieldOwnerState {
61
61
  * Indica si el campo de texto es error.
62
62
  */
63
63
  error?: boolean;
64
+ color?: Extract<ComponentPalletColor, 'default' | 'error'>;
64
65
  }
65
66
  export type TextFieldSlotsType = keyof typeof TextFieldSlots;
66
67
  export type TextFieldStyles = M4LOverridesStyleRules<TextFieldSlotsType, typeof TEXT_FIELD_KEY_COMPONENT, Theme>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.2.21",
3
+ "version": "9.2.23",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0 --no-warn-ignored"