@react-email/button 0.0.1 → 0.0.3
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.
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/license.md +7 -0
- package/package.json +15 -3
- package/readme.md +28 -15
package/dist/index.js
CHANGED
|
@@ -34,8 +34,9 @@ module.exports = __toCommonJS(src_exports);
|
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var Button = React.forwardRef(
|
|
37
|
-
({ children, style, ...props }, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
37
|
+
({ children, style, target = "_blank", ...props }, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
38
38
|
ref: forwardedRef,
|
|
39
|
+
target,
|
|
39
40
|
dangerouslySetInnerHTML: {
|
|
40
41
|
__html: `<!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%;mso-text-raise:30pt" hidden> </i><![endif]--><span>${children}</span><!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%" hidden> </i><![endif]-->`
|
|
41
42
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
var Button = React.forwardRef(
|
|
5
|
-
({ children, style, ...props }, forwardedRef) => /* @__PURE__ */ jsx("a", {
|
|
5
|
+
({ children, style, target = "_blank", ...props }, forwardedRef) => /* @__PURE__ */ jsx("a", {
|
|
6
6
|
ref: forwardedRef,
|
|
7
|
+
target,
|
|
7
8
|
dangerouslySetInnerHTML: {
|
|
8
9
|
__html: `<!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%;mso-text-raise:30pt" hidden> </i><![endif]--><span>${children}</span><!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%" hidden> </i><![endif]-->`
|
|
9
10
|
},
|
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
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-email/button",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "A React button component to help build emails",
|
|
4
5
|
"sideEffects": false,
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
7
|
"module": "./dist/index.mjs",
|
|
@@ -13,14 +14,25 @@
|
|
|
13
14
|
"build": "tsup src/index.ts --format esm,cjs --dts --external react",
|
|
14
15
|
"dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch",
|
|
15
16
|
"lint": "TIMING=1 eslint src/**/*.ts* --fix",
|
|
16
|
-
"clean": "rm -rf dist"
|
|
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"
|
|
17
25
|
},
|
|
18
26
|
"devDependencies": {
|
|
27
|
+
"@babel/preset-react": "7.18.6",
|
|
28
|
+
"@react-email/render": "*",
|
|
19
29
|
"@types/react": "18.0.20",
|
|
20
30
|
"@types/react-dom": "18.0.6",
|
|
31
|
+
"babel-jest": "28.1.3",
|
|
21
32
|
"eslint": "8.23.1",
|
|
22
33
|
"eslint-config-custom": "*",
|
|
23
|
-
"
|
|
34
|
+
"jest": "28.1.3",
|
|
35
|
+
"ts-jest": "28.0.8",
|
|
24
36
|
"tsconfig": "*",
|
|
25
37
|
"tsup": "6.2.3",
|
|
26
38
|
"typescript": "4.8.3"
|
package/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
3
|
<div align="center"><strong>@react-email/button</strong></div>
|
|
4
4
|
<div align="center">A React button component to help build emails.</div>
|
|
@@ -6,44 +6,57 @@
|
|
|
6
6
|
<div align="center">
|
|
7
7
|
<a href="https://react.email">Website</a>
|
|
8
8
|
<span> · </span>
|
|
9
|
-
<a href="https://react
|
|
9
|
+
<a href="https://github.com/zenorocha/react-email">GitHub</a>
|
|
10
10
|
<span> · </span>
|
|
11
|
-
<a href="https://react.email">
|
|
11
|
+
<a href="https://react.email/discord">Discord</a>
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
Install component from your command line.
|
|
15
17
|
|
|
16
18
|
#### With yarn
|
|
17
19
|
|
|
18
20
|
```sh
|
|
19
|
-
yarn add
|
|
21
|
+
yarn add @react-email/button -E
|
|
20
22
|
```
|
|
21
23
|
|
|
22
|
-
#### With
|
|
24
|
+
#### With npm
|
|
23
25
|
|
|
24
26
|
```sh
|
|
25
|
-
npm install
|
|
27
|
+
npm install @react-email/button -E
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
## Getting
|
|
30
|
+
## Getting started
|
|
29
31
|
|
|
30
|
-
Add the
|
|
32
|
+
Add the component to your email template. Include styles where needed.
|
|
31
33
|
|
|
32
34
|
```jsx
|
|
33
35
|
import { Button } from '@react-email/button';
|
|
34
36
|
|
|
35
|
-
const
|
|
37
|
+
const Email = () => {
|
|
36
38
|
return (
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
</
|
|
39
|
+
<Button href="https://example.com" style={{ color: '#61dafb' }}>
|
|
40
|
+
Click me
|
|
41
|
+
</Button>
|
|
40
42
|
);
|
|
41
43
|
};
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
##
|
|
46
|
+
## Props
|
|
47
|
+
|
|
48
|
+
| Name | Type | Default | Description |
|
|
49
|
+
| ------ | ------ | -------- | ------------------------------------------------ |
|
|
50
|
+
| href | string | | Link to be triggered when the button is clicked |
|
|
51
|
+
| target | string | `_blank` | Specify the target attribute for the button link |
|
|
52
|
+
|
|
53
|
+
## Support
|
|
54
|
+
|
|
55
|
+
This component was tested using the most popular email clients.
|
|
45
56
|
|
|
46
|
-
|
|
57
|
+
| <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"> |
|
|
58
|
+
| --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
|
|
47
60
|
|
|
48
61
|
## License
|
|
49
62
|
|