@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 12.6 kB
JavaScript
var Ft=Object.create;var U=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var Kt=Object.getOwnPropertyNames;var wt=Object.getPrototypeOf,Lt=Object.prototype.hasOwnProperty;var Et=(e,t)=>{for(var n in t)U(e,n,{get:t[n],enumerable:!0})},nt=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Kt(t))!Lt.call(e,s)&&s!==n&&U(e,s,{get:()=>t[s],enumerable:!(a=Mt(t,s))||a.enumerable});return e};var zt=(e,t,n)=>(n=e!=null?Ft(wt(e)):{},nt(t||!e||!e.__esModule?U(n,"default",{value:e,enumerable:!0}):n,e)),_t=e=>nt(U({},"__esModule",{value:!0}),e);var ge={};Et(ge,{PromptStopFloatingActionButton:()=>E,default:()=>xe});module.exports=_t(ge);var l=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?l(...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 k=(e,t)=>l({[`${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"}),K=(e,t)=>{let{valid:n,invalid:a,hover:s,focus:m,checked:d,active:r,selected:h,disabled:N,indeterminate:y,loading:A,empty:f,readonly:F,highlighted:X,...M}=t;return l({"k-valid":n,"k-invalid":a,"k-hover":s,"k-focus":m,"k-checked":d,"k-active":r,"k-selected":h,"k-disabled":N,"k-indeterminate":y&&!d,"k-loading":A,"k-empty":f,"k-readonly":F,"k-highlighted":X},Object.keys(M).reduce((v,T)=>(T.startsWith("k-")?v[T]=M[T]:v[`k-${T}`]=M[T],v),{}))};function it(e,t){if(!t)return{};let n=Array.isArray(t)?t:[t];return Object.fromEntries(n.map(a=>[`k-${a}`,!0]))}var i={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},x={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"},B={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"},p={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 z=require("react/jsx-runtime"),W="k-font-icon",Pt=[],Rt={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},$t={},_=e=>{let{size:t,themeColor:n,icon:a,rotate:s,flip:m,...d}=e;return a?(0,z.jsx)("span",{...d,className:l(e.className,W,k(W,{size:t}),{[`k-i-${a}`]:a,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),"aria-hidden":"true"}):(0,z.jsx)(z.Fragment,{})};_.states=Pt;_.options=Rt;_.className=W;_.defaultOptions=$t;var st=_;var S=require("react/jsx-runtime"),Q="k-svg-icon",Ht=[],Dt={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[B.outline,B.solid,B.duotone]},Y={viewBox:"0 0 24 24",variant:B.outline},P=e=>{var A,f;let{size:t,themeColor:n,rotate:a,flip:s,viewBox:m=Y.viewBox,variant:d=Y.variant,icon:r,...h}=e;if(!r)return(0,S.jsx)(S.Fragment,{});if(r==="none")return(0,S.jsx)("span",{...h,className:l(e.className,Q,k("k-icon",{size:t}),"k-none"),"aria-hidden":"true"});let N=typeof r=="object"&&r.name&&r.name,y=typeof r=="object"?d&&((A=r.variants)==null?void 0:A[d])||((f=r.variants)==null?void 0:f.outline)||r.content:void 0;return(0,S.jsx)("span",{...h,className:l(e.className,Q,k("k-icon",{size:t}),{[`k-svg-i-${N}`]:N,[`k-color-${n}`]:n,[`k-rotate-${a}`]:a,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),"aria-hidden":"true",children:(0,S.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof r=="object"?r.viewBox:m,dangerouslySetInnerHTML:y!==void 0?{__html:y}:void 0,children:r?void 0:e.children})})};P.states=Ht;P.options=Dt;P.className=Q;P.defaultOptions=Y;var Z=P;var j=zt(require("@progress/kendo-svg-icons"));var at="icon",rt="icons";var dt=require("react");var lt=require("react"),ct=(0,lt.createContext)({iconsType:"svg"});var C=require("react/jsx-runtime"),V="k-icon",Ut=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Vt=[],Gt={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[B.outline,B.solid,B.duotone]},G={viewBox:"0 0 24 24",type:"svg",variant:B.outline},g=e=>{let{iconsType:t}=(0,dt.useContext)(ct),{size:n,themeColor:a,icon:s,type:m=t||G.type,rotate:d,flip:r,viewBox:h=G.viewBox,variant:N=G.variant,...y}=e;if(!s)return(0,C.jsx)(C.Fragment,{});if((t||m)==="svg"){if(s==="none")return(0,C.jsx)(Z,{...y,className:l(e.className,V),icon:s,size:n,variant:N});let f=j[s]?s:Ut(`${s}-icon`);return j[f]?(0,C.jsx)(Z,{...y,className:l(e.className,V),icon:j[f],size:n,themeColor:a,rotate:d,flip:r,viewBox:h,variant:N}):(0,C.jsx)(C.Fragment,{})}return(0,C.jsx)(st,{...y,className:l(e.className,V),icon:s,size:n,themeColor:a,rotate:d,flip:r})};g.states=Vt;g.options=Gt;g.defaultOptions=G;g.className=V;g.moduleName=at;g.folderName=rt;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 tt="button",ut=tt;var b=require("react/jsx-runtime"),R="k-button",qt=["icon-button"],Jt=[p.hover,p.focus,p.active,p.selected,p.disabled,p.generating],Xt={size:[i.undefined,i.xsmall,i.small,i.medium,i.large],rounded:[x.undefined,x.none,x.small,x.medium,x.large,x.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]},et={showArrow:!1,arrowIconName:"chevron-down"},c=e=>{let{as:t="button",size:n,rounded:a,fillMode:s,themeColor:m,showArrow:d=et.showArrow,arrowIconName:r=et.arrowIconName,variant:h,hover:N,focus:y,active:A,selected:f,disabled:F,togglable:X,ariaDisabled:M,icon:v,iconSize:T,text:D,iconClassName:Ct,className:Ot,...Tt}=e,It=v!=null,St=e.children!==void 0;return(0,b.jsxs)(t,{className:l(Ot,R,it(R,h),k(R,{size:n,rounded:a,fillMode:s,themeColor:m}),K(R,{hover:N,focus:y,active:A,disabled:F||M,selected:f}),{"k-icon-button":!D&&!St&&It}),"aria-pressed":X?f?"true":"false":void 0,...Tt,"aria-disabled":M?"true":void 0,disabled:F||void 0,children:[typeof v=="string"&&v&&(0,b.jsx)(g,{className:l(Ct,"k-button-icon"),icon:v,size:T}),v&&typeof v!="string"&&(0,b.jsx)(b.Fragment,{children:v}),D?(0,b.jsxs)(b.Fragment,{children:[D&&(0,b.jsx)("span",{className:"k-button-text",children:D}),e.children]}):e.children&&(0,b.jsx)("span",{className:"k-button-text",children:e.children}),d&&(0,b.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,b.jsx)(g,{icon:r})})]})};c.states=Jt;c.options=Xt;c.variants=qt;c.className=R;c.defaultOptions=et;c.moduleName=tt;c.folderName=ut;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 pt=require("react/jsx-runtime"),mt=e=>(0,pt.jsx)(c,{icon:"folder",...e,"aria-label":e["aria-label"]||"Folder",children:void 0});var xt=require("react/jsx-runtime"),ft=e=>(0,xt.jsx)(c,{icon:"folder",children:"Button",...e});var bt=require("react/jsx-runtime"),gt=e=>(0,bt.jsx)(c,{children:"Button",...e});var q=require("react/jsx-runtime"),Wt=c.options,Qt=c.states,Yt={...c.defaultOptions,variant:"text"},Zt=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],jt=[],w=e=>{let{variant:t,...n}=e;switch(t){case"icon-only":return(0,q.jsx)(mt,{...n,icon:"star"});case"icon-and-text":return(0,q.jsx)(ft,{...n,icon:"star",children:"Button"});default:return(0,q.jsx)(gt,{...n,children:"Button"})}};w.options=Wt;w.states=Qt;w.variants=Zt;w.defaultOptions=Yt;w.modifiers=jt;w.className=c.className;var $=require("react/jsx-runtime"),J="k-fab",oe=[p.hover,p.focus,p.active,p.selected,p.disabled],ne={size:[i.undefined,i.small,i.medium,i.large],rounded:[x.undefined,x.none,x.small,x.medium,x.large,x.full],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary]},ht={type:"button"},u=e=>{let{size:t,rounded:n,themeColor:a,text:s,icon:m,type:d=ht.type,position:r,hover:h,focus:N,active:y,selected:A,disabled:f,...F}=e;return(0,$.jsxs)("button",{...F,type:d,className:l(e.className,J,k(J,{size:t,rounded:n,themeColor:a}),K(J,{hover:h,focus:N,active:y,disabled:f,selected:A}),{[`!k-pos-absolute k-${r}`]:r}),...!s&&m&&!e["aria-label"]&&{"aria-label":"Action"},...f&&{"aria-disabled":"true"},disabled:f||void 0,children:[m&&(0,$.jsx)(g,{className:"k-fab-icon",icon:m}),s&&(0,$.jsx)("span",{className:"k-fab-text",children:s})]})};u.states=oe;u.options=ne;u.className=J;u.defaultOptions=ht;u.moduleName="fab";u.folderName="fab";u.ariaSpec={selector:".k-fab",rules:[{selector:".k-fab",attribute:"role=button or nodeName=button",usage:"Omitted if the <button> DOM element is used."},{selector:".k-fab",attribute:"aria-label or title (when icon-only)",usage:"The attribute must be present when no text is initially visible in the button."},{selector:".k-fab.k-disabled",attribute:"aria-disabled=true",usage:"Rendered only when the button is disabled."}]};var vt=require("react/jsx-runtime"),ie="k-fab-items",yt=e=>{let{position:t,...n}=e;return(0,vt.jsx)("ul",{...n,className:l(e.className,ie,{[`k-fab-items-${t}`]:t}),children:e.children})};var H=require("react/jsx-runtime"),Nt="k-fab-item",se=[p.hover,p.focus,p.active,p.disabled],ot=e=>{let{text:t,icon:n,align:a,hover:s,focus:m,active:d,disabled:r,...h}=e;return(0,H.jsxs)("li",{...h,className:l(e.className,Nt,{[`k-text-${a}`]:a},K(Nt,{hover:s,focus:m,active:d,disabled:r})),children:[(0,H.jsx)("span",{className:"k-fab-item-text",children:t}),(0,H.jsx)(g,{className:"k-fab-item-icon",icon:n})]})};ot.states=se;var ae=require("react/jsx-runtime");var re=require("react/jsx-runtime");var le=require("react/jsx-runtime");var ce=require("react/jsx-runtime");var O=require("react/jsx-runtime"),de=u.options,ue=u.states,me={...u.defaultOptions,variant:"text"},pe=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],fe=[{name:"opened",title:"Opened"}],L=e=>{let{variant:t,modifiers:n,...a}=e,{opened:s}=n||{},m=s?(0,O.jsx)("div",{className:"k-fab-popup k-popup k-popup-transparent",style:{position:"absolute",top:"calc(16px + 36px)",right:"calc(16px + calc(36px / 2) - calc(36px /2))"},children:(0,O.jsx)(yt,{position:"bottom",children:(0,O.jsx)(ot,{text:"Item",icon:"pencil",align:"right"})})}):null,d;switch(t){case"icon-only":d=(0,O.jsx)(u,{...a,icon:"star"});break;case"icon-and-text":d=(0,O.jsx)(u,{...a,icon:"star",text:"Action"});break;default:d=(0,O.jsx)(u,{...a,text:"Action"});break}return(0,O.jsxs)("span",{style:{position:"relative"},children:[d,m]})};L.options=de;L.states=ue;L.variants=pe;L.defaultOptions=me;L.modifiers=fe;L.className=u.className;var kt=require("react/jsx-runtime"),Bt="k-prompt-stop-fab",At={generating:!0},E=e=>{let{generating:t=At.generating,icon:n,...a}=e;return(0,kt.jsx)(u,{...a,className:l(e.className,Bt,{"k-generating":t}),style:{bottom:"16px",right:"16px"},position:"bottom-end",icon:t?"stop-sm":n,active:t,"aria-label":t?"Stop generating":"Action"})};E.states=c.states;E.options=c.options;E.className=Bt;E.defaultOptions=At;var xe=E;