UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 18.2 kB
var Ce=Object.create;var nt=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty;var ve=(t,e)=>{for(var o in e)nt(t,o,{get:e[o],enumerable:!0})},St=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of xe(e))!be.call(t,s)&&s!==o&&nt(t,s,{get:()=>e[s],enumerable:!(n=he(e,s))||n.enumerable});return t};var Ae=(t,e,o)=>(o=t!=null?Ce(Ne(t)):{},St(e||!t||!t.__esModule?nt(o,"default",{value:t,enumerable:!0}):o,t)),ke=t=>St(nt({},"__esModule",{value:!0}),t);var bo={};ve(bo,{TIMELINECARDCALLOUT_CLASSNAME:()=>Et,TimelineCardCallout:()=>ot,default:()=>No});module.exports=ke(bo);var r=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?r(...e):typeof e=="object"?Object.keys(e).map((o,n)=>e[n]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var I=(t,e)=>r({[`${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"}),M=(t,e)=>{let{valid:o,invalid:n,hover:s,focus:m,checked:p,active:d,selected:B,disabled:S,indeterminate:k,loading:_,empty:y,readonly:rt,highlighted:pt,...$}=e;return r({"k-valid":o,"k-invalid":n,"k-hover":s,"k-focus":m,"k-checked":p,"k-active":d,"k-selected":B,"k-disabled":S,"k-indeterminate":k&&!p,"k-loading":_,"k-empty":y,"k-readonly":rt,"k-highlighted":pt},Object.keys($).reduce((N,H)=>(H.startsWith("k-")?N[H]=$[H]:N[`k-${H}`]=$[H],N),{}))};function Ot(t,e){if(!e)return{};let o=Array.isArray(e)?e:[e];return Object.fromEntries(o.map(n=>[`k-${n}`,!0]))}var l={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},w={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},z={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},g={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},a={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"},Bt={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var Dt=require("react/jsx-runtime"),ye="k-card-callout",st=t=>{let{callout:e,...o}=t;return(0,Dt.jsx)("span",{...o,className:r(t.className,ye,{[`k-callout-${Bt.calloutMap[e]||e}`]:e})})};var h="card",b=h;var P=require("react/jsx-runtime"),ut="k-card",Me=[u.hover,u.focus,u.selected,u.disabled],ge={},Te={},f=t=>{let{orientation:e,callout:o,hover:n,focus:s,selected:m,disabled:p,...d}=t;return(0,P.jsxs)("div",{...d,className:r(t.className,ut,M(ut,{hover:n,focus:s,disabled:p,selected:m}),{[`k-card-${e}`]:e,"k-card-with-callout":o}),children:[o&&o!=="true"&&(0,P.jsx)(st,{callout:o}),(0,P.jsx)(P.Fragment,{children:t.children})]})};f.states=Me;f.options=ge;f.className=ut;f.defaultOptions=Te;f.moduleName=h;f.folderName=b;f.ariaSpec={selector:".k-card",rules:[{selector:".k-card-list .k-card",attribute:"role=listitem",usage:"When the card is located in a list, it should have the listitem role."},{selector:".k-card-list .k-card",attribute:"tabindex=0",usage:"The card component is focusable when navigatable."},{selector:".k-card-list .k-card",attribute:"aria-describedby=.k-card-title id",usage:"Associate the card to the title element."},{selector:".k-card-list .k-card",attribute:"aria-keyshortcuts=Enter",usage:"Announces the bound Enter key that enables navigation inside the card."}]};var Y=require("react/jsx-runtime"),ft="k-card-list",Le=[],Ee={},Se={},D=t=>{let{...e}=t;return(0,Y.jsx)("div",{...e,className:r(t.className,ft,M(ft,{})),role:"list",children:(0,Y.jsx)(Y.Fragment,{children:t.children})})};D.states=Le;D.options=Ee;D.className=ft;D.defaultOptions=Se;D.moduleName=h;D.folderName=b;D.ariaSpec={selector:".k-card-list",rules:[{selector:".k-card-list",attribute:"role=list",usage:"The card list container announces its list role."},{selector:".k-card-list .k-card",attribute:"role=listitem",usage:"Each card in the list has the listitem role."},{selector:".k-card-list .k-card",attribute:"tabindex=0",usage:"The card is focusable when navigatable."},{selector:".k-card-list .k-card",attribute:"aria-describedby=.k-card-title id",usage:"Associate the card to its title element."},{selector:".k-card-list .k-card",attribute:"aria-keyshortcuts=Enter",usage:"Announces the Enter key for navigation inside the card."}]};var Rt=require("react/jsx-runtime"),Kt="k-card-group",Oe=[],Be={},De={},W=t=>{let{...e}=t;return(0,Rt.jsx)("div",{...e,className:r(t.className,Kt),children:t.children})};W.states=Oe;W.options=Be;W.className=Kt;W.defaultOptions=De;W.moduleName=h;W.folderName=b;var _t=require("react/jsx-runtime"),Ct="k-card-wrap",Ke=[u.focus,u.selected],Re={},_e={},G=t=>{let{focus:e,selected:o,...n}=t;return(0,_t.jsx)("div",{...n,className:r(t.className,Ct,M(Ct,{focus:e,selected:o})),children:t.children})};G.states=Ke;G.options=Re;G.className=Ct;G.defaultOptions=_e;G.moduleName=h;G.folderName=b;var Ht=require("react/jsx-runtime"),ht="k-card-title",He=[u.hover,u.focus],F=t=>{let{hover:e,focus:o,...n}=t;return(0,Ht.jsx)("div",{...n,className:r(t.className,ht,M(ht,{hover:e,focus:o})),children:t.children})};F.states=He;F.className=ht;var It=require("react/jsx-runtime"),Ie="k-card-subtitle",it=t=>{let{...e}=t;return(0,It.jsx)("div",{...e,className:r(t.className,Ie),children:t.children})};var K=require("react/jsx-runtime"),wt="k-card-media",xt=t=>{let{src:e,...o}=t;return(0,K.jsx)(K.Fragment,{children:e?(0,K.jsx)("img",{...o,className:r(t.className,wt),src:e}):(0,K.jsx)("span",{...o,className:r(t.className,wt),children:(0,K.jsx)(K.Fragment,{children:t.children})})})};var Q=require("react/jsx-runtime"),Nt="k-font-icon",we=[],ze={size:[l.undefined,l.xsmall,l.small,l.medium,l.large,l.xlarge,l.xxlarge,l.xxxlarge],themeColor:[a.undefined,a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info]},Pe={},Z=t=>{let{size:e,themeColor:o,icon:n,rotate:s,flip:m,...p}=t;return n?(0,Q.jsx)("span",{...p,className:r(t.className,Nt,I(Nt,{size:e}),{[`k-i-${n}`]:n,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),"aria-hidden":"true"}):(0,Q.jsx)(Q.Fragment,{})};Z.states=we;Z.options=ze;Z.className=Nt;Z.defaultOptions=Pe;var zt=Z;var U=require("react/jsx-runtime"),bt="k-svg-icon",Fe=[],Ue={size:[l.undefined,l.xsmall,l.small,l.medium,l.large,l.xlarge,l.xxlarge,l.xxxlarge],themeColor:[a.undefined,a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info],variant:[g.outline,g.solid,g.duotone]},vt={viewBox:"0 0 24 24",variant:g.outline},j=t=>{var _,y;let{size:e,themeColor:o,rotate:n,flip:s,viewBox:m=vt.viewBox,variant:p=vt.variant,icon:d,...B}=t;if(!d)return(0,U.jsx)(U.Fragment,{});if(d==="none")return(0,U.jsx)("span",{...B,className:r(t.className,bt,I("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let S=typeof d=="object"&&d.name&&d.name,k=typeof d=="object"?p&&((_=d.variants)==null?void 0:_[p])||((y=d.variants)==null?void 0:y.outline)||d.content:void 0;return(0,U.jsx)("span",{...B,className:r(t.className,bt,I("k-icon",{size:e}),{[`k-svg-i-${S}`]:S,[`k-color-${o}`]:o,[`k-rotate-${n}`]:n,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),"aria-hidden":"true",children:(0,U.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof d=="object"?d.viewBox:m,dangerouslySetInnerHTML:k!==void 0?{__html:k}:void 0,children:d?void 0:t.children})})};j.states=Fe;j.options=Ue;j.className=bt;j.defaultOptions=vt;var At=j;var kt=Ae(require("@progress/kendo-svg-icons"));var Pt="icon",Ft="icons";var Wt=require("react");var Ut=require("react"),$t=(0,Ut.createContext)({iconsType:"svg"});var O=require("react/jsx-runtime"),lt="k-icon",$e=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),We=[],Ge={size:[l.undefined,l.xsmall,l.small,l.medium,l.large,l.xlarge,l.xxlarge,l.xxxlarge],themeColor:[a.undefined,a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info],variant:[g.outline,g.solid,g.duotone]},dt={viewBox:"0 0 24 24",type:"svg",variant:g.outline},T=t=>{let{iconsType:e}=(0,Wt.useContext)($t),{size:o,themeColor:n,icon:s,type:m=e||dt.type,rotate:p,flip:d,viewBox:B=dt.viewBox,variant:S=dt.variant,...k}=t;if(!s)return(0,O.jsx)(O.Fragment,{});if((e||m)==="svg"){if(s==="none")return(0,O.jsx)(At,{...k,className:r(t.className,lt),icon:s,size:o,variant:S});let y=kt[s]?s:$e(`${s}-icon`);return kt[y]?(0,O.jsx)(At,{...k,className:r(t.className,lt),icon:kt[y],size:o,themeColor:n,rotate:p,flip:d,viewBox:B,variant:S}):(0,O.jsx)(O.Fragment,{})}return(0,O.jsx)(zt,{...k,className:r(t.className,lt),icon:s,size:o,themeColor:n,rotate:p,flip:d})};T.states=We;T.options=Ge;T.defaultOptions=dt;T.className=lt;T.moduleName=Pt;T.folderName=Ft;T.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 yt="button",Gt=yt;var x=require("react/jsx-runtime"),tt="k-button",Ve=["icon-button"],qe=[u.hover,u.focus,u.active,u.selected,u.disabled,u.generating],Je={size:[l.undefined,l.xsmall,l.small,l.medium,l.large],rounded:[w.undefined,w.none,w.small,w.medium,w.large,w.full],fillMode:[z.undefined,z.solid,z.flat,z.outline,z.clear,z.link],themeColor:[a.undefined,a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.inverse]},Mt={showArrow:!1,arrowIconName:"chevron-down"},i=t=>{let{as:e="button",size:o,rounded:n,fillMode:s,themeColor:m,showArrow:p=Mt.showArrow,arrowIconName:d=Mt.arrowIconName,variant:B,hover:S,focus:k,active:_,selected:y,disabled:rt,togglable:pt,ariaDisabled:$,icon:N,iconSize:H,text:at,iconClassName:ce,className:me,...pe}=t,ue=N!=null,fe=t.children!==void 0;return(0,x.jsxs)(e,{className:r(me,tt,Ot(tt,B),I(tt,{size:o,rounded:n,fillMode:s,themeColor:m}),M(tt,{hover:S,focus:k,active:_,disabled:rt||$,selected:y}),{"k-icon-button":!at&&!fe&&ue}),"aria-pressed":pt?y?"true":"false":void 0,...pe,"aria-disabled":$?"true":void 0,disabled:rt||void 0,children:[typeof N=="string"&&N&&(0,x.jsx)(T,{className:r(ce,"k-button-icon"),icon:N,size:H}),N&&typeof N!="string"&&(0,x.jsx)(x.Fragment,{children:N}),at?(0,x.jsxs)(x.Fragment,{children:[at&&(0,x.jsx)("span",{className:"k-button-text",children:at}),t.children]}):t.children&&(0,x.jsx)("span",{className:"k-button-text",children:t.children}),p&&(0,x.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,x.jsx)(T,{icon:d})})]})};i.states=qe;i.options=Je;i.variants=Ve;i.className=tt;i.defaultOptions=Mt;i.moduleName=yt;i.folderName=Gt;i.ariaSpec={selector:".k-button",rules:[{selector:".k-button",attribute:"role=button or nodeName=button",usage:"The button role is implicit from the native <button> element."},{selector:".k-button",attribute:"aria-label (when icon-only)",usage:"Required for icon-only buttons that have no visible text."},{selector:".k-button",attribute:"aria-pressed (when togglable)",usage:"Indicates the pressed state of a toggle button."},{selector:".k-button",attribute:"disabled (when disabled)",usage:"Rendered when the button is disabled."}]};var qt=require("react/jsx-runtime"),Vt=t=>(0,qt.jsx)(i,{icon:"folder",...t,"aria-label":t["aria-label"]||"Folder",children:void 0});var Xt=require("react/jsx-runtime"),Jt=t=>(0,Xt.jsx)(i,{icon:"folder",children:"Button",...t});var Qt=require("react/jsx-runtime"),Yt=t=>(0,Qt.jsx)(i,{children:"Button",...t});var ct=require("react/jsx-runtime"),Xe=i.options,Ye=i.states,Qe={...i.defaultOptions,variant:"text"},Ze=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],je=[],V=t=>{let{variant:e,...o}=t;switch(e){case"icon-only":return(0,ct.jsx)(Vt,{...o,icon:"star"});case"icon-and-text":return(0,ct.jsx)(Jt,{...o,icon:"star",children:"Button"});default:return(0,ct.jsx)(Yt,{...o,children:"Button"})}};V.options=Xe;V.states=Ye;V.variants=Ze;V.defaultOptions=Qe;V.modifiers=je;V.className=i.className;var L=require("react/jsx-runtime"),to="k-card-header",et=t=>{let{title:e,subtitle:o,details:n,...s}=t;return(0,L.jsxs)("div",{...s,className:r(t.className,to),children:[e&&(0,L.jsx)(F,{children:e}),o&&(0,L.jsx)(it,{children:o}),(0,L.jsx)(L.Fragment,{children:t.children}),n&&(0,L.jsx)("span",{className:"k-card-header-actions",children:(0,L.jsx)(i,{className:"k-card-details",icon:"more-vertical",fillMode:"flat","aria-label":"Card details"})})]})};var Zt=require("react/jsx-runtime"),eo="k-card-footer",gt=t=>{let{...e}=t;return(0,Zt.jsx)("div",{...e,className:r(t.className,eo),children:t.children})};var E=require("react/jsx-runtime"),oo="k-card-body",R=t=>{let{title:e,subtitle:o,details:n,...s}=t;return(0,E.jsxs)("div",{...s,className:r(t.className,oo),children:[e&&(0,E.jsx)(F,{children:e}),o&&(0,E.jsx)(it,{children:o}),(0,E.jsx)(E.Fragment,{children:t.children}),n&&(0,E.jsx)("span",{className:"k-card-header-actions",children:(0,E.jsx)(i,{className:"k-card-details",icon:"more-vertical",fillMode:"flat","aria-label":"Card details"})})]})};var te=require("react/jsx-runtime"),jt="k-card-deck",ro=[],ao={},no={},q=t=>{let{...e}=t;return(0,te.jsx)("div",{...e,className:r(t.className,jt),children:t.children})};q.states=ro;q.options=ao;q.className=jt;q.defaultOptions=no;q.moduleName=h;q.folderName=b;var oe=require("react/jsx-runtime"),ee="k-card-deck-scrollwrap",so=[],io={},lo={},J=t=>{let{...e}=t;return(0,oe.jsx)("div",{...e,className:r(t.className,ee),children:t.children})};J.states=so;J.options=io;J.className=ee;J.defaultOptions=lo;J.moduleName=h;J.folderName=b;var Tt="action-buttons",re=Tt;var ae=require("react/jsx-runtime"),mt="k-actions",co=[],mo={},Lt={alignment:"start",orientation:"horizontal"},C=t=>{let{alignment:e=Lt.alignment,orientation:o=Lt.orientation,...n}=t;return(0,ae.jsx)("div",{...n,className:r(mt,{[`${mt}-${e}`]:e,[`${mt}-${o}`]:o},t.className),children:t.children})};C.states=co;C.options=mo;C.className=mt;C.defaultOptions=Lt;C.moduleName=Tt;C.folderName=re;var v=require("react/jsx-runtime"),ne=t=>(0,v.jsx)(f,{orientation:"vertical",children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(et,{children:"Card Header"}),(0,v.jsx)(R,{children:(0,v.jsx)("p",{children:"Some quick example text to build on the card title and make up the bulk of the card's content."})}),(0,v.jsxs)(C,{className:"k-card-actions",children:[(0,v.jsx)(i,{fillMode:"flat",themeColor:"primary",children:"Action 1"}),(0,v.jsx)(i,{fillMode:"flat",themeColor:"primary",children:"Action 2"})]})]}),...t});var A=require("react/jsx-runtime"),se=t=>(0,A.jsx)(f,{orientation:"horizontal",children:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(R,{title:"Card Title",children:(0,A.jsx)("p",{children:"Some quick example text to build on the card title and make up the bulk of the card's content."})}),(0,A.jsxs)(C,{orientation:"vertical",className:"k-card-actions",children:[(0,A.jsx)(i,{fillMode:"flat",themeColor:"primary",children:"Action 1"}),(0,A.jsx)(i,{fillMode:"flat",themeColor:"primary",children:"Action 2"})]})]}),...t});var ie=require("react/jsx-runtime");var c=require("react/jsx-runtime"),po=f.options,uo=f.states,le={...f.defaultOptions,variant:"vertical"},fo=[{name:"vertical",title:"Vertical"},{name:"horizontal",title:"Horizontal"}],Co=[{name:"media",title:"Card with Media"},{name:"header",title:"Card with Header"},{name:"footer",title:"Card with Footer"}],X=t=>{let{variant:e,modifiers:o,...n}={...le,...t},s=!1,m=!1,p=!1;return Object.keys(o||{}).forEach(d=>{switch(d){case"media":{s=!!(o!=null&&o[d]);break}case"header":{m=!!(o!=null&&o[d]);break}case"footer":{p=!!(o!=null&&o[d]);break}}}),e==="horizontal"?(0,c.jsxs)(se,{style:{maxWidth:"420px"},...n,children:[s&&(0,c.jsx)(xt,{src:"https://demos.telerik.com/kendo-ui/content/web/cards/rome.jpg"}),(0,c.jsxs)("div",{children:[m&&(0,c.jsx)(et,{title:"Header Title",subtitle:"Header Subtitle"}),(0,c.jsx)(R,{title:"Title",subtitle:"Subtitle",children:(0,c.jsx)("p",{children:"Some quick example text to build on the card title and make up the bulk of the card's content."})}),p&&(0,c.jsx)(gt,{children:"Card Footer"})]}),(m||p)&&(0,c.jsx)("span",{className:"k-separator k-separator-vertical"}),(0,c.jsxs)(C,{orientation:"vertical",alignment:"stretched",className:"k-card-actions",children:[(0,c.jsx)(i,{fillMode:"flat",themeColor:"primary",children:"Button"}),(0,c.jsx)(i,{fillMode:"flat",themeColor:"primary",children:"Button"})]})]}):(0,c.jsxs)(ne,{style:{maxHeight:"450px",width:"300px"},...n,children:[m&&(0,c.jsx)(et,{title:"Header Title",subtitle:"Header Subtitle"}),s&&(0,c.jsx)(xt,{src:"https://demos.telerik.com/kendo-ui/content/web/cards/rome.jpg"}),(0,c.jsx)(R,{title:"Title",subtitle:"Subtitle",children:(0,c.jsx)("p",{children:"Some quick example text to build on the card title and make up the bulk of the card's content."})}),p&&(0,c.jsx)(gt,{children:"Card Footer"}),(0,c.jsxs)(C,{className:"k-card-actions",children:[(0,c.jsx)(i,{fillMode:"flat",themeColor:"primary",children:"Button"}),(0,c.jsx)(i,{fillMode:"flat",themeColor:"primary",children:"Button"})]})]})};X.options=po;X.states=uo;X.variants=fo;X.defaultOptions=le;X.modifiers=Co;X.className=f.className;var de=require("react/jsx-runtime"),Et="k-timeline-card-callout",ho=[],xo={},ot=t=>{let{...e}=t;return(0,de.jsx)(st,{className:r(t.className,Et),...e})};ot.states=ho;ot.className=Et;ot.defaultOptions=xo;var No=ot;