UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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