@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 8.24 kB
JavaScript
var l=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((a,c)=>e[c]||e[a]&&a||null).filter(a=>a!==null).join(" "):e).filter(e=>!!e).join(" ");var y=(o,e)=>l({[`${o}-xs`]:e.size==="xsmall",[`${o}-sm`]:e.size==="small",[`${o}-md`]:e.size==="medium",[`${o}-lg`]:e.size==="large",[`${o}-xl`]:e.size==="xlarge",[`${o}-xxl`]:e.size==="xxlarge",[`${o}-xxxl`]:e.size==="xxxlarge"},{[`${o}-${e.fillMode}`]:e.fillMode},{[`${o}-${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 s={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var d={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},t={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 J,jsx as P}from"react/jsx-runtime";var M="k-font-icon",U=[],j={size:[s.undefined,s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info]},q={},N=o=>{let{size:e,themeColor:a,icon:c,rotate:i,flip:m,...u}=o;return c?P("span",{...u,className:l(o.className,M,y(M,{size:e}),{[`k-i-${c}`]:c,[`k-color-${a}`]:a,[`k-rotate-${i}`]:i,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),"aria-hidden":"true"}):P(J,{})};N.states=U;N.options=j;N.className=M;N.defaultOptions=q;var B=N;import{Fragment as Y,jsx as S}from"react/jsx-runtime";var z="k-svg-icon",X=[],Q={size:[s.undefined,s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info],variant:[d.outline,d.solid,d.duotone]},A={viewBox:"0 0 24 24",variant:d.outline},b=o=>{let{size:e,themeColor:a,rotate:c,flip:i,viewBox:m=A.viewBox,variant:u=A.variant,icon:r,...h}=o;if(!r)return S(Y,{});if(r==="none")return S("span",{...h,className:l(o.className,z,y("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let f=typeof r=="object"&&r.name&&r.name,v=typeof r=="object"?u&&r.variants?.[u]||r.variants?.outline||r.content:void 0;return S("span",{...h,className:l(o.className,z,y("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${a}`]:a,[`k-rotate-${c}`]:c,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),"aria-hidden":"true",children:S("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof r=="object"?r.viewBox:m,dangerouslySetInnerHTML:v!==void 0?{__html:v}:void 0,children:r?void 0:o.children})})};b.states=X;b.options=Q;b.className=z;b.defaultOptions=A;var _=b;import*as T from"@progress/kendo-svg-icons";var H="icon",F="icons";import{useContext as ee}from"react";import{createContext as Z}from"react";var D=Z({iconsType:"svg"});import{Fragment as K,jsx as C}from"react/jsx-runtime";var I="k-icon",oe=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),te=[],ne={size:[s.undefined,s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info],variant:[d.outline,d.solid,d.duotone]},O={viewBox:"0 0 24 24",type:"svg",variant:d.outline},p=o=>{let{iconsType:e}=ee(D),{size:a,themeColor:c,icon:i,type:m=e||O.type,rotate:u,flip:r,viewBox:h=O.viewBox,variant:f=O.variant,...v}=o;if(!i)return C(K,{});if((e||m)==="svg"){if(i==="none")return C(_,{...v,className:l(o.className,I),icon:i,size:a,variant:f});let w=T[i]?i:oe(`${i}-icon`);return T[w]?C(_,{...v,className:l(o.className,I),icon:T[w],size:a,themeColor:c,rotate:u,flip:r,viewBox:h,variant:f}):C(K,{})}return C(B,{...v,className:l(o.className,I),icon:i,size:a,themeColor:c,rotate:u,flip:r})};p.states=te;p.options=ne;p.defaultOptions=O;p.className=I;p.moduleName=H;p.folderName=F;p.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="scrollview",G=V;import{Fragment as E,jsx as n,jsxs as g}from"react/jsx-runtime";var $="k-scrollview",se=[],re={},k={mode:"normal",views:9,currentView:5,animate:!0,arrows:!0,pager:!0,rtl:!1},x=o=>{let{mode:e=k.mode,views:a=k.views,currentView:c=k.currentView,animate:i=k.animate,arrows:m=k.arrows,pager:u=k.pager,rtl:r=k.rtl,...h}=o,f=[],v=r?"chevron-right":"chevron-left",R=r?"chevron-left":"chevron-right",w="scrollview-wrap";for(let L=0;L<a;L++)f.push(n("div",{className:"k-scrollview-view",role:"listitem","aria-roledescription":"slide"},L));return g("div",{...h,className:l($,o.className,{[`${$}-${e}`]:e!=="normal","k-rtl":r}),role:"application","aria-roledescription":"carousel",tabIndex:0,children:[n("div",{className:l("k-scrollview-wrap",{"k-scrollview-animate":i}),id:w,role:"list",style:{"--kendo-scrollview-views":a,"--kendo-scrollview-current":c},children:f}),g("div",{className:"k-scrollview-elements",children:[m&&g(E,{children:[n("span",{className:"k-scrollview-prev",role:"button","aria-label":"Previous","aria-controls":w,children:n(p,{icon:v,size:"xxxlarge"})}),n("span",{className:"k-scrollview-next",role:"button","aria-label":"Next","aria-controls":w,children:n(p,{icon:R,size:"xxxlarge"})})]}),u&&n("div",{className:"k-scrollview-nav-wrap",children:g("div",{className:"k-scrollview-nav",children:[e==="light"&&g(E,{children:[n("span",{className:"k-link"}),n("span",{className:"k-link k-primary"}),n("span",{className:"k-link k-primary k-focus"}),n("span",{className:"k-link k-focus"}),n("span",{className:"k-link"})]}),e==="normal"&&g(E,{children:[n("span",{className:"k-link",style:{transform:"scale(0.5)"}}),n("span",{className:"k-link",style:{transform:"scale(0.65)"}}),n("span",{className:"k-link",style:{transform:"scale(0.8)"}}),n("span",{className:"k-link"}),n("span",{className:"k-link k-primary"}),n("span",{className:"k-link"}),n("span",{className:"k-link",style:{transform:"scale(0.8)"}}),n("span",{className:"k-link",style:{transform:"scale(0.65)"}}),n("span",{className:"k-link",style:{transform:"scale(0.5)"}})]}),e==="dark"&&g(E,{children:[n("span",{className:"k-link",style:{transform:"scale(0.5)"}}),n("span",{className:"k-link",style:{transform:"scale(0.65)"}}),n("span",{className:"k-link"}),n("span",{className:"k-link k-primary"}),n("span",{className:"k-link"}),n("span",{className:"k-link",style:{transform:"scale(0.65)"}}),n("span",{className:"k-link",style:{transform:"scale(0.5)"}})]})]})})]}),n("div",{className:"k-sr-only","aria-live":"polite"})]})};x.states=se;x.options=re;x.className=$;x.defaultOptions=k;x.moduleName=V;x.folderName=G;x.ariaSpec={selector:".k-scrollview",rules:[{selector:".k-scrollview",attribute:"role=application",usage:"Specifies the role of the Carousel element."},{selector:".k-scrollview",attribute:"aria-roledescription=carousel",usage:"Clarifies the role of the Carousel element."},{selector:".k-scrollview",attribute:"tabindex=0",usage:"Carousel element must be focusable."},{selector:".k-scrollview-wrap",attribute:"role=list",usage:"Clarifies the scrollview wrap as a list of items (images)."},{selector:".k-scrollview-wrap>*",attribute:"role=listitem",usage:"Specifies the role of each Carousel item."},{selector:".k-scrollview-wrap>*",attribute:"aria-roledescription=slide",usage:"Clarifies the role of the Carousel item."},{selector:".k-scrollview-prev,.k-scrollview-next",attribute:"role=button",usage:"Specifies the role of the Previous/Next button."},{selector:".k-scrollview-prev,.k-scrollview-next",attribute:"aria-label",usage:"Specifies label for the Previous/Next button."},{selector:".k-scrollview-prev,.k-scrollview-next",attribute:"aria-controls",usage:"Points to the id of the items container element."},{selector:".k-scrollview>.k-sr-only",attribute:"aria-live=polite",usage:"Identifies a hidden element as a live region in the polite state."}]};var W=x;import{jsx as ae}from"react/jsx-runtime";var We=o=>ae(W,{...o});export{We as ScrollViewNormal};