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