UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 7.12 kB
var D=Object.create;var N=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var Y=(t,e)=>{for(var l in e)N(t,l,{get:e[l],enumerable:!0})},K=(t,e,l,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of U(e))!W.call(t,r)&&r!==l&&N(t,r,{get:()=>e[r],enumerable:!(n=q(e,r))||n.enumerable});return t};var Z=(t,e,l)=>(l=t!=null?D(Q(t)):{},K(e||!t||!t.__esModule?N(l,"default",{value:t,enumerable:!0}):l,t)),j=t=>K(N({},"__esModule",{value:!0}),t);var xe={};Y(xe,{SplitterNormal:()=>fe});module.exports=j(xe);var c=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?c(...e):typeof e=="object"?Object.keys(e).map((l,n)=>e[n]||e[l]&&l||null).filter(l=>l!==null).join(" "):e).filter(e=>!!e).join(" ");var $=(t,e)=>c({[`${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.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${t}-${e.themeColor}`]:e.themeColor&&e.fillMode===void 0},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full"}),R=(t,e)=>c({"k-valid":e.valid,"k-invalid":e.invalid,"k-hover":e.hover,"k-focus":e.focus,"k-checked":e.checked,"k-active":e.active,"k-selected":e.selected,"k-disabled":e.disabled,"k-indeterminate":e.indeterminate&&!e.checked,"k-loading":e.loading,"k-empty":e.empty,"k-readonly":e.readonly,"k-highlighted":e.highlighted});var a={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var o={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},I={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"};var H=require("react/jsx-runtime"),b="k-pane",ee=[],te={},M={resizable:!0,flex:!1},f=t=>{let{scrollable:e,flexBasis:l,flex:n=M.flex,collapsible:r,resizable:s=M.resizable,pinned:i,unpinned:p,tabbed:m,...h}=t;return(0,H.jsx)("div",{...h,style:{flexBasis:l,...t.style},className:c(t.className,b,{[`${b}-static`]:l,[`${b}-flex`]:n,"k-scrollable":e,[`${b}-pinned`]:i,[`${b}-unpinned`]:p,[`${b}-tabbed`]:m}),children:t.children})};f.states=ee;f.options=te;f.className=b;f.defaultOptions=M;var z=require("react/jsx-runtime"),T="k-icon k-font-icon",oe=[],le={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},ne={},P=t=>{let{size:e,themeColor:l,icon:n,rotate:r,flip:s,...i}=t;return n?(0,z.jsx)("span",{...i,className:c(t.className,T,$(T,{size:e}),{[`k-i-${n}`]:n,[`k-color-${l}`]:l,[`k-rotate-${r}`]:r,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"})}):(0,z.jsx)(z.Fragment,{})};P.states=oe;P.options=le;P.className=T;P.defaultOptions=ne;var _=P;var g=require("react/jsx-runtime"),w="k-icon k-svg-icon",ie=[],ae={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},F={viewBox:"0 0 24 24"},C=t=>{let{size:e,themeColor:l,rotate:n,flip:r,viewBox:s=F.viewBox,icon:i,...p}=t;if(!i)return(0,g.jsx)(g.Fragment,{});i==="none"&&{...p,className:c(t.className,w,"k-none")};let m=typeof i=="object"&&i.name&&i.name;return(0,g.jsx)("span",{...p,className:c(t.className,w,$("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${l}`]:l,[`k-rotate-${n}`]:n,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),children:(0,g.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:s,dangerouslySetInnerHTML:typeof i=="object"?{__html:i.content}:void 0,children:i?void 0:t.children})})};C.states=ie;C.options=ae;C.className=w;C.defaultOptions=F;var O=C;var V=Z(require("@progress/kendo-svg-icons")),u=require("react/jsx-runtime"),re=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),se=[],ce={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},A={viewBox:"0 0 24 24",type:"svg"},S=t=>{let{size:e,themeColor:l,icon:n,type:r=A.type,rotate:s,flip:i,viewBox:p=A.viewBox,...m}=t;if(!n)return(0,u.jsx)(u.Fragment,{});if(r==="svg"){if(n==="none")return(0,u.jsx)(O,{...m,icon:n,size:e});let h=re(`${n}-icon`);return V[h]?(0,u.jsx)(O,{...m,icon:V[h],size:e,themeColor:l,rotate:s,flip:i,viewBox:p}):(0,u.jsx)(u.Fragment,{})}return(0,u.jsx)(_,{...m,icon:n,size:e,themeColor:l,rotate:s,flip:i})};S.states=se;S.options=ce;S.defaultOptions=A;var d=require("react/jsx-runtime"),v="k-splitbar",pe=[I.hover,I.focus],de={},L={orientation:"horizontal",draggable:!0},y=t=>{let{hover:e,focus:l,orientation:n=L.orientation,draggable:r=L.draggable,collapsePrev:s,collapseNext:i,...p}=t;return(0,d.jsxs)("div",{...p,className:c(t.className,v,R(v,{hover:e,focus:l}),{[`${v}-${n}`]:n,[`${v}-draggable-${n}`]:r,[`${v}-static-${n}`]:!r&&!s&&!i}),children:[s&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)("div",{className:"k-collapse-prev",children:(0,d.jsx)(S,{icon:`caret-alt-${n==="horizontal"?"left":"up"}`,size:"xsmall"})})}),(0,d.jsx)("div",{className:"k-resize-handle"}),i&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)("div",{className:"k-collapse-next",children:(0,d.jsx)(S,{icon:`caret-alt-${n==="horizontal"?"right":"down"}`,size:"xsmall"})})})]})};y.states=pe;y.options=de;y.className=v;y.defaultOptions=L;var E=require("react/jsx-runtime"),J=require("react"),B="k-splitter",me={},G={orientation:"horizontal"},k=t=>{let{orientation:e=G.orientation,children:l,...n}=t,r=[];return l&&Array.isArray(l)&&l.map((s,i)=>{if(s.type===f){let p=l[i+1],m=s.props,h=p==null?void 0:p.props;r.push((0,J.createElement)(f,{...m,key:i}),p&&(0,E.jsx)(y,{draggable:m.resizable!==!1&&h.resizable!==!1,collapsePrev:m.collapsible,collapseNext:h.collapsible,orientation:e},`splitbar-${i}`))}else r.push(s)}),(0,E.jsx)("div",{...n,className:c(t.className,B,{[`${B}-${e}`]:e},"k-splitter-flex"),children:r})};k.options=me;k.className=B;k.defaultOptions=G;var X=require("react/jsx-runtime");var x=require("react/jsx-runtime"),fe=t=>(0,x.jsx)(k,{children:[(0,x.jsx)(f,{flexBasis:"20%",collapsible:!0,children:(0,x.jsx)("p",{children:"Collapsible pane - 20%"})},"pane-1"),(0,x.jsxs)(f,{children:[(0,x.jsx)("p",{children:"Content"}),(0,x.jsx)("p",{children:"Content"}),(0,x.jsx)("p",{children:"Content"})]},"pane-2"),(0,x.jsx)(f,{flexBasis:"30%",collapsible:!0,children:(0,x.jsx)("p",{children:"Collapsible pane - 30%"})},"pane-3")],...t});