UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 14.7 kB
var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((n,r)=>e[r]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var _=(t,e)=>i({[`${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.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${t}-${e.themeColor}`]:e.themeColor&&e.fillMode===void 0},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full"}),R=(t,e)=>{let{valid:n,invalid:r,hover:l,focus:m,checked:s,active:u,selected:p,disabled:x,indeterminate:M,loading:E,empty:g,readonly:O,highlighted:N,...S}=e;return i({"k-valid":n,"k-invalid":r,"k-hover":l,"k-focus":m,"k-checked":s,"k-active":u,"k-selected":p,"k-disabled":x,"k-indeterminate":M&&!s,"k-loading":E,"k-empty":g,"k-readonly":O,"k-highlighted":N},Object.keys(S).reduce((A,h)=>(h.startsWith("k-")?A[h]=S[h]:A[`k-${h}`]=S[h],A),{}))};function Ae(t,e){if(!e)return{};let n=Array.isArray(e)?e:[e];return Object.fromEntries(n.map(r=>[`k-${r}`,!0]))}var a={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},L={small:"small",medium:"medium",large:"large",full:"full"},I={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},o={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},c={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 tt,jsx as Le}from"react/jsx-runtime";var re="k-font-icon",Ze=[],je={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},et={},W=t=>{let{size:e,themeColor:n,icon:r,rotate:l,flip:m,...s}=t;return r?Le("span",{...s,className:i(t.className,re,_(re,{size:e}),{[`k-i-${r}`]:r,[`k-color-${n}`]:n,[`k-rotate-${l}`]:l,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):Le(tt,{})};W.states=Ze;W.options=je;W.className=re;W.defaultOptions=et;var ke=W;import{Fragment as rt,jsx as j}from"react/jsx-runtime";var se="k-svg-icon",ot=[],nt={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},ge={viewBox:"0 0 24 24"},X=t=>{let{size:e,themeColor:n,rotate:r,flip:l,viewBox:m=ge.viewBox,icon:s,...u}=t;if(!s)return j(rt,{});s==="none"&&{...u,className:i(t.className,se,"k-none")};let p=typeof s=="object"&&s.name&&s.name;return j("span",{...u,className:i(t.className,se,_("k-icon",{size:e}),{[`k-svg-i-${p}`]:p,[`k-color-${n}`]:n,[`k-rotate-${r}`]:r,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:j("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:m,dangerouslySetInnerHTML:typeof s=="object"?{__html:s.content}:void 0,children:s?void 0:t.children})})};X.states=ot;X.options=nt;X.className=se;X.defaultOptions=ge;var ie=X;import*as ae from"@progress/kendo-svg-icons";var Oe="icon",Se="icons";import{Fragment as ve,jsx as G}from"react/jsx-runtime";var ee="k-icon",st=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),it=[],at={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},le={viewBox:"0 0 24 24",type:"svg"},f=t=>{let{size:e,themeColor:n,icon:r,type:l=le.type,rotate:m,flip:s,viewBox:u=le.viewBox,...p}=t;if(!r)return G(ve,{});if(l==="svg"){if(r==="none")return G(ie,{...p,className:i(t.className,ee),icon:r,size:e});let x=ae[r]?r:st(`${r}-icon`);return ae[x]?G(ie,{...p,className:i(t.className,ee),icon:ae[x],size:e,themeColor:n,rotate:m,flip:s,viewBox:u}):G(ve,{})}return G(ke,{...p,className:i(t.className,ee),icon:r,size:e,themeColor:n,rotate:m,flip:s})};f.states=it;f.options=at;f.defaultOptions=le;f.className=ee;f.moduleName=Oe;f.folderName=Se;var me="button",Ce=me;import{Fragment as ut,jsx as q,jsxs as Te}from"react/jsx-runtime";var Q="k-button",lt=["icon-button"],mt=[c.hover,c.focus,c.active,c.selected,c.disabled,c.generating],ct={size:[a.small,a.medium,a.large],rounded:[L.small,L.medium,L.large,L.full],fillMode:[I.solid,I.flat,I.outline,I.clear,I.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},z={size:a.medium,rounded:L.medium,fillMode:I.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=t=>{let{size:e=z.size,rounded:n=z.rounded,fillMode:r=z.fillMode,themeColor:l=z.themeColor,showArrow:m=z.showArrow,arrowIconName:s=z.arrowIconName,variant:u,hover:p,focus:x,active:M,selected:E,disabled:g,icon:O,text:N,iconClassName:S,...A}=t,h=O!==void 0,w=t.children!==void 0;return Te("button",{...A,className:i(t.className,Q,Ae(Q,u),_(Q,{size:e,rounded:n,fillMode:r,themeColor:l}),R(Q,{hover:p,focus:x,active:M,disabled:g,selected:E}),{"k-icon-button":!N&&!w&&h}),children:[O&&q(f,{className:i(S,"k-button-icon"),icon:O}),N?Te(ut,{children:[N&&q("span",{className:"k-button-text",children:N}),t.children]}):t.children&&q("span",{className:"k-button-text",children:t.children}),m&&q("span",{className:"k-menu-button-arrow k-button-arrow",children:q(f,{icon:s})})]})};d.states=mt;d.options=ct;d.variants=lt;d.className=Q;d.defaultOptions=z;d.moduleName=me;d.folderName=Ce;import{jsx as pt}from"react/jsx-runtime";var ye=t=>pt(d,{icon:"folder",...t,children:void 0});import{jsx as Lo}from"react/jsx-runtime";import{jsx as So}from"react/jsx-runtime";var ce="popup",we=ce;import{jsx as _e}from"react/jsx-runtime";var Be="k-animation-container",dt=[],ft={},Pe={positionMode:"absolute"},B=t=>{let{positionMode:e=Pe.positionMode,animationStyle:n,offset:r,...l}=t;return _e("div",{...l,style:{...r,...t.style},className:i(t.className,Be,"k-animation-container-shown",{"k-animation-container-fixed":e==="fixed"}),children:_e("div",{className:"k-child-animation-container",style:n,children:t.children})})};B.states=dt;B.options=ft;B.className=Be;B.defaultOptions=Pe;B.moduleName=ce;B.folderName=we;var ue="popup",Ke=ue;import{jsx as Re}from"react/jsx-runtime";var ze="k-popup",Mt=[],Nt={},Ue={positionMode:"absolute"},y=t=>{let{offset:e,positionMode:n=Ue.positionMode,animationStyle:r,...l}=t;return Re(B,{positionMode:n,offset:e,animationStyle:r,children:Re("div",{...l,className:i(t.className,ze),children:t.children})})};y.states=Mt;y.options=Nt;y.className=ze;y.defaultOptions=Ue;y.moduleName=ue;y.folderName=Ke;var pe="menu-button",He=pe;import{Fragment as It,jsx as De,jsxs as bt}from"react/jsx-runtime";var $e="k-menu-button",xt=[c.hover,c.focus,c.active,c.selected,c.disabled],ht={size:[a.small,a.medium,a.large],rounded:[L.small,L.medium,L.large,L.full],fillMode:[I.solid,I.flat,I.outline,I.clear,I.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},U={size:a.medium,rounded:L.medium,fillMode:I.solid,themeColor:o.base,showArrow:!0,arrowIconName:"caret-alt-down"},P=t=>{let{size:e=U.size,rounded:n=U.rounded,fillMode:r=U.fillMode,themeColor:l=U.themeColor,hover:m,focus:s,active:u,selected:p,disabled:x,icon:M,text:E,showArrow:g=U.showArrow,arrowIconName:O=U.arrowIconName,popup:N,opened:S,...A}=t;return bt(It,{children:[De(d,{...A,className:i(t.className,$e),text:E,size:e,rounded:n,fillMode:r,themeColor:l,hover:m,focus:s,active:u,selected:p,disabled:x,icon:M,showArrow:g,arrowIconName:O}),S&&N&&De(y,{className:"k-menu-popup",children:N})]})};P.states=xt;P.options=ht;P.className=$e;P.defaultOptions=U;P.moduleName=pe;P.folderName=He;import{jsx as rn}from"react/jsx-runtime";import{jsx as mn}from"react/jsx-runtime";import{jsx as dn}from"react/jsx-runtime";var b="menu",k=b;import{Fragment as Lt,jsx as F,jsxs as Fe}from"react/jsx-runtime";var fe="k-menu-item",Et=[c.hover,c.focus,c.active,c.selected,c.disabled],At={},Ve={iconPosition:"before"},v=t=>{let{hover:e,focus:n,active:r,selected:l,disabled:m,icon:s,text:u,first:p,last:x,showArrow:M,arrowIconName:E,iconPosition:g=Ve.iconPosition,dir:O,children:N,...S}=t,A=F(Lt,{});N&&N.forEach(w=>{if(w.type==="MenuItemContent"){A.props.children.push(w);return}});let h=E;return h||(h=O==="rtl"?"caret-alt-left":"caret-alt-right"),Fe("li",{...S,className:i(t.className,fe,"k-item",R(fe,{focus:n,disabled:m,hover:e,active:r,selected:l}),{"k-first":p,"k-last":x}),children:[Fe("span",{className:i("k-link k-menu-link"),children:[s&&g==="before"&&F(f,{className:"k-menu-link-icon",icon:s}),F("span",{className:"k-menu-link-text",children:u}),s&&g==="after"&&F(f,{className:"k-menu-link-icon",icon:s}),M&&F("span",{className:"k-menu-expand-arrow",children:F(f,{icon:h})})]}),A]})};v.states=Et;v.options=At;v.className=fe;v.defaultOptions=Ve;v.moduleName=b;v.folderName=k;import{Fragment as Ot,jsx as V,jsxs as Je}from"react/jsx-runtime";var Me="k-menu-item",kt=[c.hover,c.focus,c.active,c.selected,c.disabled],gt={},Ne={dir:"ltr",iconPosition:"before"},C=t=>{let{hover:e,focus:n,active:r,selected:l,disabled:m,icon:s,text:u,first:p,last:x,showArrow:M,arrowIconName:E,iconPosition:g=Ne.iconPosition,dir:O=Ne.dir,children:N,popup:S,...A}=t,h=V(Ot,{});N&&N.forEach(ne=>{if(ne.type==="MenuListItemContent"){h.props.children.push(ne);return}});let w=E;return w||(w=O==="rtl"?"caret-alt-left":"caret-alt-right"),Je("li",{...A,className:i(t.className,Me,"k-item",R(Me,{focus:n,disabled:m}),{"k-first":p,"k-last":x}),children:[Je("span",{className:i("k-link k-menu-link",R("k-menu-link",{hover:e,active:r,selected:l,disabled:m})),children:[s&&g==="before"&&V(f,{className:"k-menu-link-icon",icon:s}),V("span",{className:"k-menu-link-text",children:u}),s&&g==="after"&&V(f,{className:"k-menu-link-icon",icon:s}),M&&V("span",{className:"k-menu-expand-arrow",children:V(f,{icon:w})})]}),h,S]})};C.states=kt;C.options=gt;C.className=Me;C.defaultOptions=Ne;C.moduleName=b;C.folderName=k;import{jsx as Tt}from"react/jsx-runtime";var We="k-menu-scroll-wrapper",St=[],vt={},Ct={},H=t=>{let{className:e,children:n,orientation:r,...l}=t;return Tt("div",{...l,className:i(e,We,{"k-menu-scroll-wrapper-vertical":r==="vertical"}),children:n})};H.states=St;H.options=vt;H.className=We;H.defaultOptions=Ct;H.moduleName=b;H.folderName=k;var Xe=H;import{Fragment as xe,jsx as D,jsxs as te}from"react/jsx-runtime";var he="k-menu",yt=[],wt={},oe={orientation:"horizontal",header:!0,scrollButtonsPosition:"around"},T=t=>{let{children:e,orientation:n=oe.orientation,header:r=oe.header,scrollable:l,scrollButtonsPosition:m=oe.scrollButtonsPosition,wrapperStyles:s,dir:u,popup:p,...x}=t,M={horizontal:{prev:u!=="rtl"?"left":"right",next:u!=="rtl"?"right":"left"},vertical:{prev:"up",next:"down"}},E=D("ul",{dir:u,...x,className:i(t.className,"k-reset",he,{[`${he}-${n}`]:n,"k-header":r}),children:e});return te(xe,{children:[l?te(Xe,{orientation:n,style:s,dir:t.dir,children:[m==="start"&&te(xe,{children:[D(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),D(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}),m==="around"&&D(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),E,m==="end"&&te(xe,{children:[D(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),D(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}),m==="around"&&D(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}):E,p]})};T.states=yt;T.options=wt;T.className=he;T.defaultOptions=oe;T.moduleName=b;T.folderName=k;import{jsx as _t}from"react/jsx-runtime";var Ie="k-separator",Ge={orientation:"horizontal"},$=t=>{let{orientation:e=Ge.orientation,...n}=t;return _t("li",{...n,className:i(t.className,"k-item",Ie,{[`${Ie}-${e}`]:e})})};$.className=Ie;$.defaultOptions=Ge;$.moduleName=b;$.folderName=k;import{Fragment as $n,jsx as Fn}from"react/jsx-runtime";import{jsx as qe}from"react/jsx-runtime";import{createElement as Kt}from"react";var be="k-menu-group",Bt=[],Pt={size:[a.small,a.medium,a.large]},Ee={size:a.medium,dir:"ltr"},K=t=>{let{children:e,size:n=Ee.size,dir:r=Ee.dir,...l}=t,m=[];return e&&Array.isArray(e)&&e.map((s,u)=>{s.type===C?m.push(Kt(C,{...s.props,dir:r,key:u})):s.type===$?m.push(qe($,{})):m.push(s)}),qe("ul",{...l,className:i(t.className,be,_(be,{size:n})),children:m})};K.states=Bt;K.options=Pt;K.className=be;K.defaultOptions=Ee;K.moduleName=b;K.folderName=k;import{Fragment as er,jsx as jn,jsxs as tr}from"react/jsx-runtime";import{Fragment as lr,jsx as ir,jsxs as ar}from"react/jsx-runtime";import{Fragment as dr,jsx as pr,jsxs as fr}from"react/jsx-runtime";import{Fragment as Ir,jsx as hr,jsxs as br}from"react/jsx-runtime";import{Fragment as gr,jsx as kr,jsxs as Or}from"react/jsx-runtime";import{jsx as Vr,jsxs as Jr}from"react/jsx-runtime";import{jsx as J,jsxs as Qe}from"react/jsx-runtime";var Ye="k-chat-file",Rt=[c.selected],zt={},Y={icon:"file-pdf",name:"FileName.pdf",size:"2MB",showButton:"true"},Z=t=>{let{icon:e=Y.icon,name:n=Y.name,size:r=Y.size,status:l,deleted:m,removeButton:s,showButton:u=Y.showButton,...p}=t;return Qe("li",{...p,className:i(Ye,t.className,{"k-chat-file-deleted":m}),children:[J(f,{icon:e,size:"xlarge"}),Qe("div",{className:"k-chat-file-info",children:[n&&J("span",{className:"k-chat-file-name",children:n}),r&&J("span",{className:"k-chat-file-size",children:r}),l&&J("span",{className:"k-chat-file-status",children:l})]}),u&&(s?J(ye,{icon:"x",fillMode:"flat"}):J(P,{icon:"more-vertical",fillMode:"flat",showArrow:!1}))]})};Z.states=Rt;Z.options=zt;Z.className=Ye;Z.defaultOptions=Y;var ns=Z;export{Ye as CHATFILE_CLASSNAME,Z as ChatFile,ns as default};