UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.72 kB
var he=Object.create;var P=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty;var ye=(e,t)=>{for(var a in t)P(e,a,{get:t[a],enumerable:!0})},Y=(e,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xe(t))!Ae.call(e,r)&&r!==a&&P(e,r,{get:()=>t[r],enumerable:!(i=ve(t,r))||i.enumerable});return e};var be=(e,t,a)=>(a=e!=null?he(ge(e)):{},Y(t||!e||!e.__esModule?P(a,"default",{value:e,enumerable:!0}):a,e)),Ce=e=>Y(P({},"__esModule",{value:!0}),e);var Ve={};ye(Ve,{CHIP_CLASSNAME:()=>$,Chip:()=>C,default:()=>Fe});module.exports=Ce(Ve);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 A=(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:k,disabled:x,indeterminate:h,loading:I,empty:g,readonly:S,highlighted:H,...z}=t;return l({"k-valid":a,"k-invalid":i,"k-hover":r,"k-focus":d,"k-checked":c,"k-active":s,"k-selected":k,"k-disabled":x,"k-indeterminate":h&&!c,"k-loading":I,"k-empty":g,"k-readonly":S,"k-highlighted":H},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"},N={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",ke=[],Ne={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]},Ie={},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,A(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=ke;w.options=Ne;w.className=B;w.defaultOptions=Ie;var ee=w;var M=require("react/jsx-runtime"),U="k-svg-icon",Me=[],Oe={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,...k}=e;if(!s)return(0,M.jsx)(M.Fragment,{});if(s==="none")return(0,M.jsx)("span",{...k,className:l(e.className,U,A("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",{...k,className:l(e.className,U,A("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=Me;R.options=Oe;R.className=U;R.defaultOptions=G;var j=R;var X=be(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 y=require("react/jsx-runtime"),D="k-icon",Se=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Te=[],Ee={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]},F={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||F.type,rotate:c,flip:s,viewBox:k=F.viewBox,variant:x=F.variant,...h}=e;if(!r)return(0,y.jsx)(y.Fragment,{});if((t||d)==="svg"){if(r==="none")return(0,y.jsx)(j,{...h,className:l(e.className,D),icon:r,size:a,variant:x});let g=X[r]?r:Se(`${r}-icon`);return X[g]?(0,y.jsx)(j,{...h,className:l(e.className,D),icon:X[g],size:a,themeColor:i,rotate:c,flip:s,viewBox:k,variant:x}):(0,y.jsx)(y.Fragment,{})}return(0,y.jsx)(ee,{...h,className:l(e.className,D),icon:r,size:a,themeColor:i,rotate:c,flip:s})};f.states=Te;f.options=Ee;f.defaultOptions=F;f.className=D;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 ze=[u.hover,u.focus,u.active,u.selected,u.disabled],_e={size:[n.undefined,n.small,n.medium,n.large],rounded:[p.undefined,p.none,p.small,p.medium,p.large,p.full],fillMode:[N.undefined,N.solid,N.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,A(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=ze;m.options=_e;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 Le=require("react/jsx-runtime");var T=require("react/jsx-runtime"),we=m.options,Re=m.states,Ke={...m.defaultOptions,variant:"image"},$e=[{name:"image",title:"Image"},{name:"icon",title:"Icon Avatar"},{name:"text",title:"Text Avatar"}],He=[],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=we;E.states=Re;E.variants=$e;E.defaultOptions=Ke;E.modifiers=He;E.className=m.className;var Q="chip",ue=Q;var b=require("react/jsx-runtime"),$="k-chip",Pe=[u.hover,u.focus,u.active,u.selected,u.disabled],De={size:[n.undefined,n.small,n.medium,n.large],rounded:[p.undefined,p.none,p.small,p.medium,p.large,p.full],fillMode:[N.undefined,N.solid,N.outline],themeColor:[o.undefined,o.base,o.success,o.warning,o.error,o.info]},fe={avatarImage:"/packages/html/assets/avatar.jpg"},C=e=>{let{size:t,rounded:a,fillMode:i,themeColor:r,text:d,icon:c,actions:s,showAvatar:k,avatarImage:x=fe.avatarImage,hover:h,focus:I,active:g,selected:S,disabled:H,...z}=e;return(0,b.jsxs)("div",{...z,className:l(e.className,$,A($,{size:t,rounded:a,fillMode:i,themeColor:r}),Z($,{hover:h,focus:I,active:g,disabled:H,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":H?"true":void 0,children:[c&&(0,b.jsx)(f,{className:"k-chip-icon",icon:c,size:"small"}),k&&(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})]})};C.states=Pe;C.options=De;C.className=$;C.defaultOptions=fe;C.moduleName=Q;C.folderName=ue;C.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 Fe=C;