@phillips/seldon 1.35.0 → 1.36.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.
@@ -1,14 +1,14 @@
1
1
  import { jsxs as P, jsx as l } from "react/jsx-runtime";
2
2
  import * as R from "react";
3
- import d from "../../node_modules/classnames/index.js";
3
+ import t from "../../node_modules/classnames/index.js";
4
4
  import { px as i, useNormalizedInputProps as y } from "../../utils/index.js";
5
5
  const z = R.forwardRef(
6
6
  ({
7
- className: a,
7
+ className: p,
8
8
  defaultValue: r,
9
9
  disabled: u,
10
10
  hideLabel: o,
11
- id: t,
11
+ id: a,
12
12
  inline: m,
13
13
  invalid: $,
14
14
  invalidText: c,
@@ -16,45 +16,45 @@ const z = R.forwardRef(
16
16
  onChange: b,
17
17
  onClick: f,
18
18
  placeholder: h,
19
- readOnly: p,
20
- size: w = "md",
19
+ readOnly: e,
20
+ size: v = "md",
21
21
  type: s = "text",
22
- value: x,
23
- warn: v,
24
- warnText: I,
25
- ...e
26
- }, N) => {
27
- const n = y({ disabled: u, id: t, invalid: $, invalidText: c, readOnly: p, type: s, warn: v, warnText: I }), j = d(`${i}-${s}-input`, `${i}-input`, `${i}-input--${w}`, {
22
+ value: w,
23
+ warn: x,
24
+ warnText: N,
25
+ ...d
26
+ }, I) => {
27
+ const n = y({ disabled: u, id: a, invalid: $, invalidText: c, readOnly: e, type: s, warn: x, warnText: N }), j = t(`${i}-${s}-input`, `${i}-input`, `${i}-input--${v}`, {
28
28
  [`${i}-input--inline`]: m,
29
- [`${i}-input--readonly`]: p,
29
+ [`${i}-input--readonly`]: e,
30
30
  [`${i}-input--disabled`]: n.disabled,
31
31
  [`${i}-input--invalid`]: n.invalid,
32
32
  [`${i}-input--warn`]: n.warn,
33
- [`${a}__wrapper`]: a,
34
- [`${i}-input--hidden`]: e.hidden
33
+ [`${p}__wrapper`]: p,
34
+ [`${i}-input--hidden`]: d.hidden
35
35
  });
36
36
  return /* @__PURE__ */ P("div", { className: j, children: [
37
- /* @__PURE__ */ l("label", { htmlFor: t, className: d(`${i}-input__label`, { [`${i}-input__label--hidden`]: o }), children: _ }),
37
+ /* @__PURE__ */ l("label", { htmlFor: a, className: t(`${i}-input__label`, { [`${i}-input__label--hidden`]: o }), children: _ }),
38
38
  /* @__PURE__ */ l(
39
39
  "input",
40
40
  {
41
- className: d(`${i}-input__input`, { className: a }),
42
- "data-testid": t,
41
+ className: t(`${i}-input__input`, { className: p }),
42
+ "data-testid": a,
43
43
  defaultValue: r,
44
44
  disabled: n.disabled,
45
- id: t,
46
- name: e.name,
45
+ id: a,
46
+ name: d.name,
47
47
  onChange: b,
48
48
  onClick: f,
49
49
  placeholder: h,
50
- readOnly: p,
51
- ref: N,
50
+ readOnly: e,
51
+ ref: I,
52
52
  type: n.type,
53
- value: x,
54
- ...e
53
+ value: w,
54
+ ...d
55
55
  }
56
56
  ),
57
- n.validation
57
+ n.validation ? n.validation : /* @__PURE__ */ l("p", { className: t(`${i}-input__validation`), children: " " })
58
58
  ] });
59
59
  }
60
60
  );
@@ -45,6 +45,10 @@ export interface SubscribeProps extends React.HTMLAttributes<HTMLFormElement> {
45
45
  * Subscribe success text
46
46
  */
47
47
  successText?: string;
48
+ /**
49
+ * Subscribe privacy text
50
+ */
51
+ privacyText?: string;
48
52
  /**
49
53
  * Subscribe state for loading or error
50
54
  */
@@ -59,5 +63,5 @@ export interface SubscribeProps extends React.HTMLAttributes<HTMLFormElement> {
59
63
  *
60
64
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-subscribe--overview)
61
65
  */
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;
66
+ declare const Subscribe: ({ blurb, buttonText, buttonProps, className, element: Element, inputLabelText, inputPlaceholder, title, loadingText, invalidText, errorText, successText, privacyText, subscriptionState, ...props }: SubscribeProps) => import("react/jsx-runtime").JSX.Element;
63
67
  export default Subscribe;
@@ -1,62 +1,65 @@
1
- import { jsxs as E, jsx as a } from "react/jsx-runtime";
2
- import I from "../../node_modules/classnames/index.js";
3
- import { getCommonProps as L } from "../../utils/index.js";
4
- import P from "../Input/Input.js";
1
+ import { jsxs as B, jsx as n } from "react/jsx-runtime";
2
+ import C from "../../node_modules/classnames/index.js";
3
+ import { getCommonProps as I } from "../../utils/index.js";
4
+ import L from "../Input/Input.js";
5
5
  import S from "../Button/Button.js";
6
- import { SubscriptionState as r } from "./types.js";
6
+ import { SubscriptionState as o } from "./types.js";
7
7
  import { ButtonVariants as T } from "../Button/types.js";
8
- const k = ({
9
- blurb: n,
10
- buttonText: l = "Sign Up",
11
- buttonProps: m,
12
- className: s,
13
- element: c = "form",
14
- inputLabelText: d = "Email*",
15
- inputPlaceholder: u = "example@email.com",
16
- title: p = "Subscribe to Newsletter",
17
- loadingText: f = "Loading...",
18
- invalidText: x = "",
19
- errorText: _ = "An error occurred. Please try again.",
20
- successText: g,
21
- subscriptionState: e = r.Default,
22
- ...t
8
+ const z = ({
9
+ blurb: s,
10
+ buttonText: t = "Sign Up",
11
+ buttonProps: c,
12
+ className: a,
13
+ element: d = "form",
14
+ inputLabelText: u = "Enter Your Email Address To Sign Up*",
15
+ inputPlaceholder: p = "example@email.com",
16
+ title: f = "Never Miss A Moment",
17
+ loadingText: g = "Loading...",
18
+ invalidText: _ = "",
19
+ errorText: h = "An error occurred. Please try again.",
20
+ successText: v,
21
+ privacyText: i = "By signing up, you agree to receive email communications from Phillips.",
22
+ subscriptionState: e = o.Default,
23
+ ...l
23
24
  }) => {
24
- const { className: o, ...N } = L(t, "Subscribe"), b = e === r.Invalid, h = e === r.Loading, v = e === r.Success, $ = e === r.Error, y = {
25
- invalid: x,
26
- success: g,
27
- loading: f,
28
- error: _
29
- }, i = e !== r.Default ? y[e] : "", w = v || h, C = b || $;
30
- return /* @__PURE__ */ E(c, { ...N, className: I(o, s), noValidate: !0, ...t, children: [
31
- /* @__PURE__ */ a("h3", { className: `${o}__title`, children: p }),
32
- n ? /* @__PURE__ */ a("p", { className: `${o}__blurb`, children: n }) : null,
33
- /* @__PURE__ */ a(
34
- P,
25
+ const { className: r, ...x } = I(l, "Subscribe"), N = e === o.Invalid, y = e === o.Loading, $ = e === o.Success, b = e === o.Error, E = {
26
+ invalid: _,
27
+ success: v,
28
+ loading: g,
29
+ error: h
30
+ }, m = e !== o.Default ? E[e] : "", P = $ || y, A = N || b;
31
+ return /* @__PURE__ */ B(d, { ...x, className: C(r, a), noValidate: !0, ...l, children: [
32
+ /* @__PURE__ */ n("h3", { className: `${r}__title`, children: f }),
33
+ s ? /* @__PURE__ */ n("p", { className: `${r}__blurb`, children: s }) : null,
34
+ /* @__PURE__ */ n(
35
+ L,
35
36
  {
36
- className: `${o}__input`,
37
+ className: `${r}__input`,
37
38
  type: "email",
38
39
  name: "email",
39
- placeholder: u,
40
- labelText: d,
41
- invalid: C,
42
- invalidText: i,
43
- warn: w,
44
- warnText: i,
40
+ placeholder: p,
41
+ labelText: u,
42
+ invalid: A,
43
+ invalidText: m,
44
+ warn: P,
45
+ warnText: m,
45
46
  required: !0
46
47
  }
47
48
  ),
48
- /* @__PURE__ */ a(
49
+ /* @__PURE__ */ n(
49
50
  S,
50
51
  {
51
- className: `${o}__button ${s}`,
52
+ className: `${r}__button ${a}`,
52
53
  variant: T.secondary,
54
+ size: "sm",
53
55
  type: "submit",
54
- ...m,
55
- children: l
56
+ ...c,
57
+ children: t
56
58
  }
57
- )
59
+ ),
60
+ i ? /* @__PURE__ */ n("p", { className: `${r}__privacy`, children: i }) : null
58
61
  ] });
59
62
  };
60
63
  export {
61
- k as default
64
+ z as default
62
65
  };
@@ -15,11 +15,10 @@ $lg: #{$px}-input--lg;
15
15
  }
16
16
 
17
17
  &__label {
18
- color: $keyline-gray;
19
- font-size: 0.8125rem;
18
+ color: $pure-black;
19
+ font-size: 0.75rem;
20
20
  font-weight: 600;
21
21
  margin-bottom: 0.5rem;
22
- text-transform: uppercase;
23
22
  word-break: break-word;
24
23
 
25
24
  &--hidden {
@@ -105,6 +104,10 @@ $lg: #{$px}-input--lg;
105
104
  &--invalid {
106
105
  color: $error-red;
107
106
 
107
+ label {
108
+ color: $error-red;
109
+ }
110
+
108
111
  .#{$px}-input__input,
109
112
  .#{$px}-input__input::placeholder,
110
113
  .#{$px}-input__validation {
@@ -127,7 +130,6 @@ $lg: #{$px}-input--lg;
127
130
  .#{$px}-input__validation {
128
131
  animation: reveal 0.45s linear forwards;
129
132
  padding-bottom: 0.5rem;
130
- padding-left: 2rem;
131
133
  }
132
134
  }
133
135
 
@@ -4,27 +4,19 @@
4
4
  @import '../../typography';
5
5
 
6
6
  .#{$px}-subscribe {
7
- max-width: 30rem;
7
+ max-width: 600px;
8
8
  width: 100%;
9
9
 
10
10
  &__title {
11
11
  @include text($heading3);
12
12
 
13
13
  margin-bottom: $spacing-xsm;
14
- text-align: center;
15
14
  }
16
15
 
17
16
  &__blurb {
18
17
  @include text($body2);
19
18
 
20
- text-align: center;
21
- }
22
-
23
- @include media($size-sm) {
24
- &__title,
25
- &__blurb {
26
- text-align: left;
27
- }
19
+ color: $pure-black;
28
20
  }
29
21
 
30
22
  &__input__wrapper {
@@ -32,6 +24,23 @@
32
24
  }
33
25
 
34
26
  &__button {
35
- margin: $spacing-md 0 $spacing-md;
27
+ margin: $spacing-sm 0 $spacing-md;
28
+ width: 100%;
29
+
30
+ @include media($size-sm) {
31
+ width: 240px;
32
+ }
33
+ }
34
+
35
+ &__privacy {
36
+ @include text($body3);
37
+
38
+ color: $pure-black;
39
+ font-size: 0.75rem;
40
+ margin-top: $spacing-sm;
41
+
42
+ @include media($size-sm) {
43
+ margin-top: $spacing-xl;
44
+ }
36
45
  }
37
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.35.0",
3
+ "version": "1.36.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"