UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 16.4 kB
var et=Object.create;var oe=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)oe(t,o,{get:e[o],enumerable:!0})},Ce=(t,e,o,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ot(e))!at.call(t,n)&&n!==o&&oe(t,n,{get:()=>e[n],enumerable:!(l=tt(e,n))||l.enumerable});return t};var it=(t,e,o)=>(o=t!=null?et(nt(t)):{},Ce(e||!t||!t.__esModule?oe(o,"default",{value:t,enumerable:!0}):o,t)),rt=t=>Ce(oe({},"__esModule",{value:!0}),t);var Yt={};st(Yt,{MaskedTextboxSuffix:()=>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 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:x,loading:k,empty:I,readonly:A,highlighted:X,...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":x&&!p,"k-loading":k,"k-empty":I,"k-readonly":A,"k-highlighted":X},Object.keys(T).reduce((b,C)=>(C.startsWith("k-")?b[C]=T[C]:b[`k-${C}`]=T[C],b),{}))};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 q="input",ne=q;var Ae=require("react/jsx-runtime"),ae="k-input",lt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],dt={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]},ut={},M=t=>{let{hover:e,focus:o,disabled:l,invalid:n,valid:d,loading:p,readonly:u,size:N,rounded:g,fillMode:x,...k}=t;return(0,Ae.jsx)("span",{...k,className:i(t.className,ae,v(ae,{size:N,rounded:g,fillMode:x}),H(ae,{hover:e,focus:o,disabled:l,invalid:n,valid:d,loading:p,readonly:u}))})};M.states=lt;M.options=dt;M.className=ae;M.defaultOptions=ut;M.moduleName=q;M.folderName=ne;var we=require("react/jsx-runtime"),se="k-picker",ct=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],pt={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]},mt={},K=t=>{let{hover:e,focus:o,disabled:l,invalid:n,valid:d,loading:p,readonly:u,size:N,rounded:g,fillMode:x,...k}=t;return(0,we.jsx)("span",{...k,className:i(t.className,se,v(se,{size:N,rounded:g,fillMode:x}),H(se,{hover:e,focus:o,disabled:l,invalid:n,valid:d,loading:p,readonly:u})),children:t.children})};K.states=ct;K.options=pt;K.className=se;K.defaultOptions=mt;K.moduleName=q;K.folderName=ne;var G=require("react/jsx-runtime"),fe="k-font-icon",ft=[],xt={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]},bt={},J=t=>{let{size:e,themeColor:o,icon:l,rotate:n,flip:d,...p}=t;return l?(0,G.jsx)("span",{...p,className:i(t.className,fe,v(fe,{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,G.jsx)(G.Fragment,{})};J.states=ft;J.options=xt;J.className=fe;J.defaultOptions=bt;var ze=J;var z=require("react/jsx-runtime"),xe="k-svg-icon",ht=[],Nt={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]},be={viewBox:"0 0 24 24",variant:O.outline},W=t=>{var k,I;let{size:e,themeColor:o,rotate:l,flip:n,viewBox:d=be.viewBox,variant:p=be.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,xe,v("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let g=typeof u=="object"&&u.name&&u.name,x=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,xe,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:x!==void 0?{__html:x}:void 0,children:u?void 0:t.children})})};W.states=ht;W.options=Nt;W.className=xe;W.defaultOptions=be;var he=W;var Ne=it(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"),ie="k-icon",gt=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),vt=[],It={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]},re={viewBox:"0 0 24 24",type:"svg",variant:O.outline},f=t=>{let{iconsType:e}=(0,He.useContext)(_e),{size:o,themeColor:l,icon:n,type:d=e||re.type,rotate:p,flip:u,viewBox:N=re.viewBox,variant:g=re.variant,...x}=t;if(!n)return(0,L.jsx)(L.Fragment,{});if((e||d)==="svg"){if(n==="none")return(0,L.jsx)(he,{...x,className:i(t.className,ie),icon:n,size:o,variant:g});let I=Ne[n]?n:gt(`${n}-icon`);return Ne[I]?(0,L.jsx)(he,{...x,className:i(t.className,ie),icon:Ne[I],size:o,themeColor:l,rotate:p,flip:u,viewBox:N,variant:g}):(0,L.jsx)(L.Fragment,{})}return(0,L.jsx)(ze,{...x,className:i(t.className,ie),icon:n,size:o,themeColor:l,rotate:p,flip:u})};f.states=vt;f.options=It;f.defaultOptions=re;f.className=ie;f.moduleName=Pe;f.folderName=Be;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 V=require("react/jsx-runtime"),Ke="k-clear-value",yt=[s.disabled,s.loading,s.readonly],kt={},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)(f,{icon:"x"})})};P.states=yt;P.options=kt;P.className=Ke;var Ve=require("react/jsx-runtime"),ge="k-input-inner",Mt=[],St={},le={type:"text",autocomplete:"off",value:"",placeholder:""},B=t=>{let{value:e=le.value,type:o=le.type,placeholder:l=le.placeholder,autocomplete:n=le.autocomplete,disabled:d,readOnly:p,...u}=t;return(0,Ve.jsx)("input",{...u,type:o,className:i(t.className,ge,v(ge,t)),placeholder:l,autoComplete:n,defaultValue:e,disabled:d||void 0,readOnly:p||void 0})};B.states=Mt;B.options=St;B.className=ge;var Q=require("react/jsx-runtime"),ve="k-input-inner",Tt=[],Ct={},Ie=t=>{let{value:e,placeholder:o,showValue:l,valueIcon:n,valueIconName:d,...p}=t;return(0,Q.jsxs)("span",{...p,className:i(t.className,ve,v(ve,t)),children:[n,!n&&d&&(0,Q.jsx)(f,{className:"k-input-value-icon",icon:d}),l&&!e&&o,l&&e&&(0,Q.jsx)("span",{className:"k-input-value-text",children:e})]})};Ie.states=Tt;Ie.options=Ct;Ie.className=ve;var $e=require("react/jsx-runtime"),ye="k-input-inner",Ot=[],Et={},De={value:"",placeholder:""},ke=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,ye,v(ye,t)),placeholder:o,rows:l,defaultValue:e,disabled:n||void 0})};ke.states=Ot;ke.options=Et;ke.className=ye;var Y=require("react/jsx-runtime"),Ue="k-input-loading-icon",Lt=[s.disabled,s.loading],D=t=>{let{disabled:e,loading:o}=t;return e||!o?(0,Y.jsx)(Y.Fragment,{}):(0,Y.jsx)("span",{className:i(t.className,Ue,"k-icon k-i-loading")})};D.states=Lt;D.className=Ue;var Z=require("react/jsx-runtime"),Fe="k-input-validation-icon",At=[s.valid,s.invalid,s.disabled,s.loading],wt={},R=t=>{let{valid:e,invalid:o,disabled:l,loading:n}=t,d=o?"warning-circle":"check-circle";return l||n||!!!(e||o)?(0,Z.jsx)(Z.Fragment,{}):(0,Z.jsx)(f,{className:i(Fe),icon:d})};R.states=At;R.options=wt;R.className=Fe;var j=require("react/jsx-runtime"),zt="k-input-prefix",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-prefix-${e}`]:e}),children:t.children}):(0,j.jsx)(j.Fragment,{})};var ee=require("react/jsx-runtime"),Bt="k-input-suffix",Rt={direction:"horizontal"},ue=t=>{let{direction:e=Rt.direction,...o}=t;return t.children?(0,ee.jsx)("span",{...o,className:i(Bt,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):(0,ee.jsx)(ee.Fragment,{})};var _t=require("react/jsx-runtime");var Ht=require("react/jsx-runtime");var qe=require("react/jsx-runtime"),Xe="k-input-separator",Kt={direction:"vertical"},$=t=>{let{direction:e=Kt.direction,...o}=t;return(0,qe.jsx)("span",{...o,className:i(Xe,t.className,{[`${Xe}-${e}`]:e})})};var Me="button",Ge=Me;var S=require("react/jsx-runtime"),te="k-button",Vt=["icon-button"],Dt=[s.hover,s.focus,s.active,s.selected,s.disabled,s.generating],$t={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]},Se={showArrow:!1,arrowIconName:"chevron-down"},E=t=>{let{as:e="button",size:o,rounded:l,fillMode:n,themeColor:d,showArrow:p=Se.showArrow,arrowIconName:u=Se.arrowIconName,variant:N,hover:g,focus:x,active:k,selected:I,disabled:A,togglable:X,ariaDisabled:T,icon:b,iconSize:C,text:_,iconClassName:ce,className:pe,...me}=t,Ze=b!=null,je=t.children!==void 0;return(0,S.jsxs)(e,{className:i(pe,te,Oe(te,N),v(te,{size:o,rounded:l,fillMode:n,themeColor:d}),H(te,{hover:g,focus:x,active:k,disabled:A||T,selected:I}),{"k-icon-button":!_&&!je&&Ze}),"aria-pressed":X?I?"true":"false":void 0,...me,"aria-disabled":T?"true":void 0,disabled:A||void 0,children:[typeof b=="string"&&b&&(0,S.jsx)(f,{className:i(ce,"k-button-icon"),icon:b,size:C}),b&&typeof b!="string"&&(0,S.jsx)(S.Fragment,{children:b}),_?(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)(f,{icon:u})})]})};E.states=Dt;E.options=$t;E.variants=Vt;E.className=te;E.defaultOptions=Se;E.moduleName=Me;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"),Ut=M.states,Ft=M.defaultOptions,Xt=M.options,qt=[{name:"prefix",title:"Prefix"},{name:"suffix",title:"Suffix"},{name:"clear-button",title:"`Clear` Button"},{name:"validation-icon",title:"Validation Icon"},{name:"separators",title:"Separators"}],Gt=[],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,x=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)(de,{children:(0,h.jsx)(f,{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}),x&&(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)(ue,{children:(0,h.jsx)(Je,{size:u.size,fillMode:"clear",children:"Send"})})]})]})};U.options=Xt;U.states=Ut;U.variants=Gt;U.defaultOptions=Ft;U.modifiers=qt;U.className=M.className;var y=require("react/jsx-runtime"),Qe="k-maskedtextbox",Jt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Wt={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]},Te={showClearButton:!0,separators:!0},w=t=>{let{size:e,rounded:o,fillMode:l,separators:n=Te.separators,showClearButton:d=Te.showClearButton,prefix:p,suffix:u,value:N,placeholder:g,hover:x,focus:k,valid:I,invalid:A,required:X,loading:T,disabled:b,readonly:C,id:_,"aria-label":ce,"aria-describedby":pe,...me}=t;return(0,y.jsxs)(M,{...me,size:e,rounded:o,fillMode:l,hover:x,focus:k,valid:I,invalid:A,required:X,loading:T,disabled:b,readonly:C,className:i(t.className,Qe),children:[p&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(de,{children:p}),n&&(0,y.jsx)($,{})]}),(0,y.jsx)(B,{id:_,placeholder:g,value:N,disabled:b,"aria-label":ce,"aria-describedby":pe,"aria-invalid":A?"true":void 0}),(0,y.jsx)(R,{valid:I,invalid:A,loading:T,disabled:b}),(0,y.jsx)(D,{loading:T,disabled:b}),d&&(0,y.jsx)(P,{loading:T,disabled:b,readonly:C,value:N}),u&&(0,y.jsxs)(y.Fragment,{children:[n&&(0,y.jsx)($,{}),(0,y.jsx)(ue,{children:u})]})]})};w.states=Jt;w.options=Wt;w.className=Qe;w.defaultOptions=Te;w.moduleName=Ee;w.folderName=Le;w.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 Ye=w;var F=require("react/jsx-runtime"),Qt=t=>(0,F.jsx)(Ye,{suffix:(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(f,{icon:"lock"})}),...t});