UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.52 kB
var S=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var Z=(o,e)=>{for(var t in e)S(o,t,{get:e[t],enumerable:!0})},j=(o,e,t,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of Q(e))!Y.call(o,d)&&d!==t&&S(o,d,{get:()=>e[d],enumerable:!(u=J(e,d))||u.enumerable});return o};var ee=o=>j(S({},"__esModule",{value:!0}),o);var Le={};Z(Le,{CheckboxGroupHorizontal:()=>ye});module.exports=ee(Le);var c=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?c(...e):typeof e=="object"?Object.keys(e).map((t,u)=>e[u]||e[t]&&t||null).filter(t=>t!==null).join(" "):e).filter(e=>!!e).join(" ");var G=(o,e)=>c({[`${o}-xs`]:e.size==="xsmall",[`${o}-sm`]:e.size==="small",[`${o}-md`]:e.size==="medium",[`${o}-lg`]:e.size==="large",[`${o}-xl`]:e.size==="xlarge",[`${o}-xxl`]:e.size==="xxlarge",[`${o}-xxxl`]:e.size==="xxxlarge"},{[`${o}-${e.fillMode}`]:e.fillMode},{[`${o}-${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"}),P=(o,e)=>{let{valid:t,invalid:u,hover:d,focus:N,checked:v,active:O,selected:A,disabled:M,indeterminate:I,loading:K,empty:H,readonly:z,highlighted:V,..._}=e;return c({"k-valid":t,"k-invalid":u,"k-hover":d,"k-focus":N,"k-checked":v,"k-active":O,"k-selected":A,"k-disabled":M,"k-indeterminate":I&&!v,"k-loading":K,"k-empty":H,"k-readonly":z,"k-highlighted":V},Object.keys(_).reduce((R,y)=>(y.startsWith("k-")?R[y]=_[y]:R[`k-${y}`]=_[y],R),{}))};var L={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},x={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"};var b={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 m(o){return T[o]=(T[o]||0)+1,`k-${o}-${T[o]}`}var k="checkbox",p=k;var $=require("react/jsx-runtime"),E="k-checkbox",oe=[b.hover,b.focus,b.valid,b.invalid,b.required,b.disabled,b.checked,b.indeterminate],te={size:[L.undefined,L.small,L.medium,L.large],rounded:[x.undefined,x.none,x.small,x.medium,x.large,x.full]},ae={},i=o=>{let{id:e,checked:t,indeterminate:u,hover:d,focus:N,disabled:v,invalid:O,valid:A,required:M,size:I,rounded:K,wrapperRole:H,...z}=o;return(0,$.jsx)("span",{className:"k-checkbox-wrap",role:H,children:(0,$.jsx)("input",{...z,id:e,type:"checkbox",defaultChecked:t,required:M,disabled:v||void 0,"aria-invalid":O?"true":void 0,className:c(o.className,E,G(E,{size:I,rounded:K}),P(E,{hover:d,focus:N,disabled:v,invalid:O,valid:A,indeterminate:u,checked:t}))})})};i.states=oe;i.options=te;i.className=E;i.defaultOptions=ae;i.moduleName=k;i.folderName=p;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;var D=require("react/jsx-runtime"),W="k-checkbox-list",re=[],ne={},X={layout:"vertical"},r=o=>{let{layout:e=X.layout,...t}=o;return(0,D.jsx)("ul",{...t,className:c(o.className,W,{[`k-list-${e}`]:e}),children:o.children})};r.states=re;r.options=ne;r.className=W;r.defaultOptions=X;r.moduleName=k;r.folderName=p;var U=require("react/jsx-runtime"),F="k-checkbox-list-item",ie=[],le={},se={},a=o=>{let{...e}=o;return(0,U.jsx)("li",{...e,className:c(o.className,F),children:o.children})};a.states=ie;a.options=le;a.className=F;a.defaultOptions=se;a.moduleName=k;a.folderName=p;var f=require("react/jsx-runtime"),h=({children:o="Label",id:e="cb-label-after",...t})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(s,{id:e,...t}),(0,f.jsx)("label",{className:"k-checkbox-label",htmlFor:e,children:o})]});var w=require("react/jsx-runtime");var B=require("react/jsx-runtime");var ce=require("react/jsx-runtime");var de=require("react/jsx-runtime");var be=require("react/jsx-runtime");var n=require("react/jsx-runtime"),me=r.options,he=r.states,ue={...r.defaultOptions,variant:"vertical"},xe=[{name:"vertical",title:"Vertical"},{name:"horizontal",title:"Horizontal"}],ke=[],C=o=>{let{variant:e,...t}=o;return e==="horizontal"?(0,n.jsxs)(r,{layout:"horizontal",...t,children:[(0,n.jsx)(a,{children:(0,n.jsx)(h,{id:m("cb"),defaultChecked:!0,children:"Label"})}),(0,n.jsx)(a,{children:(0,n.jsx)(h,{id:m("cb"),children:"Label"})}),(0,n.jsx)(a,{children:(0,n.jsx)(h,{id:m("cb"),children:"Label"})})]}):(0,n.jsxs)(r,{...t,children:[(0,n.jsx)(a,{children:(0,n.jsx)(h,{id:m("cb"),defaultChecked:!0,children:"Label"})}),(0,n.jsx)(a,{children:(0,n.jsx)(h,{id:m("cb"),children:"Label"})}),(0,n.jsx)(a,{children:(0,n.jsx)(h,{id:m("cb"),children:"Label"})})]})};C.options=me;C.states=he;C.variants=xe;C.defaultOptions=ue;C.modifiers=ke;C.className=r.className;var q=require("react/jsx-runtime"),fe=s.options,pe=s.states,Ce=s.defaultOptions,ge=[],ve=[],g=o=>(0,q.jsx)(h,{id:m("checkbox"),...o,defaultChecked:!0,children:"Label"});g.options=fe;g.states=pe;g.variants=ge;g.defaultOptions=Ce;g.modifiers=ve;g.className=s.className;var l=require("react/jsx-runtime"),ye=o=>(0,l.jsx)(r,{children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a,{children:(0,l.jsx)(i,{"aria-label":"Option 1"})}),(0,l.jsx)(a,{children:(0,l.jsx)(i,{"aria-label":"Option 2"})}),(0,l.jsx)(a,{children:(0,l.jsx)(i,{"aria-label":"Option 3"})})]}),layout:"horizontal",...o});