UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 11.7 kB
var s=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?s(...e):typeof e=="object"?Object.keys(e).map((a,l)=>e[l]||e[a]&&a||null).filter(a=>a!==null).join(" "):e).filter(e=>!!e).join(" ");var b=(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={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},o={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"};var T={};function P(t){return T[t]=(T[t]||0)+1,`k-${t}-${T[t]}`}import{Fragment as Q,jsx as _}from"react/jsx-runtime";var M="k-font-icon",J=[],X={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},W={},k=t=>{let{size:e,themeColor:a,icon:l,rotate:i,flip:d,...p}=t;return l?_("span",{...p,className:s(t.className,M,b(M,{size:e}),{[`k-i-${l}`]:l,[`k-color-${a}`]:a,[`k-rotate-${i}`]:i,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"}),"aria-hidden":"true"}):_(Q,{})};k.states=J;k.options=X;k.className=M;k.defaultOptions=W;var D=k;import{Fragment as ee,jsx as N}from"react/jsx-runtime";var S="k-svg-icon",Y=[],Z={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[c.outline,c.solid,c.duotone]},R={viewBox:"0 0 24 24",variant:c.outline},x=t=>{let{size:e,themeColor:a,rotate:l,flip:i,viewBox:d=R.viewBox,variant:p=R.variant,icon:n,...h}=t;if(!n)return N(ee,{});if(n==="none")return N("span",{...h,className:s(t.className,S,b("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let v=typeof n=="object"&&n.name&&n.name,f=typeof n=="object"?p&&n.variants?.[p]||n.variants?.outline||n.content:void 0;return N("span",{...h,className:s(t.className,S,b("k-icon",{size:e}),{[`k-svg-i-${v}`]:v,[`k-color-${a}`]:a,[`k-rotate-${l}`]:l,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),"aria-hidden":"true",children:N("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof n=="object"?n.viewBox:d,dangerouslySetInnerHTML:f!==void 0?{__html:f}:void 0,children:n?void 0:t.children})})};x.states=Y;x.options=Z;x.className=S;x.defaultOptions=R;var E=x;import*as A from"@progress/kendo-svg-icons";var H="icon",$="icons";import{useContext as oe}from"react";import{createContext as te}from"react";var G=te({iconsType:"svg"});import{Fragment as B,jsx as y}from"react/jsx-runtime";var C="k-icon",re=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ie=[],ae={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[c.outline,c.solid,c.duotone]},I={viewBox:"0 0 24 24",type:"svg",variant:c.outline},m=t=>{let{iconsType:e}=oe(G),{size:a,themeColor:l,icon:i,type:d=e||I.type,rotate:p,flip:n,viewBox:h=I.viewBox,variant:v=I.variant,...f}=t;if(!i)return y(B,{});if((e||d)==="svg"){if(i==="none")return y(E,{...f,className:s(t.className,C),icon:i,size:a,variant:v});let z=A[i]?i:re(`${i}-icon`);return A[z]?y(E,{...f,className:s(t.className,C),icon:A[z],size:a,themeColor:l,rotate:p,flip:n,viewBox:h,variant:v}):y(B,{})}return y(D,{...f,className:s(t.className,C),icon:i,size:a,themeColor:l,rotate:p,flip:n})};m.states=ie;m.options=ae;m.defaultOptions=I;m.className=C;m.moduleName=H;m.folderName=$;m.ariaSpec={selector:".k-icon, .k-svg-icon",rules:[{selector:".k-icon, .k-svg-icon",attribute:"aria-hidden=true",usage:"Hides the icon element and all its children from assistive technologies."}]};import{jsx as V,jsxs as de}from"react/jsx-runtime";var q="k-pivotgrid-configurator-button",ne=[],se={},le={},w=t=>{let{...e}=t;return V("div",{...e,className:s(t.className,q),"aria-hidden":"true",children:de("span",{children:["Change settings",V(m,{icon:"gear"})]})})};w.states=ne;w.options=se;w.className=q;w.defaultOptions=le;var F=w;import ce from"react";var L="pivotgrid",U=L;import{jsx as u,jsxs as K}from"react/jsx-runtime";var j="k-pivotgrid",ue=[],pe={},O={emptyCell:u("div",{className:"k-pivotgrid-empty-cell",role:"none",children:u("table",{role:"none",children:u("thead",{role:"none",children:u("tr",{role:"none",children:u("th",{"aria-colspan":1,"aria-rowspan":1,id:P("pivotgrid-empty"),children:u("span",{className:"k-sr-only",children:"PivotGrid component. Use the arrow keys to navigate."})})})})})}),configuratorDisplay:"none",configuratorPosition:"right"},g=t=>{let{emptyCell:e=O.emptyCell,configuratorDisplay:a=O.configuratorDisplay,configuratorPosition:l=O.configuratorPosition,configurator:i,columnHeaders:d,rowHeaders:p,children:n,...h}=t;return K("div",{className:{left:"k-d-flex k-flex-row-reverse k-pos-relative",bottom:"k-d-flex k-flex-col k-pos-relative",top:"k-d-flex k-flex-col-reverse k-pos-relative",right:"k-d-flex k-flex-row k-pos-relative"}[l],children:[K("div",{...h,className:s(t.className,j),role:"grid",children:[e,u("div",{className:"k-pivotgrid-column-headers",role:"none",children:d}),u("div",{className:"k-pivotgrid-row-headers",role:"none",children:p}),u("div",{className:"k-pivotgrid-values",role:"none",children:n})]}),i&&a==="opened"&&i,i&&a==="closed"&&ce.cloneElement(i,{"aria-hidden":"true"}),a!=="none"&&u(F,{})]})};g.states=ue;g.options=pe;g.className=j;g.defaultOptions=O;g.moduleName=L;g.folderName=U;g.ariaSpec={selector:".k-pivotgrid",rules:[{selector:".k-pivotgrid",attribute:"role=grid",usage:"The role specifies the element is a Data Grid."},{selector:".k-pivotgrid-empty-cell th",attribute:"id",usage:"Sets a unique identifier for the cell to be referenced from the first column header row aria-owns attribute."},{selector:".k-pivotgrid-column-headers>.k-pivotgrid-table",attribute:"role=none",usage:"Negates the default semantic role of the <table> element."},{selector:".k-pivotgrid-column-headers>.k-pivotgrid-table>tbody",attribute:"role=rowgroup",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-pivotgrid-column-headers>.k-pivotgrid-table>tbody>.k-pivotgrid-row",attribute:"role=row",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-pivotgrid-column-headers>.k-pivotgrid-table>tbody>.k-pivotgrid-row:first-child",attribute:"aria-owns",usage:"Lists the IDs of the empty cell and all cells in the first column headers row to construct the a11y tree."},{selector:".k-pivotgrid-column-headers>.k-pivotgrid-table>tbody>.k-pivotgrid-row>th",attribute:"role=columnheader",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-pivotgrid-column-headers>.k-pivotgrid-table>tbody>.k-pivotgrid-row>th",attribute:"aria-expanded (when expandable)",usage:"Indicates the current expanded state of the header."},{selector:".k-pivotgrid-column-headers>.k-pivotgrid-table>tbody>.k-pivotgrid-row>th",attribute:"id",usage:"Unique and deterministic identifier, used to associate the header cell with respective data cells."},{selector:'[class*="i-chevron-up"]',attribute:"aria-hidden=true",usage:"Excludes the collapse icon from the screen reader output."},{selector:'[class*="i-chevron-down"]',attribute:"aria-hidden=true",usage:"Excludes the expand icon from the screen reader output."},{selector:".k-pivotgrid-row-headers>.k-pivotgrid-table",attribute:"role=none",usage:"Negates the default semantic role of the <table> element."},{selector:".k-pivotgrid-row-headers>.k-pivotgrid-table>tbody",attribute:"role=rowgroup",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-pivotgrid-row-headers>.k-pivotgrid-table>tbody>.k-pivotgrid-row",attribute:"role=row",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-pivotgrid-row-headers>.k-pivotgrid-table>tbody>.k-pivotgrid-row",attribute:"aria-owns (when present)",usage:"Used to associate row header cells with the corresponding data cells."},{selector:".k-pivotgrid-row-headers>.k-pivotgrid-table>tbody>.k-pivotgrid-row>th",attribute:"role=rowheader",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-pivotgrid-row-headers>.k-pivotgrid-table>tbody>.k-pivotgrid-row>th",attribute:"aria-expanded (when expandable)",usage:"Indicates the current expanded state of the header."},{selector:".k-pivotgrid-values>.k-pivotgrid-table",attribute:"role=none",usage:"Negates the default semantic role of the <table> element."},{selector:".k-pivotgrid-values>.k-pivotgrid-table>tbody",attribute:"role=none",usage:"The contained rows are associated with their headers through alternative mechanics."},{selector:".k-pivotgrid-values>.k-pivotgrid-table>tbody>.k-pivotgrid-row",attribute:"role=none",usage:"The rows are associated with their headers through alternative mechanics."},{selector:".k-pivotgrid-values>.k-pivotgrid-table>tbody>.k-pivotgrid-row>td",attribute:"role=gridcell",usage:"Required as the owner <table> element has its semantic role removed."},{selector:".k-pivotgrid-values>.k-pivotgrid-table>tbody>.k-pivotgrid-row>td",attribute:"id",usage:"Unique and deterministic identifier, used to associate the data cell with respective row header cells."},{selector:".k-pivotgrid-values>.k-pivotgrid-table>tbody>.k-pivotgrid-row>td",attribute:"aria-describedby (when present)",usage:"Used to associate the data cells with the respective column header cells."},{selector:".k-pivotgrid-configurator-button",attribute:"aria-hidden=true",usage:"Hide the element from assistive technologies."},{selector:".k-pivotgrid-configurator",attribute:"role=dialog",usage:"The role specifies the element is a dialog."},{selector:".k-pivotgrid-configurator",attribute:"aria-hidden (when closed)",usage:"Specifies whether the configurator is visible if it is still in the DOM when closed."},{selector:".k-pivotgrid-configurator",attribute:"aria-labelledby",usage:"Associates the configurator wrapper with its internal header element."},{selector:".k-pivotgrid-configurator-header-text",attribute:"id",usage:"Unique identifier used to associate the header text with elements that reference it as a label."},{selector:".k-pivotgrid-configurator-content .k-label",attribute:"id",usage:"Unique identifier used to associate the label text with elements that reference it as a label."},{selector:".k-pivotgrid-configurator-actions .k-button.k-disabled",attribute:"aria-disabled=true (when disabled)",usage:"Announces the non-interactive state of the configurator Cancel and Apply buttons."},{selector:".k-fields-list-wrapper .k-treeview",attribute:"aria-labelledby",usage:"Associates the fields chooser TreeView with the Fields section and Configurator header texts."},{selector:".k-pivotgrid-configurator-content .k-chip-list",attribute:"aria-labelledby",usage:"Associates the chip lists with their respective section label and Configurator header texts."}]};var et=g;export{j as PIVOTGRID_CLASSNAME,g as PivotGrid,et as default};