@phillips/seldon 1.67.1 → 1.68.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,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { AccordionItemVariant } from './types';
2
3
  export interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement> {
3
4
  /**
4
5
  * When true, prevents border bottom style from being applied to the item.
@@ -9,9 +10,9 @@ export interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement>
9
10
  */
10
11
  isLocked?: boolean;
11
12
  /**
12
- * Determines whether the variation on text style is large or small.
13
+ * Determines whether the variant on text style is large or small.
13
14
  */
14
- variation: string;
15
+ variant?: AccordionItemVariant;
15
16
  /**
16
17
  * Uniqueid for the Accordion Item.
17
18
  */
@@ -29,5 +30,5 @@ export interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement>
29
30
  */
30
31
  hasTransition?: boolean;
31
32
  }
32
- declare const AccordionItem: ({ isLocked, variation, id, label, isLastItem, hasTransition, children, ...props }: AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
33
+ declare const AccordionItem: ({ isLocked, variant, id, label, isLastItem, hasTransition, children, ...props }: AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
33
34
  export default AccordionItem;
@@ -1,12 +1,13 @@
1
- import { jsxs as h, jsx as o, Fragment as g } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as o, Fragment as f } from "react/jsx-runtime";
2
2
  import { getCommonProps as v } from "../../utils/index.js";
3
3
  import $ from "../../assets/plus.svg.js";
4
- import f from "../../assets/minus.svg.js";
5
- import I from "../../assets/lock.svg.js";
6
- import m from "../../node_modules/classnames/index.js";
7
- import { Item as _, Trigger as C, Content as N } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
8
- import { getIconClasses as p } from "./utils.js";
9
- const x = ({
4
+ import I from "../../assets/minus.svg.js";
5
+ import _ from "../../assets/lock.svg.js";
6
+ import d from "../../node_modules/classnames/index.js";
7
+ import { Item as C, Trigger as N, Content as x } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
8
+ import { AccordionItemVariant as h } from "./types.js";
9
+ import { getIconClasses as u } from "./utils.js";
10
+ const A = ({
10
11
  children: n,
11
12
  className: s,
12
13
  baseClassName: t,
@@ -14,97 +15,97 @@ const x = ({
14
15
  isLargeVariation: e,
15
16
  id: r
16
17
  }) => {
17
- const a = c, l = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
18
- I,
18
+ const i = c, l = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
19
+ _,
19
20
  {
20
- className: p(t, e, "lock"),
21
+ className: u(t, e, "lock"),
21
22
  "data-testid": `${r}-lockedIcon`,
22
23
  "aria-hidden": !0
23
24
  }
24
- ) }), u = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
25
+ ) }), p = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
25
26
  $,
26
27
  {
27
- className: p(t, e, "plus"),
28
+ className: u(t, e, "plus"),
28
29
  "data-testid": `${r}-plusIcon`,
29
30
  "aria-hidden": !0
30
31
  }
31
- ) }), i = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
32
- f,
32
+ ) }), a = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
33
+ I,
33
34
  {
34
- className: p(t, e, "minus"),
35
+ className: u(t, e, "minus"),
35
36
  "data-testid": `${r}-minusIcon`,
36
37
  "aria-hidden": !0
37
38
  }
38
39
  ) });
