@m4l/components 9.1.31 → 9.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AppBar/AppBar.js +6 -3
- package/components/AppBar/slots/AppBarEnum.d.ts +3 -1
- package/components/AppBar/slots/AppBarEnum.js +2 -0
- package/components/AppBar/slots/AppBarSlots.d.ts +14 -6
- package/components/AppBar/slots/AppBarSlots.js +13 -2
- package/components/AppBar/styles.js +34 -6
- package/components/AppBar/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { useIsMobile } from "@m4l/graphics";
|
|
|
3
3
|
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
4
|
import { T as TEST_PROP_ID } from "../../test/constants_no_mock.js";
|
|
5
5
|
import { g as getNameDataTestId } from "./tests/utils.js";
|
|
6
|
-
import { A as AppBarRootStyled, C as ContainerIsotypeNameStyled, I as ImageIsotypeStyled,
|
|
6
|
+
import { A as AppBarRootStyled, C as ContainerIsotypeNameStyled, a as ContentIsotypeStyled, I as ImageIsotypeStyled, b as CompanyNameStyled, D as DividerStyled, M as MenuIconButtonStyled, c as ContentStyled } from "./slots/AppBarSlots.js";
|
|
7
7
|
import { g as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
|
|
8
8
|
import { P as PATH_IMG_HAMBURGUER, A as APP_BAR_KEY } from "./constants.js";
|
|
9
9
|
const AppBar = (props) => {
|
|
@@ -24,8 +24,11 @@ const AppBar = (props) => {
|
|
|
24
24
|
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId(dataTestid) } : {},
|
|
25
25
|
children: [
|
|
26
26
|
!isMobile ? /* @__PURE__ */ jsxs(ContainerIsotypeNameStyled, { ownerState: {}, children: [
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
/* @__PURE__ */ jsxs(ContentIsotypeStyled, { ownerState: {}, children: [
|
|
28
|
+
companyLogo && /* @__PURE__ */ jsx(ImageIsotypeStyled, { alt: "logo", ownerState: {}, src: companyLogo, size }),
|
|
29
|
+
/* @__PURE__ */ jsx(CompanyNameStyled, { ownerState: {}, variant: "bodyDens", skeletonWidth: "100px", size, children: companyName })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ jsx(DividerStyled, { orientation: "vertical", flexItem: true, ownerState: {} })
|
|
29
32
|
] }) : null,
|
|
30
33
|
isMobile ? /* @__PURE__ */ jsx(
|
|
31
34
|
MenuIconButtonStyled,
|
|
@@ -5,6 +5,8 @@ var AppBarSlots = /* @__PURE__ */ ((AppBarSlots2) => {
|
|
|
5
5
|
AppBarSlots2["companyName"] = "companyName";
|
|
6
6
|
AppBarSlots2["menuIconButton"] = "menuIconButton";
|
|
7
7
|
AppBarSlots2["content"] = "content";
|
|
8
|
+
AppBarSlots2["contentIsoType"] = "contentIsoType";
|
|
9
|
+
AppBarSlots2["divider"] = "divider";
|
|
8
10
|
return AppBarSlots2;
|
|
9
11
|
})(AppBarSlots || {});
|
|
10
12
|
export {
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
export declare const AppBarRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material
|
|
1
|
+
export declare const AppBarRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').AppBarOwnerState> & Record<string, unknown> & {
|
|
2
2
|
ownerState: Partial<import('../types').AppBarOwnerState> & Record<string, unknown>;
|
|
3
3
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, keyof import('react').HTMLAttributes<HTMLElement> | keyof import('react').ClassAttributes<HTMLElement>>, {}>;
|
|
4
|
-
export declare const ContainerIsotypeNameStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material
|
|
4
|
+
export declare const ContainerIsotypeNameStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').AppBarOwnerState> & Record<string, unknown> & {
|
|
5
5
|
ownerState: Partial<import('../types').AppBarOwnerState> & Record<string, unknown>;
|
|
6
6
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
7
|
-
export declare const ImageIsotypeStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Image').ImageProps, keyof import('../../Image').ImageProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material
|
|
7
|
+
export declare const ImageIsotypeStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Image').ImageProps, keyof import('../../Image').ImageProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').AppBarOwnerState> & Record<string, unknown> & {
|
|
8
8
|
ownerState: Partial<import('../types').AppBarOwnerState> & Record<string, unknown>;
|
|
9
9
|
}, {}, {}>;
|
|
10
|
-
export declare const CompanyNameStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material
|
|
10
|
+
export declare const CompanyNameStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').AppBarOwnerState> & Record<string, unknown> & {
|
|
11
11
|
ownerState: Partial<import('../types').AppBarOwnerState> & Record<string, unknown>;
|
|
12
12
|
}, {}, {}>;
|
|
13
|
-
export declare const MenuIconButtonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/IconButton/types').IconButtonProps, keyof import('../../mui_extended/IconButton/types').IconButtonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material
|
|
13
|
+
export declare const MenuIconButtonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/IconButton/types').IconButtonProps, keyof import('../../mui_extended/IconButton/types').IconButtonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').AppBarOwnerState> & Record<string, unknown> & {
|
|
14
14
|
ownerState: Partial<import('../types').AppBarOwnerState> & Record<string, unknown>;
|
|
15
15
|
}, {}, {}>;
|
|
16
|
-
export declare const ContentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material
|
|
16
|
+
export declare const ContentStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').AppBarOwnerState> & Record<string, unknown> & {
|
|
17
17
|
ownerState: Partial<import('../types').AppBarOwnerState> & Record<string, unknown>;
|
|
18
18
|
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
19
|
+
export declare const ContentIsotypeStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').AppBarOwnerState> & Record<string, unknown> & {
|
|
20
|
+
ownerState: Partial<import('../types').AppBarOwnerState> & Record<string, unknown>;
|
|
21
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
22
|
+
export declare const DividerStyled: import('@emotion/styled').StyledComponent<Pick<import('@mui/material').DividerOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLHRElement>, HTMLHRElement>, "ref"> & {
|
|
23
|
+
ref?: ((instance: HTMLHRElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLHRElement> | null | undefined;
|
|
24
|
+
}, "children" | "light" | "style" | "absolute" | "variant" | "className" | "classes" | "sx" | "textAlign" | "orientation" | "flexItem">, "children" | "ref" | "title" | "id" | "light" | "hidden" | "color" | "content" | "style" | "absolute" | "variant" | "className" | "classes" | "onChange" | "sx" | "textAlign" | "translate" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "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" | "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" | "orientation" | "flexItem"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Partial<import('../types').AppBarOwnerState> & Record<string, unknown> & {
|
|
25
|
+
ownerState: Partial<import('../types').AppBarOwnerState> & Record<string, unknown>;
|
|
26
|
+
}, {}, {}>;
|
|
@@ -2,6 +2,7 @@ import { styled } from "@mui/material/styles";
|
|
|
2
2
|
import { A as APP_BAR_KEY } from "../constants.js";
|
|
3
3
|
import { A as AppBarSlots } from "./AppBarEnum.js";
|
|
4
4
|
import { a as appBarStyles } from "../styles.js";
|
|
5
|
+
import { Divider } from "@mui/material";
|
|
5
6
|
import { T as Typography } from "../../mui_extended/Typography/Typography.js";
|
|
6
7
|
import { I as IconButton } from "../../mui_extended/IconButton/IconButton.js";
|
|
7
8
|
import { I as Image } from "../../Image/Image.js";
|
|
@@ -29,11 +30,21 @@ const ContentStyled = styled("div", {
|
|
|
29
30
|
name: APP_BAR_KEY,
|
|
30
31
|
slot: AppBarSlots.content
|
|
31
32
|
})(appBarStyles?.content);
|
|
33
|
+
const ContentIsotypeStyled = styled("div", {
|
|
34
|
+
name: APP_BAR_KEY,
|
|
35
|
+
slot: AppBarSlots.contentIsoType
|
|
36
|
+
})(appBarStyles?.contentIsoType);
|
|
37
|
+
const DividerStyled = styled(Divider, {
|
|
38
|
+
name: APP_BAR_KEY,
|
|
39
|
+
slot: AppBarSlots.divider
|
|
40
|
+
})(appBarStyles?.divider);
|
|
32
41
|
export {
|
|
33
42
|
AppBarRootStyled as A,
|
|
34
43
|
ContainerIsotypeNameStyled as C,
|
|
44
|
+
DividerStyled as D,
|
|
35
45
|
ImageIsotypeStyled as I,
|
|
36
46
|
MenuIconButtonStyled as M,
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
ContentIsotypeStyled as a,
|
|
48
|
+
CompanyNameStyled as b,
|
|
49
|
+
ContentStyled as c
|
|
39
50
|
};
|
|
@@ -12,7 +12,7 @@ const appBarStyles = {
|
|
|
12
12
|
display: "flex",
|
|
13
13
|
flexDirection: "row",
|
|
14
14
|
flexWrap: "nowrap",
|
|
15
|
-
height:
|
|
15
|
+
height: theme.vars.size.baseSpacings.sp12,
|
|
16
16
|
padding: `0 ${theme.vars.size.baseSpacings.sp4}`,
|
|
17
17
|
borderBottom: `1px solid ${theme.vars.palette.border.default}`,
|
|
18
18
|
gap: theme.vars.size.baseSpacings.sp3
|
|
@@ -30,9 +30,14 @@ const appBarStyles = {
|
|
|
30
30
|
display: "flex",
|
|
31
31
|
flexDirection: "row",
|
|
32
32
|
alignItems: "center",
|
|
33
|
+
justifyContent: "space-between",
|
|
33
34
|
gap: theme.vars.size.baseSpacings.sp3,
|
|
34
35
|
padding: `${theme.vars.size.baseSpacings.sp3} 0`,
|
|
35
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Se pone los px directamente porque no existe un token con este valor
|
|
38
|
+
*/
|
|
39
|
+
width: "204px",
|
|
40
|
+
minWidth: "204px"
|
|
36
41
|
}),
|
|
37
42
|
/**
|
|
38
43
|
* ****************************************************
|
|
@@ -85,13 +90,36 @@ const appBarStyles = {
|
|
|
85
90
|
* @updatedAt 2024-11-30 11:32:23 - automatic
|
|
86
91
|
* @updatedUser Andrés Quintero - automatic
|
|
87
92
|
*/
|
|
88
|
-
content: ({ theme
|
|
89
|
-
padding:
|
|
90
|
-
borderLeft: ownerState.isMobile ? "0" : `1px solid ${theme.vars.palette.border.secondary}`,
|
|
93
|
+
content: ({ theme }) => ({
|
|
94
|
+
padding: `0 ${theme.vars.size.baseSpacings.sp2}`,
|
|
91
95
|
display: "flex",
|
|
92
96
|
flexDirection: "row",
|
|
93
97
|
justifyContent: "flex-start",
|
|
94
|
-
alignItems: "center"
|
|
98
|
+
alignItems: "center",
|
|
99
|
+
flex: "1",
|
|
100
|
+
height: theme.vars.size.baseSpacings.sp12
|
|
101
|
+
}),
|
|
102
|
+
/**
|
|
103
|
+
* **************************************************************
|
|
104
|
+
* Estilos para el contenedor del contenido del logotipo y nombre
|
|
105
|
+
* **************************************************************
|
|
106
|
+
*/
|
|
107
|
+
contentIsoType: ({ theme }) => ({
|
|
108
|
+
display: "flex",
|
|
109
|
+
flexDirection: "row",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
gap: theme.vars.size.baseSpacings.sp3,
|
|
112
|
+
height: theme.vars.size.baseSpacings.sp6
|
|
113
|
+
}),
|
|
114
|
+
/**
|
|
115
|
+
* **************************************************************
|
|
116
|
+
* Estilos para el divisor entre el logotipo y el contenido
|
|
117
|
+
* **************************************************************
|
|
118
|
+
*/
|
|
119
|
+
divider: ({ theme, ownerState }) => ({
|
|
120
|
+
height: "100%",
|
|
121
|
+
borderColor: theme.vars.palette.border.secondary,
|
|
122
|
+
borderRightWidth: ownerState.isMobile ? "thin" : "none"
|
|
95
123
|
})
|
|
96
124
|
};
|
|
97
125
|
export {
|
|
@@ -35,4 +35,4 @@ export type AppBarSlotsType = keyof typeof AppBarSlots;
|
|
|
35
35
|
/**
|
|
36
36
|
* Estilos aplicables al `AppBar`
|
|
37
37
|
*/
|
|
38
|
-
export type AppBarStyles =
|
|
38
|
+
export type AppBarStyles = OverridesStyleRules<AppBarSlotsType, typeof APP_BAR_KEY, Theme>;
|