UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 3.77 kB
var p=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var S=(t,e)=>{for(var n in e)p(t,n,{get:e[n],enumerable:!0})},w=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $(e))!z.call(t,i)&&i!==n&&p(t,i,{get:()=>e[i],enumerable:!(r=A(e,i))||r.enumerable});return t};var N=t=>w(p({},"__esModule",{value:!0}),t);var C={};S(C,{ONETIMEPASSWORD_CLASSNAME:()=>l,OneTimePassword:()=>o,default:()=>j});module.exports=N(C);var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...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 g=(t,e)=>a({[`${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"}),k=(t,e)=>{let{valid:n,invalid:r,hover:i,focus:x,checked:f,active:b,selected:O,disabled:v,indeterminate:y,loading:T,empty:M,readonly:P,highlighted:E,...c}=e;return a({"k-valid":n,"k-invalid":r,"k-hover":i,"k-focus":x,"k-checked":f,"k-active":b,"k-selected":O,"k-disabled":v,"k-indeterminate":y&&!f,"k-loading":T,"k-empty":M,"k-readonly":P,"k-highlighted":E},Object.keys(c).reduce((m,s)=>(s.startsWith("k-")?m[s]=c[s]:m[`k-${s}`]=c[s],m),{}))};var d={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};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 u=require("react/jsx-runtime"),l="k-otp",R=[h.invalid,h.disabled],K={size:[d.undefined,d.small,d.medium,d.large]},D={},o=t=>{let{size:e,invalid:n,disabled:r,...i}=t;return(0,u.jsxs)("div",{...i,role:"group",className:a(t.className,l,g(l,{size:e}),k(l,{invalid:n,disabled:r})),children:[(0,u.jsx)("input",{type:"hidden","aria-hidden":"true"}),t.children]})};o.states=R;o.options=K;o.className=l;o.defaultOptions=D;o.moduleName="otp";o.folderName="otp";o.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 j=o;