UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 12.2 kB
var s=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?s(...e):typeof e=="object"?Object.keys(e).map((a,i)=>e[i]||e[a]&&a||null).filter(a=>a!==null).join(" "):e).filter(e=>!!e).join(" ");var m=(t,e)=>s({[`${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"}),M=(t,e)=>s({"k-valid":e.valid,"k-invalid":e.invalid,"k-hover":e.hover,"k-focus":e.focus,"k-checked":e.checked,"k-active":e.active,"k-selected":e.selected,"k-disabled":e.disabled,"k-indeterminate":e.indeterminate&&!e.checked,"k-loading":e.loading,"k-empty":e.empty,"k-readonly":e.readonly});var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},p={small:"small",medium:"medium",large:"large",full:"full"},u={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"},r={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"};import{Fragment as Ee,jsx as ce}from"react/jsx-runtime";var U="k-icon k-font-icon",Pe=[],He={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Be={},C=t=>{let{size:e,themeColor:a,icon:i,rotate:c,flip:d,...l}=t;return i?ce("span",{...l,className:s(t.className,U,m(U,{size:e}),{[`k-i-${i}`]:i,[`k-color-${a}`]:a,[`k-rotate-${c}`]:c,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):ce(Ee,{})};C.states=Pe;C.options=He;C.className=U;C.defaultOptions=Be;var de=C;import{Fragment as $e,jsx as B}from"react/jsx-runtime";var D="k-icon k-svg-icon",Re=[],Ke={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},pe={viewBox:"0 0 24 24"},O=t=>{let{size:e,themeColor:a,rotate:i,flip:c,viewBox:d=pe.viewBox,icon:l,...f}=t;if(!l)return B($e,{});l==="none"&&{...f,className:s(t.className,D,"k-none")};let x=typeof l=="object"&&l.name&&l.name;return B("span",{...f,className:s(t.className,D,m("k-icon",{size:e}),{[`k-svg-i-${x}`]:x,[`k-color-${a}`]:a,[`k-rotate-${i}`]:i,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:B("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:d,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:t.children})})};O.states=Re;O.options=Ke;O.className=D;O.defaultOptions=pe;var W=O;import*as ue from"@progress/kendo-svg-icons";import{Fragment as me,jsx as L}from"react/jsx-runtime";var Ve=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),_e=[],Fe={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Q={viewBox:"0 0 24 24",type:"svg"},h=t=>{let{size:e,themeColor:a,icon:i,type:c=Q.type,rotate:d,flip:l,viewBox:f=Q.viewBox,...x}=t;if(!i)return L(me,{});if(c==="svg"){if(i==="none")return L(W,{...x,icon:i,size:e});let v=Ve(`${i}-icon`);return ue[v]?L(W,{...x,icon:ue[v],size:e,themeColor:a,rotate:d,flip:l,viewBox:f}):L(me,{})}return L(de,{...x,icon:i,size:e,themeColor:a,rotate:d,flip:l})};h.states=_e;h.options=Fe;h.defaultOptions=Q;import{Fragment as Xe,jsx as A,jsxs as fe}from"react/jsx-runtime";var E="k-button",qe=[r.hover,r.focus,r.active,r.selected,r.disabled],Ge={size:[n.small,n.medium,n.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline,u.clear,u.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},k={size:n.medium,rounded:p.medium,fillMode:u.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},I=t=>{let{size:e=k.size,rounded:a=k.rounded,fillMode:i=k.fillMode,themeColor:c=k.themeColor,showArrow:d=k.showArrow,arrowIconName:l=k.arrowIconName,hover:f,focus:x,active:v,selected:b,disabled:y,icon:w,text:S,iconClassName:q,...G}=t,X=w!==void 0,J=t.children!==void 0;return fe("button",{...G,className:s(t.className,E,m(E,{size:e,rounded:a,fillMode:i,themeColor:c}),M(E,{hover:f,focus:x,active:v,disabled:y,selected:b}),{"k-icon-button":!S&&!J&&X}),children:[w&&A(h,{className:s(q,"k-button-icon"),icon:w}),S?fe(Xe,{children:[S&&A("span",{className:"k-button-text",children:S}),t.children]}):t.children&&A("span",{className:"k-button-text",children:t.children}),d&&A("span",{className:"k-menu-button-arrow k-button-arrow",children:A(h,{icon:l})})]})};I.states=qe;I.options=Ge;I.className=E;I.defaultOptions=k;import{jsx as no}from"react/jsx-runtime";import{jsx as Je}from"react/jsx-runtime";var Y=t=>Je(I,{icon:"folder",children:"Button",...t});import{jsx as po}from"react/jsx-runtime";import{jsx as We}from"react/jsx-runtime";var R="k-input",Ue=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled,r.loading,r.readonly],De={size:[n.small,n.medium,n.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},K={size:n.medium,rounded:n.medium,fillMode:u.solid},N=t=>{let{hover:e,focus:a,disabled:i,invalid:c,valid:d,loading:l,readonly:f,size:x=K.size,rounded:v=K.rounded,fillMode:b=K.fillMode,...y}=t;return We("span",{...y,className:s(t.className,R,m(R,{size:x,rounded:v,fillMode:b}),M(R,{hover:e,focus:a,disabled:i,invalid:c,valid:d,loading:l,readonly:f}))})};N.states=Ue;N.options=De;N.className=R;N.defaultOptions=K;import{jsx as Ze}from"react/jsx-runtime";var $="k-picker",Qe=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled,r.loading,r.readonly],Ye={size:[n.small,n.medium,n.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},V={size:n.medium,rounded:p.medium,fillMode:u.solid},_=t=>{let{hover:e,focus:a,disabled:i,invalid:c,valid:d,loading:l,readonly:f,size:x=V.size,rounded:v=V.rounded,fillMode:b=V.fillMode,...y}=t;return Ze("span",{...y,className:s(t.className,$,m($,{size:x,rounded:v,fillMode:b}),M($,{hover:e,focus:a,disabled:i,invalid:c,valid:d,loading:l,readonly:f})),children:t.children})};_.states=Qe;_.options=Ye;_.className=$;_.defaultOptions=V;import{Fragment as tt,jsx as Z}from"react/jsx-runtime";var xe="k-clear-value",je=[r.disabled,r.loading,r.readonly],et={},j=t=>{let{disabled:e,loading:a,readonly:i,value:c}=t;return e||i||a||!c?Z(tt,{}):Z("span",{className:s(t.className,xe),children:Z(h,{icon:"x"})})};j.states=je;j.options=et;j.className=xe;import{jsx as at}from"react/jsx-runtime";var ee="k-input-inner",ot=[],nt={},F={type:"text",autocomplete:"off",value:"",placeholder:""},te=t=>{let{value:e=F.value,type:a=F.type,placeholder:i=F.placeholder,autocomplete:c=F.autocomplete,...d}=t;return at("input",{...d,type:a,className:s(t.className,ee,m(ee,t)),placeholder:i,autoComplete:c,defaultValue:e})};te.states=ot;te.options=nt;te.className=ee;import{jsx as he,jsxs as it}from"react/jsx-runtime";var oe="k-input-inner",st=[],rt={},ne=t=>{let{value:e,placeholder:a,showValue:i,valueIcon:c,valueIconName:d,...l}=t;return it("span",{...l,className:s(t.className,oe,m(oe,t)),children:[c,!c&&d&&he(h,{className:"k-input-value-icon",icon:d}),i&&!e&&a,i&&e&&he("span",{className:"k-input-value-text",children:e})]})};ne.states=st;ne.options=rt;ne.className=oe;import{jsx as dt}from"react/jsx-runtime";var ae="k-input-inner",lt=[],ct={},ve={value:"",placeholder:""},P=t=>{let{value:e=ve.value,placeholder:a=ve.placeholder,rows:i,...c}=t;return dt("textarea",{...c,className:s(t.className,ae,m(ae,t)),placeholder:a,rows:i,defaultValue:e})};P.states=lt;P.options=ct;P.className=ae;import{Fragment as ut,jsx as Ne}from"react/jsx-runtime";var Ie="k-input-loading-icon",pt=[r.disabled,r.loading],ge=t=>{let{disabled:e,loading:a}=t;return e||!a?Ne(ut,{}):Ne("span",{className:s(t.className,Ie,"k-icon k-i-loading")})};ge.states=pt;ge.className=Ie;import{Fragment as xt,jsx as be}from"react/jsx-runtime";var ye="k-input-validation-icon",mt=[r.valid,r.invalid,r.disabled,r.loading],ft={},se=t=>{let{valid:e,invalid:a,disabled:i,loading:c}=t,d=a?"warning-circle":"check-circle";return i||c||!!!(e||a)?be(xt,{}):be(h,{className:s(ye),icon:d})};se.states=mt;se.options=ft;se.className=ye;import{Fragment as Nt,jsx as ke}from"react/jsx-runtime";var ht="k-input-prefix",vt={direction:"horizontal"},Se=t=>{let{direction:e=vt.direction,...a}=t;return t.children?ke("span",{...a,className:s(ht,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):ke(Nt,{})};import{Fragment as bt,jsx as Me}from"react/jsx-runtime";var It="k-input-suffix",gt={direction:"horizontal"},Te=t=>{let{direction:e=gt.direction,...a}=t;return t.children?Me("span",{...a,className:s(It,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):Me(bt,{})};import{jsx as jo}from"react/jsx-runtime";import{jsx as nn}from"react/jsx-runtime";import{jsx as kt}from"react/jsx-runtime";var ze="k-input-separator",yt={direction:"vertical"},re=t=>{let{direction:e=yt.direction,...a}=t;return kt("span",{...a,className:s(ze,t.className,{[`${ze}-${e}`]:e})})};import{Fragment as we,jsx as H,jsxs as ie}from"react/jsx-runtime";var Ce="k-textarea",St=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled],Mt={size:[n.small,n.medium,n.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},g={size:N.defaultOptions.size,rounded:N.defaultOptions.rounded,fillMode:N.defaultOptions.fillMode,flow:"vertical",affixesOrientation:"horizontal",resize:"both",separators:!0},T=t=>{let{size:e=g.size,rounded:a=g.rounded,fillMode:i=g.fillMode,separators:c=g.separators,affixesOrientation:d=g.affixesOrientation,flow:l=g.flow,resize:f=g.resize,prefix:x,suffix:v,rows:b,value:y,placeholder:w,hover:S,focus:q,valid:G,invalid:X,required:J,disabled:Le,...Ae}=t;return ie(N,{...Ae,size:e,rounded:a,fillMode:i,hover:S,focus:q,valid:G,invalid:X,required:J,disabled:Le,className:s(t.className,Ce,{"!k-flex-col":l==="vertical","!k-flex-row":l==="horizontal"}),children:[x&&ie(we,{children:[H(Se,{className:s({"!k-align-items-start":l===d}),direction:d,children:x}),c&&H(re,{direction:l==="horizontal"?"vertical":"horizontal"})]}),H(P,{className:s("!k-overflow-auto",{"!k-flex-none":l==="vertical","k-resize-x":f==="x","k-resize-y":f==="y","k-resize":f==="both","k-resize-none":f==="none"}),value:y,placeholder:w,rows:b}),v&&ie(we,{children:[c&&H(re,{direction:l==="horizontal"?"vertical":"horizontal"}),H(Te,{className:s({"!k-align-items-start":l===d}),direction:d,children:v})]})]})};T.states=St;T.options=Mt;T.className=Ce;T.defaultOptions=g;import{jsx as Cn}from"react/jsx-runtime";import{Fragment as Bn,jsx as Hn}from"react/jsx-runtime";import{Fragment as Fn,jsx as _n}from"react/jsx-runtime";import{Fragment as zt,jsx as z,jsxs as le}from"react/jsx-runtime";var Tt="k-prompt-view",Zn=t=>{let{showSearch:e,suggestions:a,settings:i,...c}=t;return le("div",{...c,className:s(t.className,Tt),children:[e&&z(T,{resize:"y",rows:1,placeholder:"Ask or generate content with AI"}),a&&le("div",{className:"k-prompt-expander",children:[z(Y,{fillMode:"flat",icon:"chevron-up",children:"Prompt Suggestions"}),z("div",{className:"k-prompt-expander-content",children:z(zt,{children:a})})]}),i&&le("div",{className:"k-prompt-expander",children:[z(Y,{fillMode:"flat",icon:"chevron-up",children:"Settings"}),z("div",{className:"k-prompt-expander-content",children:i})]}),t.children]})};export{Tt as PROMPTVIEW_CLASSNAME,Zn as PromptView};