@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 6.33 kB
JavaScript
var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((o,b)=>e[b]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var $=(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"}),O=(t,e)=>{let{valid:o,invalid:b,hover:L,focus:k,checked:h,active:N,selected:M,disabled:A,indeterminate:I,loading:K,empty:H,readonly:S,highlighted:F,..._}=e;return i({"k-valid":o,"k-invalid":b,"k-hover":L,"k-focus":k,"k-checked":h,"k-active":N,"k-selected":M,"k-disabled":A,"k-indeterminate":I&&!h,"k-loading":K,"k-empty":H,"k-readonly":S,"k-highlighted":F},Object.keys(_).reduce((z,y)=>(y.startsWith("k-")?z[y]=_[y]:z[`k-${y}`]=_[y],z),{}))};var g={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 n={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 T={};function d(t){return T[t]=(T[t]||0)+1,`k-${t}-${T[t]}`}var x="checkbox",p=x;import{jsx as w}from"react/jsx-runtime";var E="k-checkbox",U=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.checked,n.indeterminate],q={size:[g.undefined,g.small,g.medium,g.large],rounded:[u.undefined,u.none,u.small,u.medium,u.large,u.full]},V={},s=t=>{let{id:e,checked:o,indeterminate:b,hover:L,focus:k,disabled:h,invalid:N,valid:M,required:A,size:I,rounded:K,wrapperRole:H,...S}=t;return w("span",{className:"k-checkbox-wrap",role:H,children:w("input",{...S,id:e,type:"checkbox",defaultChecked:o,required:A,disabled:h||void 0,"aria-invalid":N?"true":void 0,className:i(t.className,E,$(E,{size:I,rounded:K}),O(E,{hover:L,focus:k,disabled:h,invalid:N,valid:M,indeterminate:b,checked:o}))})})};s.states=U;s.options=q;s.className=E;s.defaultOptions=V;s.moduleName=x;s.folderName=p;s.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 c=s;import{jsx as Y}from"react/jsx-runtime";var B="k-checkbox-list",J=[],Q={},G={layout:"vertical"},a=t=>{let{layout:e=G.layout,...o}=t;return Y("ul",{...o,className:i(t.className,B,{[`k-list-${e}`]:e}),children:t.children})};a.states=J;a.options=Q;a.className=B;a.defaultOptions=G;a.moduleName=x;a.folderName=p;import{jsx as te}from"react/jsx-runtime";var P="k-checkbox-list-item",Z=[],j={},ee={},r=t=>{let{...e}=t;return te("li",{...e,className:i(t.className,P),children:t.children})};r.states=Z;r.options=j;r.className=P;r.defaultOptions=ee;r.moduleName=x;r.folderName=p;import{Fragment as oe,jsx as W,jsxs as ae}from"react/jsx-runtime";var m=({children:t="Label",id:e="cb-label-after",...o})=>ae(oe,{children:[W(c,{id:e,...o}),W("label",{className:"k-checkbox-label",htmlFor:e,children:t})]});import{Fragment as Ve,jsx as qe,jsxs as Je}from"react/jsx-runtime";import{Fragment as et,jsx as je,jsxs as tt}from"react/jsx-runtime";import{Fragment as it,jsx as nt,jsxs as st}from"react/jsx-runtime";import{jsx as mt}from"react/jsx-runtime";import{jsx as xt}from"react/jsx-runtime";import{jsx as Ct}from"react/jsx-runtime";import{jsx as l,jsxs as X}from"react/jsx-runtime";var re=a.options,ne=a.states,ie={...a.defaultOptions,variant:"vertical"},se=[{name:"vertical",title:"Vertical"},{name:"horizontal",title:"Horizontal"}],le=[],f=t=>{let{variant:e,...o}=t;return e==="horizontal"?X(a,{layout:"horizontal",...o,children:[l(r,{children:l(m,{id:d("cb"),defaultChecked:!0,children:"Label"})}),l(r,{children:l(m,{id:d("cb"),children:"Label"})}),l(r,{children:l(m,{id:d("cb"),children:"Label"})})]}):X(a,{...o,children:[l(r,{children:l(m,{id:d("cb"),defaultChecked:!0,children:"Label"})}),l(r,{children:l(m,{id:d("cb"),children:"Label"})}),l(r,{children:l(m,{id:d("cb"),children:"Label"})})]})};f.options=re;f.states=ne;f.variants=se;f.defaultOptions=ie;f.modifiers=le;f.className=a.className;import{jsx as ue}from"react/jsx-runtime";var ce=c.options,de=c.states,me=c.defaultOptions,be=[],he=[],C=t=>ue(m,{id:d("checkbox"),...t,defaultChecked:!0,children:"Label"});C.options=ce;C.states=de;C.variants=be;C.defaultOptions=me;C.modifiers=he;C.className=c.className;import{jsx as D,jsxs as fe}from"react/jsx-runtime";var R="k-column-list-item",xe=[n.focus,n.disabled,n.hover],ke={},pe={},v=t=>{let{label:e,checked:o,focus:b,hover:L,disabled:k,...h}=t;return fe("span",{...h,className:i(t.className,R,O(R,{focus:b,hover:L,disabled:k})),role:"option","aria-checked":o?"true":"false",children:[D(s,{disabled:k,checked:o,"aria-label":e}),D("span",{className:"k-checkbox-label",children:e})]})};v.states=xe;v.options=ke;v.className=R;v.defaultOptions=pe;var Jt=v;export{R as COLUMNLISTITEM_CLASSNAME,v as ColumnListItem,Jt as default};