@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 17.9 kB
JavaScript
var pe=Object.create;var at=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,he=Object.prototype.hasOwnProperty;var xe=(t,e)=>{for(var o in e)at(t,o,{get:e[o],enumerable:!0})},Lt=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of fe(e))!he.call(t,s)&&s!==o&&at(t,s,{get:()=>e[s],enumerable:!(n=ue(e,s))||n.enumerable});return t};var Ne=(t,e,o)=>(o=t!=null?pe(Ce(t)):{},Lt(e||!t||!t.__esModule?at(o,"default",{value:t,enumerable:!0}):o,t)),be=t=>Lt(at({},"__esModule",{value:!0}),t);var uo={};xe(uo,{CardHorizontal:()=>Tt});module.exports=be(uo);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:E,indeterminate:k,loading:_,empty:y,readonly:ot,highlighted:ct,...$}=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":E,"k-indeterminate":k&&!p,"k-loading":_,"k-empty":y,"k-readonly":ot,"k-highlighted":ct},Object.keys($).reduce((N,H)=>(H.startsWith("k-")?N[H]=$[H]:N[`k-${H}`]=$[H],N),{}))};function St(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"},Et={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var Bt=require("react/jsx-runtime"),ve="k-card-callout",Ot=t=>{let{callout:e,...o}=t;return(0,Bt.jsx)("span",{...o,className:r(t.className,ve,{[`k-callout-${Et.calloutMap[e]||e}`]:e})})};var h="card",b=h;var P=require("react/jsx-runtime"),mt="k-card",Ae=[u.hover,u.focus,u.selected,u.disabled],ke={},ye={},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,mt,M(mt,{hover:n,focus:s,disabled:p,selected:m}),{[`k-card-${e}`]:e,"k-card-with-callout":o}),children:[o&&o!=="true"&&(0,P.jsx)(Ot,{callout:o}),(0,P.jsx)(P.Fragment,{children:t.children})]})};f.states=Ae;f.options=ke;f.className=mt;f.defaultOptions=ye;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"),pt="k-card-list",Me=[],ge={},Te={},D=t=>{let{...e}=t;return(0,Y.jsx)("div",{...e,className:r(t.className,pt,M(pt,{})),role:"list",children:(0,Y.jsx)(Y.Fragment,{children:t.children})})};D.states=Me;D.options=ge;D.className=pt;D.defaultOptions=Te;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 Kt=require("react/jsx-runtime"),Dt="k-card-group",Le=[],Se={},Ee={},W=t=>{let{...e}=t;return(0,Kt.jsx)("div",{...e,className:r(t.className,Dt),children:t.children})};W.states=Le;W.options=Se;W.className=Dt;W.defaultOptions=Ee;W.moduleName=h;W.folderName=b;var Rt=require("react/jsx-runtime"),ut="k-card-wrap",Oe=[u.focus,u.selected],Be={},De={},G=t=>{let{focus:e,selected:o,...n}=t;return(0,Rt.jsx)("div",{...n,className:r(t.className,ut,M(ut,{focus:e,selected:o})),children:t.children})};G.states=Oe;G.options=Be;G.className=ut;G.defaultOptions=De;G.moduleName=h;G.folderName=b;var _t=require("react/jsx-runtime"),ft="k-card-title",Ke=[u.hover,u.focus],F=t=>{let{hover:e,focus:o,...n}=t;return(0,_t.jsx)("div",{...n,className:r(t.className,ft,M(ft,{hover:e,focus:o})),children:t.children})};F.states=Ke;F.className=ft;var Ht=require("react/jsx-runtime"),Re="k-card-subtitle",nt=t=>{let{...e}=t;return(0,Ht.jsx)("div",{...e,className:r(t.className,Re),children:t.children})};var K=require("react/jsx-runtime"),It="k-card-media",Ct=t=>{let{src:e,...o}=t;return(0,K.jsx)(K.Fragment,{children:e?(0,K.jsx)("img",{...o,className:r(t.className,It),src:e}):(0,K.jsx)("span",{...o,className:r(t.className,It),children:(0,K.jsx)(K.Fragment,{children:t.children})})})};var Q=require("react/jsx-runtime"),ht="k-font-icon",_e=[],He={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]},Ie={},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,ht,I(ht,{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=_e;Z.options=He;Z.className=ht;Z.defaultOptions=Ie;var wt=Z;var U=require("react/jsx-runtime"),xt="k-svg-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],variant:[g.outline,g.solid,g.duotone]},Nt={viewBox:"0 0 24 24",variant:g.outline},j=t=>{var _,y;let{size:e,themeColor:o,rotate:n,flip:s,viewBox:m=Nt.viewBox,variant:p=Nt.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,xt,I("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let E=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,xt,I("k-icon",{size:e}),{[`k-svg-i-${E}`]:E,[`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=we;j.options=ze;j.className=xt;j.defaultOptions=Nt;var bt=j;var vt=Ne(require("@progress/kendo-svg-icons"));var zt="icon",Pt="icons";var $t=require("react");var Ft=require("react"),Ut=(0,Ft.createContext)({iconsType:"svg"});var O=require("react/jsx-runtime"),st="k-icon",Pe=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),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]},it={viewBox:"0 0 24 24",type:"svg",variant:g.outline},T=t=>{let{iconsType:e}=(0,$t.useContext)(Ut),{size:o,themeColor:n,icon:s,type:m=e||it.type,rotate:p,flip:d,viewBox:B=it.viewBox,variant:E=it.variant,...k}=t;if(!s)return(0,O.jsx)(O.Fragment,{});if((e||m)==="svg"){if(s==="none")return(0,O.jsx)(bt,{...k,className:r(t.className,st),icon:s,size:o,variant:E});let y=vt[s]?s:Pe(`${s}-icon`);return vt[y]?(0,O.jsx)(bt,{...k,className:r(t.className,st),icon:vt[y],size:o,themeColor:n,rotate:p,flip:d,viewBox:B,variant:E}):(0,O.jsx)(O.Fragment,{})}return(0,O.jsx)(wt,{...k,className:r(t.className,st),icon:s,size:o,themeColor:n,rotate:p,flip:d})};T.states=Fe;T.options=Ue;T.defaultOptions=it;T.className=st;T.moduleName=zt;T.folderName=Pt;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 At="button",Wt=At;var x=require("react/jsx-runtime"),tt="k-button",$e=["icon-button"],We=[u.hover,u.focus,u.active,u.selected,u.disabled,u.generating],Ge={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]},kt={showArrow:!1,arrowIconName:"chevron-down"},i=t=>{let{as:e="button",size:o,rounded:n,fillMode:s,themeColor:m,showArrow:p=kt.showArrow,arrowIconName:d=kt.arrowIconName,variant:B,hover:E,focus:k,active:_,selected:y,disabled:ot,togglable:ct,ariaDisabled:$,icon:N,iconSize:H,text:rt,iconClassName:ie,className:le,...de}=t,ce=N!=null,me=t.children!==void 0;return(0,x.jsxs)(e,{className:r(le,tt,St(tt,B),I(tt,{size:o,rounded:n,fillMode:s,themeColor:m}),M(tt,{hover:E,focus:k,active:_,disabled:ot||$,selected:y}),{"k-icon-button":!rt&&!me&&ce}),"aria-pressed":ct?y?"true":"false":void 0,...de,"aria-disabled":$?"true":void 0,disabled:ot||void 0,children:[typeof N=="string"&&N&&(0,x.jsx)(T,{className:r(ie,"k-button-icon"),icon:N,size:H}),N&&typeof N!="string"&&(0,x.jsx)(x.Fragment,{children:N}),rt?(0,x.jsxs)(x.Fragment,{children:[rt&&(0,x.jsx)("span",{className:"k-button-text",children:rt}),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=We;i.options=Ge;i.variants=$e;i.className=tt;i.defaultOptions=kt;i.moduleName=At;i.folderName=Wt;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 Vt=require("react/jsx-runtime"),Gt=t=>(0,Vt.jsx)(i,{icon:"folder",...t,"aria-label":t["aria-label"]||"Folder",children:void 0});var Jt=require("react/jsx-runtime"),qt=t=>(0,Jt.jsx)(i,{icon:"folder",children:"Button",...t});var Yt=require("react/jsx-runtime"),Xt=t=>(0,Yt.jsx)(i,{children:"Button",...t});var lt=require("react/jsx-runtime"),Ve=i.options,qe=i.states,Je={...i.defaultOptions,variant:"text"},Xe=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],Ye=[],V=t=>{let{variant:e,...o}=t;switch(e){case"icon-only":return(0,lt.jsx)(Gt,{...o,icon:"star"});case"icon-and-text":return(0,lt.jsx)(qt,{...o,icon:"star",children:"Button"});default:return(0,lt.jsx)(Xt,{...o,children:"Button"})}};V.options=Ve;V.states=qe;V.variants=Xe;V.defaultOptions=Je;V.modifiers=Ye;V.className=i.className;var L=require("react/jsx-runtime"),Qe="k-card-header",et=t=>{let{title:e,subtitle:o,details:n,...s}=t;return(0,L.jsxs)("div",{...s,className:r(t.className,Qe),children:[e&&(0,L.jsx)(F,{children:e}),o&&(0,L.jsx)(nt,{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 Qt=require("react/jsx-runtime"),Ze="k-card-footer",yt=t=>{let{...e}=t;return(0,Qt.jsx)("div",{...e,className:r(t.className,Ze),children:t.children})};var S=require("react/jsx-runtime"),je="k-card-body",R=t=>{let{title:e,subtitle:o,details:n,...s}=t;return(0,S.jsxs)("div",{...s,className:r(t.className,je),children:[e&&(0,S.jsx)(F,{children:e}),o&&(0,S.jsx)(nt,{children:o}),(0,S.jsx)(S.Fragment,{children:t.children}),n&&(0,S.jsx)("span",{className:"k-card-header-actions",children:(0,S.jsx)(i,{className:"k-card-details",icon:"more-vertical",fillMode:"flat","aria-label":"Card details"})})]})};var jt=require("react/jsx-runtime"),Zt="k-card-deck",to=[],eo={},oo={},q=t=>{let{...e}=t;return(0,jt.jsx)("div",{...e,className:r(t.className,Zt),children:t.children})};q.states=to;q.options=eo;q.className=Zt;q.defaultOptions=oo;q.moduleName=h;q.folderName=b;var ee=require("react/jsx-runtime"),te="k-card-deck-scrollwrap",ro=[],ao={},no={},J=t=>{let{...e}=t;return(0,ee.jsx)("div",{...e,className:r(t.className,te),children:t.children})};J.states=ro;J.options=ao;J.className=te;J.defaultOptions=no;J.moduleName=h;J.folderName=b;var Mt="action-buttons",oe=Mt;var re=require("react/jsx-runtime"),dt="k-actions",so=[],io={},gt={alignment:"start",orientation:"horizontal"},C=t=>{let{alignment:e=gt.alignment,orientation:o=gt.orientation,...n}=t;return(0,re.jsx)("div",{...n,className:r(dt,{[`${dt}-${e}`]:e,[`${dt}-${o}`]:o},t.className),children:t.children})};C.states=so;C.options=io;C.className=dt;C.defaultOptions=gt;C.moduleName=Mt;C.folderName=oe;var v=require("react/jsx-runtime"),ae=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 ne=require("react/jsx-runtime");var c=require("react/jsx-runtime"),lo=f.options,co=f.states,se={...f.defaultOptions,variant:"vertical"},mo=[{name:"vertical",title:"Vertical"},{name:"horizontal",title:"Horizontal"}],po=[{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}={...se,...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)(Tt,{style:{maxWidth:"420px"},...n,children:[s&&(0,c.jsx)(Ct,{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)(yt,{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)(ae,{style:{maxHeight:"450px",width:"300px"},...n,children:[m&&(0,c.jsx)(et,{title:"Header Title",subtitle:"Header Subtitle"}),s&&(0,c.jsx)(Ct,{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)(yt,{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=lo;X.states=co;X.variants=mo;X.defaultOptions=se;X.modifiers=po;X.className=f.className;var A=require("react/jsx-runtime"),Tt=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});