@phillips/seldon 1.33.0 → 1.35.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/components/Accordion/AccordionItem.d.ts +5 -1
- package/dist/components/Accordion/AccordionItem.js +59 -58
- package/dist/components/Button/Button.d.ts +2 -1
- package/dist/components/Button/Button.js +17 -16
- package/dist/components/Button/types.d.ts +5 -0
- package/dist/components/Button/types.js +4 -0
- package/dist/components/Footer/Footer.d.ts +1 -1
- package/dist/components/Footer/Footer.js +12 -10
- package/dist/components/Header/Header.js +34 -34
- package/dist/components/IconButton/IconButton.js +13 -12
- package/dist/components/Search/Search.d.ts +44 -3
- package/dist/components/Search/Search.js +113 -43
- package/dist/components/Search/SearchResults/SearchResults.d.ts +13 -0
- package/dist/components/Search/SearchResults/SearchResults.js +16 -0
- package/dist/components/Social/Social.d.ts +10 -1
- package/dist/components/Social/Social.js +19 -9
- package/dist/components/Subscribe/Subscribe.js +37 -27
- package/dist/components/ViewingsList/ViewingsListCard.js +145 -114
- package/dist/index.d.ts +1 -0
- package/dist/index.js +84 -80
- package/dist/scss/components/Footer/_footer.scss +79 -32
- package/dist/scss/components/Input/_input.scss +2 -1
- package/dist/scss/components/Navigation/NavigationItem/_navigationItem.scss +2 -2
- package/dist/scss/components/Search/_search.scss +54 -5
- package/dist/scss/components/Social/_social.scss +44 -6
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.js +40 -31
- package/package.json +2 -2
|
@@ -1,49 +1,119 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as f, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as v from "react";
|
|
3
|
+
import { getCommonProps as L, encodeURLSearchParams as k } from "../../utils/index.js";
|
|
4
4
|
import o from "../../node_modules/classnames/index.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import E from "../Input/Input.js";
|
|
6
|
+
import $ from "../../assets/search.svg.js";
|
|
7
|
+
import P from "../Link/Link.js";
|
|
8
|
+
import j from "./SearchResults/SearchResults.js";
|
|
9
|
+
const V = ({
|
|
10
|
+
useIcon: i = !0,
|
|
11
|
+
onSearch: d,
|
|
12
|
+
searchResults: b = [],
|
|
13
|
+
state: m = "idle",
|
|
14
|
+
defaultValue: N = "",
|
|
15
|
+
className: S,
|
|
16
|
+
placeholder: y = "Type to search",
|
|
17
|
+
searchButtonText: n = "Search",
|
|
18
|
+
loadingText: g = "Loading...",
|
|
19
|
+
invalidText: w = "Invalid search",
|
|
20
|
+
getAllResultsText: R = (e) => `View all results for ${e}`,
|
|
21
|
+
getAllResultsLink: C = (e) => `/Search?Search=${e}`,
|
|
22
|
+
...u
|
|
23
|
+
}) => {
|
|
24
|
+
var _;
|
|
25
|
+
const { className: e, "data-testid": t, ...x } = L(u, "Search"), [s, p] = v.useState(!1), c = v.useRef(null), l = (_ = c.current) == null ? void 0 : _.value, h = () => {
|
|
26
|
+
var r;
|
|
27
|
+
p(!s), s || (r = c.current) == null || r.focus();
|
|
10
28
|
};
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{ [`${a}-search__input-wrapper--active`]: t },
|
|
28
|
-
{ [`${a}-search__input-wrapper--use-icon`]: r }
|
|
29
|
+
return /* @__PURE__ */ f(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
...x,
|
|
33
|
+
className: o(e, S),
|
|
34
|
+
"data-testid": t,
|
|
35
|
+
role: "search",
|
|
36
|
+
...u,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ a(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
"data-testid": `${t}-overlay`,
|
|
42
|
+
className: o(`${e}__overlay`, { [`${e}__overlay--active`]: s }),
|
|
43
|
+
onClick: h
|
|
44
|
+
}
|
|
29
45
|
),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
/* @__PURE__ */ a(
|
|
47
|
+
"button",
|
|
48
|
+
{
|
|
49
|
+
"data-testid": `${t}-button`,
|
|
50
|
+
"aria-label": n,
|
|
51
|
+
className: `${e}__button`,
|
|
52
|
+
onClick: h,
|
|
53
|
+
children: i ? /* @__PURE__ */ a($, { "data-testid": `${t}-button-icon`, className: `${e}__button__icon` }) : n
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ a(
|
|
57
|
+
"form",
|
|
58
|
+
{
|
|
59
|
+
"data-testid": `${t}-form`,
|
|
60
|
+
className: o(`${e}__form`, { [`${e}__form--active`]: s }),
|
|
61
|
+
"aria-hidden": !s,
|
|
62
|
+
children: /* @__PURE__ */ f(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: o(`${e}__input-wrapper`, {
|
|
66
|
+
[`${e}__input-wrapper--use-icon`]: i
|
|
67
|
+
}),
|
|
68
|
+
role: "combobox",
|
|
69
|
+
"aria-haspopup": "listbox",
|
|
70
|
+
children: [
|
|
71
|
+
i ? /* @__PURE__ */ a($, { "data-testid": `${t}-form-icon`, className: `${e}__input-wrapper__icon` }) : null,
|
|
72
|
+
/* @__PURE__ */ a(
|
|
73
|
+
E,
|
|
74
|
+
{
|
|
75
|
+
className: `${e}__input`,
|
|
76
|
+
id: "search-input",
|
|
77
|
+
hideLabel: !0,
|
|
78
|
+
labelText: n,
|
|
79
|
+
placeholder: y,
|
|
80
|
+
type: "text",
|
|
81
|
+
defaultValue: N,
|
|
82
|
+
invalid: m === "invalid",
|
|
83
|
+
invalidText: w,
|
|
84
|
+
onKeyDown: (r) => {
|
|
85
|
+
r.key === "Escape" && p(!1);
|
|
86
|
+
},
|
|
87
|
+
onChange: d ? (r) => {
|
|
88
|
+
d(r.target.value);
|
|
89
|
+
} : void 0,
|
|
90
|
+
ref: c
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
l && l.length > 2 ? /* @__PURE__ */ a(
|
|
94
|
+
j,
|
|
95
|
+
{
|
|
96
|
+
autoCompleteResults: b,
|
|
97
|
+
isLoading: m === "loading",
|
|
98
|
+
loadingText: g,
|
|
99
|
+
children: /* @__PURE__ */ a("li", { className: `${e}__result`, children: /* @__PURE__ */ a(
|
|
100
|
+
P,
|
|
101
|
+
{
|
|
102
|
+
href: ((r) => k(C(r)))(l),
|
|
103
|
+
children: /* @__PURE__ */ a("p", { children: R(l) })
|
|
104
|
+
}
|
|
105
|
+
) }, "viewAllSearchResults")
|
|
106
|
+
}
|
|
107
|
+
) : null
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
);
|
|
46
116
|
};
|
|
47
117
|
export {
|
|
48
|
-
|
|
118
|
+
V as default
|
|
49
119
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface SearchResultsProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
autoCompleteResults?: {
|
|
4
|
+
id: string;
|
|
5
|
+
url: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
loadingText?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const SearchResults: ({ autoCompleteResults, isLoading, children, loadingText, }: React.PropsWithChildren<SearchResultsProps>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default SearchResults;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { px as e } from "../../../utils/index.js";
|
|
3
|
+
import n from "../../Link/Link.js";
|
|
4
|
+
const _ = ({
|
|
5
|
+
autoCompleteResults: s = [],
|
|
6
|
+
isLoading: l,
|
|
7
|
+
children: i,
|
|
8
|
+
loadingText: c = "Loading..."
|
|
9
|
+
}) => /* @__PURE__ */ h("ul", { "data-testid": "search-results", className: `${e}-search__results`, children: [
|
|
10
|
+
l ? /* @__PURE__ */ r("li", { className: `${e}-search__result`, children: c }) : null,
|
|
11
|
+
Array.isArray(s) && s.length > 0 && s.map((a) => /* @__PURE__ */ r("li", { className: `${e}-search__result`, children: /* @__PURE__ */ r(n, { href: a.url, children: /* @__PURE__ */ r("p", { children: a.label }) }) }, a.id)),
|
|
12
|
+
i
|
|
13
|
+
] });
|
|
14
|
+
export {
|
|
15
|
+
_ as default
|
|
16
|
+
};
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
1
2
|
export interface SocialProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
3
|
/**
|
|
3
4
|
* Title text for the social section
|
|
4
5
|
*/
|
|
5
6
|
titleText?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Text for the subscribe button
|
|
9
|
+
*/
|
|
10
|
+
buttonText?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Function for when the subscribe button is clicked
|
|
13
|
+
*/
|
|
14
|
+
onSubscribeClick?: MouseEventHandler<HTMLButtonElement>;
|
|
6
15
|
}
|
|
7
16
|
/**
|
|
8
17
|
* ## Overview
|
|
@@ -13,5 +22,5 @@ export interface SocialProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
13
22
|
*
|
|
14
23
|
* [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-social--overview)
|
|
15
24
|
*/
|
|
16
|
-
declare const Social: ({ className, children, titleText, ...props }: SocialProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare const Social: ({ className, children, titleText, buttonText, onSubscribeClick, ...props }: SocialProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
26
|
export default Social;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import l from "../../node_modules/classnames/index.js";
|
|
3
|
+
import { getCommonProps as u } from "../../utils/index.js";
|
|
4
|
+
import N from "../Button/Button.js";
|
|
5
|
+
import { ButtonVariants as d } from "../Button/types.js";
|
|
6
|
+
const v = ({
|
|
7
|
+
className: e,
|
|
8
|
+
children: t,
|
|
9
|
+
titleText: a = "Never Miss A Moment",
|
|
10
|
+
buttonText: m = "Subscribe To Our Newsletter",
|
|
11
|
+
onSubscribeClick: i,
|
|
12
|
+
...s
|
|
13
|
+
}) => {
|
|
14
|
+
const { className: o, ...n } = u(s, "Social");
|
|
15
|
+
return /* @__PURE__ */ c("div", { ...n, className: l(o, e), ...s, children: [
|
|
16
|
+
/* @__PURE__ */ r("h3", { className: `${o}__header`, children: a }),
|
|
17
|
+
/* @__PURE__ */ r(N, { onClick: i, variant: d.ghost, className: `${o}__button`, children: m }),
|
|
18
|
+
t
|
|
9
19
|
] });
|
|
10
20
|
};
|
|
11
21
|
export {
|
|
12
|
-
|
|
22
|
+
v as default
|
|
13
23
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { SubscriptionState as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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";
|
|
5
|
+
import S from "../Button/Button.js";
|
|
6
|
+
import { SubscriptionState as r } from "./types.js";
|
|
7
|
+
import { ButtonVariants as T } from "../Button/types.js";
|
|
8
|
+
const k = ({
|
|
9
|
+
blurb: n,
|
|
10
|
+
buttonText: l = "Sign Up",
|
|
10
11
|
buttonProps: m,
|
|
11
|
-
className:
|
|
12
|
+
className: s,
|
|
12
13
|
element: c = "form",
|
|
13
14
|
inputLabelText: d = "Email*",
|
|
14
15
|
inputPlaceholder: u = "example@email.com",
|
|
@@ -16,37 +17,46 @@ const U = ({
|
|
|
16
17
|
loadingText: f = "Loading...",
|
|
17
18
|
invalidText: x = "",
|
|
18
19
|
errorText: _ = "An error occurred. Please try again.",
|
|
19
|
-
successText:
|
|
20
|
-
subscriptionState: e =
|
|
20
|
+
successText: g,
|
|
21
|
+
subscriptionState: e = r.Default,
|
|
21
22
|
...t
|
|
22
23
|
}) => {
|
|
23
|
-
const { className:
|
|
24
|
+
const { className: o, ...N } = L(t, "Subscribe"), b = e === r.Invalid, h = e === r.Loading, v = e === r.Success, $ = e === r.Error, y = {
|
|
24
25
|
invalid: x,
|
|
25
|
-
success:
|
|
26
|
+
success: g,
|
|
26
27
|
loading: f,
|
|
27
28
|
error: _
|
|
28
|
-
},
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
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,
|
|
34
35
|
{
|
|
35
|
-
className: `${
|
|
36
|
+
className: `${o}__input`,
|
|
36
37
|
type: "email",
|
|
37
38
|
name: "email",
|
|
38
39
|
placeholder: u,
|
|
39
40
|
labelText: d,
|
|
40
|
-
invalid:
|
|
41
|
-
invalidText:
|
|
42
|
-
warn:
|
|
43
|
-
warnText:
|
|
41
|
+
invalid: C,
|
|
42
|
+
invalidText: i,
|
|
43
|
+
warn: w,
|
|
44
|
+
warnText: i,
|
|
44
45
|
required: !0
|
|
45
46
|
}
|
|
46
47
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ a(
|
|
49
|
+
S,
|
|
50
|
+
{
|
|
51
|
+
className: `${o}__button ${s}`,
|
|
52
|
+
variant: T.secondary,
|
|
53
|
+
type: "submit",
|
|
54
|
+
...m,
|
|
55
|
+
children: l
|
|
56
|
+
}
|
|
57
|
+
)
|
|
48
58
|
] });
|
|
49
59
|
};
|
|
50
60
|
export {
|
|
51
|
-
|
|
61
|
+
k as default
|
|
52
62
|
};
|