UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 11.1 kB
var s=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?s(...e):typeof e=="object"?Object.keys(e).map((i,r)=>e[r]||e[i]&&i||null).filter(i=>i!==null).join(" "):e).filter(e=>!!e).join(" ");var N=(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"}),R=(t,e)=>{let{valid:i,invalid:r,hover:m,focus:B,checked:h,active:d,selected:g,disabled:C,indeterminate:v,loading:q,empty:z,readonly:te,highlighted:re,..._}=e;return s({"k-valid":i,"k-invalid":r,"k-hover":m,"k-focus":B,"k-checked":h,"k-active":d,"k-selected":g,"k-disabled":C,"k-indeterminate":v&&!h,"k-loading":q,"k-empty":z,"k-readonly":te,"k-highlighted":re},Object.keys(_).reduce((H,L)=>(L.startsWith("k-")?H[L]=_[L]:H[`k-${L}`]=_[L],H),{}))};var n={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var k={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},c={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},T={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 K="breadcrumb",W=K;import{jsx as ae}from"react/jsx-runtime";var O="k-breadcrumb",oe=[T.focus],ne={size:[n.undefined,n.small,n.medium,n.large]},X={collapsing:"auto"},b=t=>{let{size:e,collapsing:i=X.collapsing,focus:r,...m}=t;return ae("nav",{...m,className:s(t.className,O,R(O,{focus:r}),N(O,{size:e}),{"k-breadcrumb-wrap":i==="wrap"}),"aria-label":"Breadcrumb",children:t.children})};b.states=oe;b.options=ne;b.className=O;b.defaultOptions=X;b.moduleName=K;b.folderName=W;b.ariaSpec={selector:".k-breadcrumb",rules:[{selector:".k-breadcrumb",attribute:"aria-label=Breadcrumb",usage:"Indicates the type of navigation provided by the nav element."},{selector:".k-breadcrumb-item .k-breadcrumb-link,.k-breadcrumb-item .k-breadcrumb-root-link",attribute:"role=link or nodeName=a",usage:'The breadcrumb item should render an <a> element or have role="link".'},{selector:".k-breadcrumb-last-item .k-breadcrumb-link,.k-breadcrumb-last-item .k-breadcrumb-root-link",attribute:"aria-current=page",usage:"The last breadcrumb item points to the active page."},{selector:".k-breadcrumb-last-item .k-breadcrumb-link",attribute:"aria-disabled=true",usage:"The last breadcrumb item is disabled."},{selector:".k-breadcrumb-delimiter-icon",attribute:"aria-hidden=true",usage:"Delimiter icon should not be accessed through assistive technology."}]};import{jsx as Ye}from"react/jsx-runtime";import{jsx as tt}from"react/jsx-runtime";import{jsx as se}from"react/jsx-runtime";var ie="k-breadcrumb-container",ce={collapsing:"auto"},I=t=>{let{collapsing:e=ce.collapsing,...i}=t;return se("ol",{...i,className:s(t.className,ie,{"!k-flex-wrap":e==="wrap","k-flex-none":e==="none"}),children:t.children})};import{jsx as le}from"react/jsx-runtime";var me="k-breadcrumb-item",u=t=>{let{root:e,last:i,...r}=t;return le("li",{...r,className:s(t.className,me,{"k-breadcrumb-root-item":e,"k-breadcrumb-last-item":i}),children:t.children})};import{jsx as be}from"react/jsx-runtime";var de="",ue=[T.hover,T.focus,T.disabled],l=t=>{let{root:e,icon:i,icontext:r,hover:m,focus:B,disabled:h,last:d,...g}=t;return be("a",{href:"#",...g,className:s(t.className,R(de,{hover:m,focus:B,disabled:h}),{"k-breadcrumb-link":!e,"k-breadcrumb-root-link":e,"k-breadcrumb-icon-link":i,"k-breadcrumb-icontext-link":r}),...d&&{"aria-current":"page"},...d&&{"aria-disabled":"true"},children:t.children})};l.states=ue;import{jsx as xe}from"react/jsx-runtime";var pe="k-breadcrumb-item-text",p=t=>{let{text:e,...i}=t,r=e||t.children;return xe("span",{...i,className:s(t.className,pe),children:r})};import{Fragment as ke,jsx as J}from"react/jsx-runtime";var P="k-font-icon",fe=[],Be={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[c.undefined,c.base,c.primary,c.secondary,c.tertiary,c.success,c.warning,c.error,c.info]},he={},M=t=>{let{size:e,themeColor:i,icon:r,rotate:m,flip:B,...h}=t;return r?J("span",{...h,className:s(t.className,P,N(P,{size:e}),{[`k-i-${r}`]:r,[`k-color-${i}`]:i,[`k-rotate-${m}`]:m,"k-flip-h":B==="h"||B==="both","k-flip-v":B==="v"||B==="both"}),"aria-hidden":"true"}):J(ke,{})};M.states=fe;M.options=Be;M.className=P;M.defaultOptions=he;var Q=M;import{Fragment as Ie,jsx as D}from"react/jsx-runtime";var F="k-svg-icon",ge=[],ve={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[c.undefined,c.base,c.primary,c.secondary,c.tertiary,c.success,c.warning,c.error,c.info],variant:[k.outline,k.solid,k.duotone]},U={viewBox:"0 0 24 24",variant:k.outline},A=t=>{let{size:e,themeColor:i,rotate:r,flip:m,viewBox:B=U.viewBox,variant:h=U.variant,icon:d,...g}=t;if(!d)return D(Ie,{});if(d==="none")return D("span",{...g,className:s(t.className,F,N("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let C=typeof d=="object"&&d.name&&d.name,v=typeof d=="object"?h&&d.variants?.[h]||d.variants?.outline||d.content:void 0;return D("span",{...g,className:s(t.className,F,N("k-icon",{size:e}),{[`k-svg-i-${C}`]:C,[`k-color-${i}`]:i,[`k-rotate-${r}`]:r,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),"aria-hidden":"true",children:D("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof d=="object"?d.viewBox:B,dangerouslySetInnerHTML:v!==void 0?{__html:v}:void 0,children:d?void 0:t.children})})};A.states=ge;A.options=ve;A.className=F;A.defaultOptions=U;var V=A;import*as G from"@progress/kendo-svg-icons";var Y="icon",Z="icons";import{useContext as Ne}from"react";import{createContext as Ce}from"react";var j=Ce({iconsType:"svg"});import{Fragment as ee,jsx as S}from"react/jsx-runtime";var w="k-icon",Te=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ye=[],Le={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[c.undefined,c.base,c.primary,c.secondary,c.tertiary,c.success,c.warning,c.error,c.info],variant:[k.outline,k.solid,k.duotone]},$={viewBox:"0 0 24 24",type:"svg",variant:k.outline},a=t=>{let{iconsType:e}=Ne(j),{size:i,themeColor:r,icon:m,type:B=e||$.type,rotate:h,flip:d,viewBox:g=$.viewBox,variant:C=$.variant,...v}=t;if(!m)return S(ee,{});if((e||B)==="svg"){if(m==="none")return S(V,{...v,className:s(t.className,w),icon:m,size:i,variant:C});let z=G[m]?m:Te(`${m}-icon`);return G[z]?S(V,{...v,className:s(t.className,w),icon:G[z],size:i,themeColor:r,rotate:h,flip:d,viewBox:g,variant:C}):S(ee,{})}return S(Q,{...v,className:s(t.className,w),icon:m,size:i,themeColor:r,rotate:h,flip:d})};a.states=ye;a.options=Le;a.defaultOptions=$;a.className=w;a.moduleName=Y;a.folderName=Z;a.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."}]};import{Fragment as Pt,jsx as Ht,jsxs as Kt}from"react/jsx-runtime";import{Fragment as Jt,jsx as Wt,jsxs as Xt}from"react/jsx-runtime";import{jsx as o,jsxs as x}from"react/jsx-runtime";var Me=b.options,Ae=b.states,Se={...b.defaultOptions,variant:"text"},Ee=[{name:"text",title:"Text"},{name:"icon",title:"Icon"},{name:"icon-and-text",title:"Icon & Text"}],ze=[],y=t=>{let{variant:e,...i}=t;switch(e){case"icon":return o(b,{...i,children:x(I,{children:[x(u,{root:!0,children:[o(l,{root:!0,icon:!0,onClick:r=>r.preventDefault(),children:o(a,{icon:"cart"})}),o(a,{className:"k-breadcrumb-delimiter-icon",icon:"chevron-right",size:"xsmall"})]}),x(u,{children:[o(l,{icon:!0,onClick:r=>r.preventDefault(),children:o(a,{icon:"js"})}),o(a,{className:"k-breadcrumb-delimiter-icon",icon:"chevron-right",size:"xsmall"})]}),x(u,{children:[o(l,{icon:!0,onClick:r=>r.preventDefault(),children:o(a,{icon:"truck"})}),o(a,{className:"k-breadcrumb-delimiter-icon",icon:"chevron-right",size:"xsmall"})]}),o(u,{last:!0,children:o(l,{icon:!0,onClick:r=>r.preventDefault(),children:o(a,{icon:"wallet"})})})]})});case"icon-and-text":return o(b,{...i,children:x(I,{children:[x(u,{root:!0,children:[x(l,{root:!0,icontext:!0,onClick:r=>r.preventDefault(),children:[o(a,{icon:"cart"}),o(p,{text:"Cart"})]}),o(a,{className:"k-breadcrumb-delimiter-icon",icon:"chevron-right",size:"xsmall"})]}),x(u,{children:[x(l,{icontext:!0,onClick:r=>r.preventDefault(),children:[o(a,{icon:"js"}),o(p,{text:"Billing"})]}),o(a,{className:"k-breadcrumb-delimiter-icon",icon:"chevron-right",size:"xsmall"})]}),x(u,{children:[x(l,{icontext:!0,onClick:r=>r.preventDefault(),children:[o(a,{icon:"truck"}),o(p,{text:"Shipping"})]}),o(a,{className:"k-breadcrumb-delimiter-icon",icon:"chevron-right",size:"xsmall"})]}),o(u,{last:!0,children:x(l,{icontext:!0,onClick:r=>r.preventDefault(),children:[o(a,{icon:"wallet"}),o(p,{text:"Payment"})]})})]})});default:return o(b,{...i,children:x(I,{children:[x(u,{root:!0,children:[o(l,{root:!0,onClick:r=>r.preventDefault(),children:o(p,{text:"Cart"})}),o(a,{className:"k-breadcrumb-delimiter-icon",icon:"chevron-right",size:"xsmall"})]}),x(u,{children:[o(l,{onClick:r=>r.preventDefault(),children:o(p,{text:"Billing"})}),o(a,{className:"k-breadcrumb-delimiter-icon",icon:"chevron-right",size:"xsmall"})]}),x(u,{children:[o(l,{onClick:r=>r.preventDefault(),children:o(p,{text:"Shipping"})}),o(a,{className:"k-breadcrumb-delimiter-icon",icon:"chevron-right",size:"xsmall"})]}),o(u,{last:!0,children:o(l,{onClick:r=>r.preventDefault(),children:o(p,{text:"Payment"})})})]})})}};y.options=Me;y.states=Ae;y.variants=Ee;y.defaultOptions=Se;y.modifiers=ze;y.className=b.className;import{Fragment as Re,jsx as f,jsxs as E}from"react/jsx-runtime";var gr=({dir:t,...e})=>f(b,{collapsing:"auto",children:f(Re,{children:E(I,{collapsing:"auto",children:[E(u,{root:!0,children:[E(l,{root:!0,icontext:!0,children:[f(a,{icon:"home"}),f(p,{text:"Home"})]}),f(a,{className:"k-breadcrumb-delimiter-icon",icon:`chevron-${t==="rtl"?"left":"right"}`,size:"xsmall"})]}),E(u,{children:[f(l,{children:f(p,{text:"First item"})}),f(a,{className:"k-breadcrumb-delimiter-icon",icon:`chevron-${t==="rtl"?"left":"right"}`,size:"xsmall"})]}),E(u,{children:[f(l,{children:f(p,{text:"Second item"})}),f(a,{className:"k-breadcrumb-delimiter-icon",icon:`chevron-${t==="rtl"?"left":"right"}`,size:"xsmall"})]}),f(u,{last:!0,children:f(l,{last:!0,children:f(p,{text:"Third item"})})})]})}),...e});export{gr as BreadcrumbCollapsingAuto};