@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 3.03 kB
JavaScript
var d=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var i in e)d(t,i,{get:e[i],enumerable:!0})},k=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of x(e))!p.call(t,l)&&l!==i&&d(t,l,{get:()=>e[l],enumerable:!(o=f(e,l))||o.enumerable});return t};var b=t=>k(d({},"__esModule",{value:!0}),t);var C={};g(C,{CHIPLIST_CLASSNAME:()=>a,ChipList:()=>n,default:()=>L});module.exports=b(C);var s=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?s(...e):typeof e=="object"?Object.keys(e).map((i,o)=>e[o]||e[i]&&i||null).filter(i=>i!==null).join(" "):e).filter(e=>!!e).join(" ");var u=(t,e)=>s({[`${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"});var r={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var c="chip",h=c;var m=require("react/jsx-runtime"),a="k-chip-list",y=[],v={size:[r.undefined,r.small,r.medium,r.large]},A={},n=t=>{let{size:e,multiselectable:i,ariaLabel:o,...l}=t;return(0,m.jsx)("div",{...l,className:s(t.className,a,u(a,{size:e})),role:t.role||"listbox","aria-label":t.role==="none"?void 0:o||"chip list","aria-orientation":t.role==="none"?void 0:"horizontal","aria-multiselectable":i?"true":void 0,children:t.children})};n.states=y;n.options=v;n.className=a;n.defaultOptions=A;n.moduleName=c;n.folderName=h;n.ariaSpec={selector:".k-chip-list",rules:[{selector:".k-chip-list",attribute:"role=listbox",usage:"Announces the list role of the chip list."},{selector:".k-chip-list",attribute:"aria-label or aria-labelledby",usage:"Adds label to the ChipList element. ListBox element requires an accessible name."},{selector:".k-chip-list",attribute:"aria-orientation=horizontal",usage:"Specifies the horizontal orientation of the chiplist."},{selector:".k-chip-list",attribute:"aria-multiselectable=true (when multiple selection)",usage:"Announces the multiple selection ability of the chiplist."},{selector:".k-chip-list .k-chip",attribute:"role=option",usage:"Announces the chip is an option inner component of the chip list."},{selector:".k-chip-list .k-chip.k-selected",attribute:"aria-selected=true",usage:"Announces the chip is selected."},{selector:".k-chip-list .k-chip:not(.k-selected)",attribute:"aria-selected=false",usage:"Announces the chip is not selected."},{selector:".k-chip-list .k-chip:has(.k-i-x-circle), .k-chip-list .k-chip:has(.k-svg-i-x-circle)",attribute:"aria-keyshortcuts=Enter Delete",usage:"Announces the Delete action along with the default Enter key."}]};var L=n;