@phillips/seldon 1.91.1 → 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,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
  };
@@ -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.1",
3
+ "version": "1.92.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"