@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.
- package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +56 -42
- package/dist/components/Navigation/NavigationList/NavigationList.d.ts +4 -0
- package/dist/components/Navigation/NavigationList/NavigationList.js +40 -30
- package/dist/patterns/LanguageSelector/LanguageSelector.js +41 -41
- package/dist/patterns/LanguageSelector/utils.d.ts +7 -0
- package/dist/patterns/LanguageSelector/utils.js +7 -0
- package/dist/site-furniture/Header/Header.d.ts +4 -0
- package/dist/site-furniture/Header/Header.js +39 -39
- package/dist/site-furniture/Header/hooks.d.ts +9 -0
- package/dist/site-furniture/Header/hooks.js +8 -0
- package/dist/site-furniture/Header/utils.js +2 -1
- package/package.json +1 -1
|
@@ -1,54 +1,68 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { getCommonProps as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TextVariants as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { SSRMediaQuery as
|
|
11
|
-
import { AccordionItemVariant as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
...
|
|
33
|
-
ref:
|
|
34
|
-
"aria-expanded":
|
|
35
|
-
className:
|
|
36
|
-
[`${
|
|
40
|
+
...f,
|
|
41
|
+
ref: $,
|
|
42
|
+
"aria-expanded": g,
|
|
43
|
+
className: L(d, s, `${h}-nav__item`, {
|
|
44
|
+
[`${s}--hovered`]: g
|
|
37
45
|
}),
|
|
38
|
-
onClick:
|
|
39
|
-
onMouseOver: () =>
|
|
40
|
-
onMouseOut: () =>
|
|
41
|
-
...
|
|
46
|
+
onClick: T,
|
|
47
|
+
onMouseOver: () => e(!0),
|
|
48
|
+
onMouseOut: () => e(!1),
|
|
49
|
+
..._,
|
|
42
50
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
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
|
-
|
|
65
|
+
R.displayName = "NavigationItemTrigger";
|
|
52
66
|
export {
|
|
53
|
-
|
|
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
|
|
2
|
-
import * as
|
|
3
|
-
import { px as
|
|
4
|
-
import
|
|
5
|
-
import { TextVariants as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
({ id:
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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:
|
|
21
|
-
"data-testid":
|
|
29
|
+
"aria-hidden": f,
|
|
30
|
+
id: v,
|
|
31
|
+
"data-testid": v,
|
|
22
32
|
role: "list",
|
|
23
|
-
className:
|
|
24
|
-
ref:
|
|
33
|
+
className: p(g, `${e}-nav__list`, { [`${e}-nav__list--offscreen`]: f }),
|
|
34
|
+
ref: h,
|
|
25
35
|
children: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
!
|
|
44
|
+
!o.length && !_.length ? i : null
|
|
35
45
|
]
|
|
36
46
|
}
|
|
37
47
|
);
|
|
38
48
|
}
|
|
39
49
|
);
|
|
40
|
-
|
|
50
|
+
x.displayName = "NavigationList";
|
|
41
51
|
export {
|
|
42
|
-
|
|
52
|
+
x as default
|
|
43
53
|
};
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import { SupportedLanguages as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { AccordionItemVariant as
|
|
10
|
-
import
|
|
11
|
-
import { LinkVariants as
|
|
12
|
-
import { TextVariants as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { SSRMediaQuery as
|
|
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:
|
|
19
|
+
value: t,
|
|
19
20
|
// can't be passed to the accordion
|
|
20
21
|
onValueChange: o,
|
|
21
|
-
label:
|
|
22
|
+
label: l,
|
|
22
23
|
options: n,
|
|
23
24
|
...m
|
|
24
|
-
}) => /* @__PURE__ */ e(
|
|
25
|
-
|
|
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(
|
|
30
|
-
variant:
|
|
31
|
-
children: /* @__PURE__ */ e(
|
|
32
|
-
|
|
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:
|
|
37
|
+
navType: y.snwFlyoutLink
|
|
37
38
|
},
|
|
38
39
|
r.value
|
|
39
40
|
)) })
|
|
40
41
|
}
|
|
41
|
-
) }), j =
|
|
42
|
+
) }), j = L(
|
|
42
43
|
({
|
|
43
44
|
className: a,
|
|
44
|
-
currentLanguage:
|
|
45
|
+
currentLanguage: t = i.en,
|
|
45
46
|
languageOptions: o = [
|
|
46
|
-
{ label: "English", value:
|
|
47
|
-
{ label: "中文", value:
|
|
47
|
+
{ label: "English", value: i.en },
|
|
48
|
+
{ label: "中文", value: i.zh }
|
|
48
49
|
],
|
|
49
|
-
onLanguageChange:
|
|
50
|
+
onLanguageChange: l = S,
|
|
50
51
|
id: n,
|
|
51
52
|
isHidden: m,
|
|
52
53
|
...r
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
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:
|
|
60
|
-
[`${
|
|
59
|
+
className: N(c, a, {
|
|
60
|
+
[`${c}--hidden`]: m
|
|
61
61
|
}),
|
|
62
62
|
options: o,
|
|
63
|
-
value:
|
|
64
|
-
onValueChange: (
|
|
65
|
-
label:
|
|
63
|
+
value: t,
|
|
64
|
+
onValueChange: (f) => l(f),
|
|
65
|
+
label: d
|
|
66
66
|
};
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */ e(
|
|
69
|
-
/* @__PURE__ */ e(
|
|
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 {};
|
|
@@ -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
|
|
3
|
-
import
|
|
4
|
-
import { findChildrenOfType as
|
|
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
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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
|
|
11
|
-
|
|
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:
|
|
14
|
-
logoHref:
|
|
15
|
-
className:
|
|
14
|
+
logo: d = /* @__PURE__ */ a(R, {}),
|
|
15
|
+
logoHref: f = "/",
|
|
16
|
+
className: u,
|
|
16
17
|
children: r,
|
|
17
|
-
toggleOpenText:
|
|
18
|
-
toggleCloseText:
|
|
19
|
-
logoText:
|
|
20
|
-
...
|
|
21
|
-
},
|
|
22
|
-
const
|
|
23
|
-
|
|
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(
|
|
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:
|
|
35
|
-
className:
|
|
36
|
-
[`${e}-header__toggle-btn--open`]:
|
|
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:
|
|
45
|
-
|
|
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:
|
|
48
|
-
|
|
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:
|
|
50
|
+
isMenuOpen: i,
|
|
52
51
|
isSearchExpanded: c,
|
|
53
|
-
setIsSearchExpanded:
|
|
52
|
+
setIsSearchExpanded: y,
|
|
53
|
+
closeMenu: N
|
|
54
54
|
},
|
|
55
55
|
children: [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
(t) =>
|
|
56
|
+
n.Children.map(
|
|
57
|
+
E,
|
|
58
|
+
(t) => n.isValidElement(t) ? n.cloneElement(t, {
|
|
59
59
|
children: [
|
|
60
|
-
...
|
|
60
|
+
...n.Children.toArray(t.props.children),
|
|
61
61
|
m
|
|
62
62
|
]
|
|
63
63
|
}) : t
|
|
64
64
|
),
|
|
65
|
-
|
|
65
|
+
$
|
|
66
66
|
]
|
|
67
67
|
}
|
|
68
68
|
) }),
|
|
69
69
|
/* @__PURE__ */ a(
|
|
70
70
|
"div",
|
|
71
71
|
{
|
|
72
|
-
className:
|
|
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
|
-
|
|
80
|
+
A.displayName = "Header";
|
|
81
81
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
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
|
+
};
|