@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 10.7 kB
JavaScript
var Ie=Object.create;var U=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Se=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var _e=(e,t)=>{for(var n in t)U(e,n,{get:t[n],enumerable:!0})},ne=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Me(t))!we.call(e,i)&&i!==n&&U(e,i,{get:()=>t[i],enumerable:!(a=Ae(t,i))||a.enumerable});return e};var ze=(e,t,n)=>(n=e!=null?Ie(Se(e)):{},ne(t||!e||!e.__esModule?U(n,"default",{value:e,enumerable:!0}):n,e)),Ee=e=>ne(U({},"__esModule",{value:!0}),e);var nt={};_e(nt,{PIVOTGRIDCONFIGURATOR_CLASSNAME:()=>K,PivotGridConfigurator:()=>_,default:()=>ot});module.exports=Ee(nt);var d=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?d(...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 B=(e,t)=>d({[`${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"}),re=(e,t)=>{let{valid:n,invalid:a,hover:i,focus:c,checked:u,active:l,selected:x,disabled:N,indeterminate:g,loading:T,empty:h,readonly:P,highlighted:q,...S}=t;return d({"k-valid":n,"k-invalid":a,"k-hover":i,"k-focus":c,"k-checked":u,"k-active":l,"k-selected":x,"k-disabled":N,"k-indeterminate":g&&!u,"k-loading":T,"k-empty":h,"k-readonly":P,"k-highlighted":q},Object.keys(S).reduce((f,k)=>(k.startsWith("k-")?f[k]=S[k]:f[`k-${k}`]=S[k],f),{}))};function ie(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"},O={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"},v={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"},A={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 J={};function ae(e){return J[e]=(J[e]||0)+1,`k-${e}-${J[e]}`}var W="action-buttons",se=W;var le=require("react/jsx-runtime"),D="k-actions",Le=[],Re={},X={alignment:"start",orientation:"horizontal"},C=e=>{let{alignment:t=X.alignment,orientation:n=X.orientation,...a}=e;return(0,le.jsx)("div",{...a,className:d(D,{[`${D}-${t}`]:t,[`${D}-${n}`]:n},e.className),children:e.children})};C.states=Le;C.options=Re;C.className=D;C.defaultOptions=X;C.moduleName=W;C.folderName=se;var z=require("react/jsx-runtime"),j="k-font-icon",$e=[],Ke={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]},Pe={},E=e=>{let{size:t,themeColor:n,icon:a,rotate:i,flip:c,...u}=e;return a?(0,z.jsx)("span",{...u,className:d(e.className,j,B(j,{size:t}),{[`k-i-${a}`]:a,[`k-color-${n}`]:n,[`k-rotate-${i}`]:i,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),"aria-hidden":"true"}):(0,z.jsx)(z.Fragment,{})};E.states=$e;E.options=Ke;E.className=j;E.defaultOptions=Pe;var de=E;var M=require("react/jsx-runtime"),Q="k-svg-icon",He=[],Ue={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:[v.outline,v.solid,v.duotone]},Y={viewBox:"0 0 24 24",variant:v.outline},L=e=>{var T,h;let{size:t,themeColor:n,rotate:a,flip:i,viewBox:c=Y.viewBox,variant:u=Y.variant,icon:l,...x}=e;if(!l)return(0,M.jsx)(M.Fragment,{});if(l==="none")return(0,M.jsx)("span",{...x,className:d(e.className,Q,B("k-icon",{size:t}),"k-none"),"aria-hidden":"true"});let N=typeof l=="object"&&l.name&&l.name,g=typeof l=="object"?u&&((T=l.variants)==null?void 0:T[u])||((h=l.variants)==null?void 0:h.outline)||l.content:void 0;return(0,M.jsx)("span",{...x,className:d(e.className,Q,B("k-icon",{size:t}),{[`k-svg-i-${N}`]:N,[`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 l=="object"?l.viewBox:c,dangerouslySetInnerHTML:g!==void 0?{__html:g}:void 0,children:l?void 0:e.children})})};L.states=He;L.options=Ue;L.className=Q;L.defaultOptions=Y;var Z=L;var ee=ze(require("@progress/kendo-svg-icons"));var ce="icon",ue="icons";var fe=require("react");var me=require("react"),pe=(0,me.createContext)({iconsType:"svg"});var y=require("react/jsx-runtime"),F="k-icon",De=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Fe=[],Ve={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:[v.outline,v.solid,v.duotone]},V={viewBox:"0 0 24 24",type:"svg",variant:v.outline},b=e=>{let{iconsType:t}=(0,fe.useContext)(pe),{size:n,themeColor:a,icon:i,type:c=t||V.type,rotate:u,flip:l,viewBox:x=V.viewBox,variant:N=V.variant,...g}=e;if(!i)return(0,y.jsx)(y.Fragment,{});if((t||c)==="svg"){if(i==="none")return(0,y.jsx)(Z,{...g,className:d(e.className,F),icon:i,size:n,variant:N});let h=ee[i]?i:De(`${i}-icon`);return ee[h]?(0,y.jsx)(Z,{...g,className:d(e.className,F),icon:ee[h],size:n,themeColor:a,rotate:u,flip:l,viewBox:x,variant:N}):(0,y.jsx)(y.Fragment,{})}return(0,y.jsx)(de,{...g,className:d(e.className,F),icon:i,size:n,themeColor:a,rotate:u,flip:l})};b.states=Fe;b.options=Ve;b.defaultOptions=V;b.className=F;b.moduleName=ce;b.folderName=ue;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 te="button",xe=te;var m=require("react/jsx-runtime"),R="k-button",Ge=["icon-button"],qe=[A.hover,A.focus,A.active,A.selected,A.disabled,A.generating],Je={size:[r.undefined,r.xsmall,r.small,r.medium,r.large],rounded:[O.undefined,O.none,O.small,O.medium,O.large,O.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]},oe={showArrow:!1,arrowIconName:"chevron-down"},s=e=>{let{as:t="button",size:n,rounded:a,fillMode:i,themeColor:c,showArrow:u=oe.showArrow,arrowIconName:l=oe.arrowIconName,variant:x,hover:N,focus:g,active:T,selected:h,disabled:P,togglable:q,ariaDisabled:S,icon:f,iconSize:k,text:H,iconClassName:Ce,className:Te,...ke}=e,Be=f!=null,Oe=e.children!==void 0;return(0,m.jsxs)(t,{className:d(Te,R,ie(R,x),B(R,{size:n,rounded:a,fillMode:i,themeColor:c}),re(R,{hover:N,focus:g,active:T,disabled:P||S,selected:h}),{"k-icon-button":!H&&!Oe&&Be}),"aria-pressed":q?h?"true":"false":void 0,...ke,"aria-disabled":S?"true":void 0,disabled:P||void 0,children:[typeof f=="string"&&f&&(0,m.jsx)(b,{className:d(Ce,"k-button-icon"),icon:f,size:k}),f&&typeof f!="string"&&(0,m.jsx)(m.Fragment,{children:f}),H?(0,m.jsxs)(m.Fragment,{children:[H&&(0,m.jsx)("span",{className:"k-button-text",children:H}),e.children]}):e.children&&(0,m.jsx)("span",{className:"k-button-text",children:e.children}),u&&(0,m.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,m.jsx)(b,{icon:l})})]})};s.states=qe;s.options=Je;s.variants=Ge;s.className=R;s.defaultOptions=oe;s.moduleName=te;s.folderName=xe;s.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 he=require("react/jsx-runtime"),ge=e=>(0,he.jsx)(s,{icon:"folder",...e,"aria-label":e["aria-label"]||"Folder",children:void 0});var be=require("react/jsx-runtime"),ve=e=>(0,be.jsx)(s,{icon:"folder",children:"Button",...e});var ye=require("react/jsx-runtime"),Ne=e=>(0,ye.jsx)(s,{children:"Button",...e});var G=require("react/jsx-runtime"),We=s.options,Xe=s.states,je={...s.defaultOptions,variant:"text"},Qe=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],Ye=[],w=e=>{let{variant:t,...n}=e;switch(t){case"icon-only":return(0,G.jsx)(ge,{...n,icon:"star"});case"icon-and-text":return(0,G.jsx)(ve,{...n,icon:"star",children:"Button"});default:return(0,G.jsx)(Ne,{...n,children:"Button"})}};w.options=We;w.states=Xe;w.variants=Qe;w.defaultOptions=je;w.modifiers=Ye;w.className=s.className;var p=require("react/jsx-runtime"),K="k-pivotgrid-configurator",Ze=[],et={},tt=(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(s,{children:"Cancel"}),(0,p.jsx)(s,{themeColor:"primary",children:"Apply"})]}),$={orientation:"vertical",mode:"push",actionButtons:tt,header:"Settings"},_=e=>{let{orientation:t=$.orientation,mode:n=$.mode,actionButtons:a=$.actionButtons,header:i=$.header,headerId:c,children:u,...l}=e,x=c||ae("pivotgrid-configurator-header");return(0,p.jsx)("div",{...l,className:d(e.className,K),role:"dialog","aria-labelledby":x,children:(0,p.jsxs)("div",{className:d("k-pivotgrid-configurator-panel",{[`${K}-${t}`]:t,[`${K}-${n}`]:n}),children:[(0,p.jsx)("div",{className:"k-pivotgrid-configurator-header",children:(0,p.jsx)("div",{className:"k-pivotgrid-configurator-header-text",id:x,children:i})}),(0,p.jsx)("div",{className:"k-pivotgrid-configurator-content",children:u}),(0,p.jsx)(C,{alignment:"end",className:"k-pivotgrid-configurator-actions",children:a})]})})};_.states=Ze;_.options=et;_.className=K;_.defaultOptions=$;var ot=_;