UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

2 lines (1 loc) 1.84 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@mui/material/Box"),o=require("@mui/material/Divider"),i=require("@mui/material/Typography"),r=require("@mui/material/Stack"),a=require("@mui/material/Button"),l=require("@mui/material/IconButton"),n=require("./Hexagon.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=d(t),u=d(o),c=d(i),x=d(r),g=d(a),m=d(l);exports.default=t=>{const{productLogo:o,productName:i,showHexagon:r=!0,onProductClick:a,onHexagonClick:l,sx:d,...f}=t,h="string"==typeof i?e.jsx(c.default,{variant:"body2","data-testid":"LogoBlock-productName",sx:{ml:r&&!a||o?2:0},children:i}):e.jsx(s.default,{"data-testid":"LogoBlock-productNameCustom",sx:{ml:r||o?2:0},children:i}),p=o&&e.jsx(s.default,{"data-testid":"LogoBlock-productLogo",sx:{"& svg":{display:"block"}},children:o}),k=o||i,j=a?e.jsx(g.default,{"data-testid":"LogoBlock-productButton",color:"inherit",sx:{textAlign:"unset",minWidth:"unset","& .MuiButton-startIcon":{ml:0,mr:0}},startIcon:p,onClick:a,children:i&&h}):e.jsxs(e.Fragment,{children:[o&&p,i&&h]});return e.jsxs(x.default,{direction:"row",alignItems:"center",sx:[{fontSize:"1.5rem"},...Array.isArray(d)?d:[d]],...f,children:[r&&l&&e.jsx(m.default,{"aria-label":"Hexagon Logo","data-testid":"LogoBlock-hexagonLogoButton",color:"inherit",onClick:l,sx:{fontSize:"inherit"},children:e.jsx(n.default,{"data-testid":"LogoBlock-hexagonLogo",fontSize:"inherit",sx:{display:"block"}})}),r&&!l&&e.jsx(s.default,{children:e.jsx(n.default,{"data-testid":"LogoBlock-hexagonLogo",fontSize:"inherit",sx:{display:"block"}})}),r&&o&&e.jsx(u.default,{"data-testid":"LogoBlock-divider",orientation:"vertical",flexItem:!0,sx:{alignSelf:"center",height:"1em",borderColor:"inherit",ml:l?2:4,mr:a?2:4,opacity:.43}}),k&&j]})};