UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 2.72 kB
var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((o,l)=>e[l]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var g=(t,e)=>i({[`${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:o,invalid:l,hover:a,focus:b,checked:f,active:k,selected:y,disabled:v,indeterminate:M,loading:O,empty:B,readonly:T,highlighted:N,...u}=e;return i({"k-valid":o,"k-invalid":l,"k-hover":a,"k-focus":b,"k-checked":f,"k-active":k,"k-selected":y,"k-disabled":v,"k-indeterminate":M&&!f,"k-loading":O,"k-empty":B,"k-readonly":T,"k-highlighted":N},Object.keys(u).reduce((c,d)=>(d.startsWith("k-")?c[d]=u[d]:c[`k-${d}`]=u[d],c),{}))};var r={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"};var h={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 m="button",p=m;import{jsx as A}from"react/jsx-runtime";var s="k-button-group",$=[h.disabled],G={fillMode:[r.undefined,r.solid,r.flat,r.outline,r.clear,r.link]},_={},n=t=>{let{fillMode:e,disabled:o,stretched:l,...a}=t;return A("div",{role:"group",...a,className:i(t.className,s,g(s,{fillMode:e}),x(s,{disabled:o}),{[`${s}-stretched`]:l}),...o&&{"aria-disabled":"true"},children:t.children})};n.states=$;n.options=G;n.className=s;n.defaultOptions=_;n.moduleName=m;n.folderName=p;n.ariaSpec={selector:".k-button-group",rules:[{selector:".k-button-group:not(.k-split-button)",attribute:"role=group",usage:"Sets the proper role for the group of buttons."},{selector:".k-button-group.k-disabled",attribute:"aria-disabled=true",usage:"The attribute is rendered only when the entire button group is disabled."},{selector:".k-button-group:not(.k-split-button):not(.k-scheduler-navigation):not(.k-zoom-control) .k-button",attribute:"aria-pressed (when selected)",usage:"Specifies the current state of the ButtonGroup. Only the selected button within the group will have this attribute set to true."}]};var H=n;export{s as BUTTONGROUP_CLASSNAME,n as ButtonGroup,H as default};