@phillips/seldon 1.47.0 → 1.49.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/dist/_virtual/_commonjsHelpers.js +15 -13
- package/dist/assets/PhillipsLogo.svg.js +1 -1
- package/dist/assets/close.svg.js +1 -1
- package/dist/components/Header/Header.d.ts +13 -4
- package/dist/components/Header/Header.js +53 -48
- package/dist/components/Header/utils.d.ts +9 -0
- package/dist/components/Header/utils.js +13 -0
- package/dist/components/Navigation/Navigation.js +35 -31
- package/dist/components/Navigation/NavigationList/NavigationList.d.ts +5 -1
- package/dist/components/Navigation/NavigationList/NavigationList.js +11 -7
- package/dist/components/Search/Search.js +121 -113
- package/dist/components/Search/SearchButton.d.ts +7 -0
- package/dist/components/Search/SearchButton.js +37 -0
- package/dist/components/Subscribe/Subscribe.js +12 -13
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +10 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +8 -0
- package/dist/node_modules/dom-helpers/esm/addClass.js +7 -0
- package/dist/node_modules/dom-helpers/esm/hasClass.js +6 -0
- package/dist/node_modules/dom-helpers/esm/removeClass.js +9 -0
- package/dist/node_modules/lodash.debounce/index.js +3 -0
- package/dist/node_modules/prop-types/index.js +11 -8
- package/dist/node_modules/react-transition-group/esm/CSSTransition.js +207 -0
- package/dist/node_modules/react-transition-group/esm/Transition.js +336 -0
- package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js +5 -0
- package/dist/node_modules/react-transition-group/esm/config.js +6 -0
- package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js +21 -0
- package/dist/node_modules/react-transition-group/esm/utils/reflow.js +6 -0
- package/dist/node_modules/usehooks-ts/dist/index.js +37 -0
- package/dist/scss/_vars.scss +3 -0
- package/dist/scss/componentStyles.scss +1 -0
- package/dist/scss/components/Drawer/_drawer.scss +1 -1
- package/dist/scss/components/Header/_header.scss +30 -3
- package/dist/scss/components/Input/_input.scss +1 -2
- package/dist/scss/components/Navigation/NavigationItem/_navigationItem.scss +2 -2
- package/dist/scss/components/Navigation/NavigationList/_navigationList.scss +14 -2
- package/dist/scss/components/Navigation/_navigation.scss +6 -16
- package/dist/scss/components/Search/SearchResults/_searchResults.scss +10 -19
- package/dist/scss/components/Search/_search.scss +52 -74
- package/dist/scss/components/Search/_searchButton.scss +41 -0
- package/dist/scss/components/Subscribe/_subscribe.scss +3 -14
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +5 -2
- package/dist/assets/loading_spinner.svg.js +0 -7
|
@@ -1,137 +1,145 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { getCommonProps as P, encodeURLSearchParams as N } from "../../utils/index.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import D from "../../assets/close.svg.js";
|
|
8
|
-
import V from "../../assets/loading_spinner.svg.js";
|
|
9
|
-
import A from "../Link/Link.js";
|
|
1
|
+
import { jsxs as p, Fragment as k, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { getCommonProps as P, px as y, encodeURLSearchParams as N } from "../../utils/index.js";
|
|
4
|
+
import u from "../../node_modules/classnames/index.js";
|
|
5
|
+
import j from "../Input/Input.js";
|
|
6
|
+
import D from "../Link/Link.js";
|
|
10
7
|
import F from "./SearchResults/SearchResults.js";
|
|
11
8
|
import { TextVariants as H } from "../Text/types.js";
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
...
|
|
9
|
+
import O from "../Text/Text.js";
|
|
10
|
+
import { useOnClickOutside as V } from "../../node_modules/usehooks-ts/dist/index.js";
|
|
11
|
+
import { HeaderContext as A } from "../Header/Header.js";
|
|
12
|
+
import { SearchButton as K } from "./SearchButton.js";
|
|
13
|
+
import M from "../../node_modules/react-transition-group/esm/CSSTransition.js";
|
|
14
|
+
const re = ({
|
|
15
|
+
onSearch: S,
|
|
16
|
+
searchResults: C = [],
|
|
17
|
+
state: c = "idle",
|
|
18
|
+
defaultValue: I = "",
|
|
19
|
+
className: R,
|
|
20
|
+
placeholder: b = "",
|
|
21
|
+
searchButtonText: l = "Search",
|
|
22
|
+
loadingText: w = "Search In Progress...",
|
|
23
|
+
invalidText: E = "Invalid search",
|
|
24
|
+
getAllResultsText: L = (e) => `View all results for ${e}`,
|
|
25
|
+
getAllResultsLink: v = (e) => `/Search?Search=${e}`,
|
|
26
|
+
...x
|
|
26
27
|
}) => {
|
|
27
|
-
var
|
|
28
|
-
const { className: e, "data-testid":
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var i;
|
|
37
|
-
if (t.stopPropagation(), t.key === "Enter") {
|
|
38
|
-
if (t.preventDefault(), o && o.length > 2) {
|
|
39
|
-
const I = N(_(o));
|
|
40
|
-
window.location.href = I;
|
|
28
|
+
var $;
|
|
29
|
+
const { className: e, "data-testid": m, ...T } = P(x, "Search"), d = f.useContext(A), h = f.useRef(null), o = f.useRef(null), t = d.isSearchExpanded, s = ($ = h.current) == null ? void 0 : $.value;
|
|
30
|
+
V(o, () => g(!1));
|
|
31
|
+
const _ = (r) => {
|
|
32
|
+
var n;
|
|
33
|
+
if (r.stopPropagation(), r.key === "Enter") {
|
|
34
|
+
if (r.preventDefault(), s && s.length > 2) {
|
|
35
|
+
const i = N(v(s));
|
|
36
|
+
window.location.href = i;
|
|
41
37
|
}
|
|
42
|
-
|
|
38
|
+
r.currentTarget instanceof HTMLAnchorElement && r.currentTarget.click();
|
|
39
|
+
}
|
|
40
|
+
r.key === "Escape" && (d.setIsSearchExpanded(!1), (n = o.current) == null || n.reset());
|
|
41
|
+
}, g = (r) => {
|
|
42
|
+
var n, i;
|
|
43
|
+
if (d.setIsSearchExpanded(r), r) {
|
|
44
|
+
(n = h.current) == null || n.focus();
|
|
45
|
+
return;
|
|
43
46
|
}
|
|
44
|
-
|
|
47
|
+
(i = o.current) == null || i.reset();
|
|
45
48
|
};
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"button",
|
|
58
|
-
{
|
|
59
|
-
type: "button",
|
|
60
|
-
"data-testid": `${r}-button`,
|
|
61
|
-
"aria-label": c,
|
|
62
|
-
className: `${e}__button ${e}__button--search`,
|
|
63
|
-
onClick: $,
|
|
64
|
-
children: /* @__PURE__ */ a(j, { "data-testid": `${r}-button-icon`, className: `${e}__button__icon` })
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
n && s === "idle" ? /* @__PURE__ */ a(
|
|
68
|
-
"button",
|
|
69
|
-
{
|
|
70
|
-
type: "button",
|
|
71
|
-
"data-testid": `${r}-close-button`,
|
|
72
|
-
"aria-label": "Close Search",
|
|
73
|
-
className: `${e}__button ${e}__button--close`,
|
|
74
|
-
onClick: $,
|
|
75
|
-
children: /* @__PURE__ */ a(D, { "data-testid": `${r}-form-icon`, className: `${e}__button__icon` })
|
|
76
|
-
}
|
|
77
|
-
) : null,
|
|
78
|
-
n && E ? /* @__PURE__ */ a(
|
|
79
|
-
V,
|
|
80
|
-
{
|
|
81
|
-
"data-testid": `${r}-form-icon`,
|
|
82
|
-
className: `${e}__button__icon ${e}__input-status-icon`
|
|
83
|
-
}
|
|
84
|
-
) : null,
|
|
85
|
-
/* @__PURE__ */ a(
|
|
49
|
+
return /* @__PURE__ */ p(k, { children: [
|
|
50
|
+
/* @__PURE__ */ a(O, { variant: H.heading3, className: `${e}__label`, children: l }),
|
|
51
|
+
/* @__PURE__ */ a(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
...T,
|
|
55
|
+
className: u(e, R, { [`${e}--active`]: t }),
|
|
56
|
+
"data-testid": m,
|
|
57
|
+
role: "search",
|
|
58
|
+
...x,
|
|
59
|
+
children: /* @__PURE__ */ p(
|
|
86
60
|
"form",
|
|
87
61
|
{
|
|
88
|
-
"data-testid": `${
|
|
89
|
-
className:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
62
|
+
"data-testid": `${m}-form`,
|
|
63
|
+
className: u(`${e}__form`, {
|
|
64
|
+
[`${e}__form--active`]: t
|
|
65
|
+
}),
|
|
66
|
+
ref: o,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ p(
|
|
69
|
+
"div",
|
|
95
70
|
{
|
|
96
|
-
className: `${e}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
71
|
+
className: u(`${e}__content-wrapper`, {
|
|
72
|
+
[`${e}__content-wrapper--active`]: t
|
|
73
|
+
}),
|
|
74
|
+
role: "combobox",
|
|
75
|
+
"aria-haspopup": "listbox",
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ a(
|
|
78
|
+
M,
|
|
79
|
+
{
|
|
80
|
+
in: t,
|
|
81
|
+
classNames: `${y}-input`,
|
|
82
|
+
addEndListener: () => {
|
|
83
|
+
},
|
|
84
|
+
children: /* @__PURE__ */ a(
|
|
85
|
+
j,
|
|
86
|
+
{
|
|
87
|
+
"aria-hidden": !t,
|
|
88
|
+
className: `${e}__input`,
|
|
89
|
+
id: "search-input",
|
|
90
|
+
hideLabel: !0,
|
|
91
|
+
labelText: l,
|
|
92
|
+
placeholder: t ? b : "",
|
|
93
|
+
type: "text",
|
|
94
|
+
defaultValue: I,
|
|
95
|
+
invalid: c === "invalid",
|
|
96
|
+
invalidText: E,
|
|
97
|
+
onKeyDown: _,
|
|
98
|
+
onChange: S ? (r) => {
|
|
99
|
+
S(r.target.value);
|
|
100
|
+
} : void 0,
|
|
101
|
+
ref: h
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ a(
|
|
107
|
+
K,
|
|
108
|
+
{
|
|
109
|
+
className: e,
|
|
110
|
+
searchButtonText: l,
|
|
111
|
+
state: c,
|
|
112
|
+
testId: m,
|
|
113
|
+
isSearchExpanded: t,
|
|
114
|
+
setIsSearchExpanded: g
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
]
|
|
110
118
|
}
|
|
111
119
|
),
|
|
112
|
-
|
|
120
|
+
s && s.length > 2 ? /* @__PURE__ */ a(
|
|
113
121
|
F,
|
|
114
122
|
{
|
|
115
|
-
autoCompleteResults:
|
|
116
|
-
isLoading:
|
|
117
|
-
loadingText:
|
|
118
|
-
onKeyDown:
|
|
123
|
+
autoCompleteResults: C,
|
|
124
|
+
isLoading: c === "loading",
|
|
125
|
+
loadingText: w,
|
|
126
|
+
onKeyDown: _,
|
|
119
127
|
children: /* @__PURE__ */ a("li", { className: `${e}__result`, children: /* @__PURE__ */ a(
|
|
120
|
-
|
|
128
|
+
D,
|
|
121
129
|
{
|
|
122
|
-
href: ((
|
|
123
|
-
children: /* @__PURE__ */ a("p", { children:
|
|
130
|
+
href: ((r) => N(v(r)))(s),
|
|
131
|
+
children: /* @__PURE__ */ a("p", { children: L(s) })
|
|
124
132
|
}
|
|
125
133
|
) }, "viewAllSearchResults")
|
|
126
134
|
}
|
|
127
135
|
) : null
|
|
128
|
-
]
|
|
136
|
+
]
|
|
129
137
|
}
|
|
130
138
|
)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
);
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] });
|
|
134
142
|
};
|
|
135
143
|
export {
|
|
136
|
-
|
|
144
|
+
re as default
|
|
137
145
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SearchProps } from './Search';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
export declare const SearchButton: ({ state, isSearchExpanded, setIsSearchExpanded, searchButtonText, className, testId, ...props }: {
|
|
4
|
+
testId: string;
|
|
5
|
+
isSearchExpanded: boolean;
|
|
6
|
+
setIsSearchExpanded: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
|
+
} & Pick<SearchProps, "state" | "searchButtonText"> & import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import b from "../../assets/search.svg.js";
|
|
3
|
+
import l from "../../assets/close.svg.js";
|
|
4
|
+
const f = ({
|
|
5
|
+
state: e,
|
|
6
|
+
isSearchExpanded: r,
|
|
7
|
+
setIsSearchExpanded: i,
|
|
8
|
+
searchButtonText: _,
|
|
9
|
+
className: t,
|
|
10
|
+
testId: o,
|
|
11
|
+
...u
|
|
12
|
+
}) => r ? r && e === "idle" ? /* @__PURE__ */ n(
|
|
13
|
+
"button",
|
|
14
|
+
{
|
|
15
|
+
...u,
|
|
16
|
+
type: "button",
|
|
17
|
+
"data-testid": `${o}-close-button`,
|
|
18
|
+
"aria-label": "Close Search",
|
|
19
|
+
className: `${t}__button ${t}__button--close`,
|
|
20
|
+
onClick: () => i(!1),
|
|
21
|
+
children: /* @__PURE__ */ n(l, { "data-testid": `${o}-form-icon`, className: `${t}__button__icon` })
|
|
22
|
+
}
|
|
23
|
+
) : null : /* @__PURE__ */ n(
|
|
24
|
+
"button",
|
|
25
|
+
{
|
|
26
|
+
...u,
|
|
27
|
+
type: "button",
|
|
28
|
+
"data-testid": `${o}-button`,
|
|
29
|
+
"aria-label": _,
|
|
30
|
+
className: `${t}__button ${t}__button--search`,
|
|
31
|
+
onClick: () => i(!0),
|
|
32
|
+
children: /* @__PURE__ */ n(b, { "data-testid": `${o}-button-icon`, className: `${t}__button__icon` })
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
export {
|
|
36
|
+
f as SearchButton
|
|
37
|
+
};
|
|
@@ -5,11 +5,11 @@ import L from "../Input/Input.js";
|
|
|
5
5
|
import S from "../Button/Button.js";
|
|
6
6
|
import { SubscriptionState as o } from "./types.js";
|
|
7
7
|
import { ButtonVariants as T } from "../Button/types.js";
|
|
8
|
-
const
|
|
9
|
-
blurb:
|
|
10
|
-
buttonText:
|
|
8
|
+
const Y = ({
|
|
9
|
+
blurb: a,
|
|
10
|
+
buttonText: m = "Sign Up",
|
|
11
11
|
buttonProps: c,
|
|
12
|
-
className:
|
|
12
|
+
className: s,
|
|
13
13
|
element: d = "form",
|
|
14
14
|
inputLabelText: u = "Enter Your Email Address To Sign Up*",
|
|
15
15
|
inputPlaceholder: p = "example@email.com",
|
|
@@ -27,10 +27,10 @@ const z = ({
|
|
|
27
27
|
success: v,
|
|
28
28
|
loading: g,
|
|
29
29
|
error: h
|
|
30
|
-
},
|
|
31
|
-
return /* @__PURE__ */ B(d, { ...x, className: C(r,
|
|
30
|
+
}, t = e !== o.Default ? E[e] : "", P = $ || y, A = N || b;
|
|
31
|
+
return /* @__PURE__ */ B(d, { ...x, className: C(r, s), noValidate: !0, ...l, children: [
|
|
32
32
|
/* @__PURE__ */ n("h3", { className: `${r}__title`, children: f }),
|
|
33
|
-
|
|
33
|
+
a ? /* @__PURE__ */ n("p", { className: `${r}__blurb`, children: a }) : null,
|
|
34
34
|
/* @__PURE__ */ n(
|
|
35
35
|
L,
|
|
36
36
|
{
|
|
@@ -40,26 +40,25 @@ const z = ({
|
|
|
40
40
|
placeholder: p,
|
|
41
41
|
labelText: u,
|
|
42
42
|
invalid: A,
|
|
43
|
-
invalidText:
|
|
43
|
+
invalidText: t,
|
|
44
44
|
warn: P,
|
|
45
|
-
warnText:
|
|
45
|
+
warnText: t,
|
|
46
46
|
required: !0
|
|
47
47
|
}
|
|
48
48
|
),
|
|
49
49
|
/* @__PURE__ */ n(
|
|
50
50
|
S,
|
|
51
51
|
{
|
|
52
|
-
className: `${r}__button ${
|
|
52
|
+
className: `${r}__button ${s}`,
|
|
53
53
|
variant: T.secondary,
|
|
54
|
-
size: "sm",
|
|
55
54
|
type: "submit",
|
|
56
55
|
...c,
|
|
57
|
-
children:
|
|
56
|
+
children: m
|
|
58
57
|
}
|
|
59
58
|
),
|
|
60
59
|
i ? /* @__PURE__ */ n("p", { className: `${r}__privacy`, children: i }) : null
|
|
61
60
|
] });
|
|
62
61
|
};
|
|
63
62
|
export {
|
|
64
|
-
|
|
63
|
+
Y as default
|
|
65
64
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function e() {
|
|
2
|
+
return e = Object.assign ? Object.assign.bind() : function(a) {
|
|
3
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
4
|
+
var t = arguments[n];
|
|
5
|
+
for (var r in t)
|
|
6
|
+
Object.prototype.hasOwnProperty.call(t, r) && (a[r] = t[r]);
|
|
7
|
+
}
|
|
8
|
+
return a;
|
|
9
|
+
}, e.apply(this, arguments);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
e as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import i from "./hasClass.js";
|
|
2
|
+
function c(s, a) {
|
|
3
|
+
s.classList ? s.classList.add(a) : i(s, a) || (typeof s.className == "string" ? s.className = s.className + " " + a : s.setAttribute("class", (s.className && s.className.baseVal || "") + " " + a));
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
c as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function c(s, a) {
|
|
2
|
+
return s.replace(new RegExp("(^|\\s)" + a + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
3
|
+
}
|
|
4
|
+
function r(s, a) {
|
|
5
|
+
s.classList ? s.classList.remove(a) : typeof s.className == "string" ? s.className = c(s.className, a) : s.setAttribute("class", c(s.className && s.className.baseVal || "", a));
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
r as default
|
|
9
|
+
};
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { getDefaultExportFromCjs as e } from "../../_virtual/_commonjsHelpers.js";
|
|
1
2
|
import { __module as r } from "../../_virtual/index3.js";
|
|
2
|
-
import { __require as
|
|
3
|
-
import { __require as
|
|
4
|
-
import { __require as
|
|
3
|
+
import { __require as o } from "./node_modules/react-is/index.js";
|
|
4
|
+
import { __require as p } from "./factoryWithTypeCheckers.js";
|
|
5
|
+
import { __require as t } from "./factoryWithThrowingShims.js";
|
|
5
6
|
if (process.env.NODE_ENV !== "production") {
|
|
6
|
-
var s =
|
|
7
|
-
r.exports =
|
|
7
|
+
var s = o(), i = !0;
|
|
8
|
+
r.exports = p()(s.isElement, i);
|
|
8
9
|
} else
|
|
9
|
-
r.exports =
|
|
10
|
-
var
|
|
10
|
+
r.exports = t()();
|
|
11
|
+
var a = r.exports;
|
|
12
|
+
const q = /* @__PURE__ */ e(a);
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
q as default,
|
|
15
|
+
a as p
|
|
13
16
|
};
|