@react-email/section 0.0.9 → 0.0.11

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.
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+
3
+ type RootProps = React.ComponentPropsWithoutRef<"table">;
4
+ type SectionProps = RootProps;
5
+ declare const Section: React.FC<Readonly<SectionProps>>;
6
+
7
+ export { Section, SectionProps };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
2
 
3
- declare type RootProps = React.ComponentPropsWithoutRef<"table">;
4
- interface SectionProps extends RootProps {
5
- }
6
- declare const Section: React.ForwardRefExoticComponent<Readonly<SectionProps> & React.RefAttributes<HTMLTableElement>>;
3
+ type RootProps = React.ComponentPropsWithoutRef<"table">;
4
+ type SectionProps = RootProps;
5
+ declare const Section: React.FC<Readonly<SectionProps>>;
7
6
 
8
7
  export { Section, SectionProps };
package/dist/index.js CHANGED
@@ -1,10 +1,37 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
8
35
  var __export = (target, all) => {
9
36
  for (var name in all)
10
37
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -17,10 +44,6 @@ var __copyProps = (to, from, except, desc) => {
17
44
  }
18
45
  return to;
19
46
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
47
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
48
 
26
49
  // src/index.ts
@@ -31,29 +54,30 @@ __export(src_exports, {
31
54
  module.exports = __toCommonJS(src_exports);
32
55
 
33
56
  // src/section.tsx
34
- var React = __toESM(require("react"));
35
57
  var import_jsx_runtime = require("react/jsx-runtime");
36
- var Section = React.forwardRef(
37
- ({ children, style, ...props }, forwardedRef) => {
38
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
39
- "table",
40
- {
41
- align: "center",
42
- width: "100%",
43
- ...props,
44
- ref: forwardedRef,
45
- "data-id": "react-email-section",
46
- style,
47
- border: 0,
48
- cellPadding: "0",
49
- cellSpacing: "0",
50
- role: "presentation",
51
- 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 }) }) })
52
- }
53
- );
54
- }
55
- );
56
- Section.displayName = "Section";
58
+ var Section = (_a) => {
59
+ var _b = _a, {
60
+ children,
61
+ style
62
+ } = _b, props = __objRest(_b, [
63
+ "children",
64
+ "style"
65
+ ]);
66
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
67
+ "table",
68
+ __spreadProps(__spreadValues({
69
+ align: "center",
70
+ width: "100%"
71
+ }, props), {
72
+ border: 0,
73
+ cellPadding: "0",
74
+ cellSpacing: "0",
75
+ role: "presentation",
76
+ style,
77
+ 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 }) }) })
78
+ })
79
+ );
80
+ };
57
81
  // Annotate the CommonJS export names for ESM import in node:
