UNPKG

@cgi-learning-hub/ui

Version:

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

2 lines (1 loc) 6.39 kB
"use strict";const c=require("./generateUtilityClasses-CENS22bI.cjs"),ee=require("react"),g=require("./index-kjfz41UI.cjs"),te=require("react/jsx-runtime");function ne(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const L=ne(ee);function re(e,t,r=void 0){const n={};for(const s in e){const o=e[s];let u="",i=!0;for(let a=0;a<o.length;a+=1){const l=o[a];l&&(u+=(i===!0?"":" ")+t(l),i=!1,r&&r[l]&&(u+=" "+r[l]))}n[s]=u}return n}function C(e,t=""){return e.displayName||e.name||t}function k(e,t,r){const n=C(t);return e.displayName||(n!==""?`${r}(${n})`:r)}function se(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return C(e,"Component");if(typeof e=="object")switch(e.$$typeof){case c.reactIsExports.ForwardRef:return k(e,e.render,"ForwardRef");case c.reactIsExports.Memo:return k(e,e.type,"memo");default:return}}}function q(e){const{variants:t,...r}=e,n={variants:t,style:c.internal_serializeStyles(r),isProcessed:!0};return n.style===r||t&&t.forEach(s=>{typeof s.style!="function"&&(s.style=c.internal_serializeStyles(s.style))}),n}const oe=c.createTheme$1();function _(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function v(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function ie(e){return e?(t,r)=>r[e]:null}function ce(e,t,r){e.theme=ae(e.theme)?r:e.theme[t]||e.theme}function b(e,t,r){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(s=>b(e,s,r));if(Array.isArray(n==null?void 0:n.variants)){let s;if(n.isProcessed)s=r?v(n.style,r):n.style;else{const{variants:o,...u}=n;s=r?v(c.internal_serializeStyles(u),r):u}return I(e,n.variants,[s],r)}return n!=null&&n.isProcessed?r?v(c.internal_serializeStyles(n.style),r):n.style:r?v(c.internal_serializeStyles(n),r):n}function I(e,t,r=[],n=void 0){var o;let s;e:for(let u=0;u<t.length;u+=1){const i=t[u];if(typeof i.props=="function"){if(s??(s={...e,...e.ownerState,ownerState:e.ownerState}),!i.props(s))continue}else for(const a in i.props)if(e[a]!==i.props[a]&&((o=e.ownerState)==null?void 0:o[a])!==i.props[a])continue e;typeof i.style=="function"?(s??(s={...e,...e.ownerState,ownerState:e.ownerState}),r.push(n?v(c.internal_serializeStyles(i.style(s)),n):i.style(s))):r.push(n?v(c.internal_serializeStyles(i.style),n):i.style)}return r}function M(e={}){const{themeId:t,defaultTheme:r=oe,rootShouldForwardProp:n=_,slotShouldForwardProp:s=_}=e;function o(i){ce(i,t,r)}return(i,a={})=>{c.internal_mutateStyles(i,f=>f.filter(d=>d!==c.styleFunctionSx));const{name:l,slot:h,skipVariantsResolver:E,skipSx:G,overridesResolver:N=ie(z(h)),...J}=a,R=l&&l.startsWith("Mui")||h?"components":"custom",Q=E!==void 0?E:h&&h!=="Root"&&h!=="root"||!1,X=G||!1;let x=_;h==="Root"||h==="root"?x=n:h?x=s:fe(i)&&(x=void 0);const j=c.styled(i,{shouldForwardProp:x,label:le(l,h),...J}),Y=f=>{if(f.__emotion_real===f)return f;if(typeof f=="function")return function(p){return b(p,f,p.theme.modularCssLayers?R:void 0)};if(c.isPlainObject(f)){const d=q(f);return function(S){return d.variants?b(S,d,S.theme.modularCssLayers?R:void 0):S.theme.modularCssLayers?v(d.style,R):d.style}}return f},$=(...f)=>{const d=[],p=f.map(Y),S=[];if(d.push(o),l&&N&&S.push(function(y){var O,A;const m=(A=(O=y.theme.components)==null?void 0:O[l])==null?void 0:A.styleOverrides;if(!m)return null;const P={};for(const V in m)P[V]=b(y,m[V],y.theme.modularCssLayers?"theme":void 0);return N(y,P)}),l&&!Q&&S.push(function(y){var P,O;const w=y.theme,m=(O=(P=w==null?void 0:w.components)==null?void 0:P[l])==null?void 0:O.variants;return m?I(y,m,[],y.theme.modularCssLayers?"theme":void 0):null}),X||S.push(c.styleFunctionSx),Array.isArray(p[0])){const T=p.shift(),y=new Array(d.length).fill(""),w=new Array(S.length).fill("");let m;m=[...y,...T,...w],m.raw=[...y,...T.raw,...w],d.unshift(m)}const Z=[...d,...p,...S],D=j(...Z);return i.muiName&&(D.muiName=i.muiName),process.env.NODE_ENV!=="production"&&(D.displayName=ue(l,h,i)),D};return j.withConfig&&($.withConfig=j.withConfig),$}}function ue(e,t,r){return e?`${e}${c.capitalize(t||"")}`:`Styled(${se(r)})`}function le(e,t){let r;return process.env.NODE_ENV!=="production"&&e&&(r=`${e}-${z(t||"Root")}`),r}function ae(e){for(const t in e)return!1;return!0}function fe(e){return typeof e=="string"&&e.charCodeAt(0)>96}function z(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function F(e,t,r=!1){const n={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const o=s;if(o==="components"||o==="slots")n[o]={...e[o],...n[o]};else if(o==="componentsProps"||o==="slotProps"){const u=e[o],i=t[o];if(!i)n[o]=u||{};else if(!u)n[o]=i;else{n[o]={...i};for(const a in u)if(Object.prototype.hasOwnProperty.call(u,a)){const l=a;n[o][l]=F(u[l],i[l],r)}}}else o==="className"&&r&&t.className?n.className=c.clsx(e==null?void 0:e.className,t==null?void 0:t.className):o==="style"&&r&&t.style?n.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:n[o]===void 0&&(n[o]=e[o])}return n}const H=L.createContext(void 0);function W({value:e,children:t}){return te.jsx(H.Provider,{value:e,children:t})}process.env.NODE_ENV!=="production"&&(W.propTypes={children:g.PropTypes.node,value:g.PropTypes.object});function de(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const s=t.components[r];return s.defaultProps?F(s.defaultProps,n,t.components.mergeClassNameAndStyle):!s.styleOverrides&&!s.variants?F(s,n,t.components.mergeClassNameAndStyle):n}function ye({props:e,name:t}){const r=L.useContext(H);return de({props:e,name:t,theme:{components:r}})}const K=c.createTheme();function B(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const U=e=>B(e)&&e!=="classes",he=M({themeId:c.THEME_ID,defaultTheme:K,rootShouldForwardProp:U});process.env.NODE_ENV!=="production"&&(g.PropTypes.node,g.PropTypes.object.isRequired);function me(e){return ye(e)}exports.DefaultPropsProvider=W;exports.composeClasses=re;exports.createStyled=M;exports.defaultTheme=K;exports.preprocessStyles=q;exports.resolveProps=F;exports.rootShouldForwardProp=U;exports.shouldForwardProp=_;exports.slotShouldForwardProp=B;exports.styled=he;exports.useDefaultProps=me;