@veracity/vui
Version:
Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.
75 lines (73 loc) • 2.36 kB
JavaScript
import { useStyleConfig } from "../core/theme.js";
import { useDown } from "../core/media.js";
import { Menu } from "../menu/menu.js";
import { useHeaderContext } from "./context.js";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
//#region src/header/headerSupport.tsx
/** Supporting internal component to avoid code duplication. */
function ListContent({ links = [] }) {
const styles = useStyleConfig("Header", useHeaderContext()).services;
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(Menu.Item, {
isTruncated: true,
linkProps: { href: "https://support.veracity.com/" },
text: "Veracity support",
title: "Veracity support",
...styles.item
}, "veracity-support"),
/* @__PURE__ */ jsx(Menu.Item, {
isTruncated: true,
linkProps: { href: "https://id.veracity.com/terms-of-use" },
text: "Veracity terms",
title: "Veracity terms",
...styles.item
}, "veracity-terms"),
/* @__PURE__ */ jsx(Menu.Item, {
isTruncated: true,
linkProps: { href: "https://services.veracity.com/PrivacyStatement" },
text: "Privacy",
title: "Privacy",
...styles.item
}, "privacy"),
links.length > 0 && links.map(({ text, url }, index) => /* @__PURE__ */ jsx(Menu.Item, {
isTruncated: true,
linkProps: { href: url },
text,
title: text,
...styles.item
}, index))
] });
}
/** Displays a list of services available to the user. */
function HeaderSupport(props) {
const { links = [], ...rest } = props;
const styles = useStyleConfig("Header", useHeaderContext()).services;
const isTablet = useDown("lg");
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Menu, {
isLazy: false,
offset: [isTablet ? 162 : 135, 16],
placement: "bottom-end",
size: "lg",
...rest,
children: [/* @__PURE__ */ jsx(Menu.Button, {
className: "vui-app-info-trigger",
color: styles.button.color,
icon: "uiQuestionCircle",
ml: 1,
size: "lg",
title: "Support",
...styles.button
}), /* @__PURE__ */ jsx(Menu.List, {
maxH: 295,
right: 0,
w: isTablet ? 280 : 320,
...styles.list,
children: /* @__PURE__ */ jsx(ListContent, { links })
})]
}) });
}
HeaderSupport.displayName = "HeaderSupport";
//#endregion
export { HeaderSupport, HeaderSupport as default };
globalThis.__vuiVersion__ = "5.3.1"
//# sourceMappingURL=headerSupport.js.map