@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 9.77 kB
JavaScript
var xe=Object.create;var H=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var Ae=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty;var Ce=(e,t)=>{for(var a in t)H(e,a,{get:t[a],enumerable:!0})},Y=(e,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ye(t))!be.call(e,r)&&r!==a&&H(e,r,{get:()=>t[r],enumerable:!(i=ge(t,r))||i.enumerable});return e};var ke=(e,t,a)=>(a=e!=null?xe(Ae(e)):{},Y(t||!e||!e.__esModule?H(a,"default",{value:e,enumerable:!0}):a,e)),Ne=e=>Y(H({},"__esModule",{value:!0}),e);var Ue={};Ce(Ue,{ChipNormal:()=>Be});module.exports=Ne(Ue);var l=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?l(...t):typeof t=="object"?Object.keys(t).map((a,i)=>t[i]||t[a]&&a||null).filter(a=>a!==null).join(" "):t).filter(t=>!!t).join(" ");var y=(e,t)=>l({[`${e}-xs`]:t.size==="xsmall",[`${e}-sm`]:t.size==="small",[`${e}-md`]:t.size==="medium",[`${e}-lg`]:t.size==="large",[`${e}-xl`]:t.size==="xlarge",[`${e}-xxl`]:t.size==="xxlarge",[`${e}-xxxl`]:t.size==="xxxlarge"},{[`${e}-${t.fillMode}`]:t.fillMode},{[`${e}-${t.themeColor}`]:t.themeColor},{"k-rounded-sm":t.rounded==="small","k-rounded-md":t.rounded==="medium","k-rounded-lg":t.rounded==="large","k-rounded-full":t.rounded==="full","k-rounded-none":t.rounded==="none"}),Z=(e,t)=>{let{valid:a,invalid:i,hover:r,focus:d,checked:c,active:s,selected:C,disabled:x,indeterminate:h,loading:I,empty:g,readonly:S,highlighted:$,...z}=t;return l({"k-valid":a,"k-invalid":i,"k-hover":r,"k-focus":d,"k-checked":c,"k-active":s,"k-selected":C,"k-disabled":x,"k-indeterminate":h&&!c,"k-loading":I,"k-empty":g,"k-readonly":S,"k-highlighted":$},Object.keys(z).reduce((V,_)=>(_.startsWith("k-")?V[_]=z[_]:V[`k-${_}`]=z[_],V),{}))};var n={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"},k={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},v={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},o={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},u={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 L=require("react/jsx-runtime"),B="k-font-icon",Ie=[],Me={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},Oe={},w=e=>{let{size:t,themeColor:a,icon:i,rotate:r,flip:d,...c}=e;return i?(0,L.jsx)("span",{...c,className:l(e.className,B,y(B,{size:t}),{[`k-i-${i}`]:i,[`k-color-${a}`]:a,[`k-rotate-${r}`]:r,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"}),"aria-hidden":"true"}):(0,L.jsx)(L.Fragment,{})};w.states=Ie;w.options=Me;w.className=B;w.defaultOptions=Oe;var ee=w;var M=require("react/jsx-runtime"),U="k-svg-icon",Se=[],Te={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[v.outline,v.solid,v.duotone]},G={viewBox:"0 0 24 24",variant:v.outline},R=e=>{var I,g;let{size:t,themeColor:a,rotate:i,flip:r,viewBox:d=G.viewBox,variant:c=G.variant,icon:s,...C}=e;if(!s)return(0,M.jsx)(M.Fragment,{});if(s==="none")return(0,M.jsx)("span",{...C,className:l(e.className,U,y("k-icon",{size:t}),"k-none"),"aria-hidden":"true"});let x=typeof s=="object"&&s.name&&s.name,h=typeof s=="object"?c&&((I=s.variants)==null?void 0:I[c])||((g=s.variants)==null?void 0:g.outline)||s.content:void 0;return(0,M.jsx)("span",{...C,className:l(e.className,U,y("k-icon",{size:t}),{[`k-svg-i-${x}`]:x,[`k-color-${a}`]:a,[`k-rotate-${i}`]:i,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),"aria-hidden":"true",children:(0,M.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:d,dangerouslySetInnerHTML:h!==void 0?{__html:h}:void 0,children:s?void 0:e.children})})};R.states=Se;R.options=Te;R.className=U;R.defaultOptions=G;var X=R;var j=ke(require("@progress/kendo-svg-icons"));var te="icon",oe="icons";var re=require("react");var ne=require("react"),ae=(0,ne.createContext)({iconsType:"svg"});var A=require("react/jsx-runtime"),P="k-icon",Ee=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),ze=[],_e={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[v.outline,v.solid,v.duotone]},D={viewBox:"0 0 24 24",type:"svg",variant:v.outline},f=e=>{let{iconsType:t}=(0,re.useContext)(ae),{size:a,themeColor:i,icon:r,type:d=t||D.type,rotate:c,flip:s,viewBox:C=D.viewBox,variant:x=D.variant,...h}=e;if(!r)return(0,A.jsx)(A.Fragment,{});if((t||d)==="svg"){if(r==="none")return(0,A.jsx)(X,{...h,className:l(e.className,P),icon:r,size:a,variant:x});let g=j[r]?r:Ee(`${r}-icon`);return j[g]?(0,A.jsx)(X,{...h,className:l(e.className,P),icon:j[g],size:a,themeColor:i,rotate:c,flip:s,viewBox:C,variant:x}):(0,A.jsx)(A.Fragment,{})}return(0,A.jsx)(ee,{...h,className:l(e.className,P),icon:r,size:a,themeColor:i,rotate:c,flip:s})};f.states=ze;f.options=_e;f.defaultOptions=D;f.className=P;f.moduleName=te;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 q="avatar",se=q;var W=require("react/jsx-runtime"),K="k-avatar";var Le=[u.hover,u.focus,u.active,u.selected,u.disabled],we={size:[n.undefined,n.small,n.medium,n.large],rounded:[p.undefined,p.none,p.small,p.medium,p.large,p.full],fillMode:[k.undefined,k.solid,k.outline],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary]},J={type:"text",border:!1},m=e=>{let{size:t,rounded:a,fillMode:i,themeColor:r,type:d=J.type,border:c=J.border,...s}=e;return(0,W.jsx)("div",{...s,className:l(e.className,K,y(K,{size:t,rounded:a,fillMode:i,themeColor:r}),{[`${K}-bordered`]:c}),children:(0,W.jsx)("span",{className:`${K}-${d}`,children:e.children})})};m.states=Le;m.options=we;m.className=K;m.defaultOptions=J;m.moduleName=q;m.folderName=se;m.ariaSpec={selector:".k-avatar",rules:[{selector:".k-avatar img",attribute:"alt",usage:"Images inside Avatar must have alt text for screen readers."}]};var O=m;var le=require("react/jsx-runtime"),ie=e=>(0,le.jsx)(O,{type:"icon",...e});var ce=require("react/jsx-runtime"),de=e=>(0,ce.jsx)(O,{type:"text",...e});var pe=require("react/jsx-runtime"),me=e=>(0,pe.jsx)(O,{type:"image",...e});var Re=require("react/jsx-runtime");var T=require("react/jsx-runtime"),Ke=m.options,$e=m.states,He={...m.defaultOptions,variant:"image"},Pe=[{name:"image",title:"Image"},{name:"icon",title:"Icon Avatar"},{name:"text",title:"Text Avatar"}],De=[],E=e=>{let{variant:t,...a}=e;switch(t){case"icon":return(0,T.jsx)(ie,{...a,children:(0,T.jsx)(f,{icon:"star"})});case"text":return(0,T.jsx)(de,{...a,children:"JO"});default:return(0,T.jsx)(me,{...a,children:(0,T.jsx)("img",{src:"https://demos.telerik.com/kendo-ui/content/web/Customers/RICSU.jpg"})})}};E.options=Ke;E.states=$e;E.variants=Pe;E.defaultOptions=He;E.modifiers=De;E.className=m.className;var Q="chip",ue=Q;var b=require("react/jsx-runtime"),F="k-chip",Fe=[u.hover,u.focus,u.active,u.selected,u.disabled],Ve={size:[n.undefined,n.small,n.medium,n.large],rounded:[p.undefined,p.none,p.small,p.medium,p.large,p.full],fillMode:[k.undefined,k.solid,k.outline],themeColor:[o.undefined,o.base,o.success,o.warning,o.error,o.info]},fe={avatarImage:"/packages/html/assets/avatar.jpg"},N=e=>{let{size:t,rounded:a,fillMode:i,themeColor:r,text:d,icon:c,actions:s,showAvatar:C,avatarImage:x=fe.avatarImage,hover:h,focus:I,active:g,selected:S,disabled:$,...z}=e;return(0,b.jsxs)("div",{...z,className:l(e.className,F,y(F,{size:t,rounded:a,fillMode:i,themeColor:r}),Z(F,{hover:h,focus:I,active:g,disabled:$,selected:S})),role:e.role||"button","aria-pressed":e.role==="option"?void 0:S?"true":"false",...e.role==="option"&&S!==void 0&&{"aria-selected":S?"true":"false"},"aria-disabled":$?"true":void 0,children:[c&&(0,b.jsx)(f,{className:"k-chip-icon",icon:c,size:"small"}),C&&(0,b.jsx)(m,{className:"k-chip-avatar",type:"image",children:(0,b.jsx)("img",{src:x,alt:""})}),(0,b.jsx)("span",{className:"k-chip-content",children:e.children?e.children:d&&(0,b.jsx)("span",{className:"k-chip-label",children:d})}),s&&(0,b.jsx)("span",{className:"k-chip-actions",children:s})]})};N.states=Fe;N.options=Ve;N.className=F;N.defaultOptions=fe;N.moduleName=Q;N.folderName=ue;N.ariaSpec={selector:".k-chip",rules:[{selector:"*:not(.k-chip-list) > .k-chip",attribute:"role=button",usage:"Announces that the chip acts as a button when standalone."},{selector:"*:not(.k-chip-list) > .k-chip.k-selected",attribute:"aria-pressed=true",usage:"Announces that the Chip has been selected."},{selector:"*:not(.k-chip-list) > .k-chip:not(.k-selected)",attribute:"aria-pressed=false",usage:"Announces that the Chip has not been selected."},{selector:".k-chip",attribute:"aria-disabled=true (when disabled)",usage:"Announces that the Chip is disabled."}]};var he=N;var ve=require("react/jsx-runtime"),Be=e=>(0,ve.jsx)(he,{text:"text",...e});