@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 6.64 kB
JavaScript
var l=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((s,a)=>e[a]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var h=(o,e)=>l({[`${o}-xs`]:e.size==="xsmall",[`${o}-sm`]:e.size==="small",[`${o}-md`]:e.size==="medium",[`${o}-lg`]:e.size==="large",[`${o}-xl`]:e.size==="xlarge",[`${o}-xxl`]:e.size==="xxlarge",[`${o}-xxxl`]:e.size==="xxxlarge"},{[`${o}-${e.fillMode}`]:e.fillMode},{[`${o}-${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"}),R=(o,e)=>{let{valid:s,invalid:a,hover:i,focus:d,checked:c,active:r,selected:g,disabled:p,indeterminate:u,loading:O,empty:b,readonly:B,highlighted:q,...T}=e;return l({"k-valid":s,"k-invalid":a,"k-hover":i,"k-focus":d,"k-checked":c,"k-active":r,"k-selected":g,"k-disabled":p,"k-indeterminate":u&&!c,"k-loading":O,"k-empty":b,"k-readonly":B,"k-highlighted":q},Object.keys(T).reduce((E,k)=>(k.startsWith("k-")?E[k]=T[k]:E[`k-${k}`]=T[k],E),{}))};var n={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},v={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"};var m={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},t={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},y={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{Fragment as X,jsx as H}from"react/jsx-runtime";var F="k-font-icon",W=[],J={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info]},Q={},C=o=>{let{size:e,themeColor:s,icon:a,rotate:i,flip:d,...c}=o;return a?H("span",{...c,className:l(o.className,F,h(F,{size:e}),{[`k-i-${a}`]:a,[`k-color-${s}`]:s,[`k-rotate-${i}`]:i,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"}),"aria-hidden":"true"}):H(X,{})};C.states=W;C.options=J;C.className=F;C.defaultOptions=Q;var K=C;import{Fragment as ee,jsx as M}from"react/jsx-runtime";var _="k-svg-icon",Y=[],Z={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info],variant:[m.outline,m.solid,m.duotone]},L={viewBox:"0 0 24 24",variant:m.outline},N=o=>{let{size:e,themeColor:s,rotate:a,flip:i,viewBox:d=L.viewBox,variant:c=L.variant,icon:r,...g}=o;if(!r)return M(ee,{});if(r==="none")return M("span",{...g,className:l(o.className,_,h("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let p=typeof r=="object"&&r.name&&r.name,u=typeof r=="object"?c&&r.variants?.[c]||r.variants?.outline||r.content:void 0;return M("span",{...g,className:l(o.className,_,h("k-icon",{size:e}),{[`k-svg-i-${p}`]:p,[`k-color-${s}`]:s,[`k-rotate-${a}`]:a,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),"aria-hidden":"true",children:M("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof r=="object"?r.viewBox:d,dangerouslySetInnerHTML:u!==void 0?{__html:u}:void 0,children:r?void 0:o.children})})};N.states=Y;N.options=Z;N.className=_;N.defaultOptions=L;var w=N;import*as $ from"@progress/kendo-svg-icons";var D="icon",P="icons";import{useContext as oe}from"react";import{createContext as te}from"react";var V=te({iconsType:"svg"});import{Fragment as G,jsx as A}from"react/jsx-runtime";var I="k-icon",ne=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ie=[],re={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info],variant:[m.outline,m.solid,m.duotone]},S={viewBox:"0 0 24 24",type:"svg",variant:m.outline},f=o=>{let{iconsType:e}=oe(V),{size:s,themeColor:a,icon:i,type:d=e||S.type,rotate:c,flip:r,viewBox:g=S.viewBox,variant:p=S.variant,...u}=o;if(!i)return A(G,{});if((e||d)==="svg"){if(i==="none")return A(w,{...u,className:l(o.className,I),icon:i,size:s,variant:p});let b=$[i]?i:ne(`${i}-icon`);return $[b]?A(w,{...u,className:l(o.className,I),icon:$[b],size:s,themeColor:a,rotate:c,flip:r,viewBox:g,variant:p}):A(G,{})}return A(K,{...u,className:l(o.className,I),icon:i,size:s,themeColor:a,rotate:c,flip:r})};f.states=ie;f.options=re;f.defaultOptions=S;f.className=I;f.moduleName=D;f.folderName=P;f.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{jsx as U,jsxs as ce}from"react/jsx-runtime";var z="k-fab",le=[y.hover,y.focus,y.active,y.selected,y.disabled],de={size:[n.undefined,n.small,n.medium,n.large],rounded:[v.undefined,v.none,v.small,v.medium,v.large,v.full],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary]},j={type:"button"},x=o=>{let{size:e,rounded:s,themeColor:a,text:i,icon:d,type:c=j.type,position:r,hover:g,focus:p,active:u,selected:O,disabled:b,...B}=o;return ce("button",{...B,type:c,className:l(o.className,z,h(z,{size:e,rounded:s,themeColor:a}),R(z,{hover:g,focus:p,active:u,disabled:b,selected:O}),{[`!k-pos-absolute k-${r}`]:r}),...!i&&d&&!o["aria-label"]&&{"aria-label":"Action"},...b&&{"aria-disabled":"true"},disabled:b||void 0,children:[d&&U(f,{className:"k-fab-icon",icon:d}),i&&U("span",{className:"k-fab-text",children:i})]})};x.states=le;x.options=de;x.className=z;x.defaultOptions=j;x.moduleName="fab";x.folderName="fab";x.ariaSpec={selector:".k-fab",rules:[{selector:".k-fab",attribute:"role=button or nodeName=button",usage:"Omitted if the <button> DOM element is used."},{selector:".k-fab",attribute:"aria-label or title (when icon-only)",usage:"The attribute must be present when no text is initially visible in the button."},{selector:".k-fab.k-disabled",attribute:"aria-disabled=true",usage:"Rendered only when the button is disabled."}]};import{jsx as ue}from"react/jsx-runtime";var Qe=o=>ue(x,{icon:"plus",text:"Create",disabled:!0,...o});export{Qe as FloatingActionButtonDisabled};