@react-email/section 0.0.1

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,9 @@
1
+ import * as React from 'react';
2
+
3
+ declare type RootProps = React.ComponentPropsWithoutRef<'table'>;
4
+ interface SectionProps extends RootProps {
5
+ style?: React.CSSProperties;
6
+ }
7
+ declare const Section: React.ForwardRefExoticComponent<Readonly<SectionProps> & React.RefAttributes<HTMLTableElement>>;
8
+
9
+ export { Section, SectionProps };
package/dist/index.js ADDED
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
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
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+
26
+ // src/index.ts
27
+ var src_exports = {};
28
+ __export(src_exports, {
29
+ Section: () => Section
30
+ });
31
+ module.exports = __toCommonJS(src_exports);
32
+
33
+ // src/section.tsx
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var Section = React.forwardRef(
37
+ ({ children, style, ...props }, forwardedRef) => {
38
+ const styleDefault = {
39
+ width: "100%",
40
+ ...style
41
+ };
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", {
43
+ ref: forwardedRef,
44
+ style: styleDefault,
45
+ align: "center",
46
+ border: 0,
47
+ cellPadding: 0,
48
+ cellSpacing: 0,
49
+ role: "presentation",
50
+ ...props,
51
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", {
52
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", {
53
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
54
+ children
55
+ })
56
+ })
57
+ })
58
+ });
59
+ }
60
+ );
61
+ Section.displayName = "Section";
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ Section
65
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,32 @@
1
+ // src/section.tsx
2
+ import * as React from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var Section = React.forwardRef(
5
+ ({ children, style, ...props }, forwardedRef) => {
6
+ const styleDefault = {
7
+ width: "100%",
8
+ ...style
9
+ };
10
+ return /* @__PURE__ */ jsx("table", {
11
+ ref: forwardedRef,
12
+ style: styleDefault,
13
+ align: "center",
14
+ border: 0,
15
+ cellPadding: 0,
16
+ cellSpacing: 0,
17
+ role: "presentation",
18
+ ...props,
19
+ children: /* @__PURE__ */ jsx("tbody", {
20
+ children: /* @__PURE__ */ jsx("tr", {
21
+ children: /* @__PURE__ */ jsx("td", {
22
+ children
23
+ })
24
+ })
25
+ })
26
+ });
27
+ }
28
+ );
29
+ Section.displayName = "Section";
30
+ export {
31
+ Section
32
+ };
package/license.md ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2022 Bu Kinoshita and Zeno Rocha
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@react-email/section",
3
+ "version": "0.0.1",
4
+ "description": "Display a section that can be formatted using columns",
5
+ "sideEffects": false,
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist/**"
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": "TIMING=1 eslint src/**/*.ts* --fix",
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}\""
22
+ },
23
+ "dependencies": {
24
+ "react": "18.2.0"
25
+ },
26
+ "devDependencies": {
27
+ "@babel/preset-react": "7.18.6",
28
+ "@react-email/render": "*",
29
+ "@types/react": "18.0.20",
30
+ "@types/react-dom": "18.0.6",
31
+ "babel-jest": "28.1.3",
32
+ "eslint": "8.23.1",
33
+ "eslint-config-custom": "*",
34
+ "jest": "28.1.3",
35
+ "ts-jest": "28.0.8",
36
+ "tsconfig": "*",
37
+ "tsup": "6.2.3",
38
+ "typescript": "4.8.3"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ }
43
+ }
package/readme.md ADDED
@@ -0,0 +1,54 @@
1
+ ![React Email Section cover](https://react.email/static/images/readme/covers/section.png)
2
+
3
+ <div align="center"><strong>@react-email/section</strong></div>
4
+ <div align="center">Display a section that can be formatted using columns</div>
5
+ <br />
6
+ <div align="center">
7
+ <a href="https://react.email">Website</a>
8
+ <span> · </span>
9
+ <a href="https://github.com/zenorocha/react-email">GitHub</a>
10
+ <span> · </span>
11
+ <a href="https://react.email/discord">Discord</a>
12
+ </div>
13
+
14
+ ## Install
15
+
16
+ Install component from your command line.
17
+
18
+ #### With yarn
19
+
20
+ ```sh
21
+ yarn add @react-email/section -E
22
+ ```
23
+
24
+ #### With npm
25
+
26
+ ```sh
27
+ npm install @react-email/section -E
28
+ ```
29
+
30
+ ## Getting started
31
+
32
+ Add the component to your email template. Include styles where needed.
33
+
34
+ ```jsx
35
+ import { Section } from '@react-email/section';
36
+
37
+ const Section = () => {
38
+ return (
39
+ <Section>{/* Any column. */}<Section />
40
+ );
41
+ };
42
+ ```
43
+
44
+ ## Support
45
+
46
+ This component was tested using the most popular email clients.
47
+
48
+ | <img src="https://react.email/static/images/readme/icons/gmail.svg" width="48px" height="48px" alt="Gmail logo"> | <img src="https://react.email/static/images/readme/icons/apple-mail.svg" width="48px" height="48px" alt="Apple Mail"> | <img src="https://react.email/static/images/readme/icons/outlook.svg" width="48px" height="48px" alt="Outlook logo"> | <img src="https://react.email/static/images/readme/icons/yahoo-mail.svg" width="48px" height="48px" alt="Yahoo! Mail logo"> | <img src="https://react.email/static/images/readme/icons/hey.svg" width="48px" height="48px" alt="HEY logo"> | <img src="https://react.email/static/images/readme/icons/superhuman.svg" width="48px" height="48px" alt="Superhuman logo"> |
49
+ | ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
50
+ | Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
51
+
52
+ ## License
53
+
54
+ MIT License