58
82
  0 && (module.exports = {
59
83
  Section
package/dist/index.mjs CHANGED
@@ -1,27 +1,60 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
1
33
  // src/section.tsx
2
- import * as React from "react";
3
34
  import { jsx } from "react/jsx-runtime";
4
- var Section = React.forwardRef(
5
- ({ children, style, ...props }, forwardedRef) => {
6
- return /* @__PURE__ */ jsx(
7
- "table",
8
- {
9
- align: "center",
10
- width: "100%",
11
- ...props,
12
- ref: forwardedRef,
13
- "data-id": "react-email-section",
14
- style,
15
- border: 0,
16
- cellPadding: "0",
17
- cellSpacing: "0",
18
- role: "presentation",
19
- children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { children }) }) })
20
- }
21
- );
22
- }
23
- );
24
- Section.displayName = "Section";
35
+ var Section = (_a) => {
36
+ var _b = _a, {
37
+ children,
38
+ style
39
+ } = _b, props = __objRest(_b, [
40
+ "children",
41
+ "style"
42
+ ]);
43
+ return /* @__PURE__ */ jsx(
44
+ "table",
45
+ __spreadProps(__spreadValues({
46
+ align: "center",
47
+ width: "100%"
48
+ }, props), {
49
+ border: 0,
50
+ cellPadding: "0",
51
+ cellSpacing: "0",
52
+ role: "presentation",
53
+ style,
54
+ children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { children }) }) })
55
+ })
56
+ );
57
+ };
25
58
  export {
26
59
  Section
27
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-email/section",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Display a section that can be formatted using columns",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -9,17 +9,19 @@
9
9
  "files": [
10
10
  "dist/**"
11
11
  ],
12
- "license": "MIT",
13
- "scripts": {
14
- "build": "tsup src/index.ts --format esm,cjs --dts --external react",
15
- "dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch",
16
- "lint": "eslint",
17
- "clean": "rm -rf dist",
18
- "test": "jest",
19
- "test:watch": "jest --watch",
20
- "format:check": "prettier --check \"**/*.{ts,tsx,md}\"",
21
- "format": "prettier --write \"**/*.{ts,tsx,md}\""
12
+ "exports": {
13
+ ".": {
14
+ "import": {
15
+ "types": "./dist/index.d.mts",
16
+ "default": "./dist/index.mjs"
17
+ },
18
+ "require": {
19
+ "types": "./dist/index.d.ts",
20
+ "default": "./dist/index.js"
21
+ }
22
+ }
22
23
  },
24
+ "license": "MIT",
23
25
  "repository": {
24
26
  "type": "git",
25
27
  "url": "https://github.com/resendlabs/react-email.git",
@@ -30,24 +32,27 @@
30
32
  "email"
31
33
  ],
32
34
  "engines": {
33
- "node": ">=16.0.0"
35
+ "node": ">=18.0.0"
34
36
  },
35
- "dependencies": {
37
+ "peerDependencies": {
36
38
  "react": "18.2.0"
37
39
  },
38
40
  "devDependencies": {
39
- "@babel/preset-react": "7.18.6",
40
- "@types/react": "18.0.20",
41
- "@types/react-dom": "18.0.6",
42
- "babel-jest": "28.1.3",
43
- "eslint": "8.23.1",
44
- "jest": "28.1.3",
45
- "prettier": "2.8.4",
46
- "ts-jest": "28.0.8",
47
- "tsup": "6.2.3",
48
- "typescript": "4.8.3"
41
+ "@babel/preset-react": "7.22.5",
42
+ "typescript": "5.1.6",
43
+ "@react-email/render": "0.0.10",
44
+ "tsconfig": "0.0.0",
45
+ "eslint-config-custom": "0.0.0"
49
46
  },
50
47
  "publishConfig": {
51
48
  "access": "public"
49
+ },
50
+ "scripts": {
51
+ "build": "tsup src/index.ts --format esm,cjs --dts --external react",
52
+ "clean": "rm -rf dist",
53
+ "dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch",
54
+ "lint": "eslint .",
55
+ "test:watch": "vitest",
56
+ "test": "vitest run"
52
57
  }
53
- }
58
+ }
package/readme.md CHANGED
@@ -33,13 +33,28 @@ Add the component to your email template. Include styles where needed.
33
33
 
34
34
  ```jsx
35
35
  import { Section } from '@react-email/section';
36
+ import { Column } from '@react-email/column';
37
+ import { Row } from '@react-email/row';
36
38
  import { Text } from '@react-email/text';
37
39
 
38
- const Section = () => {
40
+ const Email = () => {
39
41
  return (
42
+ {/* A simple `section` */}
40
43
  <Section>
41
44
  <Text>Hello World</Text>
42
- <Section />
45
+ </Section>
46
+
47
+ {/* Formatted with `rows` and `columns` */}
48
+ <Section>
49
+ <Row>
50
+ <Column>Column 1, Row 1</Column>
51
+ <Column>Column 2, Row 1</Column>
52
+ </Row>
53
+ <Row>
54
+ <Column>Column 1, Row 2</Column>
55
+ <Column>Column 2, Row 2</Column>
56
+ </Row>
57
+ </Section>
43
58
  );
44
59
  };
45
60
  ```
@@ -50,7 +65,7 @@ This component was tested using the most popular email clients.
50
65
 
51
66
  | <img src="https://react.email/static/icons/gmail.svg" width="48px" height="48px" alt="Gmail logo"> | <img src="https://react.email/static/icons/apple-mail.svg" width="48px" height="48px" alt="Apple Mail"> | <img src="https://react.email/static/icons/outlook.svg" width="48px" height="48px" alt="Outlook logo"> | <img src="https://react.email/static/icons/yahoo-mail.svg" width="48px" height="48px" alt="Yahoo! Mail logo"> | <img src="https://react.email/static/icons/hey.svg" width="48px" height="48px" alt="HEY logo"> | <img src="https://react.email/static/icons/superhuman.svg" width="48px" height="48px" alt="Superhuman logo"> |
52
67
  | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
53
- | Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
68
+ | Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
54
69
 
55
70
  ## License
56
71