@phillips/seldon 1.85.1 → 1.87.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,5 +1,5 @@
1
- import { jsx as a, jsxs as f } from "react/jsx-runtime";
2
- import i, { useEffect as V } from "react";
1
+ import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
+ import c, { useEffect as V } from "react";
3
3
  import { getCommonProps as j, px as D, encodeURLSearchParams as I } from "../../utils/index.js";
4
4
  import _ from "../../node_modules/classnames/index.js";
5
5
  import H from "../Input/Input.js";
@@ -13,28 +13,28 @@ import { SearchButton as q } from "./SearchButton.js";
13
13
  import z from "../../node_modules/react-transition-group/esm/CSSTransition.js";
14
14
  const ne = ({
15
15
  onSearch: S,
16
- onCancel: o,
16
+ onCancel: i,
17
17
  searchResults: R = [],
18
- state: c = "idle",
18
+ state: l = "idle",
19
19
  defaultValue: E = "",
20
20
  className: b,
21
21
  placeholder: w = "",
22
- searchButtonText: l = "Search",
22
+ searchButtonText: d = "Search",
23
23
  loadingText: C = "Search In Progress...",
24
- invalidText: L = "Invalid search",
24
+ invalidText: k = "Invalid search",
25
25
  getAllResultsText: P = (r) => `View all results for ${r}`,
26
26
  getAllResultsLink: v = (r) => `/Search?Search=${r}`,
27
27
  ...x
28
28
  }) => {
29
29
  var N;
30
- const { className: r, "data-testid": d, ...T } = j(x, "Search"), m = i.useContext(U), h = i.useRef(null), p = i.useRef(null), $ = i.useRef(null), t = m.isSearchExpanded, s = (N = h.current) == null ? void 0 : N.value, k = S ? (e) => {
30
+ const { className: r, "data-testid": m, ...L } = j(x, "Search"), p = c.useContext(U), f = c.useRef(null), h = c.useRef(null), g = c.useRef(null), a = p.isSearchExpanded, s = (N = f.current) == null ? void 0 : N.value, T = S ? (e) => {
31
31
  S(e.target.value);
32
32
  } : void 0;
33
- M($, (e) => {
34
- o == null || o(), u(!1), e.stopPropagation();
33
+ M(g, (e) => {
34
+ i == null || i(), n(!1), e.stopPropagation();
35
35
  });
36
- const g = (e) => {
37
- var n;
36
+ const $ = (e) => {
37
+ var o;
38
38
  if (e.stopPropagation(), e.key === "Enter") {
39
39
  if (e.preventDefault(), s && s.length > 2) {
40
40
  const y = I(v(s));
@@ -42,113 +42,124 @@ const ne = ({
42
42
  }
43
43
  e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.click();
44
44
  }
45
- e.key === "Escape" && ((n = p.current) == null || n.reset(), m.setIsSearchExpanded(!1));
45
+ e.key === "Escape" && ((o = h.current) == null || o.reset(), p.setIsSearchExpanded(!1));
46
46
  };
47
47
  V(() => {
48
48
  var e;
49
- if (t) {
50
- (e = h.current) == null || e.focus();
49
+ if (a) {
50
+ (e = f.current) == null || e.focus();
51
51
  return;
52
52
  }
53
- }, [t]);
54
- const u = (e) => {
55
- var n;
56
- (n = p.current) == null || n.reset(), m.setIsSearchExpanded(e);
53
+ }, [a]);
54
+ const n = (e) => {
55
+ var o;
56
+ (o = h.current) == null || o.reset(), p.setIsSearchExpanded(e);
57
57
  };
58
- return /* @__PURE__ */ a("div", { className: `${r}__container`, children: /* @__PURE__ */ f("div", { className: `${r}__container__inner`, ref: $, children: [
59
- /* @__PURE__ */ a(K, { variant: F.heading4, className: `${r}__container__inner__label`, children: l }),
60
- /* @__PURE__ */ a(
61
- "div",
62
- {
63
- ...T,
64
- className: _(r, b, { [`${r}--active`]: t }),
65
- "data-testid": d,
66
- role: "search",
67
- ...x,
68
- children: /* @__PURE__ */ f(
69
- "form",
58
+ return /* @__PURE__ */ t("div", { className: `${r}__container`, children: /* @__PURE__ */ u(
59
+ "div",
60
+ {
61
+ className: `${r}__container__inner`,
62
+ ref: g,
63
+ onClick: (e) => {
64
+ a || (n(!0), e.stopPropagation());
65
+ },
66
+ children: [
67
+ /* @__PURE__ */ t(K, { variant: F.heading4, className: `${r}__container__inner__label`, children: d }),
68
+ /* @__PURE__ */ t(
69
+ "div",
70
70
  {
71
- "data-testid": `${d}-form`,
72
- className: _(`${r}__form`, {
73
- [`${r}__form--active`]: t
74
- }),
75
- ref: p,
76
- children: [
77
- /* @__PURE__ */ f(
78
- "div",
79
- {
80
- className: _(`${r}__content-wrapper`, {
81
- [`${r}__content-wrapper--active`]: t
82
- }),
83
- role: "combobox",
84
- "aria-haspopup": "listbox",
85
- children: [
86
- /* @__PURE__ */ a(
87
- z,
88
- {
89
- in: t,
90
- classNames: `${D}-input`,
91
- addEndListener: () => {
92
- },
93
- children: /* @__PURE__ */ a(
94
- H,
71
+ ...L,
72
+ className: _(r, b, { [`${r}--active`]: a }),
73
+ "data-testid": m,
74
+ role: "search",
75
+ ...x,
76
+ children: /* @__PURE__ */ u(
77
+ "form",
78
+ {
79
+ "data-testid": `${m}-form`,
80
+ className: _(`${r}__form`, {
81
+ [`${r}__form--active`]: a
82
+ }),
83
+ ref: h,
84
+ children: [
85
+ /* @__PURE__ */ u(
86
+ "div",
87
+ {
88
+ className: _(`${r}__content-wrapper`, {
89
+ [`${r}__content-wrapper--active`]: a
90
+ }),
91
+ role: "combobox",
92
+ "aria-haspopup": "listbox",
93
+ children: [
94
+ /* @__PURE__ */ t(
95
+ z,
96
+ {
97
+ in: a,
98
+ classNames: `${D}-input`,
99
+ addEndListener: () => {
100
+ },
101
+ children: /* @__PURE__ */ t(
102
+ H,
103
+ {
104
+ "aria-hidden": !a,
105
+ className: `${r}__input`,
106
+ id: "search-input",
107
+ hideLabel: !0,
108
+ labelText: d,
109
+ placeholder: a ? w : "",
110
+ type: "text",
111
+ defaultValue: E,
112
+ invalid: l === "invalid",
113
+ invalidText: k,
114
+ onKeyDown: $,
115
+ onChange: T,
116
+ ref: f
117
+ }
118
+ )
119
+ }
120
+ ),
121
+ /* @__PURE__ */ t(
122
+ q,
95
123
  {
96
- "aria-hidden": !t,
97
- className: `${r}__input`,
98
- id: "search-input",
99
- hideLabel: !0,
100
- labelText: l,
101
- placeholder: t ? w : "",
102
- type: "text",
103
- defaultValue: E,
104
- invalid: c === "invalid",
105
- invalidText: L,
106
- onKeyDown: g,
107
- onChange: k,
108
- ref: h
124
+ className: r,
125
+ searchButtonText: d,
126
+ state: l,
127
+ testId: m,
128
+ isSearchExpanded: a,
129
+ setIsSearchExpanded: n,
130
+ onCancel: i
109
131
  }
110
132
  )
111
- }
112
- ),
113
- /* @__PURE__ */ a(
114
- q,
115
- {
116
- className: r,
117
- searchButtonText: l,
118
- state: c,
119
- testId: d,
120
- isSearchExpanded: t,
121
- setIsSearchExpanded: u,
122
- onCancel: o
123
- }
124
- )
125
- ]
126
- }
127
- ),
128
- s && s.length > 2 ? /* @__PURE__ */ a(
129
- A,
130
- {
131
- autoCompleteResults: R,
132
- isLoading: c === "loading",
133
- loadingText: C,
134
- onKeyDown: g,
135
- userInputValue: s,
136
- closeSearch: u,
137
- children: /* @__PURE__ */ a("li", { className: `${r}__result`, children: /* @__PURE__ */ a(
138
- O,
133
+ ]
134
+ }
135
+ ),
136
+ s && s.length > 2 ? /* @__PURE__ */ t(
137
+ A,
139
138
  {
140
- href: ((e) => I(v(e)))(s),
141
- children: /* @__PURE__ */ a("p", { children: P(s) })
139
+ autoCompleteResults: R,
140
+ isLoading: l === "loading",
141
+ loadingText: C,
142
+ onKeyDown: $,
143
+ userInputValue: s,
144
+ closeSearch: n,
145
+ children: /* @__PURE__ */ t("li", { className: `${r}__result`, children: /* @__PURE__ */ t(
146
+ O,
147
+ {
148
+ onClick: () => n(!1),
149
+ href: ((e) => I(v(e)))(s),
150
+ children: /* @__PURE__ */ t("p", { children: P(s) })
151
+ }
152
+ ) }, "viewAllSearchResults")
142
153
  }
143
- ) }, "viewAllSearchResults")
144
- }
145
- ) : null
146
- ]
154
+ ) : null
155
+ ]
156
+ }
157
+ )
147
158
  }
148
159
  )
149
- }
150
- )
151
- ] }) });
160
+ ]
161
+ }
162
+ ) });
152
163
  };
153
164
  export {
154
165
  ne as default
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps } from 'react';
2
- export interface TabTriggerProps extends ComponentProps<'div'> {
2
+ export interface TabTriggerProps extends Omit<ComponentProps<'div'>, 'onClick'> {
3
3
  /**
4
4
  * Value corresponding to the tab
5
5
  */
@@ -9,7 +9,7 @@ export interface TabTriggerProps extends ComponentProps<'div'> {
9
9
  * @param value
10
10
  * @returns
11
11
  */
12
- onTabClick?: (value: string) => void;
12
+ onClick?: (value: string) => void;
13
13
  /**
14
14
  * Tab label
15
15
  */
@@ -1,12 +1,19 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as g } from "react";
3
- import { getCommonProps as f } from "../../utils/index.js";
4
- import { Trigger as n } from "../../node_modules/@radix-ui/react-tabs/dist/index.js";
5
- const p = g(({ value: r, onTabClick: o, children: a, ...s }, e) => {
6
- const m = () => {
7
- o && o(r);
8
- }, { className: t } = f(s, "TabsContainer");
9
- return /* @__PURE__ */ i(n, { value: r, className: `${t}__tabs-trigger`, onClick: m, ref: e, children: a });
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Trigger as g } from "../../node_modules/@radix-ui/react-tabs/dist/index.js";
3
+ import { forwardRef as f } from "react";
4
+ import { getCommonProps as i } from "../../utils/index.js";
5
+ const p = f(({ value: a, onClick: r, children: s, ...e }, m) => {
6
+ const { className: o } = i(e, "TabsContainer");
7
+ return /* @__PURE__ */ t(
8
+ g,
9
+ {
10
+ value: a,
11
+ className: `${o}__tabs-trigger`,
12
+ onClick: () => r == null ? void 0 : r(a),
13
+ ref: m,
14
+ children: s
15
+ }
16
+ );
10
17
  });
11
18
  p.displayName = "TabTrigger";
12
19
  export {
@@ -16,4 +16,5 @@ export declare const Playground: {
16
16
  argTypes: {};
17
17
  };
18
18
  export declare const BrowseTabSelected: () => import("react/jsx-runtime").JSX.Element;
19
+ export declare const ControlledTabs: () => import("react/jsx-runtime").JSX.Element;
19
20
  export declare const ComponentLabels: () => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { ComponentProps } from 'react';
2
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
2
3
  export interface Tab {
3
4
  /**
4
5
  * button label
@@ -15,7 +16,7 @@ export interface Tab {
15
16
  * @param {TabsContainerProps} props - The component props containing an array of tabs.
16
17
  * @returns {JSX.Element} The rendered tab component.
17
18
  */
18
- export interface TabsContainerProps extends ComponentProps<'div'> {
19
+ export interface TabsContainerProps extends TabsPrimitive.TabsProps, Omit<ComponentProps<'div'>, 'dir'> {
19
20
  tabs: Tab[];
20
21
  /**
21
22
  * Specify the default tab
@@ -25,6 +26,10 @@ export interface TabsContainerProps extends ComponentProps<'div'> {
25
26
  * Aria-label for specific tab list view
26
27
  */
27
28
  tabListLabel?: string;
29
+ /**
30
+ * Optional value for controlled tabs
31
+ */
32
+ value?: string;
28
33
  /**
29
34
  * Optional handler when a tab is clicked
30
35
  */
@@ -1,30 +1,32 @@
1
- import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as d } from "react";
3
- import { getCommonProps as u } from "../../utils/index.js";
4
- import b from "../../node_modules/classnames/index.js";
5
- import { Root as T, List as N } from "../../node_modules/@radix-ui/react-tabs/dist/index.js";
6
- import g from "./TabTrigger.js";
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import { Root as u, List as b } from "../../node_modules/@radix-ui/react-tabs/dist/index.js";
3
+ import T from "../../node_modules/classnames/index.js";
4
+ import { forwardRef as N } from "react";
5
+ import { getCommonProps as g } from "../../utils/index.js";
7
6
  import { TextVariants as v } from "../Text/types.js";
8
- import _ from "../Text/Text.js";
9
- const x = d(
10
- ({ className: l, tabs: s = [], tabListLabel: m = "Sale Page Tabs", children: t, defaultValue: i, onTabClick: n, ...c }, f) => {
11
- const { className: a, ...p } = u(c, "TabsContainer");
12
- return /* @__PURE__ */ o(
13
- T,
7
+ import C from "../Text/Text.js";
8
+ import _ from "./TabTrigger.js";
9
+ const x = N(
10
+ ({ className: m, tabs: o = [], tabListLabel: i = "Sale Page Tabs", children: t, defaultValue: n, value: c, onTabClick: f, ...s }, d) => {
11
+ const { className: a, ...p } = g(s, "TabsContainer");
12
+ return /* @__PURE__ */ l(
13
+ u,
14
14
  {
15
- defaultValue: i || s[0].value,
15
+ ...s,
16
+ defaultValue: n || o[0].value,
17
+ value: c,
16
18
  ...p,
17
- className: b(`${a}`, l),
18
- ref: f,
19
+ className: T(`${a}`, m),
20
+ ref: d,
19
21
  children: [
20
- /* @__PURE__ */ o(N, { "aria-label": m, className: `${a}__tabs-list`, children: [
21
- s.map((e) => /* @__PURE__ */ r(
22
- g,
22
+ /* @__PURE__ */ l(b, { "aria-label": i, className: `${a}__tabs-list`, children: [
23
+ o.map((e) => /* @__PURE__ */ r(
24
+ _,
23
25
  {
24
26
  value: e.value,
25
27
  className: `${a}__tabs-trigger`,
26
- onTabClick: n,
27
- children: /* @__PURE__ */ r(_, { variant: v.label, children: e.label })
28
+ onClick: f,
29
+ children: /* @__PURE__ */ r(C, { variant: v.label, children: e.label })
28
30
  },
29
31
  e.value
30
32
  )),
@@ -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;
@@ -69,6 +69,12 @@
69
69
  margin-bottom: 0;
70
70
  }
71
71
 
72
+ a {
73
+ @include isHeaderMobile {
74
+ display: block;
75
+ }
76
+ }
77
+
72
78
  &--start,
73
79
  &--end {
74
80
  &__title {
@@ -7,7 +7,6 @@ $top-transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
7
7
  flex-direction: column;
8
8
  justify-content: left;
9
9
  opacity: 1;
10
- padding: $spacing-md 0;
11
10
 
12
11
  &--offscreen {
13
12
  opacity: 0;
@@ -74,7 +74,6 @@
74
74
  &__logo {
75
75
  align-self: center;
76
76
  margin: 0;
77
- padding-top: 6px; // small adjustment to center the logo
78
77
 
79
78
  svg {
80
79
  height: 20.58px; // 20.58px is the height of the logo's container to make logo 16px
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.85.1",
3
+ "version": "1.87.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"