UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 23.5 kB
var l=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?l(...t):typeof t=="object"?Object.keys(t).map((o,r)=>t[r]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var R=(e,t)=>l({[`${e}-xs`]:t.size==="xsmall",[`${e}-sm`]:t.size==="small",[`${e}-md`]:t.size==="medium",[`${e}-lg`]:t.size==="large",[`${e}-xl`]:t.size==="xlarge",[`${e}-xxl`]:t.size==="xxlarge",[`${e}-xxxl`]:t.size==="xxxlarge"},{[`${e}-${t.fillMode}`]:t.fillMode},{[`${e}-${t.themeColor}`]:t.themeColor},{"k-rounded-sm":t.rounded==="small","k-rounded-md":t.rounded==="medium","k-rounded-lg":t.rounded==="large","k-rounded-full":t.rounded==="full","k-rounded-none":t.rounded==="none"}),D=(e,t)=>{let{valid:o,invalid:r,hover:s,focus:u,checked:i,active:c,selected:x,disabled:f,indeterminate:d,loading:M,empty:h,readonly:B,highlighted:P,...O}=t;return l({"k-valid":o,"k-invalid":r,"k-hover":s,"k-focus":u,"k-checked":i,"k-active":c,"k-selected":x,"k-disabled":f,"k-indeterminate":d&&!i,"k-loading":M,"k-empty":h,"k-readonly":B,"k-highlighted":P},Object.keys(O).reduce((I,A)=>(A.startsWith("k-")?I[A]=O[A]:I[`k-${A}`]=O[A],I),{}))};function Be(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(r=>[`k-${r}`,!0]))}var a={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},g={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},E={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},C={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},n={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},p={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{Fragment as It,jsx as Ce}from"react/jsx-runtime";var me="k-font-icon",Mt=[],ht={size:[a.undefined,a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info]},Nt={},Y=e=>{let{size:t,themeColor:o,icon:r,rotate:s,flip:u,...i}=e;return r?Ce("span",{...i,className:l(e.className,me,R(me,{size:t}),{[`k-i-${r}`]:r,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":u==="h"||u==="both","k-flip-v":u==="v"||u==="both"}),"aria-hidden":"true"}):Ce(It,{})};Y.states=Mt;Y.options=ht;Y.className=me;Y.defaultOptions=Nt;var _e=Y;import{Fragment as gt,jsx as re}from"react/jsx-runtime";var ce="k-svg-icon",vt=[],kt={size:[a.undefined,a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info],variant:[C.outline,C.solid,C.duotone]},pe={viewBox:"0 0 24 24",variant:C.outline},Z=e=>{let{size:t,themeColor:o,rotate:r,flip:s,viewBox:u=pe.viewBox,variant:i=pe.variant,icon:c,...x}=e;if(!c)return re(gt,{});if(c==="none")return re("span",{...x,className:l(e.className,ce,R("k-icon",{size:t}),"k-none"),"aria-hidden":"true"});let f=typeof c=="object"&&c.name&&c.name,d=typeof c=="object"?i&&c.variants?.[i]||c.variants?.outline||c.content:void 0;return re("span",{...x,className:l(e.className,ce,R("k-icon",{size:t}),{[`k-svg-i-${f}`]:f,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),"aria-hidden":"true",children:re("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof c=="object"?c.viewBox:u,dangerouslySetInnerHTML:d!==void 0?{__html:d}:void 0,children:c?void 0:e.children})})};Z.states=vt;Z.options=kt;Z.className=ce;Z.defaultOptions=pe;var de=Z;import*as fe from"@progress/kendo-svg-icons";var Pe="icon",Re="icons";import{useContext as Lt}from"react";import{createContext as Et}from"react";var Ke=Et({iconsType:"svg"});import{Fragment as ze,jsx as j}from"react/jsx-runtime";var se="k-icon",At=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),yt=[],wt={size:[a.undefined,a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info],variant:[C.outline,C.solid,C.duotone]},ae={viewBox:"0 0 24 24",type:"svg",variant:C.outline},b=e=>{let{iconsType:t}=Lt(Ke),{size:o,themeColor:r,icon:s,type:u=t||ae.type,rotate:i,flip:c,viewBox:x=ae.viewBox,variant:f=ae.variant,...d}=e;if(!s)return j(ze,{});if((t||u)==="svg"){if(s==="none")return j(de,{...d,className:l(e.className,se),icon:s,size:o,variant:f});let h=fe[s]?s:At(`${s}-icon`);return fe[h]?j(de,{...d,className:l(e.className,se),icon:fe[h],size:o,themeColor:r,rotate:i,flip:c,viewBox:x,variant:f}):j(ze,{})}return j(_e,{...d,className:l(e.className,se),icon:s,size:o,themeColor:r,rotate:i,flip:c})};b.states=yt;b.options=wt;b.defaultOptions=ae;b.className=se;b.moduleName=Pe;b.folderName=Re;b.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."}]};var be="button",Ue=be;import{Fragment as De,jsx as V,jsxs as He}from"react/jsx-runtime";var ee="k-button",Ot=["icon-button"],St=[p.hover,p.focus,p.active,p.selected,p.disabled,p.generating],Tt={size:[a.undefined,a.xsmall,a.small,a.medium,a.large],rounded:[g.undefined,g.none,g.small,g.medium,g.large,g.full],fillMode:[E.undefined,E.solid,E.flat,E.outline,E.clear,E.link],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.inverse]},xe={showArrow:!1,arrowIconName:"chevron-down"},m=e=>{let{as:t="button",size:o,rounded:r,fillMode:s,themeColor:u,showArrow:i=xe.showArrow,arrowIconName:c=xe.arrowIconName,variant:x,hover:f,focus:d,active:M,selected:h,disabled:B,togglable:P,ariaDisabled:O,icon:I,iconSize:A,text:K,iconClassName:pt,className:dt,...ft}=e,bt=I!=null,xt=e.children!==void 0;return He(t,{className:l(dt,ee,Be(ee,x),R(ee,{size:o,rounded:r,fillMode:s,themeColor:u}),D(ee,{hover:f,focus:d,active:M,disabled:B||O,selected:h}),{"k-icon-button":!K&&!xt&&bt}),"aria-pressed":P?h?"true":"false":void 0,...ft,"aria-disabled":O?"true":void 0,disabled:B||void 0,children:[typeof I=="string"&&I&&V(b,{className:l(pt,"k-button-icon"),icon:I,size:A}),I&&typeof I!="string"&&V(De,{children:I}),K?He(De,{children:[K&&V("span",{className:"k-button-text",children:K}),e.children]}):e.children&&V("span",{className:"k-button-text",children:e.children}),i&&V("span",{className:"k-menu-button-arrow k-button-arrow",children:V(b,{icon:c})})]})};m.states=St;m.options=Tt;m.variants=Ot;m.className=ee;m.defaultOptions=xe;m.moduleName=be;m.folderName=Ue;m.ariaSpec={selector:".k-button",rules:[{selector:".k-button",attribute:"role=button or nodeName=button",usage:"The button role is implicit from the native <button> element."},{selector:".k-button",attribute:"aria-label (when icon-only)",usage:"Required for icon-only buttons that have no visible text."},{selector:".k-button",attribute:"aria-pressed (when togglable)",usage:"Indicates the pressed state of a toggle button."},{selector:".k-button",attribute:"disabled (when disabled)",usage:"Rendered when the button is disabled."}]};import{jsx as Bt}from"react/jsx-runtime";var Fe=e=>Bt(m,{icon:"folder",...e,"aria-label":e["aria-label"]||"Folder",children:void 0});import{jsx as Ct}from"react/jsx-runtime";var $e=e=>Ct(m,{icon:"folder",children:"Button",...e});import{jsx as _t}from"react/jsx-runtime";var Ve=e=>_t(m,{children:"Button",...e});import{jsx as Me}from"react/jsx-runtime";var Pt=m.options,Rt=m.states,Kt={...m.defaultOptions,variant:"text"},zt=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],Ut=[],X=e=>{let{variant:t,...o}=e;switch(t){case"icon-only":return Me(Fe,{...o,icon:"star"});case"icon-and-text":return Me($e,{...o,icon:"star",children:"Button"});default:return Me(Ve,{...o,children:"Button"})}};X.options=Pt;X.states=Rt;X.variants=zt;X.defaultOptions=Kt;X.modifiers=Ut;X.className=m.className;var he="menu-button",Xe=he;import{jsx as Ft}from"react/jsx-runtime";var We="k-menu-button",Dt=[p.hover,p.focus,p.active,p.selected,p.disabled],Ht={size:[a.undefined,a.xsmall,a.small,a.medium,a.large],rounded:[g.undefined,g.none,g.small,g.medium,g.large,g.full],fillMode:[E.undefined,E.solid,E.flat,E.outline,E.clear,E.link],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.inverse]},Ne={showArrow:!0,arrowIconName:"chevron-down"},L=e=>{let{size:t,rounded:o,fillMode:r,themeColor:s,hover:u,focus:i,active:c,selected:x,disabled:f,icon:d,text:M,showArrow:h=Ne.showArrow,arrowIconName:B=Ne.arrowIconName,expanded:P,...O}=e;return Ft(m,{...O,className:l(e.className,We),text:M,size:t,rounded:o,fillMode:r,themeColor:s,hover:u,focus:i,active:c,selected:x,disabled:f,ariaDisabled:f||void 0,icon:d,showArrow:h,arrowIconName:B,"aria-expanded":P?"true":"false",...!M&&d&&!e["aria-label"]&&{"aria-label":"Menu"}})};L.states=Dt;L.options=Ht;L.className=We;L.defaultOptions=Ne;L.moduleName=he;L.folderName=Xe;L.ariaSpec={selector:".k-menu-button",rules:[{selector:".k-menu-button",attribute:"role=button or nodeName=button",usage:"Omitted if the button DOM element is used."},{selector:".k-menu-button",attribute:"aria-label (when icon-only)",usage:"Required when no text is visible in the button."},{selector:".k-menu-button",attribute:"aria-expanded=true/false",usage:"Announces the state of the popup visibility."},{selector:".k-menu-button",attribute:"aria-controls=.k-menu-group id (when open)",usage:"Points to the popup element. Builds a relationship between the button and the popup."},{selector:".k-menu-button.k-disabled",attribute:"aria-disabled=true",usage:"Rendered only when the button is disabled."},{selector:".k-menu-group",attribute:"role=list",usage:"Announces the list role of the popup."},{selector:".k-menu-item",attribute:"role=listitem",usage:"Announces the listitem role of the popup items."}]};import{jsx as Kn}from"react/jsx-runtime";import{jsx as Hn}from"react/jsx-runtime";import{jsx as Xn}from"react/jsx-runtime";var y="menu",S=y;import{jsx as te,jsxs as Ge}from"react/jsx-runtime";var Ie="k-menu-item",$t=[p.hover,p.focus,p.active,p.selected,p.disabled],Vt={},Je={iconPosition:"before"},v=e=>{let{hover:t,focus:o,active:r,selected:s,disabled:u,icon:i,text:c,first:x,last:f,showArrow:d,arrowIconName:M,iconPosition:h=Je.iconPosition,dir:B,children:P,expanded:O,...I}=e,A=M;return A||(A=B==="rtl"?"chevron-left":"chevron-right"),Ge("li",{...I,className:l(e.className,Ie,"k-item",D(Ie,{focus:o,disabled:u,hover:t,active:r,selected:s}),{"k-first":x,"k-last":f}),role:"menuitem",...d&&{"aria-haspopup":"menu"},...d&&{"aria-expanded":O?"true":"false"},...u&&{"aria-disabled":"true"},...o&&{tabIndex:0},children:[Ge("span",{className:l("k-link k-menu-link"),children:[i&&h==="before"&&te(b,{className:"k-menu-link-icon",icon:i}),te("span",{className:"k-menu-link-text",children:c}),i&&h==="after"&&te(b,{className:"k-menu-link-icon",icon:i}),d&&te("span",{className:"k-menu-expand-arrow","aria-hidden":"true",children:te(b,{icon:A})})]}),P]})};v.states=$t;v.options=Vt;v.className=Ie;v.defaultOptions=Je;v.moduleName=y;v.folderName=S;import{jsx as oe,jsxs as qe}from"react/jsx-runtime";var ve="k-menu-item",Xt=[p.hover,p.focus,p.active,p.selected,p.disabled],Wt={},ke={dir:"ltr",iconPosition:"before"},k=e=>{let{hover:t,focus:o,active:r,selected:s,disabled:u,icon:i,text:c,first:x,last:f,showArrow:d,arrowIconName:M,iconPosition:h=ke.iconPosition,dir:B=ke.dir,children:P,popup:O,expanded:I,...A}=e,K=M;return K||(K=B==="rtl"?"chevron-left":"chevron-right"),qe("li",{role:"menuitem",...A,className:l(e.className,ve,"k-item",D(ve,{focus:o,disabled:u}),{"k-first":x,"k-last":f}),...d&&{"aria-haspopup":"menu"},...d&&{"aria-expanded":I?"true":"false"},...u&&{"aria-disabled":"true"},...o&&{tabIndex:0},children:[qe("span",{className:l("k-link k-menu-link",D("k-menu-link",{hover:t,active:r,selected:s,disabled:u})),children:[i&&h==="before"&&oe(b,{className:"k-menu-link-icon",icon:i}),oe("span",{className:"k-menu-link-text",children:c}),i&&h==="after"&&oe(b,{className:"k-menu-link-icon",icon:i}),d&&oe("span",{className:"k-menu-expand-arrow","aria-hidden":"true",children:oe(b,{icon:K})})]}),P,O]})};k.states=Xt;k.options=Wt;k.className=ve;k.defaultOptions=ke;k.moduleName=y;k.folderName=S;import{jsx as Qt}from"react/jsx-runtime";var Qe="k-menu-scroll-wrapper",Gt=[],Jt={},qt={},H=e=>{let{className:t,children:o,orientation:r,...s}=e;return Qt("div",{...s,className:l(t,Qe,{"k-menu-scroll-wrapper-vertical":r==="vertical"}),children:o})};H.states=Gt;H.options=Jt;H.className=Qe;H.defaultOptions=qt;H.moduleName=y;H.folderName=S;var Ye=H;import{Fragment as ge,jsx as F,jsxs as le}from"react/jsx-runtime";var Ee="k-menu",Yt=[],Zt={},ue={orientation:"horizontal",header:!0,scrollButtonsPosition:"around"},N=e=>{let{children:t,orientation:o=ue.orientation,header:r=ue.header,scrollable:s,scrollButtonsPosition:u=ue.scrollButtonsPosition,wrapperStyles:i,dir:c,popup:x,contextMenu:f,...d}=e,M={horizontal:{prev:c!=="rtl"?"left":"right",next:c!=="rtl"?"right":"left"},vertical:{prev:"up",next:"down"}},h=F("ul",{dir:c,...d,className:l(e.className,"k-reset",Ee,{[`${Ee}-${o}`]:o,"k-header":r}),role:f?"menu":"menubar",...o==="vertical"&&{"aria-orientation":"vertical"},children:t});return le(ge,{children:[s?le(Ye,{orientation:o,style:i,dir:e.dir,children:[u==="start"&&le(ge,{children:[F(m,{fillMode:"flat",icon:`chevron-${M[o].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev",tabIndex:-1,"aria-label":"Scroll previous"}),F(m,{fillMode:"flat",icon:`chevron-${M[o].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next",tabIndex:-1,"aria-label":"Scroll next"})]}),u==="around"&&F(m,{fillMode:"flat",icon:`chevron-${M[o].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev",tabIndex:-1,"aria-label":"Scroll previous"}),h,u==="end"&&le(ge,{children:[F(m,{fillMode:"flat",icon:`chevron-${M[o].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev",tabIndex:-1,"aria-label":"Scroll previous"}),F(m,{fillMode:"flat",icon:`chevron-${M[o].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next",tabIndex:-1,"aria-label":"Scroll next"})]}),u==="around"&&F(m,{fillMode:"flat",icon:`chevron-${M[o].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next",tabIndex:-1,"aria-label":"Scroll next"})]}):h,x]})};N.states=Yt;N.options=Zt;N.className=Ee;N.defaultOptions=ue;N.moduleName=y;N.folderName=S;N.ariaSpec={selector:".k-menu",rules:[{selector:".k-menu:not(.k-context-menu)",attribute:"role=menubar",usage:"Announces the Menu menubar role."},{selector:".k-menu.k-menu-vertical",attribute:"aria-orientation=vertical",usage:"Announces the Menu orientation when vertical."},{selector:".k-menu-item",attribute:"role=menuitem",usage:"Announces the Menu item role."},{selector:".k-menu-item",attribute:"aria-haspopup=menu (when present)",usage:"Indicates a popup menu is associated with the item."},{selector:".k-menu-item",attribute:"aria-expanded=true/false (when present)",usage:"Indicates whether the submenu is expanded."},{selector:".k-menu-item.k-disabled",attribute:"aria-disabled=true",usage:"Informs assistive technologies that a Menu item is disabled."},{selector:".k-menu-expand-arrow",attribute:"aria-hidden=true",usage:"Expand arrow elements are hidden from assistive technologies."},{selector:".k-menu-popup .k-menu-group",attribute:"role=menu",usage:"The role of the nested menu displayed in a popup."},{selector:".k-menu-scroll-button",attribute:"tabindex=-1",usage:"Scroll buttons are removed from the tab sequence."},{selector:".k-menu-scroll-button",attribute:"aria-label",usage:"Scroll buttons have an accessible label."},{selector:".k-menu-item.k-focus",attribute:"tabindex=0",usage:"The focused item has tabindex 0."},{selector:".k-menu-item",attribute:"aria-controls=ul.k-menu-group id (when present)",usage:"Points to the ID of the submenu. Only present when the item controls a submenu element."},{selector:".k-menu-popup .k-menu-group",attribute:"id",usage:"Each nested menu has a deterministic id linked to the parent aria-controls."}]};import{jsx as jt}from"react/jsx-runtime";var Le="k-separator",Ze={orientation:"horizontal"},W=e=>{let{orientation:t=Ze.orientation,...o}=e;return jt("li",{...o,className:l(e.className,"k-item",Le,{[`${Le}-${t}`]:t}),role:"separator"})};W.className=Le;W.defaultOptions=Ze;W.moduleName=y;W.folderName=S;import{Fragment as Ir,jsx as vr}from"react/jsx-runtime";import{jsx as no}from"react/jsx-runtime";var Ae="k-menu-group",eo=[],to={size:[a.undefined,a.small,a.medium,a.large]},oo={},T=e=>{let{children:t,size:o,...r}=e;return no("ul",{role:"menu",...r,className:l(e.className,Ae,R(Ae,{size:o})),children:t})};T.states=eo;T.options=to;T.className=Ae;T.defaultOptions=oo;T.moduleName=y;T.folderName=S;import{Fragment as ro,jsx as G,jsxs as so}from"react/jsx-runtime";var ye=e=>G(N,{children:so(ro,{children:[G(v,{first:!0,text:"Item 1"}),G(v,{showArrow:!0,arrowIconName:"chevron-down",text:"Item 2"}),G(v,{showArrow:!0,arrowIconName:"chevron-down",text:"Item 3"}),G(v,{text:"Item 4"}),G(v,{last:!0,text:"Item 5"})]}),...e});var we="popup",je=we;import{jsx as et}from"react/jsx-runtime";var tt="k-animation-container",ao=[],io={},Oe={positionMode:"absolute",shown:!0},z=e=>{let{positionMode:t=Oe.positionMode,shown:o=Oe.shown,animationStyle:r,offset:s,...u}=e;return et("div",{...u,style:{...s,...e.style},className:l(e.className,tt,{"k-animation-container-shown":o,"k-animation-container-fixed":t==="fixed"}),children:et("div",{className:"k-child-animation-container",style:r,children:e.children})})};z.states=ao;z.options=io;z.className=tt;z.defaultOptions=Oe;z.moduleName=we;z.folderName=je;var Se="popup",ot=Se;import{jsx as nt}from"react/jsx-runtime";var rt="k-popup",lo=[],uo={},st={positionMode:"absolute"},w=e=>{let{offset:t,positionMode:o=st.positionMode,animationStyle:r,containerClassName:s,containerRole:u,containerAriaLabel:i,...c}=e;return nt(z,{positionMode:o,offset:t,animationStyle:r,className:s,role:u,"aria-label":i,children:nt("div",{...c,className:l(e.className,rt),children:e.children})})};w.states=lo;w.options=uo;w.className=rt;w.defaultOptions=st;w.moduleName=Se;w.folderName=ot;w.ariaSpec={selector:".k-popup",rules:[{selector:".k-animation-container",attribute:"role (when appended to body)",usage:'Container gets role="region" when appended to document body. Popup is a building block \u2014 ARIA semantics come from consuming components.'}]};import{Fragment as Qr,jsx as Jr,jsxs as qr}from"react/jsx-runtime";import{Fragment as ts,jsx as es,jsxs as os}from"react/jsx-runtime";import{Fragment as is,jsx as as,jsxs as ls}from"react/jsx-runtime";import{Fragment as ds,jsx as ps,jsxs as fs}from"react/jsx-runtime";import{jsx as $,jsxs as bo}from"react/jsx-runtime";var mo={...N.options,scrollable:{type:"boolean"}},co=N.states,at={...N.defaultOptions,variant:"horizontal"},po=[{name:"horizontal",title:"Horizontal"},{name:"vertical",title:"Vertical"}],fo=[{name:"opened",title:"Opened"}],J=e=>{let{variant:t,modifiers:o,...r}={...at,...e},s={},u=t==="vertical"?{left:"200px",top:"30px"}:{left:"90px",top:"auto"};return Object.keys(o||{}).forEach(i=>{i==="opened"&&(s.opened=!!o?.[i],s.popup=o?.[i]?$(w,{className:"k-menu-popup",offset:u,children:bo(T,{children:[$(k,{text:"Item 1"}),$(k,{text:"Item 2"}),$(W,{}),$(k,{text:"Item 3"})]})}):null)}),t==="vertical"?$(ye,{...r,...s,orientation:"vertical",style:{width:"200px"}}):$(ye,{...r,...s})};J.options=mo;J.states=co;J.variants=po;J.defaultOptions=at;J.modifiers=fo;J.className=N.className;import{Fragment as Gs,jsx as Xs,jsxs as Ws}from"react/jsx-runtime";import{jsx as Ys}from"react/jsx-runtime";import{Fragment as Io,jsx as _,jsxs as it}from"react/jsx-runtime";var xo=m.states,lt={...m.defaultOptions,variant:"text"},Mo=m.options,ho=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],No=[{name:"opened",title:"Opened"}],q=e=>{let{variant:t,modifiers:o,...r}={...lt,...e},s={},u=_(w,{className:"k-menu-popup",children:it(T,{size:r.size,children:[_(k,{first:!0,text:"Menu Item"}),_(k,{text:"Menu Item"}),_(k,{last:!0,text:"Menu Item"})]})}),i;switch(t){case"icon-only":i=_("div",{children:_(L,{...r,...s,icon:"star"})});break;case"icon-and-text":i=_("div",{children:_(L,{...r,...s,icon:"star",children:"Dropdown Button"})});break;default:i=_("div",{children:_(L,{...r,...s,children:"Dropdown Button"})});break}return it(Io,{children:[i,o?.opened&&u]})};q.options=Mo;q.states=xo;q.variants=ho;q.defaultOptions=lt;q.modifiers=No;q.className=L.className;var Te="file-box",ut=Te;import{jsx as Q,jsxs as mt}from"react/jsx-runtime";var ct="k-file-box",vo=[p.selected],ko={},ne={icon:"file-pdf",name:"FileName.pdf",size:"2MB",showButton:"true"},U=e=>{let{icon:t=ne.icon,name:o=ne.name,size:r=ne.size,status:s,deleted:u,removeButton:i,showButton:c=ne.showButton,...x}=e,f=[o,r].filter(Boolean).join(" ");return mt("li",{role:"listitem",tabIndex:0,"aria-label":f||void 0,...x,className:l(ct,e.className,{"k-file-deleted":u}),children:[Q(b,{icon:t,size:"xlarge","aria-hidden":"true"}),mt("div",{className:"k-file-info",children:[o&&Q("span",{className:"k-file-name",children:o}),r&&Q("span",{className:"k-file-size",children:r}),s&&Q("span",{className:"k-file-status",children:s})]}),c&&(i?Q(m,{as:"span",icon:"x-circle",fillMode:"flat",size:"xsmall","aria-hidden":"true"}):Q(L,{icon:"more-vertical",fillMode:"flat",size:"xsmall",showArrow:!1,"aria-label":"File actions"}))]})};U.states=vo;U.options=ko;U.className=ct;U.defaultOptions=ne;U.moduleName=Te;U.folderName=ut;U.ariaSpec={selector:".k-file-box-wrapper",rules:[{selector:".k-file-box-wrapper",attribute:"role=list",usage:"Explicitly sets the UL role to list."},{selector:".k-file-box-wrapper",attribute:"aria-label",usage:'Provides an accessible name for the file list (e.g. "Attached files").'},{selector:".k-file-box-wrapper .k-files-scroll",attribute:"role=presentation",usage:"The scrollable container between the list and its items is presentational, ensuring the list\u2192listitem relationship is preserved in the accessibility tree."},{selector:".k-file-box-wrapper .k-file-box",attribute:"role=listitem",usage:"Explicitly sets the LI role to listitem."},{selector:".k-file-box-wrapper .k-file-box",attribute:"tabindex",usage:"Makes the file box focusable. Uses roving tabindex: 0 for the focused item, -1 for the rest."},{selector:".k-file-box-wrapper .k-file-box",attribute:"aria-label",usage:'Provides an accessible name describing the file. Can include the file name and size (e.g. "FileName.pdf 2MB").'},{selector:".k-file-box-wrapper .k-file-box .k-icon",attribute:"aria-hidden=true",usage:"The file type icon is decorative and hidden from screen readers."},{selector:".k-file-box-wrapper .k-file-box span.k-button",attribute:"aria-hidden=true",usage:"The remove button is rendered as a decorative span and hidden from screen readers. File removal is handled by keyboard interaction on the listitem itself."}]};var va=U;export{ct as FILE_BOX_CLASSNAME,U as FileBox,va as default};