@phillips/seldon 1.91.0 → 1.92.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 +1,2 @@
1
1
  export { default as ContentPeek, type ContentPeekProps } from './ContentPeek';
2
+ export { HeightUnits as ContentPeekHeightUnits } from './utils';
@@ -1,54 +1,68 @@
1
- import { jsxs as c, Fragment as T, jsx as e } from "react/jsx-runtime";
2
- import { getCommonProps as _, findChildrenOfType as b, px as d } from "../../../utils/index.js";
3
- import x from "../../../node_modules/classnames/index.js";
4
- import l, { forwardRef as I, useState as $ } from "react";
5
- import { TextVariants as u } from "../../Text/types.js";
6
- import f from "../../Text/Text.js";
7
- import M from "../NavigationList/NavigationList.js";
8
- import O from "../../Accordion/Accordion.js";
9
- import y from "../../Accordion/AccordionItem.js";
10
- import { SSRMediaQuery as p } from "../../../providers/SeldonProvider/utils.js";
11
- import { AccordionItemVariant as S } from "../../Accordion/types.js";
12
- const C = ({ id: i, label: r, children: t }) => /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
13
- y,
14
- {
15
- hasTransition: !0,
16
- id: `accordion-item-${i}`,
17
- label: /* @__PURE__ */ e(f, { variant: u.snwHeaderLink, children: r }),
18
- variant: S.lg,
19
- children: t
20
- },
21
- `accordion-key-${r}`
22
- ) }), E = I(
23
- ({ id: i, label: r, children: t, className: g, onClick: v, ...h }, N) => {
24
- const { className: n, ...a } = _({ id: i }, "NavigationItemTrigger"), [m, s] = $(!1), o = b(t, M);
25
- return /* @__PURE__ */ c(T, { children: [
26
- /* @__PURE__ */ e(p.Media, { lessThan: "md", children: /* @__PURE__ */ e(C, { id: i, label: r, ...a, children: o ? l.cloneElement(o[0], {
27
- className: `${n}__submenu--mobile`
28
- }) : void 0 }) }),
29
- /* @__PURE__ */ e(p.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ c(
1
+ import { jsxs as u, Fragment as k, jsx as o } from "react/jsx-runtime";
2
+ import { getCommonProps as y, findChildrenOfType as E, px as h } from "../../../utils/index.js";
3
+ import L from "../../../node_modules/classnames/index.js";
4
+ import c, { forwardRef as M, useState as b } from "react";
5
+ import { TextVariants as N } from "../../Text/types.js";
6
+ import C from "../../Text/Text.js";
7
+ import w from "../NavigationList/NavigationList.js";
8
+ import A from "../../Accordion/Accordion.js";
9
+ import H from "../../Accordion/AccordionItem.js";
10
+ import { SSRMediaQuery as v } from "../../../providers/SeldonProvider/utils.js";
11
+ import { AccordionItemVariant as I } from "../../Accordion/types.js";
12
+ import { HeaderContext as x } from "../../../site-furniture/Header/Header.js";
13
+ const O = ({ id: m, label: i, children: l }) => {
14
+ const { isMenuOpen: d } = c.useContext(x);
15
+ return /* @__PURE__ */ o(A, { children: /* @__PURE__ */ o(
16
+ H,
17
+ {
18
+ hasTransition: !0,
19
+ id: `accordion-item-${m}`,
20
+ label: /* @__PURE__ */ o(C, { variant: N.snwHeaderLink, children: i }),
21
+ variant: I.lg,
22
+ children: l
23
+ },
24
+ `accordion-key-${i}`
25
+ ) }, `accordion-key-${i}-${d}`);
26
+ }, R = M(
27
+ ({ id: m, label: i, children: l, className: d, onClick: T, ..._ }, $) => {
28
+ const { className: s, ...f } = y({ id: m }, "NavigationItemTrigger"), [g, e] = b(!1), t = E(l, w), { closeMenu: n } = c.useContext(x);
29
+ return /* @__PURE__ */ u(k, { children: [
30
+ /* @__PURE__ */ o(v.Media, { lessThan: "md", children: /* @__PURE__ */ o(O, { id: m, label: i, ...f, children: t ? c.cloneElement(t[0], {
31
+ className: `${s}__submenu--mobile`,
32
+ onClick: (p) => {
33
+ var r, a;
34
+ (a = (r = t[0].props) == null ? void 0 : r.onClick) == null || a.call(r, p), e == null || e(!1), n == null || n();
35
+ }
36
+ }) : null }) }),
37
+ /* @__PURE__ */ o(v.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ u(
30
38
  "li",
31
39
  {
32
- ...a,
33
- ref: N,
34
- "aria-expanded": m,
35
- className: x(g, n, `${d}-nav__item`, {
36
- [`${n}--hovered`]: m
40
+ ...f,
41
+ ref: $,
42
+ "aria-expanded": g,
43
+ className: L(d, s, `${h}-nav__item`, {
44
+ [`${s}--hovered`]: g
37
45
  }),
38
- onClick: v,
39
- onMouseOver: () => s(!0),
40
- onMouseOut: () => s(!1),
41
- ...h,
46
+ onClick: T,
47
+ onMouseOver: () => e(!0),
48
+ onMouseOut: () => e(!1),
49
+ ..._,
42
50
  children: [
43
- /* @__PURE__ */ e("button", { className: `${d}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ e(f, { variant: u.snwHeaderLink, children: r }) }),
44
- o ? l.cloneElement(o[0], { className: `${n}__submenu` }) : void 0
51
+ /* @__PURE__ */ o("button", { className: `${h}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ o(C, { variant: N.snwHeaderLink, children: i }) }),
52
+ t ? c.cloneElement(t[0], {
53
+ className: `${s}__submenu`,
54
+ onClick: (p) => {
55
+ var r, a;
56
+ (a = (r = t[0].props) == null ? void 0 : r.onClick) == null || a.call(r, p), e == null || e(!1), n == null || n();
57
+ }
58
+ }) : null
45
59
  ]
46
60
  }
47
61
  ) })
48
62
  ] });
49
63
  }
50
64
  );
51
- E.displayName = "NavigationItemTrigger";
65
+ R.displayName = "NavigationItemTrigger";
52
66
  export {
53
- E as default
67
+ R as default
54
68
  };
@@ -16,6 +16,10 @@ export interface NavigationListProps extends React.ComponentProps<'ul'> {
16
16
  * Optional right section heading
17
17
  */
18
18
  rightSectionHeading?: string;
19
+ /**
20
+ * Rewrite the onClick event
21
+ * */
22
+ onClick?: React.MouseEventHandler<HTMLElement>;
19
23
  }
20
24
  declare const NavigationList: React.ForwardRefExoticComponent<Omit<NavigationListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
21
25
  export default NavigationList;
@@ -1,43 +1,53 @@
1
- import { jsxs as e, jsx as c } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import { px as t } from "../../../utils/index.js";
4
- import l from "../../../node_modules/classnames/index.js";
5
- import { TextVariants as p } from "../../Text/types.js";
6
- import f from "../../Text/Text.js";
7
- const h = i.forwardRef(
8
- ({ id: o, children: n, className: d, isOffScreen: _, leftSectionHeading: m, rightSectionHeading: v }, u) => {
9
- const s = i.Children.toArray(n).filter((a) => {
10
- if (a && a.props.navGroup === "nav-link-start")
11
- return a;
12
- }), r = i.Children.toArray(n).filter((a) => {
13
- if (a && a.props.navGroup === "nav-link-end")
14
- return a;
15
- });
16
- return /* @__PURE__ */ e(
1
+ import { jsxs as m, jsx as c } from "react/jsx-runtime";
2
+ import * as n from "react";
3
+ import { px as e } from "../../../utils/index.js";
4
+ import p from "../../../node_modules/classnames/index.js";
5
+ import { TextVariants as N } from "../../Text/types.js";
6
+ import $ from "../../Text/Text.js";
7
+ const x = n.forwardRef(
8
+ ({ id: v, children: i, className: g, isOffScreen: f, leftSectionHeading: d, rightSectionHeading: u, onClick: s }, h) => {
9
+ const o = n.Children.toArray(i).map((t) => {
10
+ if (n.isValidElement(t) && t.props.navGroup === "nav-link-start")
11
+ return n.cloneElement(t, {
12
+ onClick: (r) => {
13
+ var a, l;
14
+ s == null || s(r), (l = (a = t.props) == null ? void 0 : a.onClick) == null || l.call(a, r);
15
+ }
16
+ });
17
+ }).filter(Boolean), _ = n.Children.toArray(i).map((t) => {
18
+ if (n.isValidElement(t) && t.props.navGroup === "nav-link-end")
19
+ return n.cloneElement(t, {
20
+ onClick: (r) => {
21
+ var a, l;
22
+ s == null || s(r), (l = (a = t.props) == null ? void 0 : a.onClick) == null || l.call(a, r);
23
+ }
24
+ });
25
+ }).filter(Boolean);
26
+ return /* @__PURE__ */ m(
17
27
  "ul",
18
28
  {
19
- "aria-hidden": _,
20
- id: o,
21
- "data-testid": o,
29
+ "aria-hidden": f,
30
+ id: v,
31
+ "data-testid": v,
22
32
  role: "list",
23
- className: l(d, `${t}-nav__list`, { [`${t}-nav__list--offscreen`]: _ }),
24
- ref: u,
33
+ className: p(g, `${e}-nav__list`, { [`${e}-nav__list--offscreen`]: f }),
34
+ ref: h,
25
35
  children: [
26
- s.length > 0 ? /* @__PURE__ */ e("div", { className: l(`${t}-nav__list__section`, `${t}-nav__list__section--start`), children: [
27
- m ? /* @__PURE__ */ c(f, { variant: p.heading4, className: `${t}-nav__list__section--start__title`, children: m }) : null,
28
- s
36
+ o.length > 0 ? /* @__PURE__ */ m("div", { className: p(`${e}-nav__list__section`, `${e}-nav__list__section--start`), children: [
37
+ d ? /* @__PURE__ */ c($, { variant: N.heading4, className: `${e}-nav__list__section--start__title`, children: d }) : null,
38
+ o
29
39
  ] }) : null,
30
- r.length > 0 ? /* @__PURE__ */ e("div", { className: l(`${t}-nav__list__section`, `${t}-nav__list__section--end`), children: [
31
- v ? /* @__PURE__ */ c(f, { variant: p.heading4, className: `${t}-nav__list__section--end__title`, children: v }) : null,
32
- r
40
+ _.length > 0 ? /* @__PURE__ */ m("div", { className: p(`${e}-nav__list__section`, `${e}-nav__list__section--end`), children: [
41
+ u ? /* @__PURE__ */ c($, { variant: N.heading4, className: `${e}-nav__list__section--end__title`, children: u }) : null,
42
+ _
33
43
  ] }) : null,
34
- !s.length && !r.length ? n : null
44
+ !o.length && !_.length ? i : null
35
45
  ]
36
46
  }
37
47
  );
38
48
  }
39
49
  );
40
- h.displayName = "NavigationList";
50
+ x.displayName = "NavigationList";
41
51
  export {
42
- h as default
52
+ x as default
43
53
  };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { PaddingTokens as f, SpacingTokens as s, defaultYear as l, emailValidation as m, encodeURLSearchParams as d, findChildrenExcludingTypes as p, findChildrenOfType as u, generatePaddingClassName as x, getCommonProps as n, noOp as i, px as g, useNormalizedInputProps as c } from "./utils/index.js";
1
+ import { PaddingTokens as f, SpacingTokens as s, defaultYear as l, emailValidation as m, encodeURLSearchParams as p, findChildrenExcludingTypes as d, findChildrenOfType as u, generatePaddingClassName as x, getCommonProps as n, noOp as i, px as g, useNormalizedInputProps as c } from "./utils/index.js";
2
2
  import { default as S } from "./assets/account_circle.svg.js";
3
3
  import { default as P } from "./assets/arrowPrev.svg.js";
4
4
  import { default as I } from "./assets/calendar.svg.js";
@@ -7,11 +7,11 @@ import { default as A } from "./assets/chevronNext.svg.js";
7
7
  import { default as v } from "./assets/chevronRight.svg.js";
8
8
  import { default as y } from "./assets/close.svg.js";
9
9
  import { default as D } from "./assets/favoriteOutline.svg.js";
10
- import { default as R } from "./assets/icon-footer-facebook.svg.js";
11
- import { default as M } from "./assets/icon-footer-instagram.svg.js";
12
- import { default as G } from "./assets/icon-footer-linkedin.svg.js";
13
- import { default as W } from "./assets/icon-footer-red.svg.js";
14
- import { default as Q } from "./assets/icon-footer-wechat.svg.js";
10
+ import { default as H } from "./assets/icon-footer-facebook.svg.js";
11
+ import { default as F } from "./assets/icon-footer-instagram.svg.js";
12
+ import { default as U } from "./assets/icon-footer-linkedin.svg.js";
13
+ import { default as O } from "./assets/icon-footer-red.svg.js";
14
+ import { default as E } from "./assets/icon-footer-wechat.svg.js";
15
15
  import { default as Y } from "./assets/instagram.svg.js";
16
16
  import { default as Z } from "./assets/lock.svg.js";
17
17
  import { default as q } from "./assets/minus.svg.js";
@@ -23,7 +23,7 @@ import { default as te } from "./assets/share.svg.js";
23
23
  import { default as ae } from "./assets/spotify.svg.js";
24
24
  import { default as se } from "./assets/wechat.svg.js";
25
25
  import { default as me } from "./assets/youtube.svg.js";
26
- import { default as pe } from "./pages/Page.js";
26
+ import { default as de } from "./pages/Page.js";
27
27
  import { usePendingState as xe } from "./utils/hooks.js";
28
28
  import { SSRMediaQuery as ie, ssrMediaQueryStyle as ge } from "./providers/SeldonProvider/utils.js";
29
29
  import { default as Ce } from "./components/Button/Button.js";
@@ -35,11 +35,11 @@ import { Grid as Ve } from "./components/Grid/Grid.js";
35
35
  import { default as we } from "./site-furniture/Header/Header.js";
36
36
  import { default as Be } from "./components/Navigation/Navigation.js";
37
37
  import { default as Ne } from "./components/Navigation/NavigationItem/NavigationItem.js";
38
- import { default as Fe } from "./components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
39
- import { default as He } from "./components/Navigation/NavigationList/NavigationList.js";
40
- import { default as Oe } from "./patterns/HeroBanner/HeroBanner.js";
41
- import { default as Ee } from "./components/Input/Input.js";
42
- import { default as Ue } from "./components/Link/Link.js";
38
+ import { default as Re } from "./components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
39
+ import { default as Me } from "./components/Navigation/NavigationList/NavigationList.js";
40
+ import { default as Ge } from "./patterns/HeroBanner/HeroBanner.js";
41
+ import { default as We } from "./components/Input/Input.js";
42
+ import { default as Qe } from "./components/Link/Link.js";
43
43
  import { LinkVariants as ze } from "./components/Link/types.js";
44
44
  import { default as je } from "./components/LinkBlock/LinkBlock.js";
45
45
  import { default as Je } from "./components/LinkList/LinkList.js";
@@ -61,11 +61,11 @@ import { default as Ao } from "./patterns/ViewingsList/StatefulViewingsList.js";
61
61
  import { TextVariants as vo } from "./components/Text/types.js";
62
62
  import { default as yo } from "./components/Text/Text.js";
63
63
  import { TextSymbolVariants as Do } from "./components/TextSymbol/types.js";
64
- import { default as Ro } from "./components/TextSymbol/TextSymbol.js";
65
- import { default as Mo } from "./components/Accordion/Accordion.js";
66
- import { default as Go } from "./components/Accordion/AccordionItem.js";
67
- import { AccordionItemVariant as Wo, AccordionVariants as Eo } from "./components/Accordion/types.js";
68
- import { default as Uo } from "./patterns/UserManagement/UserManagement.js";
64
+ import { default as Ho } from "./components/TextSymbol/TextSymbol.js";
65
+ import { default as Fo } from "./components/Accordion/Accordion.js";
66
+ import { default as Uo } from "./components/Accordion/AccordionItem.js";
67
+ import { AccordionItemVariant as Oo, AccordionVariants as Wo } from "./components/Accordion/types.js";
68
+ import { default as Qo } from "./patterns/UserManagement/UserManagement.js";
69
69
  import { AuthState as zo } from "./patterns/UserManagement/types.js";
70
70
  import { SupportedLanguages as jo } from "./types/commonTypes.js";
71
71
  import { default as Jo } from "./components/Breadcrumb/Breadcrumb.js";
@@ -75,102 +75,104 @@ import { default as Xo } from "./components/Dropdown/Dropdown.js";
75
75
  import { default as $o } from "./components/Video/Video.js";
76
76
  import { default as ot } from "./patterns/LanguageSelector/LanguageSelector.js";
77
77
  import { default as rt } from "./components/ContentPeek/ContentPeek.js";
78
- import { default as ft } from "./components/Collapsible/Collapsible.js";
79
- import { default as lt } from "./components/Collapsible/CollapsibleContent.js";
80
- import { default as dt } from "./components/Collapsible/CollapsibleTrigger.js";
81
- import { SeldonProvider as ut } from "./providers/SeldonProvider/SeldonProvider.js";
82
- import { default as nt } from "./components/PageContentWrapper/PageContentWrapper.js";
83
- import { default as gt } from "./components/Carousel/Carousel.js";
84
- import { default as Ct } from "./components/Carousel/CarouselContent.js";
85
- import { default as Lt } from "./components/Carousel/CarouselItem.js";
86
- import { default as ht } from "./components/Carousel/CarouselDots.js";
87
- import { default as bt } from "./components/Detail/Detail.js";
88
- import { default as kt } from "./patterns/DetailList/DetailList.js";
89
- import { DetailListAlignment as Vt } from "./patterns/DetailList/types.js";
90
- import { default as wt } from "./components/PinchZoom/PinchZoom.js";
91
- import { default as Bt } from "./components/Tabs/TabsContainer.js";
92
- import { default as Nt } from "./components/Tabs/TabsContent.js";
93
- import { default as Ft } from "./components/SeldonImage/SeldonImage.js";
94
- import { default as Ht } from "./patterns/SaleHeaderBanner/SaleHeaderBanner.js";
95
- import { default as Ot } from "./patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.js";
96
- import { AuctionState as Et } from "./patterns/SaleHeaderBanner/types.js";
97
- import { default as Ut } from "./components/Countdown/Countdown.js";
98
- import { CountdownVariants as zt } from "./components/Countdown/types.js";
78
+ import { HeightUnits as ft } from "./components/ContentPeek/utils.js";
79
+ import { default as lt } from "./components/Collapsible/Collapsible.js";
80
+ import { default as pt } from "./components/Collapsible/CollapsibleContent.js";
81
+ import { default as ut } from "./components/Collapsible/CollapsibleTrigger.js";
82
+ import { SeldonProvider as nt } from "./providers/SeldonProvider/SeldonProvider.js";
83
+ import { default as gt } from "./components/PageContentWrapper/PageContentWrapper.js";
84
+ import { default as Ct } from "./components/Carousel/Carousel.js";
85
+ import { default as Lt } from "./components/Carousel/CarouselContent.js";
86
+ import { default as ht } from "./components/Carousel/CarouselItem.js";
87
+ import { default as bt } from "./components/Carousel/CarouselDots.js";
88
+ import { default as kt } from "./components/Detail/Detail.js";
89
+ import { default as Vt } from "./patterns/DetailList/DetailList.js";
90
+ import { DetailListAlignment as wt } from "./patterns/DetailList/types.js";
91
+ import { default as Bt } from "./components/PinchZoom/PinchZoom.js";
92
+ import { default as Nt } from "./components/Tabs/TabsContainer.js";
93
+ import { default as Rt } from "./components/Tabs/TabsContent.js";
94
+ import { default as Mt } from "./components/SeldonImage/SeldonImage.js";
95
+ import { default as Gt } from "./patterns/SaleHeaderBanner/SaleHeaderBanner.js";
96
+ import { default as Wt } from "./patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.js";
97
+ import { AuctionState as Qt } from "./patterns/SaleHeaderBanner/types.js";
98
+ import { default as zt } from "./components/Countdown/Countdown.js";
99
+ import { CountdownVariants as jt } from "./components/Countdown/types.js";
99
100
  export {
100
- Mo as Accordion,
101
- Go as AccordionItem,
102
- Wo as AccordionItemVariant,
103
- Eo as AccordionVariants,
101
+ Fo as Accordion,
102
+ Uo as AccordionItem,
103
+ Oo as AccordionItemVariant,
104
+ Wo as AccordionVariants,
104
105
  S as AccountCircle,
105
106
  P as ArrowPrev,
106
- Et as AuctionState,
107
+ Qt as AuctionState,
107
108
  zo as AuthState,
108
109
  Jo as Breadcrumb,
109
110
  Ce as Button,
110
111
  Le as ButtonVariants,
111
112
  I as Calendar,
112
- gt as Carousel,
113
- Ct as CarouselContent,
114
- ht as CarouselDots,
115
- Lt as CarouselItem,
113
+ Ct as Carousel,
114
+ Lt as CarouselContent,
115
+ bt as CarouselDots,
116
+ ht as CarouselItem,
116
117
  T as ChevronDown,
117
118
  A as ChevronNext,
118
119
  v as ChevronRight,
119
120
  y as Close,
120
- ft as Collapsible,
121
- lt as CollapsibleContent,
122
- dt as CollapsibleTrigger,
121
+ lt as Collapsible,
122
+ pt as CollapsibleContent,
123
+ ut as CollapsibleTrigger,
123
124
  rt as ContentPeek,
124
- Ut as Countdown,
125
- zt as CountdownVariants,
126
- bt as Detail,
127
- kt as DetailList,
128
- Vt as DetailListAlignment,
125
+ ft as ContentPeekHeightUnits,
126
+ zt as Countdown,
127
+ jt as CountdownVariants,
128
+ kt as Detail,
129
+ Vt as DetailList,
130
+ wt as DetailListAlignment,
129
131
  Po as Drawer,
130
132
  Xo as Dropdown,
131
133
  be as ErrorBoundary,
132
- R as Facebook,
134
+ H as Facebook,
133
135
  D as FavoriteOutline,
134
136
  ke as Footer,
135
- M as FooterInstagram,
136
- Q as FooterWeChat,
137
+ F as FooterInstagram,
138
+ E as FooterWeChat,
137
139
  Ve as Grid,
138
140
  $e as GridItem,
139
141
  oo as GridItemAlign,
140
142
  we as Header,
141
- Oe as HeroBanner,
143
+ Ge as HeroBanner,
142
144
  he as IconButton,
143
- Ee as Input,
145
+ We as Input,
144
146
  Y as Instagram,
145
147
  ot as LanguageSelector,
146
- Ue as Link,
148
+ Qe as Link,
147
149
  je as LinkBlock,
148
150
  Je as LinkList,
149
151
  ze as LinkVariants,
150
- G as LinkedIn,
152
+ U as LinkedIn,
151
153
  Z as Lock,
152
154
  q as Minus,
153
155
  So as Modal,
154
156
  Be as Navigation,
155
157
  Ne as NavigationItem,
156
- Fe as NavigationItemTrigger,
157
- He as NavigationList,
158
+ Re as NavigationItemTrigger,
159
+ Me as NavigationList,
158
160
  f as PaddingTokens,
159
- pe as Page,
160
- nt as PageContentWrapper,
161
+ de as Page,
162
+ gt as PageContentWrapper,
161
163
  Io as Pagination,
162
164
  K as PhillipsLogo,
163
- wt as PinchZoom,
165
+ Bt as PinchZoom,
164
166
  _ as Plus,
165
167
  ee as React,
166
- W as Reddit,
168
+ O as Reddit,
167
169
  Xe as Row,
168
170
  ie as SSRMediaQuery,
169
- Ht as SaleHeaderBanner,
170
- Ot as SaleHeaderBrowseAuctions,
171
+ Gt as SaleHeaderBanner,
172
+ Wt as SaleHeaderBrowseAuctions,
171
173
  ro as Search,
172
- Ft as SeldonImage,
173
- ut as SeldonProvider,
174
+ Mt as SeldonImage,
175
+ nt as SeldonProvider,
174
176
  fo as Select,
175
177
  te as Share,
176
178
  io as Social,
@@ -181,22 +183,22 @@ export {
181
183
  po as Subscribe,
182
184
  xo as SubscriptionState,
183
185
  jo as SupportedLanguages,
184
- Bt as TabsContainer,
185
- Nt as TabsContent,
186
+ Nt as TabsContainer,
187
+ Rt as TabsContent,
186
188
  To as TagsList,
187
189
  yo as Text,
188
190
  Do as TextSymbolVariants,
189
- Ro as TextSymbols,
191
+ Ho as TextSymbols,
190
192
  vo as TextVariants,
191
- Uo as UserManagement,
193
+ Qo as UserManagement,
192
194
  $o as Video,
193
195
  co as ViewingsList,
194
196
  se as WeChat,
195
197
  me as Youtube,
196
198
  l as defaultYear,
197
199
  m as emailValidation,
198
- d as encodeURLSearchParams,
199
- p as findChildrenExcludingTypes,
200
+ p as encodeURLSearchParams,
201
+ d as findChildrenExcludingTypes,
200
202
  u as findChildrenOfType,
201
203
  x as generatePaddingClassName,
202
204
  n as getCommonProps,
@@ -1,72 +1,72 @@
1
- import { jsxs as b, Fragment as L, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as S } from "react";
3
- import { getCommonProps as N, noOp as T } from "../../utils/index.js";
4
- import x from "../../node_modules/classnames/index.js";
5
- import { SupportedLanguages as s } from "../../types/commonTypes.js";
6
- import C from "../../components/Dropdown/Dropdown.js";
7
- import k from "../../components/Accordion/Accordion.js";
8
- import w from "../../components/Accordion/AccordionItem.js";
9
- import { AccordionItemVariant as y } from "../../components/Accordion/types.js";
10
- import M from "../../components/Navigation/NavigationItem/NavigationItem.js";
11
- import { LinkVariants as V } from "../../components/Link/types.js";
12
- import { TextVariants as A } from "../../components/Text/types.js";
13
- import E from "../../components/Text/Text.js";
14
- import I from "../../components/Navigation/NavigationList/NavigationList.js";
15
- import { SSRMediaQuery as f } from "../../providers/SeldonProvider/utils.js";
1
+ import { jsxs as h, Fragment as v, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as L } from "react";
3
+ import { getCommonProps as b, noOp as S } from "../../utils/index.js";
4
+ import N from "../../node_modules/classnames/index.js";
5
+ import { SupportedLanguages as i } from "../../types/commonTypes.js";
6
+ import T from "../../components/Dropdown/Dropdown.js";
7
+ import x from "../../components/Accordion/Accordion.js";
8
+ import C from "../../components/Accordion/AccordionItem.js";
9
+ import { AccordionItemVariant as k } from "../../components/Accordion/types.js";
10
+ import w from "../../components/Navigation/NavigationItem/NavigationItem.js";
11
+ import { LinkVariants as y } from "../../components/Link/types.js";
12
+ import { TextVariants as M } from "../../components/Text/types.js";
13
+ import V from "../../components/Text/Text.js";
14
+ import A from "../../components/Navigation/NavigationList/NavigationList.js";
15
+ import { SSRMediaQuery as g } from "../../providers/SeldonProvider/utils.js";
16
+ import { getLanguageLabel as I } from "./utils.js";
16
17
  const P = ({
17
18
  id: a,
18
- value: l,
19
+ value: t,
19
20
  // can't be passed to the accordion
20
21
  onValueChange: o,
21
- label: t,
22
+ label: l,
22
23
  options: n,
23
24
  ...m
24
- }) => /* @__PURE__ */ e(k, { ...m, children: /* @__PURE__ */ e(
25
- w,
25
+ }) => /* @__PURE__ */ e(x, { ...m, children: /* @__PURE__ */ e(
26
+ C,
26
27
  {
27
28
  hasTransition: !0,
28
29
  id: a != null ? a : "language-selector-accordion",
29
- label: /* @__PURE__ */ e(E, { variant: A.snwHeaderLink, children: t }),
30
- variant: y.lg,
31
- children: /* @__PURE__ */ e(I, { id: `${a}-navlist`, children: n.map((r) => /* @__PURE__ */ e(
32
- M,
30
+ label: /* @__PURE__ */ e(V, { variant: M.snwHeaderLink, children: l }),
31
+ variant: k.lg,
32
+ children: /* @__PURE__ */ e(A, { id: `${a}-navlist`, children: n.map((r) => /* @__PURE__ */ e(
33
+ w,
33
34
  {
34
35
  label: r.label,
35
36
  onClick: () => o(r.value),
36
- navType: V.snwFlyoutLink
37
+ navType: y.snwFlyoutLink
37
38
  },
38
39
  r.value
39
40
  )) })
40
41
  }
41
- ) }), j = S(
42
+ ) }), j = L(
42
43
  ({
43
44
  className: a,
44
- currentLanguage: l = s.en,
45
+ currentLanguage: t = i.en,
45
46
  languageOptions: o = [
46
- { label: "English", value: s.en },
47
- { label: "中文", value: s.zh }
47
+ { label: "English", value: i.en },
48
+ { label: "中文", value: i.zh }
48
49
  ],
49
- onLanguageChange: t = T,
50
+ onLanguageChange: l = S,
50
51
  id: n,
51
52
  isHidden: m,
52
53
  ...r
53
- }, c) => {
54
- var u, g;
55
- const { className: p, ...h } = N({ id: n }, "LanguageSelector"), v = (g = (u = o.find((i) => i.value === l)) == null ? void 0 : u.label) != null ? g : "English", d = {
56
- ...h,
54
+ }, s) => {
55
+ const { className: c, ...u } = b({ id: n }, "LanguageSelector"), d = I({ languageOptions: o, currentLanguage: t }), p = {
56
+ ...u,
57
57
  ...r,
58
58
  id: n,
59
- className: x(p, a, {
60
- [`${p}--hidden`]: m
59
+ className: N(c, a, {
60
+ [`${c}--hidden`]: m
61
61
  }),
62
62
  options: o,
63
- value: l,
64
- onValueChange: (i) => t(i),
65
- label: v
63
+ value: t,
64
+ onValueChange: (f) => l(f),
65
+ label: d
66
66
  };
67
- return /* @__PURE__ */ b(L, { children: [
68
- /* @__PURE__ */ e(f.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ e(C, { ...d, ref: c }) }),
69
- /* @__PURE__ */ e(f.Media, { lessThan: "md", children: /* @__PURE__ */ e(P, { ...d, ref: c }) })
67
+ return /* @__PURE__ */ h(v, { children: [
68
+ /* @__PURE__ */ e(g.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ e(T, { ...p, ref: s }) }),
69
+ /* @__PURE__ */ e(g.Media, { lessThan: "md", children: /* @__PURE__ */ e(P, { ...p, ref: s }) })
70
70
  ] });
71
71
  }
72
72
  );
@@ -0,0 +1,7 @@
1
+ import { LanguageSelectorProps } from './LanguageSelector';
2
+ interface GetLanguageLabelProps {
3
+ languageOptions: LanguageSelectorProps['languageOptions'];
4
+ currentLanguage: LanguageSelectorProps['currentLanguage'];
5
+ }
6
+ export declare const getLanguageLabel: ({ languageOptions, currentLanguage }: GetLanguageLabelProps) => string;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ const f = ({ languageOptions: b, currentLanguage: c }) => {
2
+ var e, L;
3
+ return (L = (e = b == null ? void 0 : b.find((d) => d.value === c)) == null ? void 0 : e.label) != null ? L : "English";
4
+ };
5
+ export {
6
+ f as getLanguageLabel
7
+ };
@@ -34,6 +34,10 @@ export type HeaderContextType = {
34
34
  * Set the search expanded state
35
35
  */
36
36
  setIsSearchExpanded: React.Dispatch<React.SetStateAction<boolean>>;
37
+ /**
38
+ * Close the mobile menu
39
+ * */
40
+ closeMenu?: () => void;
37
41
  };
38
42
  export declare const HeaderContext: React.Context<HeaderContextType>;
39
43
  /**
@@ -1,39 +1,38 @@
1
1
  import { jsxs as o, jsx as a } from "react/jsx-runtime";
2
- import l, { createContext as T, forwardRef as P, useState as h } from "react";
3
- import d from "../../node_modules/classnames/index.js";
4
- import { findChildrenOfType as i, findChildrenExcludingTypes as j, px as e } from "../../utils/index.js";
2
+ import n, { createContext as T, forwardRef as O, useState as P } from "react";
3
+ import l from "../../node_modules/classnames/index.js";
4
+ import { findChildrenOfType as s, findChildrenExcludingTypes as j, px as e } from "../../utils/index.js";
5
5
  import R from "../../assets/PhillipsLogo.svg.js";
6
- import p from "../../patterns/UserManagement/UserManagement.js";
7
- import g from "../../patterns/LanguageSelector/LanguageSelector.js";
8
- import f from "../../components/Navigation/Navigation.js";
6
+ import h from "../../patterns/UserManagement/UserManagement.js";
7
+ import p from "../../patterns/LanguageSelector/LanguageSelector.js";
8
+ import g from "../../components/Navigation/Navigation.js";
9
9
  import { defaultHeaderContext as w } from "./utils.js";
10
- import { SSRMediaQuery as I } from "../../providers/SeldonProvider/utils.js";
11
- const L = T(w), k = P(
10
+ import { SSRMediaQuery as L } from "../../providers/SeldonProvider/utils.js";
11
+ import { useMobileMenu as k } from "./hooks.js";
12
+ const q = T(w), A = O(
12
13
  ({
13
- logo: s = /* @__PURE__ */ a(R, {}),
14
- logoHref: u = "/",
15
- className: _,
14
+ logo: d = /* @__PURE__ */ a(R, {}),
15
+ logoHref: f = "/",
16
+ className: u,
16
17
  children: r,
17
- toggleOpenText: v = "Open Menu",
18
- toggleCloseText: x = "Close Menu",
19
- logoText: C = "Home Page",
20
- ...y
21
- }, E) => {
22
- const M = i(r, p), m = i(r, g), [c, $] = h(!1), b = i(r, f), N = j(r, [f, p, g]), [n, S] = h(!1), H = n ? x : v, O = function() {
23
- S((t) => !t);
24
- };
25
- return /* @__PURE__ */ o("header", { ...y, className: d(`${e}-header`, _), ref: E, children: [
18
+ toggleOpenText: _ = "Open Menu",
19
+ toggleCloseText: v = "Close Menu",
20
+ logoText: x = "Home Page",
21
+ ...M
22
+ }, C) => {
23
+ const b = s(r, h), m = s(r, p), [c, y] = P(!1), E = s(r, g), $ = j(r, [g, h, p]), { closeMenu: N, handleMenuToggle: S, isMenuOpen: i, toggleText: H } = k({ toggleOpenText: _, toggleCloseText: v });
24
+ return /* @__PURE__ */ o("header", { ...M, className: l(`${e}-header`, u), ref: C, children: [
26
25
  /* @__PURE__ */ o("div", { className: `${e}-header__top-row`, children: [
27
- /* @__PURE__ */ a(I.Media, { greaterThanOrEqual: "md", children: m }),
26
+ /* @__PURE__ */ a(L.Media, { greaterThanOrEqual: "md", children: m }),
28
27
  /* @__PURE__ */ o(
29
28
  "button",
30
29
  {
31
30
  "aria-label": H,
32
31
  "data-testid": "mobile-menu-toggle",
33
32
  type: "button",
34
- onClick: O,
35
- className: d(`${e}-header__toggle-btn`, {
36
- [`${e}-header__toggle-btn--open`]: n
33
+ onClick: S,
34
+ className: l(`${e}-header__toggle-btn`, {
35
+ [`${e}-header__toggle-btn--open`]: i
37
36
  }),
38
37
  children: [
39
38
  /* @__PURE__ */ a("span", {}),
@@ -41,35 +40,36 @@ const L = T(w), k = P(
41
40
  ]
42
41
  }
43
42
  ),
44
- /* @__PURE__ */ a("h1", { "data-testid": "header-logo", className: `${e}-header__logo`, children: /* @__PURE__ */ a("a", { href: u, "aria-label": C, children: typeof s == "object" ? s : /* @__PURE__ */ a("img", { alt: "Phillips", "data-testid": "header-logo-img", src: s }) }) }),
45
- M
43
+ /* @__PURE__ */ a("h1", { "data-testid": "header-logo", className: `${e}-header__logo`, children: /* @__PURE__ */ a("a", { href: f, "aria-label": x, children: typeof d == "object" ? d : /* @__PURE__ */ a("img", { alt: "Phillips", "data-testid": "header-logo-img", src: d }) }) }),
44
+ b
46
45
  ] }),
47
- /* @__PURE__ */ a("div", { className: d(`${e}-header__nav`, { [`${e}-header__nav--closed`]: !n }), children: /* @__PURE__ */ o(
48
- L.Provider,
46
+ /* @__PURE__ */ a("div", { className: l(`${e}-header__nav`, { [`${e}-header__nav--closed`]: !i }), children: /* @__PURE__ */ o(
47
+ q.Provider,
49
48
  {
50
49
  value: {
51
- isMenuOpen: n,
50
+ isMenuOpen: i,
52
51
  isSearchExpanded: c,
53
- setIsSearchExpanded: $
52
+ setIsSearchExpanded: y,
53
+ closeMenu: N
54
54
  },
55
55
  children: [
56
- l.Children.map(
57
- b,
58
- (t) => l.isValidElement(t) ? l.cloneElement(t, {
56
+ n.Children.map(
57
+ E,
58
+ (t) => n.isValidElement(t) ? n.cloneElement(t, {
59
59
  children: [
60
- ...l.Children.toArray(t.props.children),
60
+ ...n.Children.toArray(t.props.children),
61
61
  m
62
62
  ]
63
63
  }) : t
64
64
  ),
65
- N
65
+ $
66
66
  ]
67
67
  }
68
68
  ) }),
69
69
  /* @__PURE__ */ a(
70
70
  "div",
71
71
  {
72
- className: d(`${e}-header__overlay`, {
72
+ className: l(`${e}-header__overlay`, {
73
73
  [`${e}-header__overlay--active`]: c
74
74
  })
75
75
  }
@@ -77,8 +77,8 @@ const L = T(w), k = P(
77
77
  ] });
78
78
  }
79
79
  );
80
- k.displayName = "Header";
80
+ A.displayName = "Header";
81
81
  export {
82
- L as HeaderContext,
83
- k as default
82
+ q as HeaderContext,
83
+ A as default
84
84
  };
@@ -0,0 +1,9 @@
1
+ import { HeaderProps } from './Header';
2
+ type UseMobileMenuProps = Pick<HeaderProps, 'toggleCloseText' | 'toggleOpenText'>;
3
+ export declare const useMobileMenu: ({ toggleCloseText, toggleOpenText }: UseMobileMenuProps) => {
4
+ isMenuOpen: boolean;
5
+ handleMenuToggle: () => void;
6
+ closeMenu: () => void;
7
+ toggleText: string | undefined;
8
+ };
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import { useState as l } from "react";
2
+ const a = ({ toggleCloseText: o, toggleOpenText: t }) => {
3
+ const [e, n] = l(!1);
4
+ return { isMenuOpen: e, handleMenuToggle: () => n((s) => !s), closeMenu: () => n(!1), toggleText: e ? o : t };
5
+ };
6
+ export {
7
+ a as useMobileMenu
8
+ };
@@ -2,7 +2,8 @@ import { noOp as e } from "../../utils/index.js";
2
2
  const n = {
3
3
  isMenuOpen: !1,
4
4
  isSearchExpanded: !1,
5
- setIsSearchExpanded: e
5
+ setIsSearchExpanded: e,
6
+ closeMenu: e
6
7
  };
7
8
  export {
8
9
  n as defaultHeaderContext
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.91.0",
3
+ "version": "1.92.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"