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