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