UNPKG

@cgi-learning-hub/ui

Version:

@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features

3 lines (2 loc) 3.62 kB
"use strict";const b=require("react"),a=require("./index-kjfz41UI.cjs"),i=require("./generateUtilityClasses-CENS22bI.cjs"),g=require("./useTheme-BrGF2Vm0.cjs"),h=require("react/jsx-runtime"),p=require("./DefaultPropsProvider-C1g4BXET.cjs"),q=require("./memoTheme-Bi1UNdyO.cjs"),w=require("./chainPropTypes-CEUi6Jb4.cjs"),O=require("./integerPropType-CR7ytEJG.cjs");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const C=j(b);function P(e){return i.generateUtilityClass("MuiPaper",e)}const x=i.generateUtilityClasses("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]),R=e=>{const{square:o,elevation:t,variant:n,classes:r}=e,l={root:["root",n,!o&&"rounded",n==="elevation"&&`elevation${t}`]};return p.composeClasses(l,P,r)},$=p.styled("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[t.variant],!t.square&&o.rounded,t.variant==="elevation"&&o[`elevation${t.elevation}`]]}})(q.memoTheme(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:o})=>!o.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),f=C.forwardRef(function(o,t){var y;const n=p.useDefaultProps({props:o,name:"MuiPaper"}),r=g.useTheme(),{className:l,component:v="div",elevation:s=1,square:T=!1,variant:c="elevation",...u}=n,d={...n,component:v,elevation:s,square:T,variant:c},m=R(d);return process.env.NODE_ENV!=="production"&&r.shadows[s]===void 0&&console.error([`MUI: The elevation provided <Paper elevation={${s}}> is not available in the theme.`,`Please make sure that \`theme.shadows[${s}]\` is defined.`].join(` `)),h.jsx($,{as:v,ownerState:d,className:i.clsx(m.root,l),ref:t,...u,style:{...c==="elevation"&&{"--Paper-shadow":(r.vars||r).shadows[s],...r.vars&&{"--Paper-overlay":(y=r.vars.overlays)==null?void 0:y[s]},...!r.vars&&r.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${i.alpha("#fff",i.getOverlayAlpha(s))}, ${i.alpha("#fff",i.getOverlayAlpha(s))})`}},...u.style}})});process.env.NODE_ENV!=="production"&&(f.propTypes={children:a.PropTypes.node,classes:a.PropTypes.object,className:a.PropTypes.string,component:a.PropTypes.elementType,elevation:w.chainPropTypes(O.integerPropType,e=>{const{elevation:o,variant:t}=e;return o>0&&t==="outlined"?new Error(`MUI: Combining \`elevation={${o}}\` with \`variant="${t}"\` has no effect. Either use \`elevation={0}\` or use a different \`variant\`.`):null}),square:a.PropTypes.bool,style:a.PropTypes.object,sx:a.PropTypes.oneOfType([a.PropTypes.arrayOf(a.PropTypes.oneOfType([a.PropTypes.func,a.PropTypes.object,a.PropTypes.bool])),a.PropTypes.func,a.PropTypes.object]),variant:a.PropTypes.oneOfType([a.PropTypes.oneOf(["elevation","outlined"]),a.PropTypes.string])});exports.Paper=f;exports.getPaperUtilityClass=P;exports.paperClasses=x;