@stackshift-ui/newsletter 6.0.12 → 7.0.0-beta.0
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/package.json +14 -14
- package/src/newsletter.test.tsx +2 -2
- package/src/newsletter_a.tsx +8 -11
- package/src/newsletter_b.tsx +7 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/newsletter",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.0-beta.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -33,25 +33,25 @@
|
|
|
33
33
|
"@stackshift-ui/typescript-config": "6.0.10"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@stackshift-ui/scripts": "6.0.
|
|
37
|
-
"@stackshift-ui/
|
|
38
|
-
"@stackshift-ui/
|
|
39
|
-
"@stackshift-ui/
|
|
40
|
-
"@stackshift-ui/
|
|
41
|
-
"@stackshift-ui/
|
|
42
|
-
"@stackshift-ui/
|
|
43
|
-
"@stackshift-ui/
|
|
44
|
-
"@stackshift-ui/section": "
|
|
45
|
-
"@stackshift-ui/
|
|
46
|
-
"@stackshift-ui/flex": "
|
|
47
|
-
"@stackshift-ui/
|
|
36
|
+
"@stackshift-ui/scripts": "6.1.0-beta.0",
|
|
37
|
+
"@stackshift-ui/system": "6.1.0-beta.0",
|
|
38
|
+
"@stackshift-ui/form": "7.0.0-beta.0",
|
|
39
|
+
"@stackshift-ui/heading": "7.0.0-beta.0",
|
|
40
|
+
"@stackshift-ui/button": "6.1.0-beta.0",
|
|
41
|
+
"@stackshift-ui/input": "7.0.0-beta.0",
|
|
42
|
+
"@stackshift-ui/text": "7.0.0-beta.0",
|
|
43
|
+
"@stackshift-ui/link": "6.0.12-beta.0",
|
|
44
|
+
"@stackshift-ui/section": "7.0.0-beta.0",
|
|
45
|
+
"@stackshift-ui/container": "7.0.0-beta.0",
|
|
46
|
+
"@stackshift-ui/flex": "7.0.0-beta.0",
|
|
47
|
+
"@stackshift-ui/image": "6.1.0-beta.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@types/react": "16.8 - 19",
|
|
51
51
|
"next": "10 - 14",
|
|
52
52
|
"react": "16.8 - 19",
|
|
53
53
|
"react-dom": "16.8 - 19",
|
|
54
|
-
"@stackshift-ui/system": ">=6.0.
|
|
54
|
+
"@stackshift-ui/system": ">=6.1.0-beta.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependenciesMeta": {
|
|
57
57
|
"next": {
|
package/src/newsletter.test.tsx
CHANGED
|
@@ -7,7 +7,7 @@ describe.concurrent("newsletter", () => {
|
|
|
7
7
|
|
|
8
8
|
test.skip("Dummy test - test if renders without errors", ({ expect }) => {
|
|
9
9
|
const clx = "my-class";
|
|
10
|
-
render(<Newsletter />);
|
|
11
|
-
expect(screen.getByTestId("
|
|
10
|
+
render(<Newsletter data-testid="newsletter" />);
|
|
11
|
+
expect(screen.getByTestId("newsletter").classList).toContain(clx);
|
|
12
12
|
});
|
|
13
13
|
});
|
package/src/newsletter_a.tsx
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Button } from "@stackshift-ui/button";
|
|
2
|
+
import { Container } from "@stackshift-ui/container";
|
|
3
|
+
import { Flex } from "@stackshift-ui/flex";
|
|
3
4
|
import { Form } from "@stackshift-ui/form";
|
|
4
5
|
import { Heading } from "@stackshift-ui/heading";
|
|
5
6
|
import { Image } from "@stackshift-ui/image";
|
|
6
7
|
import { Input } from "@stackshift-ui/input";
|
|
7
|
-
import { Text } from "@stackshift-ui/text";
|
|
8
8
|
import { Link } from "@stackshift-ui/link";
|
|
9
9
|
import { Section } from "@stackshift-ui/section";
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
10
|
+
import { Text } from "@stackshift-ui/text";
|
|
11
|
+
import React from "react";
|
|
12
12
|
|
|
13
|
-
import { Form as FormFields, Logo } from "./types";
|
|
14
|
-
import { getInputType, logoLink, thankYouPageLink } from "./helper";
|
|
15
13
|
import { NewsletterProps } from ".";
|
|
14
|
+
import { getInputType, logoLink, thankYouPageLink } from "./helper";
|
|
15
|
+
import { Form as FormFields, Logo } from "./types";
|
|
16
16
|
|
|
17
17
|
export default function Newsletter_A({
|
|
18
18
|
logo,
|
|
@@ -95,9 +95,7 @@ function NewsletterForm({ id, fields, thankYouPage, buttonLabel }: FormFields) {
|
|
|
95
95
|
thankyouPage={thankYouPageLink(thankYouPage)}>
|
|
96
96
|
<Flex align="center" gap={2} className="max-w-md mx-auto">
|
|
97
97
|
<Input
|
|
98
|
-
|
|
99
|
-
noLabel
|
|
100
|
-
ariaLabel={fields[0]?.placeholder ?? fields[0]?.name}
|
|
98
|
+
aria-label={fields[0]?.placeholder ?? fields[0]?.name}
|
|
101
99
|
className="flex-grow w-full"
|
|
102
100
|
type={getInputType(fields[0]?.type)}
|
|
103
101
|
placeholder={fields[0]?.placeholder}
|
|
@@ -110,8 +108,7 @@ function NewsletterForm({ id, fields, thankYouPage, buttonLabel }: FormFields) {
|
|
|
110
108
|
</div>
|
|
111
109
|
{buttonLabel && (
|
|
112
110
|
<Button
|
|
113
|
-
|
|
114
|
-
ariaLabel={buttonLabel ?? "Newsletter form submit button"}
|
|
111
|
+
aria-label={buttonLabel ?? "Newsletter form submit button"}
|
|
115
112
|
type="submit"
|
|
116
113
|
className="w-1/2 text-white">
|
|
117
114
|
{buttonLabel}
|
package/src/newsletter_b.tsx
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Button } from "@stackshift-ui/button";
|
|
2
|
+
import { Container } from "@stackshift-ui/container";
|
|
3
|
+
import { Flex } from "@stackshift-ui/flex";
|
|
2
4
|
import { Form } from "@stackshift-ui/form";
|
|
3
5
|
import { Heading } from "@stackshift-ui/heading";
|
|
4
6
|
import { Image } from "@stackshift-ui/image";
|
|
5
7
|
import { Input } from "@stackshift-ui/input";
|
|
6
|
-
import { Text } from "@stackshift-ui/text";
|
|
7
8
|
import { Link } from "@stackshift-ui/link";
|
|
8
9
|
import { Section } from "@stackshift-ui/section";
|
|
9
|
-
import {
|
|
10
|
-
import { Flex } from "@stackshift-ui/flex";
|
|
10
|
+
import { Text } from "@stackshift-ui/text";
|
|
11
11
|
import React from "react";
|
|
12
12
|
|
|
13
|
-
import { Form as FormFields, Logo } from "./types";
|
|
14
|
-
import { getInputType, logoLink, thankYouPageLink } from "./helper";
|
|
15
13
|
import { NewsletterProps } from ".";
|
|
14
|
+
import { getInputType, logoLink, thankYouPageLink } from "./helper";
|
|
15
|
+
import { Form as FormFields, Logo } from "./types";
|
|
16
16
|
|
|
17
17
|
export default function Newsletter_B({
|
|
18
18
|
logo,
|
|
@@ -99,9 +99,7 @@ function NewsletterForm({ id, fields, thankYouPage, buttonLabel }: FormFields) {
|
|
|
99
99
|
thankyouPage={thankYouPageLink(thankYouPage)}>
|
|
100
100
|
<div className="flex flex-col [@media(min-width:900px)]:flex-row gap-3">
|
|
101
101
|
<Input
|
|
102
|
-
|
|
103
|
-
noLabel
|
|
104
|
-
ariaLabel={fields[0]?.placeholder ?? fields[0]?.name}
|
|
102
|
+
aria-label={fields[0]?.placeholder ?? fields[0]?.name}
|
|
105
103
|
className="flex-grow w-full"
|
|
106
104
|
type={getInputType(fields[0]?.type)}
|
|
107
105
|
placeholder={fields[0]?.placeholder}
|
|
@@ -114,8 +112,7 @@ function NewsletterForm({ id, fields, thankYouPage, buttonLabel }: FormFields) {
|
|
|
114
112
|
</div>
|
|
115
113
|
{buttonLabel && (
|
|
116
114
|
<Button
|
|
117
|
-
|
|
118
|
-
ariaLabel={buttonLabel ?? "Newsletter form submit button"}
|
|
115
|
+
aria-label={buttonLabel ?? "Newsletter form submit button"}
|
|
119
116
|
type="submit"
|
|
120
117
|
className="text-white">
|
|
121
118
|
{buttonLabel}
|