@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 6.23 kB
JavaScript
var I=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var F=(t,e)=>{for(var o in e)I(t,o,{get:e[o],enumerable:!0})},V=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of U(e))!q.call(t,d)&&d!==o&&I(t,d,{get:()=>e[d],enumerable:!(s=W(e,d))||s.enumerable});return t};var j=t=>V(I({},"__esModule",{value:!0}),t);var le={};F(le,{RadioGroupDemo:()=>c,default:()=>se});module.exports=j(le);var r=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?r(...e):typeof e=="object"?Object.keys(e).map((o,s)=>e[s]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var w=(t,e)=>r({[`${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"}),D=(t,e)=>{let{valid:o,invalid:s,hover:d,focus:k,checked:R,active:y,selected:A,disabled:L,indeterminate:M,loading:C,empty:H,readonly:G,highlighted:P,...N}=e;return r({"k-valid":o,"k-invalid":s,"k-hover":d,"k-focus":k,"k-checked":R,"k-active":y,"k-selected":A,"k-disabled":L,"k-indeterminate":M&&!R,"k-loading":C,"k-empty":H,"k-readonly":G,"k-highlighted":P},Object.keys(N).reduce((O,x)=>(x.startsWith("k-")?O[x]=N[x]:O[`k-${x}`]=N[x],O),{}))};var g={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var l={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 E={};function m(t){return E[t]=(E[t]||0)+1,`k-${t}-${E[t]}`}var h="radio",p=h;var z=require("react/jsx-runtime"),T="k-radio-list",J=[],Q={},_={layout:"vertical"},i=t=>{let{layout:e=_.layout,...o}=t;return(0,z.jsx)("ul",{...o,className:r(t.className,T,{[`k-list-${e}`]:e}),role:"radiogroup",children:t.children})};i.states=J;i.options=Q;i.className=T;i.defaultOptions=_;i.moduleName=h;i.folderName=p;i.ariaSpec={selector:".k-radio-list",rules:[{selector:".k-radio-list",attribute:"role=radiogroup",usage:"Announces the radiogroup role of the element."},{selector:".k-radio-list-item",attribute:"role=none",usage:"Due to issues with nested items, forces a no-role state."},{selector:".k-radio",attribute:"readonly or aria-readonly (when readonly)",usage:"The attribute is rendered only when the radio button is read-only."},{selector:".k-radio",attribute:"aria-invalid=true (when invalid)",usage:"The attribute is rendered only when the radio button is in a form and announces the invalid state of the component."},{selector:".k-radio-list-item.k-disabled .k-radio",attribute:"disabled or aria-disabled (when disabled)",usage:"The attribute is rendered only when the radio button is disabled."}]};var K=require("react/jsx-runtime"),S="k-radio-list-item",X=[],Y={},Z={},n=t=>{let{...e}=t;return(0,K.jsx)("li",{...e,className:r(t.className,S),role:"none",children:t.children})};n.states=X;n.options=Y;n.className=S;n.defaultOptions=Z;n.moduleName=h;n.folderName=p;var B=require("react/jsx-runtime"),v="k-radio",ee=[l.hover,l.focus,l.valid,l.invalid,l.required,l.disabled,l.checked],te={size:[g.undefined,g.small,g.medium,g.large]},oe={},u=t=>{let{id:e,checked:o,hover:s,focus:d,disabled:k,invalid:R,valid:y,required:A,size:L,...M}=t;return(0,B.jsx)("span",{className:"k-radio-wrap",children:(0,B.jsx)("input",{...M,id:e,type:"radio",checked:o,required:A,disabled:k||void 0,"aria-invalid":R?"true":void 0,className:r(t.className,v,w(v,{size:L}),D(v,{hover:s,focus:d,disabled:k,invalid:R,valid:y,checked:o}))})})};u.states=ee;u.options=te;u.className=v;u.defaultOptions=oe;u.moduleName=h;u.folderName=p;u.ariaSpec={selector:".k-radio",rules:[{selector:".k-radio",attribute:"type=radio",usage:"Announces the radio type of the input."},{selector:".k-radio",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-radio",attribute:"checked (when checked)",usage:"Boolean attribute that announces the checked state of the radio button."},{selector:".k-radio",attribute:"aria-describedby (when has hint or error)",usage:"Points to the hint or error message for the radio."},{selector:".k-radio",attribute:"disabled=disabled or aria-disabled=true (when disabled)",usage:"Rendered only when the radio input is disabled."},{selector:".k-invalid, .ng-invalid",attribute:"aria-invalid=true (when invalid)",usage:"Rendered only when the radio button is in a form and announces the invalid state."}]};var $=u;var f=require("react/jsx-runtime"),b=({children:t,id:e,...o})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)($,{...o,id:e}),(0,f.jsx)("label",{className:"k-radio-label",htmlFor:e,children:t})]});var a=require("react/jsx-runtime"),ae=i.options,ie=i.states,ne={...i.defaultOptions,variant:"vertical"},re=[{name:"vertical",title:"Vertical"},{name:"horizontal",title:"Horizontal"}],de=[],c=t=>{let{variant:e,...o}=t;return e==="horizontal"?(0,a.jsxs)(i,{layout:"horizontal",...o,children:[(0,a.jsx)(n,{children:(0,a.jsx)(b,{id:m("rb"),name:"value",defaultChecked:!0,children:"Label"})}),(0,a.jsx)(n,{children:(0,a.jsx)(b,{id:m("rb"),name:"value",children:"Label"})}),(0,a.jsx)(n,{children:(0,a.jsx)(b,{id:m("rb"),name:"value",children:"Label"})})]}):(0,a.jsxs)(i,{...o,children:[(0,a.jsx)(n,{children:(0,a.jsx)(b,{id:m("rb"),name:"value",defaultChecked:!0,children:"Label"})}),(0,a.jsx)(n,{children:(0,a.jsx)(b,{id:m("rb"),name:"value",children:"Label"})}),(0,a.jsx)(n,{children:(0,a.jsx)(b,{id:m("rb"),name:"value",children:"Label"})})]})};c.options=ae;c.states=ie;c.variants=re;c.defaultOptions=ne;c.modifiers=de;c.className=i.className;var se=c;