@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.08 kB
JavaScript
"use client";
;Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),r=require("@mui/material/Dialog"),t=require("./ImageCarousel.component.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(r);const n=r=>{const{allowFullScreen:a=!1,onToggleFullScreen:n,onActiveStepChange:o,fullScreenDialogProps:u={},initialActiveStep:s=0,images:c}=r,g=c.length,[d,p]=l.useState(!1),[S,f]=l.useState(s<0?0:s>g-1?g-1:s),m=()=>{p((e=>!e)),n?.(!d)};return e.jsxs(e.Fragment,{children:[e.jsx(t.ImageCarouselComponent,{...r,isFullScreen:d,onToggleFullScreen:m,onActiveStepChange:(e,l)=>{f(e),o?.(e,l)}}),a?d&&e.jsx(i.default,{"aria-describedby":`${t.prefix}-full-screen-dialog`,"aria-labelledby":"image carousel dialog","data-testid":`${t.prefix}-fullScreenDialog`,maxWidth:!1,fullScreen:!0,...u,open:d,children:e.jsx(t.ImageCarouselComponent,{...r,"data-testid":`${t.prefix}-fullScreen`,isFullScreen:d,onToggleFullScreen:m,initialActiveStep:S})}):""]})};exports.ImageCarousel=n,exports.default=n;