@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 11.1 kB
JavaScript
var fe=Object.create;var w=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var be=Object.getPrototypeOf,he=Object.prototype.hasOwnProperty;var ge=(t,e)=>{for(var o in e)w(t,o,{get:e[o],enumerable:!0})},Y=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xe(e))!he.call(t,n)&&n!==o&&w(t,n,{get:()=>e[n],enumerable:!(r=ue(e,n))||r.enumerable});return t};var ve=(t,e,o)=>(o=t!=null?fe(be(t)):{},Y(e||!t||!t.__esModule?w(o,"default",{value:t,enumerable:!0}):o,t)),Se=t=>Y(w({},"__esModule",{value:!0}),t);var He={};ge(He,{Splitter:()=>f,SplitterDemo:()=>I,SplitterNormal:()=>$e,SplitterPane:()=>d,SplitterSplitbar:()=>C,SplitterVertical:()=>Re});module.exports=Se(He);var m=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?m(...e):typeof e=="object"?Object.keys(e).map((o,r)=>e[r]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var A=(t,e)=>m({[`${t}-xs`]:e.size==="xsmall",[`${t}-sm`]:e.size==="small",[`${t}-md`]:e.size==="medium",[`${t}-lg`]:e.size==="large",[`${t}-xl`]:e.size==="xlarge",[`${t}-xxl`]:e.size==="xxlarge",[`${t}-xxxl`]:e.size==="xxxlarge"},{[`${t}-${e.fillMode}`]:e.fillMode},{[`${t}-${e.themeColor}`]:e.themeColor},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full","k-rounded-none":e.rounded==="none"}),Z=(t,e)=>{let{valid:o,invalid:r,hover:n,focus:l,checked:p,active:a,selected:c,disabled:u,indeterminate:b,loading:L,empty:k,readonly:de,highlighted:me,...H}=e;return m({"k-valid":o,"k-invalid":r,"k-hover":n,"k-focus":l,"k-checked":p,"k-active":a,"k-selected":c,"k-disabled":u,"k-indeterminate":b&&!p,"k-loading":L,"k-empty":k,"k-readonly":de,"k-highlighted":me},Object.keys(H).reduce((D,E)=>(E.startsWith("k-")?D[E]=H[E]:D[`k-${E}`]=H[E],D),{}))};var s={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var v={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},i={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},F={open:"open",hover:"hover",focus:"focus",active:"active",selected:"selected",disabled:"disabled",valid:"valid",invalid:"invalid",loading:"loading",required:"required",empty:"empty",indeterminate:"indeterminate",checked:"checked",readonly:"readonly",highlighted:"highlighted",generating:"generating",expanded:"expanded"};var ee=require("react/jsx-runtime"),P="k-pane",ye=[],ke={},V={resizable:!0,flex:!1},d=t=>{let{scrollable:e,flexBasis:o,flex:r=V.flex,collapsible:n,resizable:l=V.resizable,pinned:p,unpinned:a,tabbed:c,...u}=t;return(0,ee.jsx)("div",{...u,style:{flexBasis:o,...t.style},className:m(t.className,P,{[`${P}-static`]:o,[`${P}-flex`]:r,"k-scrollable":e,[`${P}-pinned`]:p,[`${P}-unpinned`]:a,[`${P}-tabbed`]:c}),role:"group",children:t.children})};d.states=ye;d.options=ke;d.className=P;d.defaultOptions=V;var M=require("react/jsx-runtime"),G="k-font-icon",Pe=[],Ne={size:[s.undefined,s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[i.undefined,i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info]},Ce={},O=t=>{let{size:e,themeColor:o,icon:r,rotate:n,flip:l,...p}=t;return r?(0,M.jsx)("span",{...p,className:m(t.className,G,A(G,{size:e}),{[`k-i-${r}`]:r,[`k-color-${o}`]:o,[`k-rotate-${n}`]:n,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),"aria-hidden":"true"}):(0,M.jsx)(M.Fragment,{})};O.states=Pe;O.options=Ne;O.className=G;O.defaultOptions=Ce;var te=O;var N=require("react/jsx-runtime"),U="k-svg-icon",ze=[],Ie={size:[s.undefined,s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[i.undefined,i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info],variant:[v.outline,v.solid,v.duotone]},j={viewBox:"0 0 24 24",variant:v.outline},$=t=>{var L,k;let{size:e,themeColor:o,rotate:r,flip:n,viewBox:l=j.viewBox,variant:p=j.variant,icon:a,...c}=t;if(!a)return(0,N.jsx)(N.Fragment,{});if(a==="none")return(0,N.jsx)("span",{...c,className:m(t.className,U,A("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let u=typeof a=="object"&&a.name&&a.name,b=typeof a=="object"?p&&((L=a.variants)==null?void 0:L[p])||((k=a.variants)==null?void 0:k.outline)||a.content:void 0;return(0,N.jsx)("span",{...c,className:m(t.className,U,A("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":n==="h"||n==="both","k-flip-v":n==="v"||n==="both"}),"aria-hidden":"true",children:(0,N.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:l,dangerouslySetInnerHTML:b!==void 0?{__html:b}:void 0,children:a?void 0:t.children})})};$.states=ze;$.options=Ie;$.className=U;$.defaultOptions=j;var q=$;var W=ve(require("@progress/kendo-svg-icons"));var oe="icon",ne="icons";var ie=require("react");var re=require("react"),ae=(0,re.createContext)({iconsType:"svg"});var y=require("react/jsx-runtime"),_="k-icon",Te=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Le=[],Ee={size:[s.undefined,s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[i.undefined,i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info],variant:[v.outline,v.solid,v.duotone]},B={viewBox:"0 0 24 24",type:"svg",variant:v.outline},S=t=>{let{iconsType:e}=(0,ie.useContext)(ae),{size:o,themeColor:r,icon:n,type:l=e||B.type,rotate:p,flip:a,viewBox:c=B.viewBox,variant:u=B.variant,...b}=t;if(!n)return(0,y.jsx)(y.Fragment,{});if((e||l)==="svg"){if(n==="none")return(0,y.jsx)(q,{...b,className:m(t.className,_),icon:n,size:o,variant:u});let k=W[n]?n:Te(`${n}-icon`);return W[k]?(0,y.jsx)(q,{...b,className:m(t.className,_),icon:W[k],size:o,themeColor:r,rotate:p,flip:a,viewBox:c,variant:u}):(0,y.jsx)(y.Fragment,{})}return(0,y.jsx)(te,{...b,className:m(t.className,_),icon:n,size:o,themeColor:r,rotate:p,flip:a})};S.states=Le;S.options=Ee;S.defaultOptions=B;S.className=_;S.moduleName=oe;S.folderName=ne;S.ariaSpec={selector:".k-icon, .k-svg-icon",rules:[{selector:".k-icon, .k-svg-icon",attribute:"aria-hidden=true",usage:"Hides the icon element and all its children from assistive technologies."}]};var x=require("react/jsx-runtime"),T="k-splitbar",Ae=[F.hover,F.focus],Me={},J={orientation:"horizontal",draggable:!0},C=t=>{let{hover:e,focus:o,orientation:r=J.orientation,draggable:n=J.draggable,collapsePrev:l,collapseNext:p,ariaLabel:a,...c}=t;return(0,x.jsxs)("div",{...c,className:m(t.className,T,Z(T,{hover:e,focus:o}),{[`${T}-${r}`]:r,[`${T}-draggable-${r}`]:n,[`${T}-static-${r}`]:!n&&!l&&!p}),role:"separator","aria-label":a,...r==="horizontal"&&{"aria-orientation":"vertical"},"aria-keyshortcuts":"ArrowLeft ArrowRight ArrowUp ArrowDown",children:[l&&(0,x.jsx)(x.Fragment,{children:(0,x.jsx)("div",{className:"k-collapse-prev",children:(0,x.jsx)(S,{icon:`chevron-${r==="horizontal"?"left":"up"}`,size:"xsmall"})})}),(0,x.jsx)("div",{className:"k-resize-handle","aria-hidden":"true"}),p&&(0,x.jsx)(x.Fragment,{children:(0,x.jsx)("div",{className:"k-collapse-next",children:(0,x.jsx)(S,{icon:`chevron-${r==="horizontal"?"right":"down"}`,size:"xsmall"})})})]})};C.states=Ae;C.options=Me;C.className=T;C.defaultOptions=J;var X="splitter",se=X;var K=require("react/jsx-runtime"),pe=require("react"),Q="k-splitter",Oe={},le={orientation:"horizontal"},f=t=>{let{orientation:e=le.orientation,children:o,panes:r,...n}=t,l=[];return r&&r.forEach((p,a)=>{let c=r[a+1],u=p.props,b=c==null?void 0:c.props;l.push((0,pe.createElement)(d,{...u,key:a})),c&&l.push((0,K.jsx)(C,{draggable:u.resizable!==!1&&b.resizable!==!1,collapsePrev:u.collapsible,collapseNext:b.collapsible,orientation:e,ariaLabel:"Pane separator"},`splitbar-${a}`))}),(0,K.jsxs)("div",{...n,className:m(t.className,Q,{[`${Q}-${e}`]:e},"k-splitter-flex"),children:[l,o]})};f.options=Oe;f.className=Q;f.defaultOptions=le;f.moduleName=X;f.folderName=se;f.ariaSpec={selector:".k-splitter",rules:[{selector:".k-pane",attribute:"role=group",usage:"Sets the proper role for the Splitter pane."},{selector:".k-splitbar",attribute:"role=separator",usage:"Sets the proper role for the Splitter split-bar element."},{selector:".k-splitbar",attribute:"aria-label",usage:"An accessible name for the separator."},{selector:".k-splitbar-horizontal",attribute:"aria-orientation=vertical",usage:"When a splitbar separates two panes horizontally, its aria-orientation must be explicitly set to vertical."},{selector:".k-splitbar",attribute:"aria-keyshortcuts",usage:"Announces available keyboard shortcuts."}]};var h=require("react/jsx-runtime"),$e=t=>(0,h.jsx)(f,{panes:[(0,h.jsx)(d,{flexBasis:"20%",collapsible:!0,children:(0,h.jsx)("p",{children:"Collapsible pane - 20%"})},"pane-1"),(0,h.jsxs)(d,{children:[(0,h.jsx)("p",{children:"Content"}),(0,h.jsx)("p",{children:"Content"}),(0,h.jsx)("p",{children:"Content"})]},"pane-2"),(0,h.jsx)(d,{flexBasis:"30%",collapsible:!0,children:(0,h.jsx)("p",{children:"Collapsible pane - 30%"})},"pane-3")],...t});var g=require("react/jsx-runtime"),Re=t=>(0,g.jsx)(f,{panes:[(0,g.jsx)(d,{flexBasis:"20%",collapsible:!0,children:(0,g.jsx)("p",{children:"Collapsible pane - 20%"})},"pane-1"),(0,g.jsxs)(d,{children:[(0,g.jsx)("p",{children:"Content"}),(0,g.jsx)("p",{children:"Content"}),(0,g.jsx)("p",{children:"Content"})]},"pane-2"),(0,g.jsx)(d,{flexBasis:"30%",collapsible:!0,children:(0,g.jsx)("p",{children:"Collapsible pane - 30%"})},"pane-3")],orientation:"vertical",...t});var z=require("react/jsx-runtime"),R=require("react"),we=f.options,_e=f.states,ce={...f.defaultOptions,variant:"horizontal",firstPaneProps:!0,secondPaneProps:!0},Be=[{name:"horizontal",title:"Horizontal"},{name:"vertical",title:"Vertical"}],Ke=[{name:"firstPaneProps",title:"Collapsible Left"},{name:"secondPaneProps",title:"Collapsible Right"}],I=t=>{let{variant:e,modifiers:o,...r}={...ce,...t},n=c=>({collapsible:c,content:c?"Resizable and collapsible":"Resizable only"}),l=n(!0),p=n(!0),a={display:"flex",justifyContent:"center",alignItems:"center"};return Object.keys(o||{}).forEach(c=>{let u=o==null?void 0:o[c];switch(c){case"secondPaneProps":p=n(!!u);break;case"firstPaneProps":l=n(!!u);break;default:break}}),e==="vertical"?(0,z.jsx)(f,{style:{height:"238px"},...r,orientation:"vertical",panes:[(0,R.createElement)(d,{...l,flexBasis:"50%",style:a,key:"pane-1"},(0,z.jsx)("p",{children:l.content})),(0,R.createElement)(d,{...p,flexBasis:"50%",style:a,key:"pane-2"},(0,z.jsx)("p",{children:p.content}))]}):(0,z.jsx)(f,{style:{height:"238px"},...r,orientation:"horizontal",panes:[(0,R.createElement)(d,{...l,flexBasis:"50%",style:a,key:"pane-1"},(0,z.jsx)("p",{children:l.content})),(0,R.createElement)(d,{...p,flexBasis:"50%",style:a,key:"pane-2"},(0,z.jsx)("p",{children:p.content}))]})};I.options=we;I.states=_e;I.variants=Be;I.defaultOptions=ce;I.modifiers=Ke;I.className=f.className;