UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 10.6 kB
var fe=Object.create;var R=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)R(t,o,{get:e[o],enumerable:!0})},Q=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xe(e))!he.call(t,n)&&n!==o&&R(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)):{},Q(e||!t||!t.__esModule?R(o,"default",{value:t,enumerable:!0}):o,t)),Se=t=>Q(R({},"__esModule",{value:!0}),t);var Ke={};ge(Ke,{SplitterVertical:()=>Be});module.exports=Se(Ke);var d=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?d(...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 E=(t,e)=>d({[`${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"}),Y=(t,e)=>{let{valid:o,invalid:r,hover:n,focus:l,checked:p,active:a,selected:c,disabled:m,indeterminate:b,loading:T,empty:y,readonly:de,highlighted:me,...K}=e;return d({"k-valid":o,"k-invalid":r,"k-hover":n,"k-focus":l,"k-checked":p,"k-active":a,"k-selected":c,"k-disabled":m,"k-indeterminate":b&&!p,"k-loading":T,"k-empty":y,"k-readonly":de,"k-highlighted":me},Object.keys(K).reduce((H,L)=>(L.startsWith("k-")?H[L]=K[L]:H[`k-${L}`]=K[L],H),{}))};var s={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var g={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"},D={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 Z=require("react/jsx-runtime"),k="k-pane",ye=[],ke={},F={resizable:!0,flex:!1},f=t=>{let{scrollable:e,flexBasis:o,flex:r=F.flex,collapsible:n,resizable:l=F.resizable,pinned:p,unpinned:a,tabbed:c,...m}=t;return(0,Z.jsx)("div",{...m,style:{flexBasis:o,...t.style},className:d(t.className,k,{[`${k}-static`]:o,[`${k}-flex`]:r,"k-scrollable":e,[`${k}-pinned`]:p,[`${k}-unpinned`]:a,[`${k}-tabbed`]:c}),role:"group",children:t.children})};f.states=ye;f.options=ke;f.className=k;f.defaultOptions=F;var A=require("react/jsx-runtime"),V="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={},M=t=>{let{size:e,themeColor:o,icon:r,rotate:n,flip:l,...p}=t;return r?(0,A.jsx)("span",{...p,className:d(t.className,V,E(V,{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,A.jsx)(A.Fragment,{})};M.states=Pe;M.options=Ne;M.className=V;M.defaultOptions=Ce;var ee=M;var P=require("react/jsx-runtime"),G="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:[g.outline,g.solid,g.duotone]},U={viewBox:"0 0 24 24",variant:g.outline},O=t=>{var T,y;let{size:e,themeColor:o,rotate:r,flip:n,viewBox:l=U.viewBox,variant:p=U.variant,icon:a,...c}=t;if(!a)return(0,P.jsx)(P.Fragment,{});if(a==="none")return(0,P.jsx)("span",{...c,className:d(t.className,G,E("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let m=typeof a=="object"&&a.name&&a.name,b=typeof a=="object"?p&&((T=a.variants)==null?void 0:T[p])||((y=a.variants)==null?void 0:y.outline)||a.content:void 0;return(0,P.jsx)("span",{...c,className:d(t.className,G,E("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`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,P.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})})};O.states=ze;O.options=Ie;O.className=G;O.defaultOptions=U;var j=O;var q=ve(require("@progress/kendo-svg-icons"));var te="icon",oe="icons";var ae=require("react");var ne=require("react"),re=(0,ne.createContext)({iconsType:"svg"});var S=require("react/jsx-runtime"),w="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:[g.outline,g.solid,g.duotone]},_={viewBox:"0 0 24 24",type:"svg",variant:g.outline},v=t=>{let{iconsType:e}=(0,ae.useContext)(re),{size:o,themeColor:r,icon:n,type:l=e||_.type,rotate:p,flip:a,viewBox:c=_.viewBox,variant:m=_.variant,...b}=t;if(!n)return(0,S.jsx)(S.Fragment,{});if((e||l)==="svg"){if(n==="none")return(0,S.jsx)(j,{...b,className:d(t.className,w),icon:n,size:o,variant:m});let y=q[n]?n:Te(`${n}-icon`);return q[y]?(0,S.jsx)(j,{...b,className:d(t.className,w),icon:q[y],size:o,themeColor:r,rotate:p,flip:a,viewBox:c,variant:m}):(0,S.jsx)(S.Fragment,{})}return(0,S.jsx)(ee,{...b,className:d(t.className,w),icon:n,size:o,themeColor:r,rotate:p,flip:a})};v.states=Le;v.options=Ee;v.defaultOptions=_;v.className=w;v.moduleName=te;v.folderName=oe;v.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"),C="k-splitbar",Ae=[D.hover,D.focus],Me={},W={orientation:"horizontal",draggable:!0},z=t=>{let{hover:e,focus:o,orientation:r=W.orientation,draggable:n=W.draggable,collapsePrev:l,collapseNext:p,ariaLabel:a,...c}=t;return(0,x.jsxs)("div",{...c,className:d(t.className,C,Y(C,{hover:e,focus:o}),{[`${C}-${r}`]:r,[`${C}-draggable-${r}`]:n,[`${C}-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)(v,{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)(v,{icon:`chevron-${r==="horizontal"?"right":"down"}`,size:"xsmall"})})})]})};z.states=Ae;z.options=Me;z.className=C;z.defaultOptions=W;var J="splitter",ie=J;var B=require("react/jsx-runtime"),le=require("react"),X="k-splitter",Oe={},se={orientation:"horizontal"},u=t=>{let{orientation:e=se.orientation,children:o,panes:r,...n}=t,l=[];return r&&r.forEach((p,a)=>{let c=r[a+1],m=p.props,b=c==null?void 0:c.props;l.push((0,le.createElement)(f,{...m,key:a})),c&&l.push((0,B.jsx)(z,{draggable:m.resizable!==!1&&b.resizable!==!1,collapsePrev:m.collapsible,collapseNext:b.collapsible,orientation:e,ariaLabel:"Pane separator"},`splitbar-${a}`))}),(0,B.jsxs)("div",{...n,className:d(t.className,X,{[`${X}-${e}`]:e},"k-splitter-flex"),children:[l,o]})};u.options=Oe;u.className=X;u.defaultOptions=se;u.moduleName=J;u.folderName=ie;u.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 pe=require("react/jsx-runtime");var N=require("react/jsx-runtime"),$=require("react"),$e=u.options,Re=u.states,ce={...u.defaultOptions,variant:"horizontal",firstPaneProps:!0,secondPaneProps:!0},we=[{name:"horizontal",title:"Horizontal"},{name:"vertical",title:"Vertical"}],_e=[{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 m=o==null?void 0:o[c];switch(c){case"secondPaneProps":p=n(!!m);break;case"firstPaneProps":l=n(!!m);break;default:break}}),e==="vertical"?(0,N.jsx)(u,{style:{height:"238px"},...r,orientation:"vertical",panes:[(0,$.createElement)(f,{...l,flexBasis:"50%",style:a,key:"pane-1"},(0,N.jsx)("p",{children:l.content})),(0,$.createElement)(f,{...p,flexBasis:"50%",style:a,key:"pane-2"},(0,N.jsx)("p",{children:p.content}))]}):(0,N.jsx)(u,{style:{height:"238px"},...r,orientation:"horizontal",panes:[(0,$.createElement)(f,{...l,flexBasis:"50%",style:a,key:"pane-1"},(0,N.jsx)("p",{children:l.content})),(0,$.createElement)(f,{...p,flexBasis:"50%",style:a,key:"pane-2"},(0,N.jsx)("p",{children:p.content}))]})};I.options=$e;I.states=Re;I.variants=we;I.defaultOptions=ce;I.modifiers=_e;I.className=u.className;var h=require("react/jsx-runtime"),Be=t=>(0,h.jsx)(u,{panes:[(0,h.jsx)(f,{flexBasis:"20%",collapsible:!0,children:(0,h.jsx)("p",{children:"Collapsible pane - 20%"})},"pane-1"),(0,h.jsxs)(f,{children:[(0,h.jsx)("p",{children:"Content"}),(0,h.jsx)("p",{children:"Content"}),(0,h.jsx)("p",{children:"Content"})]},"pane-2"),(0,h.jsx)(f,{flexBasis:"30%",collapsible:!0,children:(0,h.jsx)("p",{children:"Collapsible pane - 30%"})},"pane-3")],orientation:"vertical",...t});