39
40
  return /* @__PURE__ */ o(
40
- C,
41
+ N,
41
42
  {
42
43
  "data-disabled": c,
43
44
  asChild: !0,
44
- className: m(t, { [`${t}--hoverable`]: !c }, s),
45
- children: /* @__PURE__ */ h("div", { "data-testid": `${r}-trigger`, children: [
46
- /* @__PURE__ */ o("div", { className: m(`${t}__text`, { [`${t}__text--lg`]: e }), children: n }),
47
- a && l,
48
- !a && u,
49
- !a && i
45
+ className: d(t, { [`${t}--hoverable`]: !c }, s),
46
+ children: /* @__PURE__ */ g("div", { "data-testid": `${r}-trigger`, children: [
47
+ /* @__PURE__ */ o("div", { className: d(`${t}__text`, { [`${t}__text--lg`]: e }), children: n }),
48
+ i && l,
49
+ !i && p,
50
+ !i && a
50
51
  ] })
51
52
  }
52
53
  );
53
- }, A = ({
54
+ }, k = ({
54
55
  children: n,
55
56
  baseClassName: s,
56
57
  disable: t,
57
58
  hasTransition: c,
58
59
  isLargeVariation: e,
59
60
  className: r
60
- }) => /* @__PURE__ */ o(g, { children: t && n ? /* @__PURE__ */ o("div", { children: n }) : /* @__PURE__ */ o(
61
- N,
61
+ }) => /* @__PURE__ */ o(f, { children: t && n ? /* @__PURE__ */ o("div", { children: n }) : /* @__PURE__ */ o(
62
+ x,
62
63
  {
63
64
  asChild: !0,
64
- className: m(
65
+ className: d(
65
66
  { [`${s}__content--lg`]: e },
66
67
  { [`${s}--transition`]: c },
67
68
  r
68
69
  ),
69
70
  children: n
70
71
  }
71
- ) }), H = ({
72
+ ) }), q = ({
72
73
  isLocked: n = !1,
73
- variation: s,
74
+ variant: s = h.sm,
74
75
  id: t,
75
76
  label: c,
76
77
  isLastItem: e,
77
78
  hasTransition: r = !1,
78
- children: a,
79
+ children: i,
79
80
  ...l
80
81
  }) => {
81
- const { className: u } = v({ id: t }, "Accordion"), i = s === "lg", d = `${u}-item`;
82
- return /* @__PURE__ */ h(
83
- _,
82
+ const { className: p } = v({ id: t }, "Accordion"), a = s === h.lg, m = `${p}-item`;
83
+ return /* @__PURE__ */ g(
84
+ C,
84
85
  {
85
86
  disabled: n,
86
87
  value: t,
87
- className: m(d, { [`${d}__border-bottom`]: !e }),
88
+ className: d(m, { [`${m}__border-bottom`]: !e }),
88
89
  ...l,
89
90
  children: [
90
91
  /* @__PURE__ */ o(
91
- x,
92
+ A,
92
93
  {
93
94
  disable: n,
94
- isLargeVariation: i,
95
+ isLargeVariation: a,
95
96
  id: t,
96
- baseClassName: `${d}-label`,
97
+ baseClassName: `${m}-label`,
97
98
  children: c
98
99
  }
99
100
  ),
100
101
  /* @__PURE__ */ o(
101
- A,
102
+ k,
102
103
  {
103
104
  disable: n,
104
105
  hasTransition: r,
105
- isLargeVariation: i,
106
- baseClassName: d,
107
- children: /* @__PURE__ */ o("div", { className: "radix-accordion-content", children: a })
106
+ isLargeVariation: a,
107
+ baseClassName: m,
108
+ children: /* @__PURE__ */ o("div", { className: "radix-accordion-content", children: i })
108
109
  }
109
110
  )
110
111
  ]
@@ -112,5 +113,5 @@ const x = ({
112
113
  );
113
114
  };
114
115
  export {
115
- H as default
116
+ q as default
116
117
  };
@@ -1,2 +1,3 @@
1
1
  export { default as Accordion, type AccordionProps } from './Accordion';
2
2
  export { default as AccordionItem, type AccordionItemProps } from './AccordionItem';
3
+ export { AccordionItemVariant, AccordionVariants } from './types';
@@ -44,3 +44,22 @@ export declare enum AccordionVariants {
44
44
  singleNonCollapsible = "singleNonCollapsible"
45
45
  }
46
46
  export type AccordionVariantKey = keyof typeof AccordionVariants;
47
+ export declare enum AccordionType {
48
+ single = "single",
49
+ multiple = "multiple"
50
+ }
51
+ export interface AccordionVariantProps {
52
+ /**
53
+ * Determines whether multiple elements can be opened at the same time or not.
54
+ */
55
+ type: AccordionType;
56
+ /**
57
+ * Determines if an open element can be closed by clicking on it.
58
+ * Only applicable to the `single` variants.
59
+ */
60
+ collapsible?: boolean;
61
+ }
62
+ export declare enum AccordionItemVariant {
63
+ lg = "lg",
64
+ sm = "sm"
65
+ }
@@ -1,4 +1,6 @@
1
- var e = /* @__PURE__ */ ((l) => (l.multiple = "multiple", l.singleCollapsible = "singleCollapsible", l.singleNonCollapsible = "singleNonCollapsible", l))(e || {});
1
+ var e = /* @__PURE__ */ ((l) => (l.multiple = "multiple", l.singleCollapsible = "singleCollapsible", l.singleNonCollapsible = "singleNonCollapsible", l))(e || {}), s = /* @__PURE__ */ ((l) => (l.single = "single", l.multiple = "multiple", l))(s || {}), g = /* @__PURE__ */ ((l) => (l.lg = "lg", l.sm = "sm", l))(g || {});
2
2
  export {
3
+ g as AccordionItemVariant,
4
+ s as AccordionType,
3
5
  e as AccordionVariants
4
6
  };
@@ -1,15 +1,4 @@
1
- import { AccordionVariantKey } from './types';
2
- export interface AccordionVariantProps {
3
- /**
4
- * Determines whether multiple elements can be opened at the same time or not.
5
- */
6
- type: 'single' | 'multiple';
7
- /**
8
- * Determines if an open element can be closed by clicking on it.
9
- * Only applicable to the `single` variants.
10
- */
11
- collapsible?: boolean;
12
- }
1
+ import { AccordionVariantKey, AccordionVariantProps } from './types';
13
2
  /**
14
3
  * Sets the type and collapsible props based on the variant prop
15
4
  * The collapsible prop should only be passed when the variant is single
@@ -1,12 +1,12 @@
1
- import n from "../../node_modules/classnames/index.js";
2
- import { AccordionVariants as l } from "./types.js";
3
- const r = (i) => {
4
- const o = { type: "multiple" };
5
- return i === l.singleCollapsible && (o.type = "single", o.collapsible = !0), i === l.singleNonCollapsible && (o.type = "single", o.collapsible = !1), o;
6
- }, p = (i, o, e) => n(`${i}__icon`, `${i}-${e}__icon`, {
1
+ import s from "../../node_modules/classnames/index.js";
2
+ import { AccordionType as l, AccordionVariants as e } from "./types.js";
3
+ const c = (i) => {
4
+ const o = { type: l.multiple };
5
+ return i === e.singleCollapsible && (o.type = l.single, o.collapsible = !0), i === e.singleNonCollapsible && (o.type = l.single, o.collapsible = !1), o;
6
+ }, p = (i, o, n) => s(`${i}__icon`, `${i}-${n}__icon`, {
7
7
  [`${i}__icon--lg`]: o
8
8
  });
9
9
  export {
10
- r as getAccordionVariantProps,
10
+ c as getAccordionVariantProps,
11
11
  p as getIconClasses
12
12
  };
@@ -8,36 +8,35 @@ import M from "../NavigationList/NavigationList.js";
8
8
  import O from "../../Accordion/Accordion.js";
9
9
  import y from "../../Accordion/AccordionItem.js";
10
10
  import { SSRMediaQuery as u } from "../../../providers/utils.js";
11
- const S = ({ id: i, label: r, children: a }) => /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
11
+ const S = ({ id: i, label: r, children: t }) => /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
12
12
  y,
13
13
  {
14
- variation: "sm",
15
14
  hasTransition: !0,
16
15
  id: `accordion-item-${i}`,
17
16
  label: /* @__PURE__ */ e(f, { variant: p.snwHeaderLink, children: r }),
18
- children: a
17
+ children: t
19
18
  },
20
19
  `accordion-key-${r}`
21
20
  ) }), C = $(
22
- ({ id: i, label: r, children: a, className: g, onClick: v, ...h }, N) => {
23
- const { className: n, ...t } = _({ id: i }, "NavigationItemTrigger"), [m, s] = I(!1), o = b(a, M);
21
+ ({ id: i, label: r, children: t, className: g, onClick: h, ...v }, N) => {
22
+ const { className: n, ...a } = _({ id: i }, "NavigationItemTrigger"), [m, s] = I(!1), o = b(t, M);
24
23
  return /* @__PURE__ */ d(T, { children: [
25
- /* @__PURE__ */ e(u.Media, { lessThan: "md", children: /* @__PURE__ */ e(S, { id: i, label: r, ...t, children: o ? l.cloneElement(o[0], {
24
+ /* @__PURE__ */ e(u.Media, { lessThan: "md", children: /* @__PURE__ */ e(S, { id: i, label: r, ...a, children: o ? l.cloneElement(o[0], {
26
25
  className: `${n}__submenu--mobile`
27
26
  }) : void 0 }) }),
28
27
  /* @__PURE__ */ e(u.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ d(
29
28
  "li",
30
29
  {
31
- ...t,
30
+ ...a,
32
31
  ref: N,
33
32
  "aria-expanded": m,
34
33
  className: x(g, n, `${c}-nav__item`, {
35
34
  [`${n}--hovered`]: m
36
35
  }),
37
- onClick: v,
36
+ onClick: h,
38
37
  onMouseOver: () => s(!0),
39
38
  onMouseOut: () => s(!1),
40
- ...h,
39
+ ...v,
41
40
  children: [
42
41
  /* @__PURE__ */ e("button", { className: `${c}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ e(f, { variant: p.snwHeaderLink, children: r }) }),
43
42
  o ? l.cloneElement(o[0], { className: `${n}__submenu` }) : void 0
@@ -7,6 +7,10 @@ export interface SearchProps extends React.HTMLAttributes<HTMLDivElement> {
7
7
  * @returns void
8
8
  */
9
9
  onSearch?: (searchQuery: string) => void;
10
+ /**
11
+ * called when the search is cancelled
12
+ */
13
+ onCancel?: () => void;
10
14
  /**
11
15
  * The search results to display
12
16
  */
@@ -40,5 +44,5 @@ export interface SearchProps extends React.HTMLAttributes<HTMLDivElement> {
40
44
  */
41
45
  invalidText?: string;
42
46
  }
43
- declare const Search: ({ onSearch, searchResults, state, defaultValue, className, placeholder, searchButtonText, loadingText, invalidText, getAllResultsText, getAllResultsLink, ...props }: React.PropsWithChildren<SearchProps>) => import("react/jsx-runtime").JSX.Element;
47
+ declare const Search: ({ onSearch, onCancel, searchResults, state, defaultValue, className, placeholder, searchButtonText, loadingText, invalidText, getAllResultsText, getAllResultsLink, ...props }: React.PropsWithChildren<SearchProps>) => import("react/jsx-runtime").JSX.Element;
44
48
  export default Search;
@@ -1,145 +1,149 @@
1
1
  import { jsx as a, jsxs as u } from "react/jsx-runtime";
2
- import i, { useEffect as y } from "react";
3
- import { getCommonProps as V, px as j, encodeURLSearchParams as g } from "../../utils/index.js";
2
+ import c, { useEffect as V } from "react";
3
+ import { getCommonProps as j, px as D, encodeURLSearchParams as I } from "../../utils/index.js";
4
4
  import f from "../../node_modules/classnames/index.js";
5
- import D from "../Input/Input.js";
6
- import H from "../Link/Link.js";
7
- import O from "./SearchResults/SearchResults.js";
8
- import { TextVariants as A } from "../Text/types.js";
9
- import F from "../Text/Text.js";
10
- import { useOnClickOutside as K } from "../../node_modules/usehooks-ts/dist/index.js";
11
- import { HeaderContext as M } from "../../site-furniture/Header/Header.js";
12
- import { SearchButton as U } from "./SearchButton.js";
13
- import q from "../../node_modules/react-transition-group/esm/CSSTransition.js";
5
+ import H from "../Input/Input.js";
6
+ import O from "../Link/Link.js";
7
+ import A from "./SearchResults/SearchResults.js";
8
+ import { TextVariants as F } from "../Text/types.js";
9
+ import K from "../Text/Text.js";
10
+ import { useOnClickOutside as M } from "../../node_modules/usehooks-ts/dist/index.js";
11
+ import { HeaderContext as U } from "../../site-furniture/Header/Header.js";
12
+ import { SearchButton as q } from "./SearchButton.js";
13
+ import z from "../../node_modules/react-transition-group/esm/CSSTransition.js";
14
14
  const ne = ({
15
- onSearch: p,
16
- searchResults: C = [],
17
- state: c = "idle",
18
- defaultValue: I = "",
19
- className: E,
20
- placeholder: R = "",
21
- searchButtonText: l = "Search",
22
- loadingText: b = "Search In Progress...",
23
- invalidText: w = "Invalid search",
24
- getAllResultsText: k = (e) => `View all results for ${e}`,
25
- getAllResultsLink: _ = (e) => `/Search?Search=${e}`,
26
- ...S
15
+ onSearch: _,
16
+ onCancel: i,
17
+ searchResults: E = [],
18
+ state: l = "idle",
19
+ defaultValue: R = "",
20
+ className: b,
21
+ placeholder: w = "",
22
+ searchButtonText: d = "Search",
23
+ loadingText: C = "Search In Progress...",
24
+ invalidText: k = "Invalid search",
25
+ getAllResultsText: L = (r) => `View all results for ${r}`,
26
+ getAllResultsLink: S = (r) => `/Search?Search=${r}`,
27
+ ...v
27
28
  }) => {
28
29
  var N;
29
- const { className: e, "data-testid": d, ...L } = V(S, "Search"), o = i.useContext(M), m = i.useRef(null), h = i.useRef(null), v = i.useRef(null), t = o.isSearchExpanded, n = (N = m.current) == null ? void 0 : N.value, T = p ? (r) => {
30
- p(r.target.value);
30
+ const { className: r, "data-testid": m, ...P } = j(v, "Search"), o = c.useContext(U), h = c.useRef(null), p = c.useRef(null), x = c.useRef(null), t = o.isSearchExpanded, s = (N = h.current) == null ? void 0 : N.value, T = _ ? (e) => {
31
+ _(e.target.value);
31
32
  } : void 0;
32
- K(v, () => $(!1));
33
- const x = (r) => {
34
- var s;
35
- if (r.stopPropagation(), r.key === "Enter") {
36
- if (r.preventDefault(), n && n.length > 2) {
37
- const P = g(_(n));
38
- window.location.href = P;
33
+ M(x, (e) => {
34
+ i == null || i(), g(!1), e.stopPropagation();
35
+ });
36
+ const $ = (e) => {
37
+ var n;
38
+ if (e.stopPropagation(), e.key === "Enter") {
39
+ if (e.preventDefault(), s && s.length > 2) {
40
+ const y = I(S(s));
41
+ window.location.href = y;
39
42
  }
40
- r.currentTarget instanceof HTMLAnchorElement && r.currentTarget.click();
43
+ e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.click();
41
44
  }
42
- r.key === "Escape" && (o.setIsSearchExpanded(!1), (s = h.current) == null || s.reset());
45
+ e.key === "Escape" && (o.setIsSearchExpanded(!1), (n = p.current) == null || n.reset());
43
46
  };
44
- y(() => {
45
- var r;
47
+ V(() => {
48
+ var e;
46
49
  if (t) {
47
- (r = m.current) == null || r.focus();
50
+ (e = h.current) == null || e.focus();
48
51
  return;
49
52
  }
50
53
  }, [t]);
51
- const $ = (r) => {
52
- var s;
53
- o.setIsSearchExpanded(r), (s = h.current) == null || s.reset();
54
+ const g = (e) => {
55
+ var n;
56
+ o.setIsSearchExpanded(e), (n = p.current) == null || n.reset();
54
57
  };
55
- return /* @__PURE__ */ a("div", { className: `${e}__container`, children: /* @__PURE__ */ u(
58
+ return /* @__PURE__ */ a("div", { className: `${r}__container`, children: /* @__PURE__ */ u(
56
59
  "div",
57
60
  {
58
61
  onClick: () => o.setIsSearchExpanded(!0),
59
- className: `${e}__container__inner`,
60
- ref: v,
62
+ className: `${r}__container__inner`,
63
+ ref: x,
61
64
  children: [
62
- /* @__PURE__ */ a(F, { variant: A.heading4, className: `${e}__container__inner__label`, children: l }),
65
+ /* @__PURE__ */ a(K, { variant: F.heading4, className: `${r}__container__inner__label`, children: d }),
63
66
  /* @__PURE__ */ a(
64
67
  "div",
65
68
  {
66
- ...L,
67
- className: f(e, E, { [`${e}--active`]: t }),
68
- "data-testid": d,
69
+ ...P,
70
+ className: f(r, b, { [`${r}--active`]: t }),
71
+ "data-testid": m,
69
72
  role: "search",
70
- ...S,
73
+ ...v,
71
74
  children: /* @__PURE__ */ u(
72
75
  "form",
73
76
  {
74
- "data-testid": `${d}-form`,
75
- className: f(`${e}__form`, {
76
- [`${e}__form--active`]: t
77
+ "data-testid": `${m}-form`,
78
+ className: f(`${r}__form`, {
79
+ [`${r}__form--active`]: t
77
80
  }),
78
- ref: h,
81
+ ref: p,
79
82
  children: [
80
83
  /* @__PURE__ */ u(
81
84
  "div",
82
85
  {
83
- className: f(`${e}__content-wrapper`, {
84
- [`${e}__content-wrapper--active`]: t
86
+ className: f(`${r}__content-wrapper`, {
87
+ [`${r}__content-wrapper--active`]: t
85
88
  }),
86
89
  role: "combobox",
87
90
  "aria-haspopup": "listbox",
88
91
  children: [
89
92
  /* @__PURE__ */ a(
90
- q,
93
+ z,
91
94
  {
92
95
  in: t,
93
- classNames: `${j}-input`,
96
+ classNames: `${D}-input`,
94
97
  addEndListener: () => {
95
98
  },
96
99
  children: /* @__PURE__ */ a(
97
- D,
100
+ H,
98
101
  {
99
102
  "aria-hidden": !t,
100
- className: `${e}__input`,
103
+ className: `${r}__input`,
101
104
  id: "search-input",
102
105
  hideLabel: !0,
103
- labelText: l,
104
- placeholder: t ? R : "",
106
+ labelText: d,
107
+ placeholder: t ? w : "",
105
108
  type: "text",
106
- defaultValue: I,
107
- invalid: c === "invalid",
108
- invalidText: w,
109
- onKeyDown: x,
109
+ defaultValue: R,
110
+ invalid: l === "invalid",
111
+ invalidText: k,
112
+ onKeyDown: $,
110
113
  onChange: T,
111
- ref: m
114
+ ref: h
112
115
  }
113
116
  )
114
117
  }
115
118
  ),
116
119
  /* @__PURE__ */ a(
117
- U,
120
+ q,
118
121
  {
119
- className: e,
120
- searchButtonText: l,
121
- state: c,
122
- testId: d,
122
+ className: r,
123
+ searchButtonText: d,
124
+ state: l,
125
+ testId: m,
123
126
  isSearchExpanded: t,
124
- setIsSearchExpanded: $
127
+ setIsSearchExpanded: g,
128
+ onCancel: i
125
129
  }
126
130
  )
127
131
  ]
128
132
  }
129
133
  ),
130
- n && n.length > 2 ? /* @__PURE__ */ a(
131
- O,
134
+ s && s.length > 2 ? /* @__PURE__ */ a(
135
+ A,
132
136
  {
133
- autoCompleteResults: C,
134
- isLoading: c === "loading",
135
- loadingText: b,
136
- onKeyDown: x,
137
- userInputValue: n,
138
- children: /* @__PURE__ */ a("li", { className: `${e}__result`, children: /* @__PURE__ */ a(
139
- H,
137
+ autoCompleteResults: E,
138
+ isLoading: l === "loading",
139
+ loadingText: C,
140
+ onKeyDown: $,
141
+ userInputValue: s,
142
+ children: /* @__PURE__ */ a("li", { className: `${r}__result`, children: /* @__PURE__ */ a(
143
+ O,
140
144
  {
141
- href: ((r) => g(_(r)))(n),
142
- children: /* @__PURE__ */ a("p", { children: k(n) })
145
+ href: ((e) => I(S(e)))(s),
146
+ children: /* @__PURE__ */ a("p", { children: L(s) })
143
147
  }
144
148
  ) }, "viewAllSearchResults")
145
149
  }
@@ -1,7 +1,7 @@
1
1
  import { SearchProps } from './Search';
2
2
  import { ComponentProps } from 'react';
3
- export declare const SearchButton: ({ state, isSearchExpanded, setIsSearchExpanded, searchButtonText, className, testId, ...props }: {
3
+ export declare const SearchButton: ({ state, isSearchExpanded, setIsSearchExpanded, searchButtonText, className, testId, onCancel, ...props }: {
4
4
  testId: string;
5
5
  isSearchExpanded: boolean;
6
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;
7
+ } & Pick<SearchProps, "onCancel" | "state" | "searchButtonText"> & import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,41 +1,42 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import _ from "../../assets/search.svg.js";
3
- import b from "../../assets/close.svg.js";
4
- const m = ({
5
- state: l,
6
- isSearchExpanded: i,
7
- setIsSearchExpanded: u,
8
- searchButtonText: e,
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import e from "../../assets/search.svg.js";
3
+ import l from "../../assets/close.svg.js";
4
+ const p = ({
5
+ state: $,
6
+ isSearchExpanded: u,
7
+ setIsSearchExpanded: _,
8
+ searchButtonText: a,
9
9
  className: t,
10
10
  testId: o,
11
- ...a
12
- }) => i ? i ? /* @__PURE__ */ n(
11
+ onCancel: i,
12
+ ...b
13
+ }) => u ? u ? /* @__PURE__ */ r(
13
14
  "button",
14
15
  {
15
- ...a,
16
+ ...b,
16
17
  type: "button",
17
18
  "data-testid": `${o}-close-button`,
18
19
  "aria-label": "Close Search",
19
20
  className: `${t}__button ${t}__button--close`,
20
- onClick: (r) => {
21
- u(!1), r.stopPropagation();
21
+ onClick: (n) => {
22
+ i == null || i(), _(!1), n.stopPropagation();
22
23
  },
23
- children: /* @__PURE__ */ n(b, { "data-testid": `${o}-form-icon`, className: `${t}__button__icon` })
24
+ children: /* @__PURE__ */ r(l, { "data-testid": `${o}-form-icon`, className: `${t}__button__icon` })
24
25
  }
25
- ) : null : /* @__PURE__ */ n(
26
+ ) : null : /* @__PURE__ */ r(
26
27
  "button",
27
28
  {
28
- ...a,
29
+ ...b,
29
30
  type: "button",
30
31
  "data-testid": `${o}-button`,
31
- "aria-label": e,
32
+ "aria-label": a,
32
33
  className: `${t}__button ${t}__button--search`,
33
- onClick: (r) => {
34
- u(!0), r.stopPropagation();
34
+ onClick: (n) => {
35
+ _(!0), n.stopPropagation();
35
36
  },
36
- children: /* @__PURE__ */ n(_, { "data-testid": `${o}-button-icon`, className: `${t}__button__icon` })
37
+ children: /* @__PURE__ */ r(e, { "data-testid": `${o}-button-icon`, className: `${t}__button__icon` })
37
38
  }
38
39
  );
39
40
  export {
40
- m as SearchButton
41
+ p as SearchButton
41
42
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { PaddingTokens as f, SpacingTokens as l, defaultYear as p, emailValidation as s, encodeURLSearchParams as m, findChildrenExcludingTypes as d, findChildrenOfType as u, generatePaddingClassName as x, getCommonProps as i, noOp as n, px as g, useNormalizedInputProps as c } from "./utils/index.js";
1
+ import { PaddingTokens as f, SpacingTokens as p, defaultYear as l, emailValidation as s, encodeURLSearchParams as m, findChildrenExcludingTypes as d, findChildrenOfType as u, generatePaddingClassName as i, getCommonProps as n, noOp as x, px as g, useNormalizedInputProps as c } from "./utils/index.js";
2
2
  import { default as C } from "./pages/Page.js";
3
3
  import { default as P } from "./components/Button/Button.js";
4
- import { ButtonVariants as b } from "./components/Button/types.js";
5
- import { default as k } from "./components/IconButton/IconButton.js";
4
+ import { ButtonVariants as T } from "./components/Button/types.js";
5
+ import { default as b } from "./components/IconButton/IconButton.js";
6
6
  import { default as B } from "./components/ErrorBoundary/ErrorBoundary.js";
7
- import { default as h } from "./site-furniture/Footer/Footer.js";
8
- import { Grid as w } from "./components/Grid/Grid.js";
9
- import { default as A } from "./site-furniture/Header/Header.js";
7
+ import { default as N } from "./site-furniture/Footer/Footer.js";
8
+ import { Grid as v } from "./components/Grid/Grid.js";
9
+ import { default as y } from "./site-furniture/Header/Header.js";
10
10
  import { default as G } from "./components/Navigation/Navigation.js";
11
11
  import { default as H } from "./components/Navigation/NavigationItem/NavigationItem.js";
12
12
  import { default as O } from "./components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
@@ -20,70 +20,73 @@ import { default as _ } from "./components/LinkList/LinkList.js";
20
20
  import { default as ee } from "./components/Row/Row.js";
21
21
  import { default as re } from "./components/GridItem/GridItem.js";
22
22
  import { GridItemAlign as ae } from "./components/GridItem/types.js";
23
- import { default as le } from "./components/Search/Search.js";
23
+ import { default as pe } from "./components/Search/Search.js";
24
24
  import { default as se } from "./components/Select/Select.js";
25
25
  import { default as de } from "./components/SplitPanel/SplitPanel.js";
26
- import { default as xe } from "./patterns/Subscribe/Subscribe.js";
27
- import { SubscriptionState as ne } from "./patterns/Subscribe/types.js";
26
+ import { default as ie } from "./patterns/Subscribe/Subscribe.js";
27
+ import { SubscriptionState as xe } from "./patterns/Subscribe/types.js";
28
28
  import { default as ce } from "./patterns/Social/Social.js";
29
29
  import { default as Ce } from "./patterns/ViewingsList/ViewingsList.js";
30
30
  import { default as Pe } from "./components/Modal/Modal.js";
31
- import { default as be } from "./components/Drawer/Drawer.js";
32
- import { default as ke } from "./components/Pagination/Pagination.js";
31
+ import { default as Te } from "./components/Drawer/Drawer.js";
32
+ import { default as be } from "./components/Pagination/Pagination.js";
33
33
  import { default as Be } from "./patterns/ViewingsList/StatefulViewingsList.js";
34
- import { TextVariants as he } from "./components/Text/types.js";
35
- import { default as we } from "./components/Text/Text.js";
36
- import { TextSymbolVariants as Ae } from "./components/TextSymbol/types.js";
34
+ import { TextVariants as Ne } from "./components/Text/types.js";
35
+ import { default as ve } from "./components/Text/Text.js";
36
+ import { TextSymbolVariants as ye } from "./components/TextSymbol/types.js";
37
37
  import { default as Ge } from "./components/TextSymbol/TextSymbol.js";
38
38
  import { default as He } from "./components/Accordion/Accordion.js";
39
39
  import { default as Oe } from "./components/Accordion/AccordionItem.js";
40
- import { default as Ue } from "./patterns/UserManagement/UserManagement.js";
41
- import { AuthState as Fe } from "./patterns/UserManagement/types.js";
42
- import { SupportedLanguages as Ye } from "./types/commonTypes.js";
43
- import { default as qe } from "./components/Breadcrumb/Breadcrumb.js";
40
+ import { AccordionItemVariant as Ue, AccordionVariants as ze } from "./components/Accordion/types.js";
41
+ import { default as We } from "./patterns/UserManagement/UserManagement.js";
42
+ import { AuthState as je } from "./patterns/UserManagement/types.js";
43
+ import { SupportedLanguages as Je } from "./types/commonTypes.js";
44
+ import { default as Qe } from "./components/Breadcrumb/Breadcrumb.js";
44
45
  import "react/jsx-runtime";
45
46
  import "./node_modules/classnames/index.js";
46
47
  import "react";
47
- import { default as Ke } from "./components/Dropdown/Dropdown.js";
48
- import { default as Xe } from "./components/Video/Video.js";
49
- import { default as _e } from "./patterns/LanguageSelector/LanguageSelector.js";
50
- import { default as eo } from "./components/ContentPeek/ContentPeek.js";
51
- import { default as ro } from "./components/Collapsible/Collapsible.js";
52
- import { default as ao } from "./components/Collapsible/CollapsibleContent.js";
53
- import { default as lo } from "./components/Collapsible/CollapsibleTrigger.js";
54
- import { SeldonProvider as so } from "./providers/SeldonProvider.js";
55
- import { default as uo } from "./components/PageContentWrapper/PageContentWrapper.js";
56
- import { default as io } from "./components/Carousel/Carousel.js";
57
- import { default as go } from "./components/Carousel/CarouselContent.js";
58
- import { default as So } from "./components/Carousel/CarouselItem.js";
59
- import { default as Lo } from "./components/Carousel/CarouselDots.js";
48
+ import { default as Ze } from "./components/Dropdown/Dropdown.js";
49
+ import { default as $e } from "./components/Video/Video.js";
50
+ import { default as oo } from "./patterns/LanguageSelector/LanguageSelector.js";
51
+ import { default as to } from "./components/ContentPeek/ContentPeek.js";
52
+ import { default as fo } from "./components/Collapsible/Collapsible.js";
53
+ import { default as lo } from "./components/Collapsible/CollapsibleContent.js";
54
+ import { default as mo } from "./components/Collapsible/CollapsibleTrigger.js";
55
+ import { SeldonProvider as io } from "./providers/SeldonProvider.js";
56
+ import { default as xo } from "./components/PageContentWrapper/PageContentWrapper.js";
57
+ import { default as co } from "./components/Carousel/Carousel.js";
58
+ import { default as Co } from "./components/Carousel/CarouselContent.js";
59
+ import { default as Po } from "./components/Carousel/CarouselItem.js";
60
+ import { default as To } from "./components/Carousel/CarouselDots.js";
60
61
  export {
61
62
  He as Accordion,
62
63
  Oe as AccordionItem,
63
- Fe as AuthState,
64
- qe as Breadcrumb,
64
+ Ue as AccordionItemVariant,
65
+ ze as AccordionVariants,
66
+ je as AuthState,
67
+ Qe as Breadcrumb,
65
68
  P as Button,
66
- b as ButtonVariants,
67
- io as Carousel,
68
- go as CarouselContent,
69
- Lo as CarouselDots,
70
- So as CarouselItem,
71
- ro as Collapsible,
72
- ao as CollapsibleContent,
73
- lo as CollapsibleTrigger,
74
- eo as ContentPeek,
75
- be as Drawer,
76
- Ke as Dropdown,
69
+ T as ButtonVariants,
70
+ co as Carousel,
71
+ Co as CarouselContent,
72
+ To as CarouselDots,
73
+ Po as CarouselItem,
74
+ fo as Collapsible,
75
+ lo as CollapsibleContent,
76
+ mo as CollapsibleTrigger,
77
+ to as ContentPeek,
78
+ Te as Drawer,
79
+ Ze as Dropdown,
77
80
  B as ErrorBoundary,
78
- h as Footer,
79
- w as Grid,
81
+ N as Footer,
82
+ v as Grid,
80
83
  re as GridItem,
81
84
  ae as GridItemAlign,
82
- A as Header,
85
+ y as Header,
83
86
  F as HeroBanner,
84
- k as IconButton,
87
+ b as IconButton,
85
88
  Y as Input,
86
- _e as LanguageSelector,
89
+ oo as LanguageSelector,
87
90
  q as Link,
88
91
  X as LinkBlock,
89
92
  _ as LinkList,
@@ -95,34 +98,34 @@ export {
95
98
  U as NavigationList,
96
99
  f as PaddingTokens,
97
100
  C as Page,
98
- uo as PageContentWrapper,
99
- ke as Pagination,
101
+ xo as PageContentWrapper,
102
+ be as Pagination,
100
103
  ee as Row,
101
- le as Search,
102
- so as SeldonProvider,
104
+ pe as Search,
105
+ io as SeldonProvider,
103
106
  se as Select,
104
107
  ce as Social,
105
- l as SpacingTokens,
108
+ p as SpacingTokens,
106
109
  de as SplitPanel,
107
110
  Be as StatefulViewingsList,
108
- xe as Subscribe,
109
- ne as SubscriptionState,
110
- Ye as SupportedLanguages,
111
- we as Text,
112
- Ae as TextSymbolVariants,
111
+ ie as Subscribe,
112
+ xe as SubscriptionState,
113
+ Je as SupportedLanguages,
114
+ ve as Text,
115
+ ye as TextSymbolVariants,
113
116
  Ge as TextSymbols,
114
- he as TextVariants,
115
- Ue as UserManagement,
116
- Xe as Video,
117
+ Ne as TextVariants,
118
+ We as UserManagement,
119
+ $e as Video,
117
120
  Ce as ViewingsList,
118
- p as defaultYear,
121
+ l as defaultYear,
119
122
  s as emailValidation,
120
123
  m as encodeURLSearchParams,
121
124
  d as findChildrenExcludingTypes,
122
125
  u as findChildrenOfType,
123
- x as generatePaddingClassName,
124
- i as getCommonProps,
125
- n as noOp,
126
+ i as generatePaddingClassName,
127
+ n as getCommonProps,
128
+ x as noOp,
126
129
  g as px,
127
130
  c as useNormalizedInputProps
128
131
  };
@@ -23,7 +23,6 @@ const j = ({
23
23
  }) => /* @__PURE__ */ e(k, { ...m, children: /* @__PURE__ */ e(
24
24
  w,
25
25
  {
26
- variation: "sm",
27
26
  hasTransition: !0,
28
27
  id: a != null ? a : "language-selector-accordion",
29
28
  label: /* @__PURE__ */ e(P, { variant: E.snwHeaderLink, children: t }),
@@ -1,13 +1,13 @@
1
1
  @use '../../allPartials' as *;
2
2
 
3
3
  .#{$px}-accordion {
4
- border-top: 1px solid $keyline-gray;
4
+ border-top: 1px solid $light-gray;
5
5
  margin-bottom: 10px;
6
6
  width: 100%;
7
7
  }
8
8
 
9
9
  .#{$px}-accordion-item {
10
- padding: $spacing-sm;
10
+ padding: $spacing-sm 0;
11
11
  width: 100%;
12
12
 
13
13
  svg {
@@ -15,7 +15,7 @@
15
15
  }
16
16
 
17
17
  &__border-bottom {
18
- border-bottom: 1px solid $keyline-gray;
18
+ border-bottom: 1px solid $light-gray;
19
19
  }
20
20
 
21
21
  &[data-state='open'] {
@@ -105,12 +105,12 @@
105
105
  &__text {
106
106
  flex: auto;
107
107
 
108
- @include text($body1);
108
+ @include text($body2);
109
109
  @include DistinctDisplay;
110
110
  }
111
111
 
112
112
  &__text--lg {
113
- @include text($heading3);
113
+ @include text($body1);
114
114
  }
115
115
 
116
116
  &__icon {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.67.1",
3
+ "version": "1.68.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"