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