UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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