@phillips/seldon 1.27.0 → 1.29.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.
|
@@ -37,6 +37,10 @@ export interface SubscribeProps extends React.HTMLAttributes<HTMLFormElement> {
|
|
|
37
37
|
* Subscribe error text
|
|
38
38
|
*/
|
|
39
39
|
invalidText?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Subscribe invalid text
|
|
42
|
+
*/
|
|
43
|
+
errorText?: string;
|
|
40
44
|
/**
|
|
41
45
|
* Subscribe success text
|
|
42
46
|
*/
|
|
@@ -55,5 +59,5 @@ export interface SubscribeProps extends React.HTMLAttributes<HTMLFormElement> {
|
|
|
55
59
|
*
|
|
56
60
|
* [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-subscribe--overview)
|
|
57
61
|
*/
|
|
58
|
-
declare const Subscribe: ({ blurb, buttonText, buttonProps, className, element: Element, inputLabelText, inputPlaceholder, title, loadingText, invalidText, successText, subscriptionState, ...props }: SubscribeProps) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
declare const Subscribe: ({ blurb, buttonText, buttonProps, className, element: Element, inputLabelText, inputPlaceholder, title, loadingText, invalidText, errorText, successText, subscriptionState, ...props }: SubscribeProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
63
|
export default Subscribe;
|
|
@@ -1,50 +1,52 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { SubscriptionState as
|
|
7
|
-
const
|
|
8
|
-
blurb:
|
|
1
|
+
import { jsxs as C, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import E from "../../node_modules/classnames/index.js";
|
|
3
|
+
import { getCommonProps as I } from "../../utils/index.js";
|
|
4
|
+
import L from "../Input/Input.js";
|
|
5
|
+
import P from "../Button/Button.js";
|
|
6
|
+
import { SubscriptionState as o } from "./types.js";
|
|
7
|
+
const U = ({
|
|
8
|
+
blurb: a,
|
|
9
9
|
buttonText: i = "Sign Up",
|
|
10
10
|
buttonProps: m,
|
|
11
11
|
className: n,
|
|
12
|
-
element:
|
|
13
|
-
inputLabelText:
|
|
14
|
-
inputPlaceholder:
|
|
15
|
-
title:
|
|
16
|
-
loadingText:
|
|
17
|
-
invalidText:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
element: c = "form",
|
|
13
|
+
inputLabelText: d = "Email*",
|
|
14
|
+
inputPlaceholder: u = "example@email.com",
|
|
15
|
+
title: p = "Subscribe to Newsletter",
|
|
16
|
+
loadingText: f = "Loading...",
|
|
17
|
+
invalidText: x = "",
|
|
18
|
+
errorText: _ = "An error occurred. Please try again.",
|
|
19
|
+
successText: b,
|
|
20
|
+
subscriptionState: e = o.Default,
|
|
21
|
+
...t
|
|
21
22
|
}) => {
|
|
22
|
-
const { className:
|
|
23
|
-
invalid:
|
|
24
|
-
success:
|
|
25
|
-
loading:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
23
|
+
const { className: r, ...g } = I(t, "Subscribe"), N = e === o.Invalid, h = e === o.Loading, v = e === o.Success, y = e === o.Error, $ = {
|
|
24
|
+
invalid: x,
|
|
25
|
+
success: b,
|
|
26
|
+
loading: f,
|
|
27
|
+
error: _
|
|
28
|
+
}, l = e !== o.Default ? $[e] : "", T = v || h, w = N || y;
|
|
29
|
+
return /* @__PURE__ */ C(c, { ...g, className: E(r, n), noValidate: !0, ...t, children: [
|
|
30
|
+
/* @__PURE__ */ s("h3", { className: `${r}__title`, children: p }),
|
|
31
|
+
a ? /* @__PURE__ */ s("p", { className: `${r}__blurb`, children: a }) : null,
|
|
32
|
+
/* @__PURE__ */ s(
|
|
33
|
+
L,
|
|
32
34
|
{
|
|
33
|
-
className: `${
|
|
35
|
+
className: `${r}__input`,
|
|
34
36
|
type: "email",
|
|
35
37
|
name: "email",
|
|
36
|
-
placeholder:
|
|
37
|
-
labelText:
|
|
38
|
-
invalid:
|
|
39
|
-
invalidText:
|
|
40
|
-
warn:
|
|
41
|
-
warnText:
|
|
38
|
+
placeholder: u,
|
|
39
|
+
labelText: d,
|
|
40
|
+
invalid: w,
|
|
41
|
+
invalidText: l,
|
|
42
|
+
warn: T,
|
|
43
|
+
warnText: l,
|
|
42
44
|
required: !0
|
|
43
45
|
}
|
|
44
46
|
),
|
|
45
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ s(P, { className: `${r}__button ${n}`, buttonType: "secondary", type: "submit", ...m, children: i })
|
|
46
48
|
] });
|
|
47
49
|
};
|
|
48
50
|
export {
|
|
49
|
-
|
|
51
|
+
U as default
|
|
50
52
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d = /* @__PURE__ */ ((r) => (r.Default = "default", r.Loading = "loading", r.Invalid = "invalid", r.Error = "error", r.Success = "success", r))(d || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
d as SubscriptionState
|
|
4
4
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phillips/seldon",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/PhillipsAuctionHouse/seldon"
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"eslint": "^8.57.0",
|
|
76
76
|
"eslint-plugin-react": "^7.34.3",
|
|
77
77
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
78
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
78
|
+
"eslint-plugin-react-refresh": "^0.4.8",
|
|
79
79
|
"eslint-plugin-storybook": "^0.8.0",
|
|
80
80
|
"husky": "^9.0.11",
|
|
81
81
|
"prettier": "3.3.2",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"stylelint-config-standard": "^36.0.1",
|
|
93
93
|
"stylelint-config-standard-scss": "^13.1.0",
|
|
94
94
|
"stylelint-order": "^6.0.4",
|
|
95
|
-
"stylelint-scss": "^6.
|
|
95
|
+
"stylelint-scss": "^6.4.1",
|
|
96
96
|
"ts-node": "^10.9.2",
|
|
97
97
|
"typescript": "^5.5.3",
|
|
98
98
|
"vite": "^5.3.3",
|