UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.01 kB
var ce=Object.create;var $=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var fe=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty;var ge=(t,e)=>{for(var i in e)$(t,i,{get:e[i],enumerable:!0})},J=(t,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of me(e))!pe.call(t,r)&&r!==i&&$(t,r,{get:()=>e[r],enumerable:!(a=ue(e,r))||a.enumerable});return t};var xe=(t,e,i)=>(i=t!=null?ce(fe(t)):{},J(e||!t||!t.__esModule?$(i,"default",{value:t,enumerable:!0}):i,t)),he=t=>J($({},"__esModule",{value:!0}),t);var Ee={};ge(Ee,{NAVIGATOR_CLASSNAME:()=>W,Navigator:()=>z,default:()=>Be});module.exports=he(Ee);var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((i,a)=>e[a]||e[i]&&i||null).filter(i=>i!==null).join(" "):e).filter(e=>!!e).join(" ");var C=(t,e)=>l({[`${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"}),Q=(t,e)=>{let{valid:i,invalid:a,hover:r,focus:u,checked:m,active:s,selected:N,disabled:b,indeterminate:p,loading:y,empty:g,readonly:L,highlighted:P,...I}=e;return l({"k-valid":i,"k-invalid":a,"k-hover":r,"k-focus":u,"k-checked":m,"k-active":s,"k-selected":N,"k-disabled":b,"k-indeterminate":p&&!m,"k-loading":y,"k-empty":g,"k-readonly":L,"k-highlighted":P},Object.keys(I).reduce((f,k)=>(k.startsWith("k-")?f[k]=I[k]:f[`k-${k}`]=I[k],f),{}))};function X(t,e){if(!e)return{};let i=Array.isArray(e)?e:[e];return Object.fromEntries(i.map(a=>[`k-${a}`,!0]))}var n={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},T={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},M={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"},O={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 A=require("react/jsx-runtime"),F="k-font-icon",be=[],ve={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]},Ne={},B=t=>{let{size:e,themeColor:i,icon:a,rotate:r,flip:u,...m}=t;return a?(0,A.jsx)("span",{...m,className:l(t.className,F,C(F,{size:e}),{[`k-i-${a}`]:a,[`k-color-${i}`]:i,[`k-rotate-${r}`]:r,"k-flip-h":u==="h"||u==="both","k-flip-v":u==="v"||u==="both"}),"aria-hidden":"true"}):(0,A.jsx)(A.Fragment,{})};B.states=be;B.options=ve;B.className=F;B.defaultOptions=Ne;var Y=B;var w=require("react/jsx-runtime"),U="k-svg-icon",ye=[],ke={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]},V={viewBox:"0 0 24 24",variant:x.outline},E=t=>{var y,g;let{size:e,themeColor:i,rotate:a,flip:r,viewBox:u=V.viewBox,variant:m=V.variant,icon:s,...N}=t;if(!s)return(0,w.jsx)(w.Fragment,{});if(s==="none")return(0,w.jsx)("span",{...N,className:l(t.className,U,C("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let b=typeof s=="object"&&s.name&&s.name,p=typeof s=="object"?m&&((y=s.variants)==null?void 0:y[m])||((g=s.variants)==null?void 0:g.outline)||s.content:void 0;return(0,w.jsx)("span",{...N,className:l(t.className,U,C("k-icon",{size:e}),{[`k-svg-i-${b}`]:b,[`k-color-${i}`]:i,[`k-rotate-${a}`]:a,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),"aria-hidden":"true",children:(0,w.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:u,dangerouslySetInnerHTML:p!==void 0?{__html:p}:void 0,children:s?void 0:t.children})})};E.states=ye;E.options=ke;E.className=U;E.defaultOptions=V;var D=E;var G=xe(require("@progress/kendo-svg-icons"));var Z="icon",ee="icons";var ne=require("react");var te=require("react"),oe=(0,te.createContext)({iconsType:"svg"});var v=require("react/jsx-runtime"),H="k-icon",Ce=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Te=[],Me={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]},K={viewBox:"0 0 24 24",type:"svg",variant:x.outline},h=t=>{let{iconsType:e}=(0,ne.useContext)(oe),{size:i,themeColor:a,icon:r,type:u=e||K.type,rotate:m,flip:s,viewBox:N=K.viewBox,variant:b=K.variant,...p}=t;if(!r)return(0,v.jsx)(v.Fragment,{});if((e||u)==="svg"){if(r==="none")return(0,v.jsx)(D,{...p,className:l(t.className,H),icon:r,size:i,variant:b});let g=G[r]?r:Ce(`${r}-icon`);return G[g]?(0,v.jsx)(D,{...p,className:l(t.className,H),icon:G[g],size:i,themeColor:a,rotate:m,flip:s,viewBox:N,variant:b}):(0,v.jsx)(v.Fragment,{})}return(0,v.jsx)(Y,{...p,className:l(t.className,H),icon:r,size:i,themeColor:a,rotate:m,flip:s})};h.states=Te;h.options=Me;h.defaultOptions=K;h.className=H;h.moduleName=Z;h.folderName=ee;h.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 j="button",ie=j;var d=require("react/jsx-runtime"),_="k-button",Oe=["icon-button"],we=[O.hover,O.focus,O.active,O.selected,O.disabled,O.generating],Se={size:[n.undefined,n.xsmall,n.small,n.medium,n.large],rounded:[T.undefined,T.none,T.small,T.medium,T.large,T.full],fillMode:[M.undefined,M.solid,M.flat,M.outline,M.clear,M.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"},c=t=>{let{as:e="button",size:i,rounded:a,fillMode:r,themeColor:u,showArrow:m=q.showArrow,arrowIconName:s=q.arrowIconName,variant:N,hover:b,focus:p,active:y,selected:g,disabled:L,togglable:P,ariaDisabled:I,icon:f,iconSize:k,text:R,iconClassName:re,className:ae,...se}=t,le=f!=null,de=t.children!==void 0;return(0,d.jsxs)(e,{className:l(ae,_,X(_,N),C(_,{size:i,rounded:a,fillMode:r,themeColor:u}),Q(_,{hover:b,focus:p,active:y,disabled:L||I,selected:g}),{"k-icon-button":!R&&!de&&le}),"aria-pressed":P?g?"true":"false":void 0,...se,"aria-disabled":I?"true":void 0,disabled:L||void 0,children:[typeof f=="string"&&f&&(0,d.jsx)(h,{className:l(re,"k-button-icon"),icon:f,size:k}),f&&typeof f!="string"&&(0,d.jsx)(d.Fragment,{children:f}),R?(0,d.jsxs)(d.Fragment,{children:[R&&(0,d.jsx)("span",{className:"k-button-text",children:R}),t.children]}):t.children&&(0,d.jsx)("span",{className:"k-button-text",children:t.children}),m&&(0,d.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,d.jsx)(h,{icon:s})})]})};c.states=we;c.options=Se;c.variants=Oe;c.className=_;c.defaultOptions=q;c.moduleName=j;c.folderName=ie;c.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 S=require("react/jsx-runtime"),W="k-navigator",Ie=[],ze={},Ae={},z=t=>{let{...e}=t;return(0,S.jsxs)("div",{...e,className:l(t.className,W),children:[(0,S.jsx)(c,{className:"k-navigator-n",icon:"chevron-up",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan north"}),(0,S.jsx)(c,{className:"k-navigator-e",icon:"chevron-right",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan east"}),(0,S.jsx)(c,{className:"k-navigator-s",icon:"chevron-down",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan south"}),(0,S.jsx)(c,{className:"k-navigator-w",icon:"chevron-left",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan west"})]})};z.states=Ie;z.options=ze;z.className=W;z.defaultOptions=Ae;var Be=z;