@comet/mail-react 9.4.0-canary-20260810072652 → 9.4.0-canary-20260810073530
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/lib/blocks/richText/RichTextList.js +1 -1
- package/lib/components/section/MjmlSection.js +10 -24
- package/lib/components/text/HtmlText.js +1 -1
- package/lib/components/text/MjmlText.d.ts +1 -1
- package/lib/components/text/MjmlText.js +3 -3
- package/package.json +3 -3
- /package/lib/components/text/{textStyles.d.ts → generateResponsiveTextCss.d.ts} +0 -0
- /package/lib/components/text/{textStyles.js → generateResponsiveTextCss.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
+
import { generateResponsiveTextCss } from "../../components/text/generateResponsiveTextCss.js";
|
|
3
4
|
import { useOutlookTextStyle } from "../../components/text/OutlookTextStyleContext.js";
|
|
4
|
-
import { generateResponsiveTextCss } from "../../components/text/textStyles.js";
|
|
5
5
|
import { generateResponsiveTokenCss } from "../../styles/generateResponsiveVariantCss.js";
|
|
6
6
|
import { registerStyles } from "../../styles/registerStyles.js";
|
|
7
7
|
import { defaultTheme } from "../../theme/defaultTheme.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { MjmlGroup, MjmlSection as BaseMjmlSection } from "@faire/mjml-react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import { generateResponsiveTokenCss } from "../../styles/generateResponsiveVariantCss.js";
|
|
4
5
|
import { registerStyles } from "../../styles/registerStyles.js";
|
|
5
|
-
import { getDefaultFromResponsiveValue
|
|
6
|
+
import { getDefaultFromResponsiveValue } from "../../theme/responsiveValue.js";
|
|
6
7
|
import { useOptionalTheme } from "../../theme/ThemeProvider.js";
|
|
7
|
-
import { css } from "../../utils/css.js";
|
|
8
8
|
import { useIsInsideMjmlWrapper } from "../wrapper/InsideMjmlWrapperContext.js";
|
|
9
9
|
/** A section wrapper for email layouts. Must be a direct child of `MjmlBody` or `MjmlWrapper`. */
|
|
10
10
|
export function MjmlSection({ children, indent, disableResponsiveBehavior, slotProps, className, ...restProps }) {
|
|
@@ -24,25 +24,11 @@ function getIndentProps(theme) {
|
|
|
24
24
|
paddingRight: getDefaultFromResponsiveValue(theme.sizes.contentIndentation),
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
registerStyles((theme) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (!breakpoint) {
|
|
36
|
-
return "";
|
|
37
|
-
}
|
|
38
|
-
return css `
|
|
39
|
-
${breakpoint.belowMediaQuery} {
|
|
40
|
-
.mjmlSection--indented > table > tbody > tr > td {
|
|
41
|
-
padding-left: ${override.value}px !important;
|
|
42
|
-
padding-right: ${override.value}px !important;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
`;
|
|
46
|
-
})
|
|
47
|
-
.join("\n");
|
|
48
|
-
});
|
|
27
|
+
registerStyles((theme) => generateResponsiveTokenCss({
|
|
28
|
+
breakpoints: theme.breakpoints,
|
|
29
|
+
selector: ".mjmlSection--indented > table > tbody > tr > td",
|
|
30
|
+
tokens: [
|
|
31
|
+
{ value: theme.sizes.contentIndentation, cssProperty: "padding-left", unit: "px" },
|
|
32
|
+
{ value: theme.sizes.contentIndentation, cssProperty: "padding-right", unit: "px" },
|
|
33
|
+
],
|
|
34
|
+
}));
|
|
@@ -3,8 +3,8 @@ import clsx from "clsx";
|
|
|
3
3
|
import { registerStyles } from "../../styles/registerStyles.js";
|
|
4
4
|
import { getDefaultOrUndefined } from "../../theme/responsiveValue.js";
|
|
5
5
|
import { useTheme } from "../../theme/ThemeProvider.js";
|
|
6
|
+
import { generateResponsiveTextCss } from "./generateResponsiveTextCss.js";
|
|
6
7
|
import { OutlookTextStyleProvider } from "./OutlookTextStyleContext.js";
|
|
7
|
-
import { generateResponsiveTextCss } from "./textStyles.js";
|
|
8
8
|
export function HtmlText({ element: Element = "td", variant: variantProp, bottomSpacing, className, style, children, ...restProps }) {
|
|
9
9
|
const theme = useTheme();
|
|
10
10
|
const { defaultVariant, variants, ...baseStyles } = theme.text;
|
|
@@ -37,4 +37,4 @@ export type MjmlTextProps = IMjmlTextProps & {
|
|
|
37
37
|
* The `variant` and `bottomSpacing` props require a `ThemeProvider` (or `MjmlMailRoot`).
|
|
38
38
|
*/
|
|
39
39
|
export declare function MjmlText({ variant: variantProp, bottomSpacing, className, children, ...restProps }: MjmlTextProps): ReactNode;
|
|
40
|
-
export declare function
|
|
40
|
+
export declare function generateMjmlTextStyles(theme: Theme): string;
|
|
@@ -4,8 +4,8 @@ import clsx from "clsx";
|
|
|
4
4
|
import { registerStyles } from "../../styles/registerStyles.js";
|
|
5
5
|
import { getDefaultOrUndefined } from "../../theme/responsiveValue.js";
|
|
6
6
|
import { useOptionalTheme } from "../../theme/ThemeProvider.js";
|
|
7
|
+
import { generateResponsiveTextCss } from "./generateResponsiveTextCss.js";
|
|
7
8
|
import { OutlookTextStyleProvider } from "./OutlookTextStyleContext.js";
|
|
8
|
-
import { generateResponsiveTextCss } from "./textStyles.js";
|
|
9
9
|
/**
|
|
10
10
|
* Text component that can be styled using the theme, optionally using a variant.
|
|
11
11
|
*
|
|
@@ -56,10 +56,10 @@ function getThemedProps(theme, variantProp, bottomSpacing, explicitProps) {
|
|
|
56
56
|
},
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
export function
|
|
59
|
+
export function generateMjmlTextStyles(theme) {
|
|
60
60
|
return generateResponsiveTextCss(theme, {
|
|
61
61
|
styleSelector: (variantName) => `.mjmlText--${variantName} > div`,
|
|
62
62
|
spacingSelector: (variantName) => `.mjmlText--bottomSpacing.mjmlText--${variantName}`,
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
registerStyles(
|
|
65
|
+
registerStyles(generateMjmlTextStyles);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comet/mail-react",
|
|
3
|
-
"version": "9.4.0-canary-
|
|
3
|
+
"version": "9.4.0-canary-20260810073530",
|
|
4
4
|
"description": "Utilities for building HTML emails with React",
|
|
5
5
|
"license": "BSD-2-Clause",
|
|
6
6
|
"type": "module",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"typescript": "^5.9.3",
|
|
49
49
|
"vite": "^7.3.1",
|
|
50
50
|
"vitest": "^4.1.8",
|
|
51
|
-
"@comet/cli": "9.4.0-canary-
|
|
52
|
-
"@comet/eslint-config": "9.4.0-canary-
|
|
51
|
+
"@comet/cli": "9.4.0-canary-20260810073530",
|
|
52
|
+
"@comet/eslint-config": "9.4.0-canary-20260810073530"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
File without changes
|
|
File without changes
|