UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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