@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 9.96 kB
JavaScript
var Ce=Object.create;var H=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var Se=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty;var Ie=(e,t)=>{for(var n in t)H(e,n,{get:t[n],enumerable:!0})},Z=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Te(t))!Be.call(e,i)&&i!==n&&H(e,i,{get:()=>t[i],enumerable:!(a=ke(t,i))||a.enumerable});return e};var Me=(e,t,n)=>(n=e!=null?Ce(Se(e)):{},Z(t||!e||!e.__esModule?H(n,"default",{value:e,enumerable:!0}):n,e)),Ae=e=>Z(H({},"__esModule",{value:!0}),e);var We={};Ie(We,{CARDHEADER_CLASSNAME:()=>he,CardHeader:()=>Xe});module.exports=Ae(We);var s=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?s(...t):typeof t=="object"?Object.keys(t).map((n,a)=>t[a]||t[n]&&n||null).filter(n=>n!==null).join(" "):t).filter(t=>!!t).join(" ");var S=(e,t)=>s({[`${e}-xs`]:t.size==="xsmall",[`${e}-sm`]:t.size==="small",[`${e}-md`]:t.size==="medium",[`${e}-lg`]:t.size==="large",[`${e}-xl`]:t.size==="xlarge",[`${e}-xxl`]:t.size==="xxlarge",[`${e}-xxxl`]:t.size==="xxxlarge"},{[`${e}-${t.fillMode}`]:t.fillMode},{[`${e}-${t.themeColor}`]:t.themeColor},{"k-rounded-sm":t.rounded==="small","k-rounded-md":t.rounded==="medium","k-rounded-lg":t.rounded==="large","k-rounded-full":t.rounded==="full","k-rounded-none":t.rounded==="none"}),K=(e,t)=>{let{valid:n,invalid:a,hover:i,focus:u,checked:m,active:d,selected:C,disabled:y,indeterminate:f,loading:k,empty:x,readonly:_,highlighted:U,...A}=t;return s({"k-valid":n,"k-invalid":a,"k-hover":i,"k-focus":u,"k-checked":m,"k-active":d,"k-selected":C,"k-disabled":y,"k-indeterminate":f&&!m,"k-loading":k,"k-empty":x,"k-readonly":_,"k-highlighted":U},Object.keys(A).reduce((p,T)=>(T.startsWith("k-")?p[T]=A[T]:p[`k-${T}`]=A[T],p),{}))};function j(e,t){if(!t)return{};let n=Array.isArray(t)?t:[t];return Object.fromEntries(n.map(a=>[`k-${a}`,!0]))}var r={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},B={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},I={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},h={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},o={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},g={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"};var w=require("react/jsx-runtime"),V="k-font-icon",Oe=[],we={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},Ee={},E=e=>{let{size:t,themeColor:n,icon:a,rotate:i,flip:u,...m}=e;return a?(0,w.jsx)("span",{...m,className:s(e.className,V,S(V,{size:t}),{[`k-i-${a}`]:a,[`k-color-${n}`]:n,[`k-rotate-${i}`]:i,"k-flip-h":u==="h"||u==="both","k-flip-v":u==="v"||u==="both"}),"aria-hidden":"true"}):(0,w.jsx)(w.Fragment,{})};E.states=Oe;E.options=we;E.className=V;E.defaultOptions=Ee;var ee=E;var M=require("react/jsx-runtime"),G="k-svg-icon",ze=[],Le={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[h.outline,h.solid,h.duotone]},q={viewBox:"0 0 24 24",variant:h.outline},z=e=>{var k,x;let{size:t,themeColor:n,rotate:a,flip:i,viewBox:u=q.viewBox,variant:m=q.variant,icon:d,...C}=e;if(!d)return(0,M.jsx)(M.Fragment,{});if(d==="none")return(0,M.jsx)("span",{...C,className:s(e.className,G,S("k-icon",{size:t}),"k-none"),"aria-hidden":"true"});let y=typeof d=="object"&&d.name&&d.name,f=typeof d=="object"?m&&((k=d.variants)==null?void 0:k[m])||((x=d.variants)==null?void 0:x.outline)||d.content:void 0;return(0,M.jsx)("span",{...C,className:s(e.className,G,S("k-icon",{size:t}),{[`k-svg-i-${y}`]:y,[`k-color-${n}`]:n,[`k-rotate-${a}`]:a,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),"aria-hidden":"true",children:(0,M.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof d=="object"?d.viewBox:u,dangerouslySetInnerHTML:f!==void 0?{__html:f}:void 0,children:d?void 0:e.children})})};z.states=ze;z.options=Le;z.className=G;z.defaultOptions=q;var J=z;var X=Me(require("@progress/kendo-svg-icons"));var te="icon",oe="icons";var ie=require("react");var ne=require("react"),re=(0,ne.createContext)({iconsType:"svg"});var N=require("react/jsx-runtime"),$="k-icon",_e=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Re=[],He={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[h.outline,h.solid,h.duotone]},D={viewBox:"0 0 24 24",type:"svg",variant:h.outline},b=e=>{let{iconsType:t}=(0,ie.useContext)(re),{size:n,themeColor:a,icon:i,type:u=t||D.type,rotate:m,flip:d,viewBox:C=D.viewBox,variant:y=D.variant,...f}=e;if(!i)return(0,N.jsx)(N.Fragment,{});if((t||u)==="svg"){if(i==="none")return(0,N.jsx)(J,{...f,className:s(e.className,$),icon:i,size:n,variant:y});let x=X[i]?i:_e(`${i}-icon`);return X[x]?(0,N.jsx)(J,{...f,className:s(e.className,$),icon:X[x],size:n,themeColor:a,rotate:m,flip:d,viewBox:C,variant:y}):(0,N.jsx)(N.Fragment,{})}return(0,N.jsx)(ee,{...f,className:s(e.className,$),icon:i,size:n,themeColor:a,rotate:m,flip:d})};b.states=Re;b.options=He;b.defaultOptions=D;b.className=$;b.moduleName=te;b.folderName=oe;b.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 W="button",ae=W;var c=require("react/jsx-runtime"),L="k-button",Ke=["icon-button"],$e=[g.hover,g.focus,g.active,g.selected,g.disabled,g.generating],De={size:[r.undefined,r.xsmall,r.small,r.medium,r.large],rounded:[B.undefined,B.none,B.small,B.medium,B.large,B.full],fillMode:[I.undefined,I.solid,I.flat,I.outline,I.clear,I.link],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.inverse]},Q={showArrow:!1,arrowIconName:"chevron-down"},l=e=>{let{as:t="button",size:n,rounded:a,fillMode:i,themeColor:u,showArrow:m=Q.showArrow,arrowIconName:d=Q.arrowIconName,variant:C,hover:y,focus:f,active:k,selected:x,disabled:_,togglable:U,ariaDisabled:A,icon:p,iconSize:T,text:R,iconClassName:ge,className:be,...ve}=e,ye=p!=null,Ne=e.children!==void 0;return(0,c.jsxs)(t,{className:s(be,L,j(L,C),S(L,{size:n,rounded:a,fillMode:i,themeColor:u}),K(L,{hover:y,focus:f,active:k,disabled:_||A,selected:x}),{"k-icon-button":!R&&!Ne&&ye}),"aria-pressed":U?x?"true":"false":void 0,...ve,"aria-disabled":A?"true":void 0,disabled:_||void 0,children:[typeof p=="string"&&p&&(0,c.jsx)(b,{className:s(ge,"k-button-icon"),icon:p,size:T}),p&&typeof p!="string"&&(0,c.jsx)(c.Fragment,{children:p}),R?(0,c.jsxs)(c.Fragment,{children:[R&&(0,c.jsx)("span",{className:"k-button-text",children:R}),e.children]}):e.children&&(0,c.jsx)("span",{className:"k-button-text",children:e.children}),m&&(0,c.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,c.jsx)(b,{icon:d})})]})};l.states=$e;l.options=De;l.variants=Ke;l.className=L;l.defaultOptions=Q;l.moduleName=W;l.folderName=ae;l.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 le=require("react/jsx-runtime"),se=e=>(0,le.jsx)(l,{icon:"folder",...e,"aria-label":e["aria-label"]||"Folder",children:void 0});var ce=require("react/jsx-runtime"),de=e=>(0,ce.jsx)(l,{icon:"folder",children:"Button",...e});var me=require("react/jsx-runtime"),ue=e=>(0,me.jsx)(l,{children:"Button",...e});var P=require("react/jsx-runtime"),Pe=l.options,Fe=l.states,Ue={...l.defaultOptions,variant:"text"},Ve=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],Ge=[],O=e=>{let{variant:t,...n}=e;switch(t){case"icon-only":return(0,P.jsx)(se,{...n,icon:"star"});case"icon-and-text":return(0,P.jsx)(de,{...n,icon:"star",children:"Button"});default:return(0,P.jsx)(ue,{...n,children:"Button"})}};O.options=Pe;O.states=Fe;O.variants=Ve;O.defaultOptions=Ue;O.modifiers=Ge;O.className=l.className;var fe=require("react/jsx-runtime"),qe="k-card-subtitle",pe=e=>{let{...t}=e;return(0,fe.jsx)("div",{...t,className:s(e.className,qe),children:e.children})};var xe=require("react/jsx-runtime"),Y="k-card-title",Je=[g.hover,g.focus],F=e=>{let{hover:t,focus:n,...a}=e;return(0,xe.jsx)("div",{...a,className:s(e.className,Y,K(Y,{hover:t,focus:n})),children:e.children})};F.states=Je;F.className=Y;var v=require("react/jsx-runtime"),he="k-card-header",Xe=e=>{let{title:t,subtitle:n,details:a,...i}=e;return(0,v.jsxs)("div",{...i,className:s(e.className,he),children:[t&&(0,v.jsx)(F,{children:t}),n&&(0,v.jsx)(pe,{children:n}),(0,v.jsx)(v.Fragment,{children:e.children}),a&&(0,v.jsx)("span",{className:"k-card-header-actions",children:(0,v.jsx)(l,{className:"k-card-details",icon:"more-vertical",fillMode:"flat","aria-label":"Card details"})})]})};