@react-email/section 0.0.7-canary.0 → 0.0.7
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/dist/index.d.ts +0 -1
- package/dist/index.js +5 -20
- package/dist/index.mjs +5 -20
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
declare type RootProps = React.ComponentPropsWithoutRef<'table'>;
|
|
4
4
|
interface SectionProps extends RootProps {
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
5
|
}
|
|
7
6
|
declare const Section: React.ForwardRefExoticComponent<Readonly<SectionProps> & React.RefAttributes<HTMLTableElement>>;
|
|
8
7
|
|
package/dist/index.js
CHANGED
|
@@ -35,34 +35,19 @@ var React = __toESM(require("react"));
|
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var Section = React.forwardRef(
|
|
37
37
|
({ children, style, ...props }, forwardedRef) => {
|
|
38
|
-
const styleDefaultTable = {
|
|
39
|
-
width: "100%",
|
|
40
|
-
...style
|
|
41
|
-
};
|
|
42
|
-
const styleDefaultTr = {
|
|
43
|
-
display: "grid",
|
|
44
|
-
gridAutoColumns: "minmax(0, 1fr)",
|
|
45
|
-
gridAutoFlow: "column"
|
|
46
|
-
};
|
|
47
|
-
const arrayChildren = React.Children.toArray(children);
|
|
48
|
-
const hasTdElement = (child) => {
|
|
49
|
-
return React.isValidElement(child) && (child.type === "td" || child.type.displayName === "Column");
|
|
50
|
-
};
|
|
51
|
-
const finalChildren = arrayChildren.map((child, index) => {
|
|
52
|
-
return hasTdElement(child) ? child : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: child }, index);
|
|
53
|
-
});
|
|
54
38
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
39
|
"table",
|
|
56
40
|
{
|
|
41
|
+
...props,
|
|
57
42
|
ref: forwardedRef,
|
|
58
|
-
style
|
|
43
|
+
style,
|
|
59
44
|
align: "center",
|
|
60
45
|
border: 0,
|
|
61
|
-
cellPadding: 0,
|
|
62
|
-
cellSpacing: 0,
|
|
46
|
+
cellPadding: "0",
|
|
47
|
+
cellSpacing: "0",
|
|
63
48
|
role: "presentation",
|
|
64
49
|
...props,
|
|
65
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", {
|
|
50
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children }) }) })
|
|
66
51
|
}
|
|
67
52
|
);
|
|
68
53
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -3,34 +3,19 @@ import * as React from "react";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
var Section = React.forwardRef(
|
|
5
5
|
({ children, style, ...props }, forwardedRef) => {
|
|
6
|
-
const styleDefaultTable = {
|
|
7
|
-
width: "100%",
|
|
8
|
-
...style
|
|
9
|
-
};
|
|
10
|
-
const styleDefaultTr = {
|
|
11
|
-
display: "grid",
|
|
12
|
-
gridAutoColumns: "minmax(0, 1fr)",
|
|
13
|
-
gridAutoFlow: "column"
|
|
14
|
-
};
|
|
15
|
-
const arrayChildren = React.Children.toArray(children);
|
|
16
|
-
const hasTdElement = (child) => {
|
|
17
|
-
return React.isValidElement(child) && (child.type === "td" || child.type.displayName === "Column");
|
|
18
|
-
};
|
|
19
|
-
const finalChildren = arrayChildren.map((child, index) => {
|
|
20
|
-
return hasTdElement(child) ? child : /* @__PURE__ */ jsx("td", { children: child }, index);
|
|
21
|
-
});
|
|
22
6
|
return /* @__PURE__ */ jsx(
|
|
23
7
|
"table",
|
|
24
8
|
{
|
|
9
|
+
...props,
|
|
25
10
|
ref: forwardedRef,
|
|
26
|
-
style
|
|
11
|
+
style,
|
|
27
12
|
align: "center",
|
|
28
13
|
border: 0,
|
|
29
|
-
cellPadding: 0,
|
|
30
|
-
cellSpacing: 0,
|
|
14
|
+
cellPadding: "0",
|
|
15
|
+
cellSpacing: "0",
|
|
31
16
|
role: "presentation",
|
|
32
17
|
...props,
|
|
33
|
-
children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx("tr", {
|
|
18
|
+
children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { children }) }) })
|
|
34
19
|
}
|
|
35
20
|
);
|
|
36
21
|
}
|