@react-email/button 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,8 @@
1
+ import * as React from 'react';
2
+
3
+ declare type RootProps = React.ComponentPropsWithoutRef<'a'>;
4
+ interface ButtonProps extends RootProps {
5
+ }
6
+ declare const Button: React.ForwardRefExoticComponent<Readonly<ButtonProps> & React.RefAttributes<HTMLAnchorElement>>;
7
+
8
+ export { Button, ButtonProps };
package/dist/index.js ADDED
@@ -0,0 +1,50 @@
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
+ Button: () => Button
30
+ });
31
+ module.exports = __toCommonJS(src_exports);
32
+
33
+ // src/button.tsx
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var Button = React.forwardRef(
37
+ ({ children, style, ...props }, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
38
+ ref: forwardedRef,
39
+ dangerouslySetInnerHTML: {
40
+ __html: `<!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%;mso-text-raise:30pt" hidden>&nbsp;</i><![endif]--><span>${children}</span><!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]-->`
41
+ },
42
+ style,
43
+ ...props
44
+ })
45
+ );
46
+ Button.displayName = "Button";
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ Button
50
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,17 @@
1
+ // src/button.tsx
2
+ import * as React from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var Button = React.forwardRef(
5
+ ({ children, style, ...props }, forwardedRef) => /* @__PURE__ */ jsx("a", {
6
+ ref: forwardedRef,
7
+ dangerouslySetInnerHTML: {
8
+ __html: `<!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%;mso-text-raise:30pt" hidden>&nbsp;</i><![endif]--><span>${children}</span><!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]-->`
9
+ },
10
+ style,
11
+ ...props
12
+ })
13
+ );
14
+ Button.displayName = "Button";
15
+ export {
16
+ Button
17
+ };
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@react-email/button",
3
+ "version": "0.0.1",
4
+ "sideEffects": false,
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist/**"
10
+ ],
11
+ "license": "MIT",
12
+ "scripts": {
13
+ "build": "tsup src/index.ts --format esm,cjs --dts --external react",
14
+ "dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch",
15
+ "lint": "TIMING=1 eslint src/**/*.ts* --fix",
16
+ "clean": "rm -rf dist"
17
+ },
18
+ "devDependencies": {
19
+ "@types/react": "18.0.20",
20
+ "@types/react-dom": "18.0.6",
21
+ "eslint": "8.23.1",
22
+ "eslint-config-custom": "*",
23
+ "react": "18.2.0",
24
+ "tsconfig": "*",
25
+ "tsup": "6.2.3",
26
+ "typescript": "4.8.3"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ }
31
+ }
package/readme.md ADDED
@@ -0,0 +1,50 @@
1
+ ![React Email button cover](../../.github/static/button.png)
2
+
3
+ <div align="center"><strong>@react-email/button</strong></div>
4
+ <div align="center">A React button component to help build emails.</div>
5
+ <br />
6
+ <div align="center">
7
+ <a href="https://react.email">Website</a>
8
+ <span> · </span>
9
+ <a href="https://react.email">Documentation</a>
10
+ <span> · </span>
11
+ <a href="https://react.email">Twitter</a>
12
+ </div>
13
+
14
+ ## Installation
15
+
16
+ #### With yarn
17
+
18
+ ```sh
19
+ yarn add -E @react-email/button
20
+ ```
21
+
22
+ #### With NPM
23
+
24
+ ```sh
25
+ npm install --save-exact @react-email/button
26
+ ```
27
+
28
+ ## Getting Started
29
+
30
+ Add the `Button` to your app first.
31
+
32
+ ```jsx
33
+ import { Button } from '@react-email/button';
34
+
35
+ const App = () => {
36
+ return (
37
+ <div>
38
+ <Button href="https://react.email">Button</Button>
39
+ </div>
40
+ );
41
+ };
42
+ ```
43
+
44
+ ## Documentation
45
+
46
+ Find the full API reference on [official documentation](https://react.email).
47
+
48
+ ## License
49
+
50
+ MIT License