@phillips/seldon 1.279.1 → 1.279.2

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 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),E=require("react"),R=require("../../_virtual/index2.cjs"),V=require("../../utils/index.cjs"),A=require("../../components/Input/Input.cjs"),B=require("../../components/Button/Button.cjs"),a=require("./types.cjs"),C=require("../../components/Button/types.cjs"),l=require("../../components/Text/Text.cjs"),p=require("../../components/Text/types.cjs");function I(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const L=I(E),g=L.forwardRef(({autoFocus:e=!0,blurb:t,buttonText:n="Sign Up",buttonProps:s,className:u,element:S="form",inputLabelText:b="Enter Your Email Address To Sign Up*",inputPlaceholder:x="example@email.com",title:y="Never Miss A Moment",loadingText:j="Loading...",invalidText:v="",errorText:q="An error occurred. Please try again.",successText:_,privacyText:d="By signing up, you agree to receive email communications from Phillips.",subscriptionState:r=a.SubscriptionState.Default,id:c,...m},h)=>{const{className:o,...N}=V.getCommonProps({id:c,...m},"Subscribe"),T=r===a.SubscriptionState.Invalid,$=r===a.SubscriptionState.Loading,P=r===a.SubscriptionState.Success,M=r===a.SubscriptionState.Error,O={invalid:v,success:_,loading:j,error:q},f=r!==a.SubscriptionState.Default?O[r]:"",w=P||$,D=T||M;return i.jsxs(S,{id:c,...N,className:R.default(o,u),noValidate:!0,ref:h,...m,children:[i.jsx(l.default,{variant:p.TextVariants.headingSmall,className:`${o}__title`,children:y}),t?i.jsx(l.default,{variant:p.TextVariants.bodyMedium,children:t}):null,i.jsx(A.default,{autoFocus:e,className:`${o}__input`,type:"email",name:"email",placeholder:x,labelText:b,invalid:D,invalidText:f,warn:w,warnText:f,required:!0,id:`${c}-input`}),i.jsx(B.default,{className:`${o}__button ${u}`,variant:C.ButtonVariants.secondary,type:"submit",...s,children:n}),d?i.jsx(l.default,{element:"p",children:d}):null]})});g.displayName="Subscribe";exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),R=require("react"),V=require("../../_virtual/index2.cjs"),A=require("../../utils/index.cjs"),B=require("../../components/Input/Input.cjs"),C=require("../../components/Button/Button.cjs"),a=require("./types.cjs"),I=require("../../components/Button/types.cjs"),l=require("../../components/Text/Text.cjs"),p=require("../../components/Text/types.cjs");function L(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const U=L(R),g=U.forwardRef(({autoFocus:e=!0,blurb:t,buttonText:n="Sign Up",buttonProps:s,className:u,element:S="form",inputLabelText:b="Enter Your Email Address To Sign Up*",inputPlaceholder:x="example@email.com",inputProps:y,title:j="Never Miss A Moment",loadingText:v="Loading...",invalidText:q="",errorText:_="An error occurred. Please try again.",successText:h,privacyText:d="By signing up, you agree to receive email communications from Phillips.",subscriptionState:r=a.SubscriptionState.Default,id:c,...m},N)=>{const{className:o,...T}=A.getCommonProps({id:c,...m},"Subscribe"),$=r===a.SubscriptionState.Invalid,P=r===a.SubscriptionState.Loading,M=r===a.SubscriptionState.Success,O=r===a.SubscriptionState.Error,w={invalid:q,success:h,loading:v,error:_},f=r!==a.SubscriptionState.Default?w[r]:"",D=M||P,E=$||O;return i.jsxs(S,{id:c,...T,className:V.default(o,u),noValidate:!0,ref:N,...m,children:[i.jsx(l.default,{variant:p.TextVariants.headingSmall,className:`${o}__title`,children:j}),t?i.jsx(l.default,{variant:p.TextVariants.bodyMedium,children:t}):null,i.jsx(B.default,{autoFocus:e,className:`${o}__input`,type:"email",name:"email",placeholder:x,labelText:b,invalid:E,invalidText:f,warn:D,warnText:f,required:!0,id:`${c}-input`,...y}),i.jsx(C.default,{className:`${o}__button ${u}`,variant:I.ButtonVariants.secondary,type:"submit",...s,children:n}),d?i.jsx(l.default,{element:"p",children:d}):null]})});g.displayName="Subscribe";exports.default=g;
@@ -1,3 +1,4 @@
1
+ import { InputProps } from '../../components/Input/Input';
1
2
  import { ButtonProps } from '../../components/Button/Button';
2
3
  import { SubscriptionState } from './types';
3
4
  import * as React from 'react';
@@ -15,9 +16,9 @@ export interface SubscribeProps extends React.HTMLAttributes<HTMLFormElement> {
15
16
  */
16
17
  buttonText?: string;
17
18
  /**
18
- * Optional element to render in place of a form e.g. Remix Form, etc
19
+ * Optional element to render in place of a form, e.g. Remix or react-router `Form`.
19
20
  */
20
- element?: React.ElementType<React.ComponentProps<'form'>>;
21
+ element?: React.ElementType;
21
22
  /**
22
23
  * A unique `id` for the `<Subscribe>`
23
24
  */
@@ -30,6 +31,10 @@ export interface SubscribeProps extends React.HTMLAttributes<HTMLFormElement> {
30
31
  * Subscribe input label
31
32
  */
32
33
  inputPlaceholder?: string;
34
+ /**
35
+ * Subscribe input extra props to spread (e.g. `autoComplete`)
36
+ */
37
+ inputProps?: Partial<InputProps>;
33
38
  /**
34
39
  * Subscribe title text
35
40
  */
@@ -1,14 +1,14 @@
1
- import { jsxs as I, jsx as o } from "react/jsx-runtime";
2
- import * as L from "react";
3
- import M from "../../_virtual/index2.js";
4
- import { getCommonProps as V } from "../../utils/index.js";
5
- import j from "../../components/Input/Input.js";
6
- import D from "../../components/Button/Button.js";
1
+ import { jsxs as L, jsx as o } from "react/jsx-runtime";
2
+ import * as M from "react";
3
+ import V from "../../_virtual/index2.js";
4
+ import { getCommonProps as j } from "../../utils/index.js";
5
+ import D from "../../components/Input/Input.js";
6
+ import R from "../../components/Button/Button.js";
7
7
  import { SubscriptionState as r } from "./types.js";
8
- import { ButtonVariants as R } from "../../components/Button/types.js";
8
+ import { ButtonVariants as U } from "../../components/Button/types.js";
9
9
  import i from "../../components/Text/Text.js";
10
10
  import { TextVariants as d } from "../../components/Text/types.js";
11
- const U = L.forwardRef(
11
+ const q = M.forwardRef(
12
12
  ({
13
13
  autoFocus: u = !0,
14
14
  blurb: t,
@@ -18,36 +18,37 @@ const U = L.forwardRef(
18
18
  element: g = "form",
19
19
  inputLabelText: x = "Enter Your Email Address To Sign Up*",
20
20
  inputPlaceholder: v = "example@email.com",
21
- title: h = "Never Miss A Moment",
22
- loadingText: y = "Loading...",
23
- invalidText: N = "",
24
- errorText: _ = "An error occurred. Please try again.",
25
- successText: b,
21
+ inputProps: h,
22
+ title: y = "Never Miss A Moment",
23
+ loadingText: N = "Loading...",
24
+ invalidText: _ = "",
25
+ errorText: b = "An error occurred. Please try again.",
26
+ successText: S,
26
27
  privacyText: s = "By signing up, you agree to receive email communications from Phillips.",
27
28
  subscriptionState: e = r.Default,
28
29
  id: n,
29
30
  ...l
30
- }, S) => {
31
- const { className: a, ...T } = V({ id: n, ...l }, "Subscribe"), $ = e === r.Invalid, E = e === r.Loading, P = e === r.Success, w = e === r.Error, A = {
32
- invalid: N,
33
- success: b,
34
- loading: y,
35
- error: _
36
- }, c = e !== r.Default ? A[e] : "", B = P || E, C = $ || w;
37
- return /* @__PURE__ */ I(
31
+ }, T) => {
32
+ const { className: a, ...$ } = j({ id: n, ...l }, "Subscribe"), E = e === r.Invalid, P = e === r.Loading, w = e === r.Success, A = e === r.Error, B = {
33
+ invalid: _,
34
+ success: S,
35
+ loading: N,
36
+ error: b
37
+ }, c = e !== r.Default ? B[e] : "", C = w || P, I = E || A;
38
+ return /* @__PURE__ */ L(
38
39
  g,
39
40
  {
40
41
  id: n,
41
- ...T,
42
- className: M(a, m),
42
+ ...$,
43
+ className: V(a, m),
43
44
  noValidate: !0,
44
- ref: S,
45
+ ref: T,
45
46
  ...l,
46
47
  children: [
47
- /* @__PURE__ */ o(i, { variant: d.headingSmall, className: `${a}__title`, children: h }),
48
+ /* @__PURE__ */ o(i, { variant: d.headingSmall, className: `${a}__title`, children: y }),
48
49
  t ? /* @__PURE__ */ o(i, { variant: d.bodyMedium, children: t }) : null,
49
50
  /* @__PURE__ */ o(
50
- j,
51
+ D,
51
52
  {
52
53
  autoFocus: u,
53
54
  className: `${a}__input`,
@@ -55,19 +56,20 @@ const U = L.forwardRef(
55
56
  name: "email",
56
57
  placeholder: v,
57
58
  labelText: x,
58
- invalid: C,
59
+ invalid: I,
59
60
  invalidText: c,
60
- warn: B,
61
+ warn: C,
61
62
  warnText: c,
62
63
  required: !0,
63
- id: `${n}-input`
64
+ id: `${n}-input`,
65
+ ...h
64
66
  }
65
67
  ),
66
68
  /* @__PURE__ */ o(
67
- D,
69
+ R,
68
70
  {
69
71
  className: `${a}__button ${m}`,
70
- variant: R.secondary,
72
+ variant: U.secondary,
71
73
  type: "submit",
72
74
  ...f,
73
75
  children: p
@@ -79,7 +81,7 @@ const U = L.forwardRef(
79
81
  );
80
82
  }
81
83
  );
82
- U.displayName = "Subscribe";
84
+ q.displayName = "Subscribe";
83
85
  export {
84
- U as default
86
+ q as default
85
87
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.279.1",
3
+ "version": "1.279.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"