@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) • 4.87 kB
JavaScript
;const P=require("react"),i=require("./index-kjfz41UI.cjs"),w=require("./generateUtilityClasses-CENS22bI.cjs"),y=require("./memoTheme-Bi1UNdyO.cjs"),D=require("./dividerClasses-BpVbhp8e.cjs"),u=require("react/jsx-runtime"),c=require("./DefaultPropsProvider-C1g4BXET.cjs");function O(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const R=O(P),S=t=>{const{absolute:e,children:r,classes:o,flexItem:d,light:s,orientation:n,textAlign:a,variant:l}=t,f={root:["root",e&&"absolute",l,s&&"light",n==="vertical"&&"vertical",d&&"flexItem",r&&"withChildren",r&&n==="vertical"&&"withChildrenVertical",a==="right"&&n!=="vertical"&&"textAlignRight",a==="left"&&n!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",n==="vertical"&&"wrapperVertical"]};return c.composeClasses(f,D.getDividerUtilityClass,o)},A=c.styled("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.absolute&&e.absolute,e[r.variant],r.light&&e.light,r.orientation==="vertical"&&e.vertical,r.flexItem&&e.flexItem,r.children&&e.withChildren,r.children&&r.orientation==="vertical"&&e.withChildrenVertical,r.textAlign==="right"&&r.orientation!=="vertical"&&e.textAlignRight,r.textAlign==="left"&&r.orientation!=="vertical"&&e.textAlignLeft]}})(y.memoTheme(({theme:t})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.alpha((t.vars||t).palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&e.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>e.orientation==="vertical"&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>e.textAlign==="right"&&e.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>e.textAlign==="left"&&e.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),C=c.styled("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.wrapper,r.orientation==="vertical"&&e.wrapperVertical]}})(y.memoTheme(({theme:t})=>({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}))),p=R.forwardRef(function(e,r){const o=c.useDefaultProps({props:e,name:"MuiDivider"}),{absolute:d=!1,children:s,className:n,orientation:a="horizontal",component:l=s||a==="vertical"?"div":"hr",flexItem:f=!1,light:b=!1,role:g=l!=="hr"?"separator":void 0,textAlign:T="center",variant:m="fullWidth",...x}=o,h={...o,absolute:d,component:l,flexItem:f,light:b,orientation:a,role:g,textAlign:T,variant:m},v=S(h);return u.jsx(A,{as:l,className:w.clsx(v.root,n),role:g,ref:r,ownerState:h,"aria-orientation":g==="separator"&&(l!=="hr"||a==="vertical")?a:void 0,...x,children:s?u.jsx(C,{className:v.wrapper,ownerState:h,children:s}):null})});p&&(p.muiSkipListHighlight=!0);process.env.NODE_ENV!=="production"&&(p.propTypes={absolute:i.PropTypes.bool,children:i.PropTypes.node,classes:i.PropTypes.object,className:i.PropTypes.string,component:i.PropTypes.elementType,flexItem:i.PropTypes.bool,light:i.PropTypes.bool,orientation:i.PropTypes.oneOf(["horizontal","vertical"]),role:i.PropTypes.string,sx:i.PropTypes.oneOfType([i.PropTypes.arrayOf(i.PropTypes.oneOfType([i.PropTypes.func,i.PropTypes.object,i.PropTypes.bool])),i.PropTypes.func,i.PropTypes.object]),textAlign:i.PropTypes.oneOf(["center","left","right"]),variant:i.PropTypes.oneOfType([i.PropTypes.oneOf(["fullWidth","inset","middle"]),i.PropTypes.string])});exports.Divider=p;