@m4l/components 9.1.116 → 9.1.117
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.
|
@@ -4,6 +4,7 @@ import { P as PaperFormRootStyled, C as ContentStyled } from "./slots/PaperFormS
|
|
|
4
4
|
import { useRef } from "react";
|
|
5
5
|
import { a as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
|
|
6
6
|
import { P as PAPER_FORM_KEY } from "./constants.js";
|
|
7
|
+
import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
|
|
7
8
|
import { P as PropertyValue } from "../PropertyValue/PropertyValue.js";
|
|
8
9
|
const isPropertyValue = (child) => typeof child === "object" && child !== null && "property" in child && "value" in child;
|
|
9
10
|
const renderChildren = (children) => {
|
|
@@ -25,14 +26,22 @@ function PaperForm(props) {
|
|
|
25
26
|
isForm = false,
|
|
26
27
|
variant = "standard"
|
|
27
28
|
} = props;
|
|
29
|
+
const { currentSize } = useComponentSize(size);
|
|
28
30
|
const paperFormRef = useRef(null);
|
|
29
31
|
const rootClass = getComponentSlotRoot(PAPER_FORM_KEY);
|
|
32
|
+
const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
|
|
33
|
+
const ownerState = {
|
|
34
|
+
size: adjustedSize,
|
|
35
|
+
color,
|
|
36
|
+
isForm,
|
|
37
|
+
paperFormVariant: variant
|
|
38
|
+
};
|
|
30
39
|
return /* @__PURE__ */ jsxs(
|
|
31
40
|
PaperFormRootStyled,
|
|
32
41
|
{
|
|
33
42
|
className: rootClass,
|
|
34
43
|
ref: paperFormRef,
|
|
35
|
-
ownerState: {
|
|
44
|
+
ownerState: { ...ownerState },
|
|
36
45
|
...process.env.NODE_ENV !== "production" ? { "data-testid": dataTestId } : {},
|
|
37
46
|
children: [
|
|
38
47
|
/* @__PURE__ */ jsx(Header, { urlIcon, title, color, size }),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { g as getHeightSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
1
2
|
const paperFormStyles = {
|
|
2
3
|
/**
|
|
3
4
|
*************************************************************
|
|
@@ -11,8 +12,7 @@ const paperFormStyles = {
|
|
|
11
12
|
border: `${theme.size.borderStroke.container}`,
|
|
12
13
|
borderColor: theme.vars.palette.border.default,
|
|
13
14
|
width: "100%",
|
|
14
|
-
height: "auto"
|
|
15
|
-
overflow: "hidden"
|
|
15
|
+
height: "auto"
|
|
16
16
|
}),
|
|
17
17
|
/**
|
|
18
18
|
* ************************************************************
|
|
@@ -26,10 +26,15 @@ const paperFormStyles = {
|
|
|
26
26
|
alignItems: "center",
|
|
27
27
|
gap: theme.vars.size.baseSpacings.sp1,
|
|
28
28
|
overflow: "hidden",
|
|
29
|
-
|
|
30
|
-
padding: `${theme.vars.size.baseSpacings.sp2}`,
|
|
29
|
+
padding: `${theme.vars.size.baseSpacings.sp1} ${theme.vars.size.baseSpacings.sp2}`,
|
|
31
30
|
borderRadius: `${theme.vars.size.borderRadius.r1} ${theme.vars.size.borderRadius.r1} 0 0`,
|
|
32
|
-
background: theme.vars.palette[ownerState.color ?? "default"].hoverOpacity
|
|
31
|
+
background: theme.vars.palette[ownerState.color ?? "default"].hoverOpacity,
|
|
32
|
+
alignSelf: "stretch",
|
|
33
|
+
...getHeightSizeStyles(
|
|
34
|
+
theme.generalSettings.isMobile,
|
|
35
|
+
ownerState.size || "medium",
|
|
36
|
+
"container"
|
|
37
|
+
)
|
|
33
38
|
}),
|
|
34
39
|
/**
|
|
35
40
|
* ************************************************************
|
|
@@ -43,8 +48,7 @@ const paperFormStyles = {
|
|
|
43
48
|
fontSize: theme.typography.body,
|
|
44
49
|
variants: [],
|
|
45
50
|
display: "inline-flex",
|
|
46
|
-
alignItems: "center"
|
|
47
|
-
marginTop: "1px"
|
|
51
|
+
alignItems: "center"
|
|
48
52
|
}),
|
|
49
53
|
/**
|
|
50
54
|
* ************************************************************
|
|
@@ -25,7 +25,7 @@ interface CommonsProps {
|
|
|
25
25
|
paperFormVariant?: PaperFormProps['variant'];
|
|
26
26
|
}
|
|
27
27
|
export type HeaderProps = Omit<PaperFormProps, 'children' | 'isForm' | 'variant'> & CommonsProps;
|
|
28
|
-
export type PaperFormOwnerState = Pick<PaperFormProps, 'isForm' | 'color'> & CommonsProps;
|
|
28
|
+
export type PaperFormOwnerState = Pick<PaperFormProps, 'isForm' | 'color' | 'size'> & CommonsProps;
|
|
29
29
|
/**
|
|
30
30
|
* ***********************************
|
|
31
31
|
* Slots para los estilos utilizados
|