UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.18 kB
var j=Object.create;var O=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Q=(t,e)=>{for(var r in e)O(t,r,{get:e[r],enumerable:!0})},P=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of q(e))!X.call(t,a)&&a!==r&&O(t,a,{get:()=>e[a],enumerable:!(l=U(e,a))||l.enumerable});return t};var Y=(t,e,r)=>(r=t!=null?j(J(t)):{},P(e||!t||!t.__esModule?O(r,"default",{value:t,enumerable:!0}):r,t)),Z=t=>P(O({},"__esModule",{value:!0}),t);var de={};Q(de,{ScrollView:()=>k,default:()=>me});module.exports=Z(de);var c=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?c(...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 b=(t,e)=>c({[`${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 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"},n={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"};var C=require("react/jsx-runtime"),z="k-font-icon",ee=[],te={size:[s.undefined,s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info]},oe={},S=t=>{let{size:e,themeColor:r,icon:l,rotate:a,flip:m,...u}=t;return l?(0,C.jsx)("span",{...u,className:c(t.className,z,b(z,{size:e}),{[`k-i-${l}`]:l,[`k-color-${r}`]:r,[`k-rotate-${a}`]:a,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),"aria-hidden":"true"}):(0,C.jsx)(C.Fragment,{})};S.states=ee;S.options=te;S.className=z;S.defaultOptions=oe;var B=S;var y=require("react/jsx-runtime"),A="k-svg-icon",ne=[],se={size:[s.undefined,s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info],variant:[d.outline,d.solid,d.duotone]},_={viewBox:"0 0 24 24",variant:d.outline},I=t=>{var w,f;let{size:e,themeColor:r,rotate:l,flip:a,viewBox:m=_.viewBox,variant:u=_.variant,icon:i,...N}=t;if(!i)return(0,y.jsx)(y.Fragment,{});if(i==="none")return(0,y.jsx)("span",{...N,className:c(t.className,A,b("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let x=typeof i=="object"&&i.name&&i.name,g=typeof i=="object"?u&&((w=i.variants)==null?void 0:w[u])||((f=i.variants)==null?void 0:f.outline)||i.content:void 0;return(0,y.jsx)("span",{...N,className:c(t.className,A,b("k-icon",{size:e}),{[`k-svg-i-${x}`]:x,[`k-color-${r}`]:r,[`k-rotate-${l}`]:l,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"}),"aria-hidden":"true",children:(0,y.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:m,dangerouslySetInnerHTML:g!==void 0?{__html:g}:void 0,children:i?void 0:t.children})})};I.states=ne;I.options=se;I.className=A;I.defaultOptions=_;var T=I;var $=Y(require("@progress/kendo-svg-icons"));var H="icon",F="icons";var G=require("react");var D=require("react"),K=(0,D.createContext)({iconsType:"svg"});var v=require("react/jsx-runtime"),E="k-icon",re=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ae=[],ie={size:[s.undefined,s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info],variant:[d.outline,d.solid,d.duotone]},L={viewBox:"0 0 24 24",type:"svg",variant:d.outline},p=t=>{let{iconsType:e}=(0,G.useContext)(K),{size:r,themeColor:l,icon:a,type:m=e||L.type,rotate:u,flip:i,viewBox:N=L.viewBox,variant:x=L.variant,...g}=t;if(!a)return(0,v.jsx)(v.Fragment,{});if((e||m)==="svg"){if(a==="none")return(0,v.jsx)(T,{...g,className:c(t.className,E),icon:a,size:r,variant:x});let f=$[a]?a:re(`${a}-icon`);return $[f]?(0,v.jsx)(T,{...g,className:c(t.className,E),icon:$[f],size:r,themeColor:l,rotate:u,flip:i,viewBox:N,variant:x}):(0,v.jsx)(v.Fragment,{})}return(0,v.jsx)(B,{...g,className:c(t.className,E),icon:a,size:r,themeColor:l,rotate:u,flip:i})};p.states=ae;p.options=ie;p.defaultOptions=L;p.className=E;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",W=V;var o=require("react/jsx-runtime"),R="k-scrollview",le=[],ce={},h={mode:"normal",views:9,currentView:5,animate:!0,arrows:!0,pager:!0,rtl:!1},k=t=>{let{mode:e=h.mode,views:r=h.views,currentView:l=h.currentView,animate:a=h.animate,arrows:m=h.arrows,pager:u=h.pager,rtl:i=h.rtl,...N}=t,x=[],g=i?"chevron-right":"chevron-left",w=i?"chevron-left":"chevron-right",f="scrollview-wrap";for(let M=0;M<r;M++)x.push((0,o.jsx)("div",{className:"k-scrollview-view",role:"listitem","aria-roledescription":"slide"},M));return(0,o.jsxs)("div",{...N,className:c(R,t.className,{[`${R}-${e}`]:e!=="normal","k-rtl":i}),role:"application","aria-roledescription":"carousel",tabIndex:0,children:[(0,o.jsx)("div",{className:c("k-scrollview-wrap",{"k-scrollview-animate":a}),id:f,role:"list",style:{"--kendo-scrollview-views":r,"--kendo-scrollview-current":l},children:x}),(0,o.jsxs)("div",{className:"k-scrollview-elements",children:[m&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"k-scrollview-prev",role:"button","aria-label":"Previous","aria-controls":f,children:(0,o.jsx)(p,{icon:g,size:"xxxlarge"})}),(0,o.jsx)("span",{className:"k-scrollview-next",role:"button","aria-label":"Next","aria-controls":f,children:(0,o.jsx)(p,{icon:w,size:"xxxlarge"})})]}),u&&(0,o.jsx)("div",{className:"k-scrollview-nav-wrap",children:(0,o.jsxs)("div",{className:"k-scrollview-nav",children:[e==="light"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"k-link"}),(0,o.jsx)("span",{className:"k-link k-primary"}),(0,o.jsx)("span",{className:"k-link k-primary k-focus"}),(0,o.jsx)("span",{className:"k-link k-focus"}),(0,o.jsx)("span",{className:"k-link"})]}),e==="normal"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"k-link",style:{transform:"scale(0.5)"}}),(0,o.jsx)("span",{className:"k-link",style:{transform:"scale(0.65)"}}),(0,o.jsx)("span",{className:"k-link",style:{transform:"scale(0.8)"}}),(0,o.jsx)("span",{className:"k-link"}),(0,o.jsx)("span",{className:"k-link k-primary"}),(0,o.jsx)("span",{className:"k-link"}),(0,o.jsx)("span",{className:"k-link",style:{transform:"scale(0.8)"}}),(0,o.jsx)("span",{className:"k-link",style:{transform:"scale(0.65)"}}),(0,o.jsx)("span",{className:"k-link",style:{transform:"scale(0.5)"}})]}),e==="dark"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"k-link",style:{transform:"scale(0.5)"}}),(0,o.jsx)("span",{className:"k-link",style:{transform:"scale(0.65)"}}),(0,o.jsx)("span",{className:"k-link"}),(0,o.jsx)("span",{className:"k-link k-primary"}),(0,o.jsx)("span",{className:"k-link"}),(0,o.jsx)("span",{className:"k-link",style:{transform:"scale(0.65)"}}),(0,o.jsx)("span",{className:"k-link",style:{transform:"scale(0.5)"}})]})]})})]}),(0,o.jsx)("div",{className:"k-sr-only","aria-live":"polite"})]})};k.states=le;k.options=ce;k.className=R;k.defaultOptions=h;k.moduleName=V;k.folderName=W;k.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 me=k;