diff --git a/packages/html/.eslintrc.js b/packages/html/.eslintrc.js new file mode 100644 index 000000000..03ee7431b --- /dev/null +++ b/packages/html/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ['custom'], +}; diff --git a/packages/html/license.md b/packages/html/license.md new file mode 100644 index 000000000..4df82815f --- /dev/null +++ b/packages/html/license.md @@ -0,0 +1,8 @@ +Copyright 2022 Bu Kinoshita and Zeno Rocha + +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: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +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. + diff --git a/packages/html/package.json b/packages/html/package.json new file mode 100644 index 000000000..c84b4f11b --- /dev/null +++ b/packages/html/package.json @@ -0,0 +1,32 @@ +{ + "name": "@react-email/html", + "version": "0.0.1", + "description": "A React html component to wrap emails", + "sideEffects": false, + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist/**" + ], + "license": "MIT", + "scripts": { + "build": "tsup src/index.ts --format esm,cjs --dts --external react", + "dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch", + "lint": "TIMING=1 eslint src/**/*.ts* --fix", + "clean": "rm -rf dist" + }, + "devDependencies": { + "@types/react": "18.0.20", + "@types/react-dom": "18.0.6", + "eslint": "8.23.1", + "eslint-config-custom": "*", + "react": "18.2.0", + "tsconfig": "*", + "tsup": "6.2.3", + "typescript": "4.8.3" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/html/readme.md b/packages/html/readme.md new file mode 100644 index 000000000..4879e1ad2 --- /dev/null +++ b/packages/html/readme.md @@ -0,0 +1,51 @@ +![React Email HTML cover](https://react-email-assets.vercel.app/html.png) + +
@react-email/html
+
A React html component to wrap emails.
+
+
+Website + · +Documentation + · +Twitter +
+ +## Install + +Install component from your command line. + +#### With yarn + +```sh +yarn add @react-email/html -E +``` + +#### With npm + +```sh +npm install @react-email/html -E +``` + +## Getting started + +Add the component to your email template. Include styles where needed. + +```jsx +import { Button } from '@react-email/button'; +import { Html } from '@react-email/html'; + +const Email = () => { + return ( + + + + ); +}; +``` + +## License + +MIT License diff --git a/packages/html/src/html.tsx b/packages/html/src/html.tsx new file mode 100644 index 000000000..4cc8f969a --- /dev/null +++ b/packages/html/src/html.tsx @@ -0,0 +1,18 @@ +import * as React from 'react'; + +type RootProps = React.ComponentPropsWithoutRef<'html'>; + +export interface HtmlProps extends RootProps {} + +export const Html: React.FC> = ({ + children, + lang = 'en', + style, + ...props +}) => ( + + {children} + +); + +Html.displayName = 'Html'; diff --git a/packages/html/src/index.ts b/packages/html/src/index.ts new file mode 100644 index 000000000..f7bfdd142 --- /dev/null +++ b/packages/html/src/index.ts @@ -0,0 +1 @@ +export * from './html'; diff --git a/packages/html/tsconfig.json b/packages/html/tsconfig.json new file mode 100644 index 000000000..46c4f7bb4 --- /dev/null +++ b/packages/html/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "lib": ["dom", "ES2015"] + }, + "extends": "tsconfig/react-library.json", + "include": ["."], + "exclude": ["dist", "build", "node_modules"] +}