@react-email/section
Advanced tools
Comparing version 0.0.9 to 0.0.10
import * as React from 'react'; | ||
declare type RootProps = React.ComponentPropsWithoutRef<"table">; | ||
interface SectionProps extends RootProps { | ||
} | ||
declare const Section: React.ForwardRefExoticComponent<Readonly<SectionProps> & React.RefAttributes<HTMLTableElement>>; | ||
type RootProps = React.ComponentPropsWithoutRef<"table">; | ||
type SectionProps = RootProps; | ||
declare const Section: React.FC<Readonly<SectionProps>>; | ||
export { Section, SectionProps }; |
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __defProps = Object.defineProperties; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __spreadValues = (a, b) => { | ||
for (var prop in b || (b = {})) | ||
if (__hasOwnProp.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
if (__getOwnPropSymbols) | ||
for (var prop of __getOwnPropSymbols(b)) { | ||
if (__propIsEnum.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
} | ||
return a; | ||
}; | ||
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); | ||
var __objRest = (source, exclude) => { | ||
var target = {}; | ||
for (var prop in source) | ||
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) | ||
target[prop] = source[prop]; | ||
if (source != null && __getOwnPropSymbols) | ||
for (var prop of __getOwnPropSymbols(source)) { | ||
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) | ||
target[prop] = source[prop]; | ||
} | ||
return target; | ||
}; | ||
var __export = (target, all) => { | ||
@@ -20,6 +47,2 @@ for (var name in all) | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -35,25 +58,26 @@ | ||
// src/section.tsx | ||
var React = __toESM(require("react")); | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var Section = React.forwardRef( | ||
({ children, style, ...props }, forwardedRef) => { | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
"table", | ||
{ | ||
align: "center", | ||
width: "100%", | ||
...props, | ||
ref: forwardedRef, | ||
"data-id": "react-email-section", | ||
style, | ||
border: 0, | ||
cellPadding: "0", | ||
cellSpacing: "0", | ||
role: "presentation", | ||
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 }) }) }) | ||
} | ||
); | ||
} | ||
); | ||
Section.displayName = "Section"; | ||
var Section = (_a) => { | ||
var _b = _a, { | ||
children, | ||
style | ||
} = _b, props = __objRest(_b, [ | ||
"children", | ||
"style" | ||
]); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
"table", | ||
__spreadProps(__spreadValues({ | ||
align: "center", | ||
width: "100%" | ||
}, props), { | ||
border: 0, | ||
cellPadding: "0", | ||
cellSpacing: "0", | ||
role: "presentation", | ||
style, | ||
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 }) }) }) | ||
}) | ||
); | ||
}; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -60,0 +84,0 @@ 0 && (module.exports = { |
{ | ||
"name": "@react-email/section", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Display a section that can be formatted using columns", | ||
@@ -12,12 +12,22 @@ "sideEffects": false, | ||
], | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
} | ||
} | ||
}, | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "tsup src/index.ts --format esm,cjs --dts --external react", | ||
"clean": "rm -rf dist", | ||
"dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch", | ||
"lint": "eslint", | ||
"clean": "rm -rf dist", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"format:check": "prettier --check \"**/*.{ts,tsx,md}\"", | ||
"format": "prettier --write \"**/*.{ts,tsx,md}\"" | ||
"lint": "eslint .", | ||
"test:watch": "vitest", | ||
"test": "vitest run" | ||
}, | ||
@@ -34,18 +44,13 @@ "repository": { | ||
"engines": { | ||
"node": ">=16.0.0" | ||
"node": ">=18.0.0" | ||
}, | ||
"dependencies": { | ||
"peerDependencies": { | ||
"react": "18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/preset-react": "7.18.6", | ||
"@types/react": "18.0.20", | ||
"@types/react-dom": "18.0.6", | ||
"babel-jest": "28.1.3", | ||
"eslint": "8.23.1", | ||
"jest": "28.1.3", | ||
"prettier": "2.8.4", | ||
"ts-jest": "28.0.8", | ||
"tsup": "6.2.3", | ||
"typescript": "4.8.3" | ||
"@babel/preset-react": "7.22.5", | ||
"@react-email/render": "workspace:*", | ||
"eslint-config-custom": "workspace:*", | ||
"tsconfig": "workspace:*", | ||
"typescript": "5.1.6" | ||
}, | ||
@@ -52,0 +57,0 @@ "publishConfig": { |
@@ -36,9 +36,24 @@ ![React Email Section cover](https://react.email/static/covers/section.png) | ||
import { Section } from '@react-email/section'; | ||
import { Column } from '@react-email/column'; | ||
import { Row } from '@react-email/row'; | ||
import { Text } from '@react-email/text'; | ||
const Section = () => { | ||
const Email = () => { | ||
return ( | ||
{/* A simple `section` */} | ||
<Section> | ||
<Text>Hello World</Text> | ||
<Section /> | ||
</Section> | ||
{/* Formatted with `rows` and `columns` */} | ||
<Section> | ||
<Row> | ||
<Column>Column 1, Row 1</Column> | ||
<Column>Column 2, Row 1</Column> | ||
</Row> | ||
<Row> | ||
<Column>Column 1, Row 2</Column> | ||
<Column>Column 2, Row 2</Column> | ||
</Row> | ||
</Section> | ||
); | ||
@@ -54,3 +69,3 @@ }; | ||
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | ||
| Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ | | ||
| Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ | | ||
@@ -57,0 +72,0 @@ ## License |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11012
5
7
146
73
21
3
3
1
10
- Removedreact@18.2.0