@phillips/seldon 1.130.0 → 1.130.1

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,85 +1,85 @@
1
- import { jsx as t, jsxs as h } from "react/jsx-runtime";
2
- import s, { useEffect as T } from "react";
3
- import { getCommonProps as y, px as V, encodeURLSearchParams as $ } from "../../utils/index.js";
1
+ import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
+ import n, { useEffect as V } from "react";
3
+ import { getCommonProps as j, px as D, encodeURLSearchParams as $ } from "../../utils/index.js";
4
4
  import p from "../../node_modules/classnames/index.js";
5
- import j from "../Input/Input.js";
6
- import D from "../Link/Link.js";
7
- import H from "./SearchResults/SearchResults.js";
8
- import { TextVariants as O } from "../Text/types.js";
9
- import A from "../Text/Text.js";
10
- import { useOnClickOutside as F } from "../../node_modules/usehooks-ts/dist/index.js";
11
- import { HeaderContext as K } from "../../site-furniture/Header/Header.js";
12
- import { SearchButton as M } from "./SearchButton.js";
13
- import U from "../../node_modules/react-remove-scroll/dist/es2015/Combination.js";
14
- import Z from "../../node_modules/react-transition-group/esm/CSSTransition.js";
15
- const oe = ({
16
- onSearch: u,
17
- onCancel: _,
18
- searchResults: R = [],
19
- state: i = "idle",
20
- defaultValue: C = "",
21
- className: N,
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 Z } from "./SearchButton.js";
13
+ import q from "../../node_modules/react-remove-scroll/dist/es2015/Combination.js";
14
+ import z from "../../node_modules/react-transition-group/esm/CSSTransition.js";
15
+ const ie = ({
16
+ onSearch: _,
17
+ onCancel: S,
18
+ searchResults: N = [],
19
+ state: o = "idle",
20
+ defaultValue: w = "",
21
+ className: C,
22
22
  placeholder: I = "",
23
- searchButtonText: c = "Search",
23
+ searchButtonText: i = "Search",
24
24
  loadingText: E = "Search In Progress...",
25
25
  invalidText: b = "Invalid search",
26
- getAllResultsText: w = (e) => `View all results for ${e}`,
27
- getAllResultsLink: S = (e) => `/Search?Search=${e}`,
28
- ...v
26
+ getAllResultsText: P = (e) => `View all results for ${e}`,
27
+ getAllResultsLink: v = (e) => `/Search?Search=${e}`,
28
+ ...x
29
29
  }) => {
30
- const { className: e, "data-testid": l, ...P } = y(v, "Search"), d = s.useContext(K), m = s.useRef(null), f = s.useRef(null), x = s.useRef(null), a = d.isSearchExpanded, n = m.current?.value, k = u ? (r) => {
31
- u(r.target.value);
30
+ const { className: e, "data-testid": c, ...k } = j(x, "Search"), l = n.useContext(U), d = n.useRef(null), m = n.useRef(null), R = n.useRef(null), a = l.isSearchExpanded, s = d.current?.value, [L, u] = n.useState(!0), T = _ ? (r) => {
31
+ _(r.target.value);
32
32
  } : void 0;
33
- F(x, (r) => {
34
- _?.(), o(!1), r.stopPropagation();
33
+ M(R, (r) => {
34
+ S?.(), h(!1), r.stopPropagation();
35
35
  });
36
36
  const g = (r) => {
37
37
  if (r.stopPropagation(), r.key === "Enter") {
38
- if (r.preventDefault(), n && n.length > 2) {
39
- const L = $(S(n));
40
- o(!1), window.location.href = L;
38
+ if (r.preventDefault(), s && s.length > 2) {
39
+ const y = $(v(s));
40
+ u(!1), window.location.href = y;
41
41
  }
42
- r.currentTarget instanceof HTMLAnchorElement && (o(!1), r.currentTarget.click());
42
+ r.currentTarget instanceof HTMLAnchorElement && (u(!1), r.currentTarget.click());
43
43
  }
44
- r.key === "Escape" && (f.current?.reset(), d.setIsSearchExpanded(!1));
44
+ r.key === "Escape" && (m.current?.reset(), l.setIsSearchExpanded(!1));
45
45
  };
46
- T(() => {
46
+ V(() => {
47
47
  if (a) {
48
- m.current?.focus();
48
+ d.current?.focus();
49
49
  return;
50
50
  }
51
51
  }, [a]);
52
- const o = (r) => {
53
- f.current?.reset(), d.setIsSearchExpanded(r);
52
+ const h = (r) => {
53
+ m.current?.reset(), l.setIsSearchExpanded(r);
54
54
  };
55
- return /* @__PURE__ */ t(U, { enabled: a, allowPinchZoom: !0, removeScrollBar: !1, children: /* @__PURE__ */ t("div", { className: `${e}__container`, children: /* @__PURE__ */ h(
55
+ return /* @__PURE__ */ t(q, { enabled: a, allowPinchZoom: !0, removeScrollBar: !1, children: /* @__PURE__ */ t("div", { className: `${e}__container`, children: /* @__PURE__ */ f(
56
56
  "div",
57
57
  {
58
58
  className: `${e}__container__inner`,
59
- ref: x,
59
+ ref: R,
60
60
  onClick: (r) => {
61
- a || (o(!0), r.stopPropagation());
61
+ a || (h(!0), r.stopPropagation());
62
62
  },
63
63
  children: [
64
- /* @__PURE__ */ t(A, { variant: O.heading4, className: `${e}__container__inner__label`, children: c }),
64
+ /* @__PURE__ */ t(K, { variant: F.heading4, className: `${e}__container__inner__label`, children: i }),
65
65
  /* @__PURE__ */ t(
66
66
  "div",
67
67
  {
68
- ...P,
69
- className: p(e, N, { [`${e}--active`]: a }),
70
- "data-testid": l,
68
+ ...k,
69
+ className: p(e, C, { [`${e}--active`]: a }),
70
+ "data-testid": c,
71
71
  role: "search",
72
- ...v,
73
- children: /* @__PURE__ */ h(
72
+ ...x,
73
+ children: /* @__PURE__ */ f(
74
74
  "form",
75
75
  {
76
- "data-testid": `${l}-form`,
76
+ "data-testid": `${c}-form`,
77
77
  className: p(`${e}__form`, {
78
78
  [`${e}__form--active`]: a
79
79
  }),
80
- ref: f,
80
+ ref: m,
81
81
  children: [
82
- /* @__PURE__ */ h(
82
+ /* @__PURE__ */ f(
83
83
  "div",
84
84
  {
85
85
  className: p(`${e}__content-wrapper`, {
@@ -89,62 +89,61 @@ const oe = ({
89
89
  "aria-haspopup": "listbox",
90
90
  children: [
91
91
  /* @__PURE__ */ t(
92
- Z,
92
+ z,
93
93
  {
94
94
  in: a,
95
- classNames: `${V}-input`,
95
+ classNames: `${D}-input`,
96
96
  addEndListener: () => {
97
97
  },
98
98
  children: /* @__PURE__ */ t(
99
- j,
99
+ H,
100
100
  {
101
101
  "aria-hidden": !a,
102
102
  className: `${e}__input`,
103
103
  id: "search-input",
104
104
  hideLabel: !0,
105
- labelText: c,
105
+ labelText: i,
106
106
  placeholder: a ? I : "",
107
107
  type: "text",
108
- defaultValue: C,
109
- invalid: i === "invalid",
108
+ defaultValue: w,
109
+ invalid: o === "invalid",
110
110
  invalidText: b,
111
111
  onKeyDown: g,
112
- onChange: k,
113
- ref: m
112
+ onChange: T,
113
+ ref: d
114
114
  }
115
115
  )
116
116
  }
117
117
  ),
118
118
  /* @__PURE__ */ t(
119
- M,
119
+ Z,
120
120
  {
121
121
  className: e,
122
- searchButtonText: c,
123
- state: i,
124
- testId: l,
122
+ searchButtonText: i,
123
+ state: o,
124
+ testId: c,
125
125
  isSearchExpanded: a,
126
- setIsSearchExpanded: o,
127
- onCancel: _
126
+ setIsSearchExpanded: h,
127
+ onCancel: S
128
128
  }
129
129
  )
130
130
  ]
131
131
  }
132
132
  ),
133
- n && n.length > 2 ? /* @__PURE__ */ t(
134
- H,
133
+ a && L && s && s.length > 2 ? /* @__PURE__ */ t(
134
+ A,
135
135
  {
136
- autoCompleteResults: R,
137
- isLoading: i === "loading",
136
+ autoCompleteResults: N,
137
+ isLoading: o === "loading",
138
138
  loadingText: E,
139
139
  onKeyDown: g,
140
- userInputValue: n,
141
- closeSearch: o,
140
+ userInputValue: s,
141
+ closeSearch: u,
142
142
  children: /* @__PURE__ */ t("li", { className: `${e}__result`, children: /* @__PURE__ */ t(
143
- D,
143
+ O,
144
144
  {
145
- onClick: () => o(!1),
146
- href: ((r) => $(S(r)))(n),
147
- children: /* @__PURE__ */ t("p", { children: w(n) })
145
+ href: ((r) => $(v(r)))(s),
146
+ children: /* @__PURE__ */ t("p", { children: P(s) })
148
147
  }
149
148
  ) }, "viewAllSearchResults")
150
149
  }
@@ -159,5 +158,5 @@ const oe = ({
159
158
  ) }) });
160
159
  };
161
160
  export {
162
- oe as default
161
+ ie as default
163
162
  };
@@ -1,4 +1,4 @@
1
- import { __module as t } from "../../_virtual/index6.js";
1
+ import { __module as t } from "../../_virtual/index5.js";
2
2
  /*!
3
3
  Copyright (c) 2015 Jed Watson.
4
4
  Based on code that is Copyright 2013-2015, Facebook, Inc.
@@ -1,4 +1,4 @@
1
- import { __module as e } from "../../../../_virtual/index5.js";
1
+ import { __module as e } from "../../../../_virtual/index6.js";
2
2
  import { __require as o } from "./cjs/react-is.production.min.js";
3
3
  import { __require as t } from "./cjs/react-is.development.js";
4
4
  var r;
@@ -103,9 +103,10 @@ $snwHeaderLink: 'snwHeaderLink';
103
103
  $snwFlyoutLink: 'snwFlyoutLink';
104
104
  $snwHeadingHero1: 'snwHeadingHero1';
105
105
  $snwHeadingHero2: 'snwHeadingHero2';
106
- $text-tokens: $button, $link, $email, $label, $badge, $blockquote, $heading1, $heading2, $heading3, $heading4, $heading5,
107
- $title1, $title2, $title3, $title4, $body1, $body2, $body3, $string1, $string2, $string3, $snwFlyoutLink,
108
- $snwHeaderLink, $snwHeadingHero1, $snwHeadingHero2;
106
+ $text-tokens:
107
+ $button, $link, $email, $label, $badge, $blockquote, $heading1, $heading2, $heading3, $heading4, $heading5, $title1,
108
+ $title2, $title3, $title4, $body1, $body2, $body3, $string1, $string2, $string3, $snwFlyoutLink, $snwHeaderLink,
109
+ $snwHeadingHero1, $snwHeadingHero2;
109
110
 
110
111
  ////////////////////////
111
112
  /// Breakpoint TOKENS to be used for min-width comparisons, make sure they match BREAKPOINTS in constants.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.130.0",
3
+ "version": "1.130.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"