UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 14.9 kB
var et=Object.create;var ee=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var nt=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var st=(t,e)=>{for(var o in e)ee(t,o,{get:e[o],enumerable:!0})},ye=(t,e,o,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ot(e))!at.call(t,a)&&a!==o&&ee(t,a,{get:()=>e[a],enumerable:!(l=tt(e,a))||l.enumerable});return t};var it=(t,e,o)=>(o=t!=null?et(nt(t)):{},ye(e||!t||!t.__esModule?ee(o,"default",{value:t,enumerable:!0}):o,t)),rt=t=>ye(ee({},"__esModule",{value:!0}),t);var Yt={};st(Yt,{SearchboxNormal:()=>Qt});module.exports=rt(Yt);var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((o,l)=>e[l]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var N=(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.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"}),_=(t,e)=>{let{valid:o,invalid:l,hover:a,focus:d,checked:p,active:c,selected:g,disabled:h,indeterminate:x,loading:I,empty:v,readonly:P,highlighted:U,...O}=e;return i({"k-valid":o,"k-invalid":l,"k-hover":a,"k-focus":d,"k-checked":p,"k-active":c,"k-selected":g,"k-disabled":h,"k-indeterminate":x&&!p,"k-loading":I,"k-empty":v,"k-readonly":P,"k-highlighted":U},Object.keys(O).reduce((y,A)=>(A.startsWith("k-")?y[A]=O[A]:y[`k-${A}`]=O[A],y),{}))};function Se(t,e){if(!e)return{};let o=Array.isArray(e)?e:[e];return Object.fromEntries(o.map(l=>[`k-${l}`,!0]))}var n={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},u={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},m={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},k={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"},s={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 D="input",te=D;var Me=require("react/jsx-runtime"),oe="k-input",lt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],dt={size:[n.undefined,n.small,n.medium,n.large],rounded:[u.undefined,u.none,u.small,u.medium,u.large,u.full],fillMode:[m.undefined,m.solid,m.flat,m.outline]},ct={},S=t=>{let{hover:e,focus:o,disabled:l,invalid:a,valid:d,loading:p,readonly:c,size:g,rounded:h,fillMode:x,...I}=t;return(0,Me.jsx)("span",{...I,className:i(t.className,oe,N(oe,{size:g,rounded:h,fillMode:x}),_(oe,{hover:e,focus:o,disabled:l,invalid:a,valid:d,loading:p,readonly:c}))})};S.states=lt;S.options=dt;S.className=oe;S.defaultOptions=ct;S.moduleName=D;S.folderName=te;var ke=require("react/jsx-runtime"),ne="k-picker",ut=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],pt={size:[n.undefined,n.small,n.medium,n.large],rounded:[u.undefined,u.none,u.small,u.medium,u.large,u.full],fillMode:[m.undefined,m.solid,m.flat,m.outline]},mt={},B=t=>{let{hover:e,focus:o,disabled:l,invalid:a,valid:d,loading:p,readonly:c,size:g,rounded:h,fillMode:x,...I}=t;return(0,ke.jsx)("span",{...I,className:i(t.className,ne,N(ne,{size:g,rounded:h,fillMode:x}),_(ne,{hover:e,focus:o,disabled:l,invalid:a,valid:d,loading:p,readonly:c})),children:t.children})};B.states=ut;B.options=pt;B.className=ne;B.defaultOptions=mt;B.moduleName=D;B.folderName=te;var F=require("react/jsx-runtime"),re="k-font-icon",ft=[],xt={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[r.undefined,r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info]},bt={},q=t=>{let{size:e,themeColor:o,icon:l,rotate:a,flip:d,...p}=t;return l?(0,F.jsx)("span",{...p,className:i(t.className,re,N(re,{size:e}),{[`k-i-${l}`]:l,[`k-color-${o}`]:o,[`k-rotate-${a}`]:a,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"}),"aria-hidden":"true"}):(0,F.jsx)(F.Fragment,{})};q.states=ft;q.options=xt;q.className=re;q.defaultOptions=bt;var Te=q;var E=require("react/jsx-runtime"),le="k-svg-icon",ht=[],Nt={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[r.undefined,r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info],variant:[k.outline,k.solid,k.duotone]},de={viewBox:"0 0 24 24",variant:k.outline},G=t=>{var I,v;let{size:e,themeColor:o,rotate:l,flip:a,viewBox:d=de.viewBox,variant:p=de.variant,icon:c,...g}=t;if(!c)return(0,E.jsx)(E.Fragment,{});if(c==="none")return(0,E.jsx)("span",{...g,className:i(t.className,le,N("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let h=typeof c=="object"&&c.name&&c.name,x=typeof c=="object"?p&&((I=c.variants)==null?void 0:I[p])||((v=c.variants)==null?void 0:v.outline)||c.content:void 0;return(0,E.jsx)("span",{...g,className:i(t.className,le,N("k-icon",{size:e}),{[`k-svg-i-${h}`]:h,[`k-color-${o}`]:o,[`k-rotate-${l}`]:l,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"}),"aria-hidden":"true",children:(0,E.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof c=="object"?c.viewBox:d,dangerouslySetInnerHTML:x!==void 0?{__html:x}:void 0,children:c?void 0:t.children})})};G.states=ht;G.options=Nt;G.className=le;G.defaultOptions=de;var ce=G;var ue=it(require("@progress/kendo-svg-icons"));var Ce="icon",Oe="icons";var Ee=require("react");var Le=require("react"),Ae=(0,Le.createContext)({iconsType:"svg"});var C=require("react/jsx-runtime"),ae="k-icon",gt=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),It=[],vt={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[r.undefined,r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info],variant:[k.outline,k.solid,k.duotone]},se={viewBox:"0 0 24 24",type:"svg",variant:k.outline},f=t=>{let{iconsType:e}=(0,Ee.useContext)(Ae),{size:o,themeColor:l,icon:a,type:d=e||se.type,rotate:p,flip:c,viewBox:g=se.viewBox,variant:h=se.variant,...x}=t;if(!a)return(0,C.jsx)(C.Fragment,{});if((e||d)==="svg"){if(a==="none")return(0,C.jsx)(ce,{...x,className:i(t.className,ae),icon:a,size:o,variant:h});let v=ue[a]?a:gt(`${a}-icon`);return ue[v]?(0,C.jsx)(ce,{...x,className:i(t.className,ae),icon:ue[v],size:o,themeColor:l,rotate:p,flip:c,viewBox:g,variant:h}):(0,C.jsx)(C.Fragment,{})}return(0,C.jsx)(Te,{...x,className:i(t.className,ae),icon:a,size:o,themeColor:l,rotate:p,flip:c})};f.states=It;f.options=vt;f.defaultOptions=se;f.className=ae;f.moduleName=Ce;f.folderName=Oe;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."}]};var K=require("react/jsx-runtime"),ze="k-clear-value",yt=[s.disabled,s.loading,s.readonly],St={},z=t=>{let{disabled:e,loading:o,readonly:l,value:a}=t;return e||l||o||!a?(0,K.jsx)(K.Fragment,{}):(0,K.jsx)("span",{className:i(t.className,ze),children:(0,K.jsx)(f,{icon:"x"})})};z.states=yt;z.options=St;z.className=ze;var we=require("react/jsx-runtime"),pe="k-input-inner",Mt=[],kt={},ie={type:"text",autocomplete:"off",value:"",placeholder:""},w=t=>{let{value:e=ie.value,type:o=ie.type,placeholder:l=ie.placeholder,autocomplete:a=ie.autocomplete,disabled:d,readOnly:p,...c}=t;return(0,we.jsx)("input",{...c,type:o,className:i(t.className,pe,N(pe,t)),placeholder:l,autoComplete:a,defaultValue:e,disabled:d||void 0,readOnly:p||void 0})};w.states=Mt;w.options=kt;w.className=pe;var X=require("react/jsx-runtime"),me="k-input-inner",Tt=[],Ct={},fe=t=>{let{value:e,placeholder:o,showValue:l,valueIcon:a,valueIconName:d,...p}=t;return(0,X.jsxs)("span",{...p,className:i(t.className,me,N(me,t)),children:[a,!a&&d&&(0,X.jsx)(f,{className:"k-input-value-icon",icon:d}),l&&!e&&o,l&&e&&(0,X.jsx)("span",{className:"k-input-value-text",children:e})]})};fe.states=Tt;fe.options=Ct;fe.className=me;var He=require("react/jsx-runtime"),xe="k-input-inner",Ot=[],Lt={},Re={value:"",placeholder:""},be=t=>{let{value:e=Re.value,placeholder:o=Re.placeholder,rows:l,disabled:a,...d}=t;return(0,He.jsx)("textarea",{...d,className:i(t.className,xe,N(xe,t)),placeholder:o,rows:l,defaultValue:e,disabled:a||void 0})};be.states=Ot;be.options=Lt;be.className=xe;var W=require("react/jsx-runtime"),Pe="k-input-loading-icon",At=[s.disabled,s.loading],V=t=>{let{disabled:e,loading:o}=t;return e||!o?(0,W.jsx)(W.Fragment,{}):(0,W.jsx)("span",{className:i(t.className,Pe,"k-icon k-i-loading")})};V.states=At;V.className=Pe;var J=require("react/jsx-runtime"),_e="k-input-validation-icon",Et=[s.valid,s.invalid,s.disabled,s.loading],zt={},R=t=>{let{valid:e,invalid:o,disabled:l,loading:a}=t,d=o?"warning-circle":"check-circle";return l||a||!!!(e||o)?(0,J.jsx)(J.Fragment,{}):(0,J.jsx)(f,{className:i(_e),icon:d})};R.states=Et;R.options=zt;R.className=_e;var Q=require("react/jsx-runtime"),wt="k-input-prefix",Rt={direction:"horizontal"},Be=t=>{let{direction:e=Rt.direction,...o}=t;return t.children?(0,Q.jsx)("span",{...o,className:i(wt,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):(0,Q.jsx)(Q.Fragment,{})};var Y=require("react/jsx-runtime"),Ht="k-input-suffix",Pt={direction:"horizontal"},Ke=t=>{let{direction:e=Pt.direction,...o}=t;return t.children?(0,Y.jsx)("span",{...o,className:i(Ht,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):(0,Y.jsx)(Y.Fragment,{})};var _t=require("react/jsx-runtime");var Bt=require("react/jsx-runtime");var $e=require("react/jsx-runtime"),Ve="k-input-separator",Kt={direction:"vertical"},he=t=>{let{direction:e=Kt.direction,...o}=t;return(0,$e.jsx)("span",{...o,className:i(Ve,t.className,{[`${Ve}-${e}`]:e})})};var Ne="button",Ue=Ne;var M=require("react/jsx-runtime"),Z="k-button",Vt=["icon-button"],$t=[s.hover,s.focus,s.active,s.selected,s.disabled,s.generating],Ut={size:[n.undefined,n.xsmall,n.small,n.medium,n.large],rounded:[u.undefined,u.none,u.small,u.medium,u.large,u.full],fillMode:[m.undefined,m.solid,m.flat,m.outline,m.clear,m.link],themeColor:[r.undefined,r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.inverse]},ge={showArrow:!1,arrowIconName:"chevron-down"},T=t=>{let{as:e="button",size:o,rounded:l,fillMode:a,themeColor:d,showArrow:p=ge.showArrow,arrowIconName:c=ge.arrowIconName,variant:g,hover:h,focus:x,active:I,selected:v,disabled:P,togglable:U,ariaDisabled:O,icon:y,iconSize:A,text:j,iconClassName:Je,className:Qe,...Ye}=t,Ze=y!=null,je=t.children!==void 0;return(0,M.jsxs)(e,{className:i(Qe,Z,Se(Z,g),N(Z,{size:o,rounded:l,fillMode:a,themeColor:d}),_(Z,{hover:h,focus:x,active:I,disabled:P||O,selected:v}),{"k-icon-button":!j&&!je&&Ze}),"aria-pressed":U?v?"true":"false":void 0,...Ye,"aria-disabled":O?"true":void 0,disabled:P||void 0,children:[typeof y=="string"&&y&&(0,M.jsx)(f,{className:i(Je,"k-button-icon"),icon:y,size:A}),y&&typeof y!="string"&&(0,M.jsx)(M.Fragment,{children:y}),j?(0,M.jsxs)(M.Fragment,{children:[j&&(0,M.jsx)("span",{className:"k-button-text",children:j}),t.children]}):t.children&&(0,M.jsx)("span",{className:"k-button-text",children:t.children}),p&&(0,M.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,M.jsx)(f,{icon:c})})]})};T.states=$t;T.options=Ut;T.variants=Vt;T.className=Z;T.defaultOptions=ge;T.moduleName=Ne;T.folderName=Ue;T.ariaSpec={selector:".k-button",rules:[{selector:".k-button",attribute:"role=button or nodeName=button",usage:"The button role is implicit from the native <button> element."},{selector:".k-button",attribute:"aria-label (when icon-only)",usage:"Required for icon-only buttons that have no visible text."},{selector:".k-button",attribute:"aria-pressed (when togglable)",usage:"Indicates the pressed state of a toggle button."},{selector:".k-button",attribute:"disabled (when disabled)",usage:"Rendered when the button is disabled."}]};var Fe=require("react/jsx-runtime"),De=t=>(0,Fe.jsx)(T,{children:"Button",...t});var b=require("react/jsx-runtime"),Dt=S.states,Ft=S.defaultOptions,qt=S.options,Gt=[{name:"prefix",title:"Prefix"},{name:"suffix",title:"Suffix"},{name:"clear-button",title:"`Clear` Button"},{name:"validation-icon",title:"Validation Icon"},{name:"separators",title:"Separators"}],Xt=[],$=t=>{let{modifiers:e,valid:o,invalid:l,loading:a,disabled:d,readonly:p,...c}=t,g=e==null?void 0:e.prefix,h=e==null?void 0:e.suffix,x=e==null?void 0:e["clear-button"],I=e==null?void 0:e["validation-icon"],v=e==null?void 0:e.separators;return(0,b.jsxs)(S,{...c,valid:o,invalid:l,loading:a,disabled:d,readonly:p,style:{width:300},children:[g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Be,{children:(0,b.jsx)(f,{icon:"lock"})}),v&&(0,b.jsx)(he,{})]}),(0,b.jsx)(w,{placeholder:"Placeholder",value:"Value"}),I&&(0,b.jsx)(R,{valid:o,invalid:l,loading:a,disabled:d}),(0,b.jsx)(V,{loading:a,disabled:d}),x&&(0,b.jsx)(z,{loading:a,disabled:d,readonly:p,value:"Value"}),h&&(0,b.jsxs)(b.Fragment,{children:[v&&(0,b.jsx)(he,{}),(0,b.jsx)(Ke,{children:(0,b.jsx)(De,{size:c.size,fillMode:"clear",children:"Send"})})]})]})};$.options=qt;$.states=Dt;$.variants=Xt;$.defaultOptions=Ft;$.modifiers=Gt;$.className=S.className;var Ie="searchbox",qe=Ie;var L=require("react/jsx-runtime"),Ge="k-searchbox",Wt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading],Jt={size:[n.undefined,n.small,n.medium,n.large],rounded:[u.undefined,u.none,u.small,u.medium,u.large,u.full],fillMode:[m.undefined,m.solid,m.flat,m.outline]},ve={showIcon:!0,icon:"search"},H=t=>{let{value:e,placeholder:o,size:l,rounded:a,fillMode:d,hover:p,focus:c,valid:g,invalid:h,required:x,loading:I,disabled:v,showIcon:P=ve.showIcon,icon:U=ve.icon,"aria-label":O,...y}=t;return(0,L.jsxs)(S,{...y,size:l,rounded:a,fillMode:d,hover:p,focus:c,valid:g,invalid:h,required:x,loading:I,disabled:v,className:i(t.className,Ge),children:[P&&(0,L.jsx)(f,{className:"k-input-icon",icon:U}),(0,L.jsx)(w,{placeholder:o,value:e,"aria-label":O}),(0,L.jsx)(V,{...t}),(0,L.jsx)(R,{...t}),(0,L.jsx)(z,{...t})]})};H.states=Wt;H.options=Jt;H.className=Ge;H.defaultOptions=ve;H.moduleName=Ie;H.folderName=qe;var Xe=H;var We=require("react/jsx-runtime"),Qt=t=>(0,We.jsx)(Xe,{...t});