UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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