UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 3.33 kB
var o=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?o(...e):typeof e=="object"?Object.keys(e).map((n,r)=>e[r]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var h=(t,e)=>o({[`${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"}),f=(t,e)=>{let{valid:n,invalid:r,hover:l,focus:g,checked:p,active:k,selected:x,disabled:b,indeterminate:O,loading:v,empty:y,readonly:T,highlighted:M,...u}=e;return o({"k-valid":n,"k-invalid":r,"k-hover":l,"k-focus":g,"k-checked":p,"k-active":k,"k-selected":x,"k-disabled":b,"k-indeterminate":O&&!p,"k-loading":v,"k-empty":y,"k-readonly":T,"k-highlighted":M},Object.keys(u).reduce((c,a)=>(a.startsWith("k-")?c[a]=u[a]:c[`k-${a}`]=u[a],c),{}))};var s={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var m={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"};import{jsx as S,jsxs as w}from"react/jsx-runtime";var d="k-otp",A=[m.invalid,m.disabled],$={size:[s.undefined,s.small,s.medium,s.large]},z={},i=t=>{let{size:e,invalid:n,disabled:r,...l}=t;return w("div",{...l,role:"group",className:o(t.className,d,h(d,{size:e}),f(d,{invalid:n,disabled:r})),children:[S("input",{type:"hidden","aria-hidden":"true"}),t.children]})};i.states=A;i.options=$;i.className=d;i.defaultOptions=z;i.moduleName="otp";i.folderName="otp";i.ariaSpec={selector:".k-otp",rules:[{selector:".k-otp",attribute:"role=group",usage:"Sets the proper role for the OTP."},{selector:".k-otp > input",attribute:"type=hidden",usage:"The hidden input holding the OTP inputs value."},{selector:".k-otp > input",attribute:"aria-hidden=true",usage:"Hides the hidden input from assistive technologies."},{selector:".k-otp .k-otp-input > .k-input-inner",attribute:"label for or aria-label or aria-labelledby",usage:"The input needs an accessible name to be assigned to it."},{selector:".k-otp .k-otp-input > .k-input-inner",attribute:"autocomplete=off",usage:"Sets the default autocomplete for the input."},{selector:".k-otp .k-otp-input > .k-input-inner",attribute:"aria-describedby (when has hint or error)",usage:"Points to the hint or error message for the OTP inputs."},{selector:".k-otp.k-invalid .k-otp-input > .k-input-inner, .k-otp.ng-invalid .k-otp-input > .k-input-inner",attribute:"aria-invalid=true",usage:"Rendered only when the OTP is in a form and announces the invalid state."},{selector:".k-otp.k-disabled .k-otp-input > .k-input-inner",attribute:"disabled=disabled or aria-disabled=true",usage:"Rendered only when the OTP is disabled."}]};var B=i;export{d as ONETIMEPASSWORD_CLASSNAME,i as OneTimePassword,B as default};