UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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