UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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