@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 4.96 kB
JavaScript
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((r,l)=>e[l]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var x=(t,e)=>a({[`${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"});var n={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var c={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"};import{Fragment as F,jsx as w}from"react/jsx-runtime";var N="k-font-icon",B=[],H={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]},R={},g=t=>{let{size:e,themeColor:r,icon:l,rotate:i,flip:m,...u}=t;return l?w("span",{...u,className:a(t.className,N,x(N,{size:e}),{[`k-i-${l}`]:l,[`k-color-${r}`]:r,[`k-rotate-${i}`]:i,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),"aria-hidden":"true"}):w(F,{})};g.states=B;g.options=H;g.className=N;g.defaultOptions=R;var L=g;import{Fragment as V,jsx as k}from"react/jsx-runtime";var I="k-svg-icon",G=[],P={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:[c.outline,c.solid,c.duotone]},S={viewBox:"0 0 24 24",variant:c.outline},h=t=>{let{size:e,themeColor:r,rotate:l,flip:i,viewBox:m=S.viewBox,variant:u=S.variant,icon:s,...y}=t;if(!s)return k(V,{});if(s==="none")return k("span",{...y,className:a(t.className,I,x("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let f=typeof s=="object"&&s.name&&s.name,p=typeof s=="object"?u&&s.variants?.[u]||s.variants?.outline||s.content:void 0;return k("span",{...y,className:a(t.className,I,x("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${r}`]:r,[`k-rotate-${l}`]:l,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),"aria-hidden":"true",children:k("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:m,dangerouslySetInnerHTML:p!==void 0?{__html:p}:void 0,children:s?void 0:t.children})})};h.states=G;h.options=P;h.className=I;h.defaultOptions=S;var z=h;import*as O from"@progress/kendo-svg-icons";var $="icon",A="icons";import{useContext as D}from"react";import{createContext as j}from"react";var E=j({iconsType:"svg"});import{Fragment as _,jsx as v}from"react/jsx-runtime";var b="k-icon",U=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),K=[],q={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:[c.outline,c.solid,c.duotone]},C={viewBox:"0 0 24 24",type:"svg",variant:c.outline},d=t=>{let{iconsType:e}=D(E),{size:r,themeColor:l,icon:i,type:m=e||C.type,rotate:u,flip:s,viewBox:y=C.viewBox,variant:f=C.variant,...p}=t;if(!i)return v(_,{});if((e||m)==="svg"){if(i==="none")return v(z,{...p,className:a(t.className,b),icon:i,size:r,variant:f});let T=O[i]?i:U(`${i}-icon`);return O[T]?v(z,{...p,className:a(t.className,b),icon:O[T],size:r,themeColor:l,rotate:u,flip:s,viewBox:y,variant:f}):v(_,{})}return v(L,{...p,className:a(t.className,b),icon:i,size:r,themeColor:l,rotate:u,flip:s})};d.states=K;d.options=q;d.defaultOptions=C;d.className=b;d.moduleName=$;d.folderName=A;d.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."}]};import{jsx as M,jsxs as Q}from"react/jsx-runtime";var W="k-list-group-item",J=t=>{let{groupIconName:e,...r}=t;return Q("li",{...r,role:"presentation",className:a(W,t.className),children:[e&&M("span",{className:"k-list-item-icon-wrapper",children:M(d,{icon:e,className:"k-list-item-icon"})}),M("span",{className:"k-list-item-text",children:t.children})]})};J.ariaSpec={selector:".k-list-group-item",rules:[{selector:".k-list-group-item",attribute:"role=presentation",usage:"Group headers are presentational, not selectable options."},{selector:".k-list-group-item",attribute:"id (when referenced)",usage:"ID for aria-labelledby on the parent group UL."}]};export{J as ListGroupItem};