@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 23.2 kB
JavaScript
var a=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?a(...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 K=(e,t)=>a({[`${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"}),W=(e,t)=>{let{valid:o,invalid:r,hover:s,focus:m,checked:l,active:u,selected:p,disabled:M,indeterminate:f,loading:x,empty:b,readonly:C,highlighted:P,...y}=t;return a({"k-valid":o,"k-invalid":r,"k-hover":s,"k-focus":m,"k-checked":l,"k-active":u,"k-selected":p,"k-disabled":M,"k-indeterminate":f&&!l,"k-loading":x,"k-empty":b,"k-readonly":C,"k-highlighted":P},Object.keys(y).reduce((I,L)=>(L.startsWith("k-")?I[L]=y[L]:I[`k-${L}`]=y[L],I),{}))};function ze(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(r=>[`k-${r}`,!0]))}var i={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},A={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},k={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},_={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"},d={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 fe={};function Me(e){return fe[e]=(fe[e]||0)+1,`k-${e}-${fe[e]}`}var xe="action-buttons",He=xe;import{jsx as wt}from"react/jsx-runtime";var ae="k-actions",Et=[],Lt={},be={alignment:"start",orientation:"horizontal"},D=e=>{let{alignment:t=be.alignment,orientation:o=be.orientation,...r}=e;return wt("div",{...r,className:a(ae,{[`${ae}-${t}`]:t,[`${ae}-${o}`]:o},e.className),children:e.children})};D.states=Et;D.options=Lt;D.className=ae;D.defaultOptions=be;D.moduleName=xe;D.folderName=He;import{Fragment as St,jsx as We}from"react/jsx-runtime";var Ne="k-font-icon",Ot=[],yt={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info]},Tt={},j=e=>{let{size:t,themeColor:o,icon:r,rotate:s,flip:m,...l}=e;return r?We("span",{...l,className:a(e.className,Ne,K(Ne,{size:t}),{[`k-i-${r}`]:r,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),"aria-hidden":"true"}):We(St,{})};j.states=Ot;j.options=yt;j.className=Ne;j.defaultOptions=Tt;var $e=j;import{Fragment as Bt,jsx as ie}from"react/jsx-runtime";var he="k-svg-icon",Ct=[],_t={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info],variant:[_.outline,_.solid,_.duotone]},Ie={viewBox:"0 0 24 24",variant:_.outline},ee=e=>{let{size:t,themeColor:o,rotate:r,flip:s,viewBox:m=Ie.viewBox,variant:l=Ie.variant,icon:u,...p}=e;if(!u)return ie(Bt,{});if(u==="none")return ie("span",{...p,className:a(e.className,he,K("k-icon",{size:t}),"k-none"),"aria-hidden":"true"});let M=typeof u=="object"&&u.name&&u.name,f=typeof u=="object"?l&&u.variants?.[l]||u.variants?.outline||u.content:void 0;return ie("span",{...p,className:a(e.className,he,K("k-icon",{size:t}),{[`k-svg-i-${M}`]:M,[`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:ie("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof u=="object"?u.viewBox:m,dangerouslySetInnerHTML:f!==void 0?{__html:f}:void 0,children:u?void 0:e.children})})};ee.states=Ct;ee.options=_t;ee.className=he;ee.defaultOptions=Ie;var ve=ee;import*as ge from"@progress/kendo-svg-icons";var Fe="icon",Ve="icons";import{useContext as Kt}from"react";import{createContext as Pt}from"react";var Je=Pt({iconsType:"svg"});import{Fragment as Xe,jsx as te}from"react/jsx-runtime";var le="k-icon",Rt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Dt=[],Ut={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info],variant:[_.outline,_.solid,_.duotone]},me={viewBox:"0 0 24 24",type:"svg",variant:_.outline},N=e=>{let{iconsType:t}=Kt(Je),{size:o,themeColor:r,icon:s,type:m=t||me.type,rotate:l,flip:u,viewBox:p=me.viewBox,variant:M=me.variant,...f}=e;if(!s)return te(Xe,{});if((t||m)==="svg"){if(s==="none")return te(ve,{...f,className:a(e.className,le),icon:s,size:o,variant:M});let b=ge[s]?s:Rt(`${s}-icon`);return ge[b]?te(ve,{...f,className:a(e.className,le),icon:ge[b],size:o,themeColor:r,rotate:l,flip:u,viewBox:p,variant:M}):te(Xe,{})}return te($e,{...f,className:a(e.className,le),icon:s,size:o,themeColor:r,rotate:l,flip:u})};N.states=Dt;N.options=Ut;N.defaultOptions=me;N.className=le;N.moduleName=Fe;N.folderName=Ve;N.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 Ae="button",Ge=Ae;import{Fragment as qe,jsx as X,jsxs as Qe}from"react/jsx-runtime";var oe="k-button",zt=["icon-button"],Ht=[d.hover,d.focus,d.active,d.selected,d.disabled,d.generating],Wt={size:[i.undefined,i.xsmall,i.small,i.medium,i.large],rounded:[A.undefined,A.none,A.small,A.medium,A.large,A.full],fillMode:[k.undefined,k.solid,k.flat,k.outline,k.clear,k.link],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.inverse]},ke={showArrow:!1,arrowIconName:"chevron-down"},c=e=>{let{as:t="button",size:o,rounded:r,fillMode:s,themeColor:m,showArrow:l=ke.showArrow,arrowIconName:u=ke.arrowIconName,variant:p,hover:M,focus:f,active:x,selected:b,disabled:C,togglable:P,ariaDisabled:y,icon:I,iconSize:L,text:R,iconClassName:It,className:vt,...gt}=e,At=I!=null,kt=e.children!==void 0;return Qe(t,{className:a(vt,oe,ze(oe,p),K(oe,{size:o,rounded:r,fillMode:s,themeColor:m}),W(oe,{hover:M,focus:f,active:x,disabled:C||y,selected:b}),{"k-icon-button":!R&&!kt&&At}),"aria-pressed":P?b?"true":"false":void 0,...gt,"aria-disabled":y?"true":void 0,disabled:C||void 0,children:[typeof I=="string"&&I&&X(N,{className:a(It,"k-button-icon"),icon:I,size:L}),I&&typeof I!="string"&&X(qe,{children:I}),R?Qe(qe,{children:[R&&X("span",{className:"k-button-text",children:R}),e.children]}):e.children&&X("span",{className:"k-button-text",children:e.children}),l&&X("span",{className:"k-menu-button-arrow k-button-arrow",children:X(N,{icon:u})})]})};c.states=Ht;c.options=Wt;c.variants=zt;c.className=oe;c.defaultOptions=ke;c.moduleName=Ae;c.folderName=Ge;c.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 $t}from"react/jsx-runtime";var Ye=e=>$t(c,{icon:"folder",...e,"aria-label":e["aria-label"]||"Folder",children:void 0});import{jsx as Ft}from"react/jsx-runtime";var Ze=e=>Ft(c,{icon:"folder",children:"Button",...e});import{jsx as Vt}from"react/jsx-runtime";var je=e=>Vt(c,{children:"Button",...e});import{jsx as Ee}from"react/jsx-runtime";var Jt=c.options,Xt=c.states,Gt={...c.defaultOptions,variant:"text"},qt=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],Qt=[],G=e=>{let{variant:t,...o}=e;switch(t){case"icon-only":return Ee(Ye,{...o,icon:"star"});case"icon-and-text":return Ee(Ze,{...o,icon:"star",children:"Button"});default:return Ee(je,{...o,children:"Button"})}};G.options=Jt;G.states=Xt;G.variants=qt;G.defaultOptions=Gt;G.modifiers=Qt;G.className=c.className;var Le="menu-button",et=Le;import{jsx as jt}from"react/jsx-runtime";var tt="k-menu-button",Yt=[d.hover,d.focus,d.active,d.selected,d.disabled],Zt={size:[i.undefined,i.xsmall,i.small,i.medium,i.large],rounded:[A.undefined,A.none,A.small,A.medium,A.large,A.full],fillMode:[k.undefined,k.solid,k.flat,k.outline,k.clear,k.link],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.inverse]},we={showArrow:!0,arrowIconName:"chevron-down"},E=e=>{let{size:t,rounded:o,fillMode:r,themeColor:s,hover:m,focus:l,active:u,selected:p,disabled:M,icon:f,text:x,showArrow:b=we.showArrow,arrowIconName:C=we.arrowIconName,expanded:P,...y}=e;return jt(c,{...y,className:a(e.className,tt),text:x,size:t,rounded:o,fillMode:r,themeColor:s,hover:m,focus:l,active:u,selected:p,disabled:M,ariaDisabled:M||void 0,icon:f,showArrow:b,arrowIconName:C,"aria-expanded":P?"true":"false",...!x&&f&&!e["aria-label"]&&{"aria-label":"Menu"}})};E.states=Yt;E.options=Zt;E.className=tt;E.defaultOptions=we;E.moduleName=Le;E.folderName=et;E.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 ir}from"react/jsx-runtime";import{jsx as cr}from"react/jsx-runtime";import{jsx as Mr}from"react/jsx-runtime";var w="menu",T=w;import{jsx as ne,jsxs as ot}from"react/jsx-runtime";var Oe="k-menu-item",eo=[d.hover,d.focus,d.active,d.selected,d.disabled],to={},nt={iconPosition:"before"},v=e=>{let{hover:t,focus:o,active:r,selected:s,disabled:m,icon:l,text:u,first:p,last:M,showArrow:f,arrowIconName:x,iconPosition:b=nt.iconPosition,dir:C,children:P,expanded:y,...I}=e,L=x;return L||(L=C==="rtl"?"chevron-left":"chevron-right"),ot("li",{...I,className:a(e.className,Oe,"k-item",W(Oe,{focus:o,disabled:m,hover:t,active:r,selected:s}),{"k-first":p,"k-last":M}),role:"menuitem",...f&&{"aria-haspopup":"menu"},...f&&{"aria-expanded":y?"true":"false"},...m&&{"aria-disabled":"true"},...o&&{tabIndex:0},children:[ot("span",{className:a("k-link k-menu-link"),children:[l&&b==="before"&&ne(N,{className:"k-menu-link-icon",icon:l}),ne("span",{className:"k-menu-link-text",children:u}),l&&b==="after"&&ne(N,{className:"k-menu-link-icon",icon:l}),f&&ne("span",{className:"k-menu-expand-arrow","aria-hidden":"true",children:ne(N,{icon:L})})]}),P]})};v.states=eo;v.options=to;v.className=Oe;v.defaultOptions=nt;v.moduleName=w;v.folderName=T;import{jsx as re,jsxs as rt}from"react/jsx-runtime";var ye="k-menu-item",oo=[d.hover,d.focus,d.active,d.selected,d.disabled],no={},Te={dir:"ltr",iconPosition:"before"},g=e=>{let{hover:t,focus:o,active:r,selected:s,disabled:m,icon:l,text:u,first:p,last:M,showArrow:f,arrowIconName:x,iconPosition:b=Te.iconPosition,dir:C=Te.dir,children:P,popup:y,expanded:I,...L}=e,R=x;return R||(R=C==="rtl"?"chevron-left":"chevron-right"),rt("li",{role:"menuitem",...L,className:a(e.className,ye,"k-item",W(ye,{focus:o,disabled:m}),{"k-first":p,"k-last":M}),...f&&{"aria-haspopup":"menu"},...f&&{"aria-expanded":I?"true":"false"},...m&&{"aria-disabled":"true"},...o&&{tabIndex:0},children:[rt("span",{className:a("k-link k-menu-link",W("k-menu-link",{hover:t,active:r,selected:s,disabled:m})),children:[l&&b==="before"&&re(N,{className:"k-menu-link-icon",icon:l}),re("span",{className:"k-menu-link-text",children:u}),l&&b==="after"&&re(N,{className:"k-menu-link-icon",icon:l}),f&&re("span",{className:"k-menu-expand-arrow","aria-hidden":"true",children:re(N,{icon:R})})]}),P,y]})};g.states=oo;g.options=no;g.className=ye;g.defaultOptions=Te;g.moduleName=w;g.folderName=T;import{jsx as io}from"react/jsx-runtime";var st="k-menu-scroll-wrapper",ro=[],so={},ao={},$=e=>{let{className:t,children:o,orientation:r,...s}=e;return io("div",{...s,className:a(t,st,{"k-menu-scroll-wrapper-vertical":r==="vertical"}),children:o})};$.states=ro;$.options=so;$.className=st;$.defaultOptions=ao;$.moduleName=w;$.folderName=T;var at=$;import{Fragment as Se,jsx as F,jsxs as ce}from"react/jsx-runtime";var Ce="k-menu",lo=[],mo={},de={orientation:"horizontal",header:!0,scrollButtonsPosition:"around"},h=e=>{let{children:t,orientation:o=de.orientation,header:r=de.header,scrollable:s,scrollButtonsPosition:m=de.scrollButtonsPosition,wrapperStyles:l,dir:u,popup:p,contextMenu:M,...f}=e,x={horizontal:{prev:u!=="rtl"?"left":"right",next:u!=="rtl"?"right":"left"},vertical:{prev:"up",next:"down"}},b=F("ul",{dir:u,...f,className:a(e.className,"k-reset",Ce,{[`${Ce}-${o}`]:o,"k-header":r}),role:M?"menu":"menubar",...o==="vertical"&&{"aria-orientation":"vertical"},children:t});return ce(Se,{children:[s?ce(at,{orientation:o,style:l,dir:e.dir,children:[m==="start"&&ce(Se,{children:[F(c,{fillMode:"flat",icon:`chevron-${x[o].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev",tabIndex:-1,"aria-label":"Scroll previous"}),F(c,{fillMode:"flat",icon:`chevron-${x[o].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next",tabIndex:-1,"aria-label":"Scroll next"})]}),m==="around"&&F(c,{fillMode:"flat",icon:`chevron-${x[o].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev",tabIndex:-1,"aria-label":"Scroll previous"}),b,m==="end"&&ce(Se,{children:[F(c,{fillMode:"flat",icon:`chevron-${x[o].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev",tabIndex:-1,"aria-label":"Scroll previous"}),F(c,{fillMode:"flat",icon:`chevron-${x[o].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next",tabIndex:-1,"aria-label":"Scroll next"})]}),m==="around"&&F(c,{fillMode:"flat",icon:`chevron-${x[o].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next",tabIndex:-1,"aria-label":"Scroll next"})]}):b,p]})};h.states=lo;h.options=mo;h.className=Ce;h.defaultOptions=de;h.moduleName=w;h.folderName=T;h.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 uo}from"react/jsx-runtime";var _e="k-separator",it={orientation:"horizontal"},q=e=>{let{orientation:t=it.orientation,...o}=e;return uo("li",{...o,className:a(e.className,"k-item",_e,{[`${_e}-${t}`]:t}),role:"separator"})};q.className=_e;q.defaultOptions=it;q.moduleName=w;q.folderName=T;import{Fragment as Fr,jsx as Vr}from"react/jsx-runtime";import{jsx as Mo}from"react/jsx-runtime";var Be="k-menu-group",co=[],po={size:[i.undefined,i.small,i.medium,i.large]},fo={},S=e=>{let{children:t,size:o,...r}=e;return Mo("ul",{role:"menu",...r,className:a(e.className,Be,K(Be,{size:o})),children:t})};S.states=co;S.options=po;S.className=Be;S.defaultOptions=fo;S.moduleName=w;S.folderName=T;import{Fragment as xo,jsx as Q,jsxs as bo}from"react/jsx-runtime";var Pe=e=>Q(h,{children:bo(xo,{children:[Q(v,{first:!0,text:"Item 1"}),Q(v,{showArrow:!0,arrowIconName:"chevron-down",text:"Item 2"}),Q(v,{showArrow:!0,arrowIconName:"chevron-down",text:"Item 3"}),Q(v,{text:"Item 4"}),Q(v,{last:!0,text:"Item 5"})]}),...e});var Ke="popup",lt=Ke;import{jsx as mt}from"react/jsx-runtime";var ut="k-animation-container",No=[],ho={},Re={positionMode:"absolute",shown:!0},U=e=>{let{positionMode:t=Re.positionMode,shown:o=Re.shown,animationStyle:r,offset:s,...m}=e;return mt("div",{...m,style:{...s,...e.style},className:a(e.className,ut,{"k-animation-container-shown":o,"k-animation-container-fixed":t==="fixed"}),children:mt("div",{className:"k-child-animation-container",style:r,children:e.children})})};U.states=No;U.options=ho;U.className=ut;U.defaultOptions=Re;U.moduleName=Ke;U.folderName=lt;var De="popup",ct=De;import{jsx as dt}from"react/jsx-runtime";var pt="k-popup",Io=[],vo={},ft={positionMode:"absolute"},O=e=>{let{offset:t,positionMode:o=ft.positionMode,animationStyle:r,containerClassName:s,containerRole:m,containerAriaLabel:l,...u}=e;return dt(U,{positionMode:o,offset:t,animationStyle:r,className:s,role:m,"aria-label":l,children:dt("div",{...u,className:a(e.className,pt),children:e.children})})};O.states=Io;O.options=vo;O.className=pt;O.defaultOptions=ft;O.moduleName=De;O.folderName=ct;O.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 Is,jsx as Ns,jsxs as hs}from"react/jsx-runtime";import{Fragment as Es,jsx as ks,jsxs as Ls}from"react/jsx-runtime";import{Fragment as Ss,jsx as Ts,jsxs as Cs}from"react/jsx-runtime";import{Fragment as Rs,jsx as Ks,jsxs as Ds}from"react/jsx-runtime";import{jsx as V,jsxs as Lo}from"react/jsx-runtime";var go={...h.options,scrollable:{type:"boolean"}},Ao=h.states,Mt={...h.defaultOptions,variant:"horizontal"},ko=[{name:"horizontal",title:"Horizontal"},{name:"vertical",title:"Vertical"}],Eo=[{name:"opened",title:"Opened"}],Y=e=>{let{variant:t,modifiers:o,...r}={...Mt,...e},s={},m=t==="vertical"?{left:"200px",top:"30px"}:{left:"90px",top:"auto"};return Object.keys(o||{}).forEach(l=>{l==="opened"&&(s.opened=!!o?.[l],s.popup=o?.[l]?V(O,{className:"k-menu-popup",offset:m,children:Lo(S,{children:[V(g,{text:"Item 1"}),V(g,{text:"Item 2"}),V(q,{}),V(g,{text:"Item 3"})]})}):null)}),t==="vertical"?V(Pe,{...r,...s,orientation:"vertical",style:{width:"200px"}}):V(Pe,{...r,...s})};Y.options=go;Y.states=Ao;Y.variants=ko;Y.defaultOptions=Mt;Y.modifiers=Eo;Y.className=h.className;import{Fragment as xa,jsx as fa,jsxs as Ma}from"react/jsx-runtime";import{jsx as Ia}from"react/jsx-runtime";import{Fragment as So,jsx as B,jsxs as xt}from"react/jsx-runtime";var wo=c.states,bt={...c.defaultOptions,variant:"text"},Oo=c.options,yo=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],To=[{name:"opened",title:"Opened"}],Z=e=>{let{variant:t,modifiers:o,...r}={...bt,...e},s={},m=B(O,{className:"k-menu-popup",children:xt(S,{size:r.size,children:[B(g,{first:!0,text:"Menu Item"}),B(g,{text:"Menu Item"}),B(g,{last:!0,text:"Menu Item"})]})}),l;switch(t){case"icon-only":l=B("div",{children:B(E,{...r,...s,icon:"star"})});break;case"icon-and-text":l=B("div",{children:B(E,{...r,...s,icon:"star",children:"Dropdown Button"})});break;default:l=B("div",{children:B(E,{...r,...s,children:"Dropdown Button"})});break}return xt(So,{children:[l,o?.opened&&m]})};Z.options=Oo;Z.states=wo;Z.variants=yo;Z.defaultOptions=bt;Z.modifiers=To;Z.className=E.className;var se="window",pe=se;import{jsx as Po}from"react/jsx-runtime";var Nt="k-window-content",Co=[],_o={},Bo={},z=e=>{let{children:t,...o}=e;return Po("div",{...o,className:a(Nt,e.className),children:t})};z.states=Co;z.options=_o;z.className=Nt;z.defaultOptions=Bo;z.moduleName=se;z.folderName=pe;import{Fragment as Uo,jsx as J,jsxs as ht}from"react/jsx-runtime";var Ue="k-window",Ko=[],Ro={},Do={},H=e=>{let{title:t,actions:o,minimized:r,actionButtons:s,actionButtonsAlign:m,...l}=e,u=t!==void 0?Me("window-title"):void 0;return ht("div",{...l,className:a(e.className,Ue,{[`${Ue}-minimized`]:r}),role:"dialog","aria-labelledby":u,children:[(t!==void 0||o)&&ht("div",{className:"k-window-titlebar",children:[t!==void 0&&J("span",{className:"k-window-title",id:u,children:t}),o&&J(Uo,{children:J("div",{className:"k-window-titlebar-actions",children:o.map(p=>p==="more-vertical"?J(E,{icon:p,fillMode:"flat",size:"xsmall",showArrow:!1,className:"k-window-titlebar-action","aria-label":"More actions"},p):J(c,{icon:p,fillMode:"flat",size:"xsmall",className:"k-window-titlebar-action","aria-label":p},p))})})]}),J(z,{className:a({"k-hidden":r}),children:e.children}),s&&J(D,{alignment:m,className:"k-window-actions",children:s})]})};H.states=Ko;H.options=Ro;H.className=Ue;H.defaultOptions=Do;H.moduleName=se;H.folderName=pe;H.ariaSpec={selector:".k-window",rules:[{selector:".k-window:not(.k-dialog)",attribute:"role=dialog",usage:"Announces the dialog role of the component."},{selector:".k-window:not(.k-dialog)",attribute:"aria-labelledby",usage:"Associate the title of the dialog."}]};var qa=H;export{Ue as WINDOW_CLASSNAME,H as Window,qa as default};