@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.
3 lines (2 loc) • 1.89 kB
JavaScript
"use client";
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material/Stack"),n=require("@mui/material/Typography"),a=require("@mui/icons-material/PersonOutlined"),i=require("@mui/icons-material/CalendarTodayOutlined"),o=require("@mui/material/Box"),s=require("./HeroBanner.component.js"),l=require("./constant.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=c(r),u=c(n),d=c(a),p=c(i),f=c(o);exports.HeroBanner=r=>{const{backgroundImage:n,backgroundColor:a,title:i,description:o,authorName:c,lastUpdated:x,actionElements:h=[],...g}=r,j="string"==typeof i?e.jsx(u.default,{color:"inherit",border:0,variant:"h2",mt:2,className:`${l.prefix}-title`,children:i}):i,y=o&&("string"==typeof o?e.jsx(u.default,{variant:"subtitle1",component:"p",width:{xs:1,sm:"525px"},sx:{fontWeight:400,mt:5},className:`${l.prefix}-description`,color:"inherit",children:o}):o),C=Array.isArray(h)&&h.length>0&&e.jsx(m.default,{sx:{mt:8},direction:{xs:"column",sm:"row"},spacing:4,className:`${l.prefix}-actions`,children:h.map(((e,r)=>t.cloneElement(e,{key:r,sx:{zIndex:1}})))}),q={backgroundImage:n,backgroundColor:a,titleComponent:j,descriptionComponent:y,authorNameComponent:c&&("string"==typeof c?e.jsxs(f.default,{display:"flex",alignItems:"center",justifyContent:"center",className:`${l.prefix}-authorName`,children:[e.jsx(d.default,{}),e.jsx(u.default,{component:"span",variant:"h6",fontWeight:400,sx:{ml:3},children:c})]}):c),lastUpdatedComponent:x&&("string"==typeof x?e.jsxs(f.default,{display:"flex",alignItems:"center",justifyContent:"center",ml:c?15:0,className:`${l.prefix}-lastUpdated`,children:[e.jsx(p.default,{}),e.jsx(u.default,{component:"span",variant:"h6",fontWeight:400,sx:{ml:3},children:x})]}):x),actionComponent:C};return e.jsx(s.HeroBannerComponent,{...q,...g})};