UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.16 kB
var n=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?n(...e):typeof e=="object"?Object.keys(e).map((o,h)=>e[h]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var S=(t,e)=>n({[`${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"}),$=(t,e)=>{let{valid:o,invalid:h,hover:L,focus:M,checked:C,active:y,selected:N,disabled:O,indeterminate:E,loading:A,empty:I,readonly:K,highlighted:D,...H}=e;return n({"k-valid":o,"k-invalid":h,"k-hover":L,"k-focus":M,"k-checked":C,"k-active":y,"k-selected":N,"k-disabled":O,"k-indeterminate":E&&!C,"k-loading":A,"k-empty":I,"k-readonly":K,"k-highlighted":D},Object.keys(H).reduce((z,g)=>(g.startsWith("k-")?z[g]=H[g]:z[`k-${g}`]=H[g],z),{}))};var c={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},u={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"};var d={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 _={};function m(t){return _[t]=(_[t]||0)+1,`k-${t}-${_[t]}`}var x="checkbox",k=x;import{jsx as w}from"react/jsx-runtime";var v="k-checkbox",F=[d.hover,d.focus,d.valid,d.invalid,d.required,d.disabled,d.checked,d.indeterminate],U={size:[c.undefined,c.small,c.medium,c.large],rounded:[u.undefined,u.none,u.small,u.medium,u.large,u.full]},q={},i=t=>{let{id:e,checked:o,indeterminate:h,hover:L,focus:M,disabled:C,invalid:y,valid:N,required:O,size:E,rounded:A,wrapperRole:I,...K}=t;return w("span",{className:"k-checkbox-wrap",role:I,children:w("input",{...K,id:e,type:"checkbox",defaultChecked:o,required:O,disabled:C||void 0,"aria-invalid":y?"true":void 0,className:n(t.className,v,S(v,{size:E,rounded:A}),$(v,{hover:L,focus:M,disabled:C,invalid:y,valid:N,indeterminate:h,checked:o}))})})};i.states=F;i.options=U;i.className=v;i.defaultOptions=q;i.moduleName=x;i.folderName=k;i.ariaSpec={selector:".k-checkbox",rules:[{selector:".k-checkbox",attribute:"role=checkbox or type=checkbox",usage:"Announces the checkbox role of the element."},{selector:".k-checkbox",attribute:"label for or aria-label or aria-labelledby (when has accessible name)",usage:"The input requires an accessible name to which it will be assigned."},{selector:".k-checkbox",attribute:"aria-checked=true/false/mixed or checked",usage:"For native checkboxes the checked state is handled by the browser. aria-checked is used for custom implementations."},{selector:".k-checkbox",attribute:"aria-describedby (when has hint or error)",usage:"Points to the hint or error message for the checkbox."},{selector:".k-checkbox",attribute:"disabled or aria-disabled=true (when disabled)",usage:"For native checkboxes use the HTML disabled attribute. aria-disabled for custom implementations."},{selector:".k-invalid, .ng-invalid",attribute:"aria-invalid=true (when invalid)",usage:"Rendered only when the CheckBox is in a form and announces the invalid state."}]};var s=i;import{jsx as Q}from"react/jsx-runtime";var B="k-checkbox-list",V=[],J={},G={layout:"vertical"},a=t=>{let{layout:e=G.layout,...o}=t;return Q("ul",{...o,className:n(t.className,B,{[`k-list-${e}`]:e}),children:t.children})};a.states=V;a.options=J;a.className=B;a.defaultOptions=G;a.moduleName=x;a.folderName=k;import{jsx as ee}from"react/jsx-runtime";var P="k-checkbox-list-item",Y=[],Z={},j={},r=t=>{let{...e}=t;return ee("li",{...e,className:n(t.className,P),children:t.children})};r.states=Y;r.options=Z;r.className=P;r.defaultOptions=j;r.moduleName=x;r.folderName=k;import{Fragment as te,jsx as W,jsxs as oe}from"react/jsx-runtime";var b=({children:t="Label",id:e="cb-label-after",...o})=>oe(te,{children:[W(s,{id:e,...o}),W("label",{className:"k-checkbox-label",htmlFor:e,children:t})]});import{Fragment as qe,jsx as Ue,jsxs as Ve}from"react/jsx-runtime";import{Fragment as je,jsx as Ze,jsxs as et}from"react/jsx-runtime";import{Fragment as nt,jsx as rt,jsxs as it}from"react/jsx-runtime";import{jsx as dt}from"react/jsx-runtime";import{jsx as ut}from"react/jsx-runtime";import{jsx as ft}from"react/jsx-runtime";import{jsx as l,jsxs as X}from"react/jsx-runtime";var ae=a.options,re=a.states,ne={...a.defaultOptions,variant:"vertical"},ie=[{name:"vertical",title:"Vertical"},{name:"horizontal",title:"Horizontal"}],le=[],p=t=>{let{variant:e,...o}=t;return e==="horizontal"?X(a,{layout:"horizontal",...o,children:[l(r,{children:l(b,{id:m("cb"),defaultChecked:!0,children:"Label"})}),l(r,{children:l(b,{id:m("cb"),children:"Label"})}),l(r,{children:l(b,{id:m("cb"),children:"Label"})})]}):X(a,{...o,children:[l(r,{children:l(b,{id:m("cb"),defaultChecked:!0,children:"Label"})}),l(r,{children:l(b,{id:m("cb"),children:"Label"})}),l(r,{children:l(b,{id:m("cb"),children:"Label"})})]})};p.options=ae;p.states=re;p.variants=ie;p.defaultOptions=ne;p.modifiers=le;p.className=a.className;import{jsx as he}from"react/jsx-runtime";var se=s.options,ce=s.states,de=s.defaultOptions,me=[],be=[],f=t=>he(b,{id:m("checkbox"),...t,defaultChecked:!0,children:"Label"});f.options=se;f.states=ce;f.variants=me;f.defaultOptions=de;f.modifiers=be;f.className=s.className;import{jsx as R,jsxs as pe}from"react/jsx-runtime";var ue="k-item",xe={size:[c.undefined,c.small,c.medium,c.large]},ke=[],T=t=>{let{text:e,size:o,...h}=t;return R("li",{...h,className:n(t.className,ue),children:pe("label",{className:"k-label k-checkbox-label",children:[R(i,{size:o}),R("span",{children:e})]})})};T.states=ke;T.options=xe;var Vt=T;export{T as ColumnMenuMulticheckItem,Vt as default};