@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 31.1 kB
JavaScript
import we from"react";var n=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?n(...t):typeof t=="object"?Object.keys(t).map((o,s)=>t[s]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var g=(e,t)=>n({[`${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"}),S=(e,t)=>{let{valid:o,invalid:s,hover:a,focus:l,checked:c,active:p,selected:f,disabled:x,indeterminate:b,loading:k,empty:N,readonly:v,highlighted:$,...P}=t;return n({"k-valid":o,"k-invalid":s,"k-hover":a,"k-focus":l,"k-checked":c,"k-active":p,"k-selected":f,"k-disabled":x,"k-indeterminate":b&&!c,"k-loading":k,"k-empty":N,"k-readonly":v,"k-highlighted":$},Object.keys(P).reduce((C,_)=>(_.startsWith("k-")?C[_]=P[_]:C[`k-${_}`]=P[_],C),{}))};function ft(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(s=>[`k-${s}`,!0]))}var r={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},m={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},L={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},H={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},d={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},i={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 Pe={};function I(e){return Pe[e]=(Pe[e]||0)+1,`k-${e}-${Pe[e]}`}import{jsx as bt}from"react/jsx-runtime";var co="k-list-group-sticky-header",_e=e=>bt("div",{className:n(co,e.className),children:bt("div",{className:"k-list-header-text",children:e.children})});import{jsx as mo}from"react/jsx-runtime";var po="k-no-data",He=e=>{let{live:t,...o}=e;return mo("span",{...o,className:n(po,e.className),"aria-live":t?"polite":void 0,children:e.children})};var W="list",Z=W;import{jsx as xt,jsxs as ht}from"react/jsx-runtime";var ze="k-list",uo=[],fo={size:[r.undefined,r.small,r.medium,r.large]},bo={},y=e=>{let{size:t,virtualization:o,children:s,header:a,selectAll:l,optionLabel:c,customValue:p,noData:f,screenReaders:x,...b}=e,N=we.Children.toArray(s)[0],v=N?.props?.children?we.Children.count(N.props.children):we.Children.count(s);return ht("div",{...b,className:n(e.className,ze,g(ze,{size:t}),{"k-virtual-list":o}),children:[c,l,p,a&&xt(_e,{children:a}),s||(f!==void 0?f:xt(He,{live:!0,children:"No data found."})),x&&s&&ht(He,{className:"k-sr-only",live:!0,children:[v," items found."]})]})};y.states=uo;y.options=fo;y.className=ze;y.defaultOptions=bo;y.moduleName=W;y.folderName=Z;y.ariaSpec={selector:".k-list",rules:[{selector:".k-list .k-no-data",attribute:"aria-live=polite",usage:'Announces "No data found" to screen readers.'}]};import{jsx as No}from"react/jsx-runtime";var Lt="k-list-container",xo=[],ho={},Lo={},j=e=>{let{...t}=e;return No("div",{...t,className:n(e.className,Lt),children:e.children})};j.states=xo;j.options=ho;j.className=Lt;j.defaultOptions=Lo;j.moduleName=W;j.folderName=Z;var q="checkbox",ee=q;import{jsx as Nt}from"react/jsx-runtime";var he="k-checkbox",go=[i.hover,i.focus,i.valid,i.invalid,i.required,i.disabled,i.checked,i.indeterminate],ko={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full]},Io={},T=e=>{let{id:t,checked:o,indeterminate:s,hover:a,focus:l,disabled:c,invalid:p,valid:f,required:x,size:b,rounded:k,wrapperRole:N,...v}=e;return Nt("span",{className:"k-checkbox-wrap",role:N,children:Nt("input",{...v,id:t,type:"checkbox",defaultChecked:o,required:x,disabled:c||void 0,"aria-invalid":p?"true":void 0,className:n(e.className,he,g(he,{size:b,rounded:k}),S(he,{hover:a,focus:l,disabled:c,invalid:p,valid:f,indeterminate:s,checked:o}))})})};T.states=go;T.options=ko;T.className=he;T.defaultOptions=Io;T.moduleName=q;T.folderName=ee;T.ariaSpec={selector:".k-checkbox",rules:[{selector:".k-checkbox",attribute:"role=checkbox or type=checkbox",usage:"Announces the checkbox role of the element."},{selector:".k-checkbox",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-checkbox",attribute:"aria-checked=true/false/mixed or checked",usage:"For native checkboxes the checked state is handled by the browser. aria-checked is used for custom implementations."},{selector:".k-checkbox",attribute:"aria-describedby (when has hint or error)",usage:"Points to the hint or error message for the checkbox."},{selector:".k-checkbox",attribute:"disabled or aria-disabled=true (when disabled)",usage:"For native checkboxes use the HTML disabled attribute. aria-disabled for custom implementations."},{selector:".k-invalid, .ng-invalid",attribute:"aria-invalid=true (when invalid)",usage:"Rendered only when the CheckBox is in a form and announces the invalid state."}]};var B=T;import{jsx as So}from"react/jsx-runtime";var gt="k-checkbox-list",vo=[],Co={},kt={layout:"vertical"},A=e=>{let{layout:t=kt.layout,...o}=e;return So("ul",{...o,className:n(e.className,gt,{[`k-list-${t}`]:t}),children:e.children})};A.states=vo;A.options=Co;A.className=gt;A.defaultOptions=kt;A.moduleName=q;A.folderName=ee;import{jsx as Oo}from"react/jsx-runtime";var It="k-checkbox-list-item",yo=[],Mo={},Ao={},O=e=>{let{...t}=e;return Oo("li",{...t,className:n(e.className,It),children:e.children})};O.states=yo;O.options=Mo;O.className=It;O.defaultOptions=Ao;O.moduleName=q;O.folderName=ee;import{Fragment as To,jsx as vt,jsxs as Eo}from"react/jsx-runtime";var D=({children:e="Label",id:t="cb-label-after",...o})=>Eo(To,{children:[vt(B,{id:t,...o}),vt("label",{className:"k-checkbox-label",htmlFor:t,children:e})]});import{Fragment as ki,jsx as gi,jsxs as Ii}from"react/jsx-runtime";import{Fragment as Mi,jsx as yi,jsxs as Ai}from"react/jsx-runtime";import{Fragment as Ri,jsx as Ki,jsxs as Bi}from"react/jsx-runtime";import{jsx as wi}from"react/jsx-runtime";import{jsx as Gi}from"react/jsx-runtime";import{jsx as Xi}from"react/jsx-runtime";import{jsx as K,jsxs as Ct}from"react/jsx-runtime";var Ko=A.options,Ro=A.states,Bo={...A.defaultOptions,variant:"vertical"},Po=[{name:"vertical",title:"Vertical"},{name:"horizontal",title:"Horizontal"}],_o=[],te=e=>{let{variant:t,...o}=e;return t==="horizontal"?Ct(A,{layout:"horizontal",...o,children:[K(O,{children:K(D,{id:I("cb"),defaultChecked:!0,children:"Label"})}),K(O,{children:K(D,{id:I("cb"),children:"Label"})}),K(O,{children:K(D,{id:I("cb"),children:"Label"})})]}):Ct(A,{...o,children:[K(O,{children:K(D,{id:I("cb"),defaultChecked:!0,children:"Label"})}),K(O,{children:K(D,{id:I("cb"),children:"Label"})}),K(O,{children:K(D,{id:I("cb"),children:"Label"})})]})};te.options=Ko;te.states=Ro;te.variants=Po;te.defaultOptions=Bo;te.modifiers=_o;te.className=A.className;import{jsx as Go}from"react/jsx-runtime";var Ho=B.options,wo=B.states,zo=B.defaultOptions,Do=[],Uo=[],oe=e=>Go(D,{id:I("checkbox"),...e,defaultChecked:!0,children:"Label"});oe.options=Ho;oe.states=wo;oe.variants=Do;oe.defaultOptions=zo;oe.modifiers=Uo;oe.className=B.className;import{Fragment as Xo,jsx as St}from"react/jsx-runtime";var De="k-font-icon",Vo=[],Fo={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[d.undefined,d.base,d.primary,d.secondary,d.tertiary,d.success,d.warning,d.error,d.info]},$o={},ce=e=>{let{size:t,themeColor:o,icon:s,rotate:a,flip:l,...c}=e;return s?St("span",{...c,className:n(e.className,De,g(De,{size:t}),{[`k-i-${s}`]:s,[`k-color-${o}`]:o,[`k-rotate-${a}`]:a,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),"aria-hidden":"true"}):St(Xo,{})};ce.states=Vo;ce.options=Fo;ce.className=De;ce.defaultOptions=$o;var yt=ce;import{Fragment as Jo,jsx as Le}from"react/jsx-runtime";var Ue="k-svg-icon",Wo=[],qo={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[d.undefined,d.base,d.primary,d.secondary,d.tertiary,d.success,d.warning,d.error,d.info],variant:[H.outline,H.solid,H.duotone]},Ge={viewBox:"0 0 24 24",variant:H.outline},pe=e=>{let{size:t,themeColor:o,rotate:s,flip:a,viewBox:l=Ge.viewBox,variant:c=Ge.variant,icon:p,...f}=e;if(!p)return Le(Jo,{});if(p==="none")return Le("span",{...f,className:n(e.className,Ue,g("k-icon",{size:t}),"k-none"),"aria-hidden":"true"});let x=typeof p=="object"&&p.name&&p.name,b=typeof p=="object"?c&&p.variants?.[c]||p.variants?.outline||p.content:void 0;return Le("span",{...f,className:n(e.className,Ue,g("k-icon",{size:t}),{[`k-svg-i-${x}`]:x,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"}),"aria-hidden":"true",children:Le("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof p=="object"?p.viewBox:l,dangerouslySetInnerHTML:b!==void 0?{__html:b}:void 0,children:p?void 0:e.children})})};pe.states=Wo;pe.options=qo;pe.className=Ue;pe.defaultOptions=Ge;var Ve=pe;import*as Fe from"@progress/kendo-svg-icons";var Mt="icon",At="icons";import{useContext as Yo}from"react";import{createContext as Qo}from"react";var Ot=Qo({iconsType:"svg"});import{Fragment as Tt,jsx as de}from"react/jsx-runtime";var Ne="k-icon",Zo=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),jo=[],en={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[d.undefined,d.base,d.primary,d.secondary,d.tertiary,d.success,d.warning,d.error,d.info],variant:[H.outline,H.solid,H.duotone]},ge={viewBox:"0 0 24 24",type:"svg",variant:H.outline},u=e=>{let{iconsType:t}=Yo(Ot),{size:o,themeColor:s,icon:a,type:l=t||ge.type,rotate:c,flip:p,viewBox:f=ge.viewBox,variant:x=ge.variant,...b}=e;if(!a)return de(Tt,{});if((t||l)==="svg"){if(a==="none")return de(Ve,{...b,className:n(e.className,Ne),icon:a,size:o,variant:x});let N=Fe[a]?a:Zo(`${a}-icon`);return Fe[N]?de(Ve,{...b,className:n(e.className,Ne),icon:Fe[N],size:o,themeColor:s,rotate:c,flip:p,viewBox:f,variant:x}):de(Tt,{})}return de(yt,{...b,className:n(e.className,Ne),icon:a,size:o,themeColor:s,rotate:c,flip:p})};u.states=jo;u.options=en;u.defaultOptions=ge;u.className=Ne;u.moduleName=Mt;u.folderName=At;u.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 J,jsxs as sn}from"react/jsx-runtime";var $e="k-list-item",tn=[i.hover,i.focus,i.selected,i.disabled],on={},nn={},M=e=>{let{text:t,groupLabel:o,group:s,iconName:a,iconClassName:l,showCheckbox:c,checked:p,hover:f,focus:x,selected:b,disabled:k,actions:N,description:v,id:$,...P}=e,C=t||e.children;return sn("li",{...P,id:$,role:s?"presentation":"option",tabIndex:s?void 0:x?0:-1,"aria-selected":!s&&b?"true":s?void 0:"false","aria-disabled":!s&&k?"true":void 0,className:n(e.className,s?"k-list-group-item":$e,S($e,{hover:f,focus:x,disabled:k,selected:b})),children:[c&&J(T,{checked:p}),a&&J("span",{className:"k-list-item-icon-wrapper",children:J(u,{icon:a,className:n("k-list-item-icon",l)})}),J("span",{className:"k-list-item-text",children:C}),N&&J("div",{className:"k-list-item-actions",children:N}),v&&J("span",{className:"k-list-item-description",children:v}),o&&o!==""&&J("div",{className:"k-list-item-group-label",children:o})]})};M.states=tn;M.options=on;M.className=$e;M.defaultOptions=nn;M.moduleName=W;M.folderName=Z;M.ariaSpec={selector:".k-list-item",rules:[{selector:".k-list-item",attribute:"role=option",usage:"Each list item is an option in the listbox."},{selector:".k-list-item",attribute:"id",usage:"ID for aria-activedescendant reference."},{selector:".k-list-item",attribute:"aria-selected (when selectable)",usage:"Indicates the selected state of the option."},{selector:".k-list-group-item",attribute:"role=presentation",usage:"Group headers are presentational, not selectable options."},{selector:".k-list-item-icon",attribute:"aria-hidden=true",usage:"Decorative icons are hidden from assistive technology."}]};import{jsx as rn}from"react/jsx-runtime";var an="k-list-ul",me=e=>{let{children:t,role:o,id:s,...a}=e;return rn("ul",{...a,id:s,role:o,className:n(an,e.className),children:t})};me.ariaSpec={selector:".k-list-ul",rules:[{selector:'.k-list-ul[role="listbox"]',attribute:"role=listbox",usage:"For ungrouped lists, the UL has the listbox role."},{selector:'.k-list-ul[role="listbox"]',attribute:"aria-label or aria-labelledby (when has accessible name)",usage:"Accessible name for the listbox."},{selector:'.k-list-ul[role="group"]',attribute:"role=group",usage:"For grouped sublists under a group header."},{selector:'.k-list-ul[role="group"]',attribute:"aria-labelledby (when grouped)",usage:"References the group header ID."}]};import{jsx as Xe,jsxs as cn}from"react/jsx-runtime";var ln="k-list-content",w=e=>{let{virtualization:t,grouping:o,"aria-label":s,"aria-labelledby":a,listboxId:l,...c}=e;return cn("div",{...c,className:n(ln,e.className),role:o?"listbox":void 0,id:o?l:void 0,"aria-label":o?s:void 0,"aria-labelledby":o?a:void 0,children:[o?e.children:Xe(me,{role:"listbox",id:l,"aria-label":s,"aria-labelledby":a,children:e.children}),t&&Xe("div",{className:"k-height-container",children:Xe("div",{})})]})};w.ariaSpec={selector:".k-list-content",rules:[{selector:'.k-list-content[role="listbox"]',attribute:"role=listbox",usage:"For grouped lists, the list content container has the listbox role."},{selector:'.k-list-content[role="listbox"]',attribute:"aria-label or aria-labelledby (when has accessible name)",usage:"Accessible name for the listbox."}]};import{jsx as We,jsxs as un}from"react/jsx-runtime";var ke="k-list-sticky-header",pn=[i.hover,i.focus,i.selected],dn={},mn={},Ie=e=>{let{label:t="Select all",showCheckbox:o=!0,checked:s,indeterminate:a,hover:l,focus:c,selected:p,...f}=e;return We("div",{...f,className:n(ke,e.className),children:un("div",{className:n(`${ke}-item`,S(`${ke}-item`,{hover:l,focus:c,selected:p})),children:[o&&We(T,{checked:s,indeterminate:a,"aria-label":t}),We("span",{className:"k-list-item-text",children:t})]})})};Ie.states=pn;Ie.options=dn;Ie.className=ke;Ie.defaultOptions=mn;import{Fragment as rr,jsx as ar,jsxs as lr}from"react/jsx-runtime";import{jsx as qe,jsxs as bn}from"react/jsx-runtime";var fn="k-list-group-item",Je=e=>{let{groupIconName:t,...o}=e;return bn("li",{...o,role:"presentation",className:n(fn,e.className),children:[t&&qe("span",{className:"k-list-item-icon-wrapper",children:qe(u,{icon:t,className:"k-list-item-icon"})}),qe("span",{className:"k-list-item-text",children:e.children})]})};Je.ariaSpec={selector:".k-list-group-item",rules:[{selector:".k-list-group-item",attribute:"role=presentation",usage:"Group headers are presentational, not selectable options."},{selector:".k-list-group-item",attribute:"id (when referenced)",usage:"ID for aria-labelledby on the parent group UL."}]};import{jsx as Nn}from"react/jsx-runtime";var Qe="k-list-optionlabel",xn=[i.hover,i.focus,i.selected,i.disabled],hn={},Ln={},ve=e=>{let{text:t,hover:o,focus:s,selected:a,disabled:l,...c}=e;return Nn("div",{...c,className:n(Qe,S(Qe,{hover:o,focus:s,selected:a,disabled:l})),children:t})};ve.states=xn;ve.options=hn;ve.className=Qe;ve.defaultOptions=Ln;import{jsx as vn}from"react/jsx-runtime";var Ye="k-list-custom-value",gn=[i.hover,i.focus,i.selected,i.disabled],kn={},In={},Ce=e=>{let{text:t,hover:o,focus:s,selected:a,disabled:l,...c}=e;return vn("div",{...c,className:n(Ye,S(Ye,{hover:o,focus:s,selected:a,disabled:l})),children:t})};Ce.states=gn;Ce.options=kn;Ce.className=Ye;Ce.defaultOptions=In;import{Fragment as Cr,jsx as vr,jsxs as Sr}from"react/jsx-runtime";import{Fragment as Er,jsx as Tr,jsxs as Kr}from"react/jsx-runtime";import{Fragment as zr,jsx as Hr,jsxs as wr}from"react/jsx-runtime";import{Fragment as Xr,jsx as Fr,jsxs as $r}from"react/jsx-runtime";import{jsx as Qr}from"react/jsx-runtime";import{Fragment as ol,jsx as tl,jsxs as nl}from"react/jsx-runtime";var ue="input",Se=ue;import{jsx as Mn}from"react/jsx-runtime";var ye="k-input",Cn=[i.hover,i.focus,i.valid,i.invalid,i.required,i.disabled,i.loading,i.readonly],Sn={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[L.undefined,L.solid,L.flat,L.outline]},yn={},E=e=>{let{hover:t,focus:o,disabled:s,invalid:a,valid:l,loading:c,readonly:p,size:f,rounded:x,fillMode:b,...k}=e;return Mn("span",{...k,className:n(e.className,ye,g(ye,{size:f,rounded:x,fillMode:b}),S(ye,{hover:t,focus:o,disabled:s,invalid:a,valid:l,loading:c,readonly:p}))})};E.states=Cn;E.options=Sn;E.className=ye;E.defaultOptions=yn;E.moduleName=ue;E.folderName=Se;import{jsx as En}from"react/jsx-runtime";var Me="k-picker",An=[i.hover,i.focus,i.valid,i.invalid,i.required,i.disabled,i.loading,i.readonly],On={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[L.undefined,L.solid,L.flat,L.outline]},Tn={},ne=e=>{let{hover:t,focus:o,disabled:s,invalid:a,valid:l,loading:c,readonly:p,size:f,rounded:x,fillMode:b,...k}=e;return En("span",{...k,className:n(e.className,Me,g(Me,{size:f,rounded:x,fillMode:b}),S(Me,{hover:t,focus:o,disabled:s,invalid:a,valid:l,loading:c,readonly:p})),children:e.children})};ne.states=An;ne.options=On;ne.className=Me;ne.defaultOptions=Tn;ne.moduleName=ue;ne.folderName=Se;import{Fragment as Bn,jsx as Ze}from"react/jsx-runtime";var Et="k-clear-value",Kn=[i.disabled,i.loading,i.readonly],Rn={},fe=e=>{let{disabled:t,loading:o,readonly:s,value:a}=e;return t||s||o||!a?Ze(Bn,{}):Ze("span",{className:n(e.className,Et),children:Ze(u,{icon:"x"})})};fe.states=Kn;fe.options=Rn;fe.className=Et;import{jsx as Hn}from"react/jsx-runtime";var je="k-input-inner",Pn=[],_n={},Ae={type:"text",autocomplete:"off",value:"",placeholder:""},Q=e=>{let{value:t=Ae.value,type:o=Ae.type,placeholder:s=Ae.placeholder,autocomplete:a=Ae.autocomplete,disabled:l,readOnly:c,...p}=e;return Hn("input",{...p,type:o,className:n(e.className,je,g(je,e)),placeholder:s,autoComplete:a,defaultValue:t,disabled:l||void 0,readOnly:c||void 0})};Q.states=Pn;Q.options=_n;Q.className=je;import{jsx as Kt,jsxs as Dn}from"react/jsx-runtime";var et="k-input-inner",wn=[],zn={},tt=e=>{let{value:t,placeholder:o,showValue:s,valueIcon:a,valueIconName:l,...c}=e;return Dn("span",{...c,className:n(e.className,et,g(et,e)),children:[a,!a&&l&&Kt(u,{className:"k-input-value-icon",icon:l}),s&&!t&&o,s&&t&&Kt("span",{className:"k-input-value-text",children:t})]})};tt.states=wn;tt.options=zn;tt.className=et;import{jsx as Vn}from"react/jsx-runtime";var ot="k-input-inner",Un=[],Gn={},Rt={value:"",placeholder:""},nt=e=>{let{value:t=Rt.value,placeholder:o=Rt.placeholder,rows:s,disabled:a,...l}=e;return Vn("textarea",{...l,className:n(e.className,ot,g(ot,e)),placeholder:o,rows:s,defaultValue:t,disabled:a||void 0})};nt.states=Un;nt.options=Gn;nt.className=ot;import{Fragment as $n,jsx as Bt}from"react/jsx-runtime";var Pt="k-input-loading-icon",Fn=[i.disabled,i.loading],Oe=e=>{let{disabled:t,loading:o}=e;return t||!o?Bt($n,{}):Bt("span",{className:n(e.className,Pt,"k-icon k-i-loading")})};Oe.states=Fn;Oe.className=Pt;import{Fragment as qn,jsx as _t}from"react/jsx-runtime";var Ht="k-input-validation-icon",Xn=[i.valid,i.invalid,i.disabled,i.loading],Wn={},be=e=>{let{valid:t,invalid:o,disabled:s,loading:a}=e,l=o?"warning-circle":"check-circle";return s||a||!!!(t||o)?_t(qn,{}):_t(u,{className:n(Ht),icon:l})};be.states=Xn;be.options=Wn;be.className=Ht;import{Fragment as Yn,jsx as wt}from"react/jsx-runtime";var Jn="k-input-prefix",Qn={direction:"horizontal"},Te=e=>{let{direction:t=Qn.direction,...o}=e;return e.children?wt("span",{...o,className:n(Jn,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):wt(Yn,{})};import{Fragment as es,jsx as zt}from"react/jsx-runtime";var Zn="k-input-suffix",jn={direction:"horizontal"},Ee=e=>{let{direction:t=jn.direction,...o}=e;return e.children?zt("span",{...o,className:n(Zn,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):zt(es,{})};import{jsx as rc}from"react/jsx-runtime";import{jsx as dc}from"react/jsx-runtime";import{jsx as os}from"react/jsx-runtime";var Dt="k-input-separator",ts={direction:"vertical"},se=e=>{let{direction:t=ts.direction,...o}=e;return os("span",{...o,className:n(Dt,e.className,{[`${Dt}-${t}`]:t})})};var st="button",Ut=st;import{Fragment as Gt,jsx as ie,jsxs as Vt}from"react/jsx-runtime";var xe="k-button",ns=["icon-button"],ss=[i.hover,i.focus,i.active,i.selected,i.disabled,i.generating],is={size:[r.undefined,r.xsmall,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[L.undefined,L.solid,L.flat,L.outline,L.clear,L.link],themeColor:[d.undefined,d.base,d.primary,d.secondary,d.tertiary,d.success,d.warning,d.error,d.info,d.inverse]},it={showArrow:!1,arrowIconName:"chevron-down"},h=e=>{let{as:t="button",size:o,rounded:s,fillMode:a,themeColor:l,showArrow:c=it.showArrow,arrowIconName:p=it.arrowIconName,variant:f,hover:x,focus:b,active:k,selected:N,disabled:v,togglable:$,ariaDisabled:P,icon:C,iconSize:_,text:X,iconClassName:Be,className:io,...ao}=e,ro=C!=null,lo=e.children!==void 0;return Vt(t,{className:n(io,xe,ft(xe,f),g(xe,{size:o,rounded:s,fillMode:a,themeColor:l}),S(xe,{hover:x,focus:b,active:k,disabled:v||P,selected:N}),{"k-icon-button":!X&&!lo&&ro}),"aria-pressed":$?N?"true":"false":void 0,...ao,"aria-disabled":P?"true":void 0,disabled:v||void 0,children:[typeof C=="string"&&C&&ie(u,{className:n(Be,"k-button-icon"),icon:C,size:_}),C&&typeof C!="string"&&ie(Gt,{children:C}),X?Vt(Gt,{children:[X&&ie("span",{className:"k-button-text",children:X}),e.children]}):e.children&&ie("span",{className:"k-button-text",children:e.children}),c&&ie("span",{className:"k-menu-button-arrow k-button-arrow",children:ie(u,{icon:p})})]})};h.states=ss;h.options=is;h.variants=ns;h.className=xe;h.defaultOptions=it;h.moduleName=st;h.folderName=Ut;h.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 as}from"react/jsx-runtime";var Ke=e=>as(h,{children:"Button",...e});import{Fragment as Ft,jsx as z,jsxs as at}from"react/jsx-runtime";var rs=E.states,ls=E.defaultOptions,cs=E.options,ps=[{name:"prefix",title:"Prefix"},{name:"suffix",title:"Suffix"},{name:"clear-button",title:"`Clear` Button"},{name:"validation-icon",title:"Validation Icon"},{name:"separators",title:"Separators"}],ds=[],ae=e=>{let{modifiers:t,valid:o,invalid:s,loading:a,disabled:l,readonly:c,...p}=e,f=t?.prefix,x=t?.suffix,b=t?.["clear-button"],k=t?.["validation-icon"],N=t?.separators;return at(E,{...p,valid:o,invalid:s,loading:a,disabled:l,readonly:c,style:{width:300},children:[f&&at(Ft,{children:[z(Te,{children:z(u,{icon:"lock"})}),N&&z(se,{})]}),z(Q,{placeholder:"Placeholder",value:"Value"}),k&&z(be,{valid:o,invalid:s,loading:a,disabled:l}),z(Oe,{loading:a,disabled:l}),b&&z(fe,{loading:a,disabled:l,readonly:c,value:"Value"}),x&&at(Ft,{children:[N&&z(se,{}),z(Ee,{children:z(Ke,{size:p.size,fillMode:"clear",children:"Send"})})]})]})};ae.options=cs;ae.states=rs;ae.variants=ds;ae.defaultOptions=ls;ae.modifiers=ps;ae.className=E.className;var rt="popup",$t=rt;import{jsx as Xt}from"react/jsx-runtime";var Wt="k-animation-container",ms=[],us={},lt={positionMode:"absolute",shown:!0},F=e=>{let{positionMode:t=lt.positionMode,shown:o=lt.shown,animationStyle:s,offset:a,...l}=e;return Xt("div",{...l,style:{...a,...e.style},className:n(e.className,Wt,{"k-animation-container-shown":o,"k-animation-container-fixed":t==="fixed"}),children:Xt("div",{className:"k-child-animation-container",style:s,children:e.children})})};F.states=ms;F.options=us;F.className=Wt;F.defaultOptions=lt;F.moduleName=rt;F.folderName=$t;var ct="popup",qt=ct;import{jsx as Jt}from"react/jsx-runtime";var Qt="k-popup",fs=[],bs={},Yt={positionMode:"absolute"},U=e=>{let{offset:t,positionMode:o=Yt.positionMode,animationStyle:s,containerClassName:a,containerRole:l,containerAriaLabel:c,...p}=e;return Jt(F,{positionMode:o,offset:t,animationStyle:s,className:a,role:l,"aria-label":c,children:Jt("div",{...p,className:n(e.className,Qt),children:e.children})})};U.states=fs;U.options=bs;U.className=Qt;U.defaultOptions=Yt;U.moduleName=ct;U.folderName=qt;U.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.'}]};var pt="smart-box",Zt=pt;import{Fragment as dt,jsx as re,jsxs as Re}from"react/jsx-runtime";var jt="k-smart-box",xs=[i.hover,i.focus,i.disabled],hs={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[L.undefined,L.solid,L.flat,L.outline]},eo={separators:!0},R=e=>{let{size:t,rounded:o,fillMode:s,separators:a=eo.separators,prefix:l,suffix:c,value:p,placeholder:f,hover:x,focus:b,disabled:k,popup:N,opened:v,processing:$,inputAriaLabel:P,inputAriaControls:C,inputAriaActiveDescendant:_,inputAriaAutocomplete:X,...Be}=e;return Re(dt,{children:[Re(E,{...Be,size:t,rounded:o,fillMode:s,hover:x,focus:b,disabled:k,loading:$,className:n(e.className,jt),children:[l&&Re(dt,{children:[re(Te,{children:l}),a&&re(se,{})]}),re(Q,{placeholder:f,value:p,role:"combobox","aria-haspopup":"listbox","aria-expanded":v?"true":"false","aria-autocomplete":X,"aria-controls":v?C:void 0,"aria-activedescendant":v?_:void 0,"aria-label":P}),c&&Re(dt,{children:[a&&re(se,{}),re(Ee,{children:c})]})]}),v&&N&&re(U,{className:"k-smart-box-popup",children:N})]})};R.states=xs;R.options=hs;R.className=jt;R.defaultOptions=eo;R.moduleName=pt;R.folderName=Zt;R.ariaSpec={selector:".k-smart-box",rules:[{selector:".k-smart-box .k-input-inner",attribute:"role=combobox",usage:"Announces the combobox role for the SmartBox input."},{selector:".k-smart-box .k-input-inner",attribute:"aria-label or aria-labelledby",usage:'Provides an accessible label for the SmartBox (e.g., "AI-powered search").'},{selector:".k-smart-box .k-input-inner",attribute:"aria-expanded",usage:"Indicates whether the suggestion popup is currently visible."},{selector:".k-smart-box .k-input-inner",attribute:"aria-haspopup=listbox",usage:"Indicates that the SmartBox has a popup listbox with suggestions."},{selector:".k-smart-box .k-input-inner",attribute:"aria-controls (when present)",usage:"References the ID of the popup listbox element when the popup is open."},{selector:".k-smart-box .k-input-inner",attribute:"aria-autocomplete (when present)",usage:"Indicates the autocomplete behavior of the input field."},{selector:".k-smart-box .k-input-inner",attribute:"aria-activedescendant (when present)",usage:"When the popup is open and keyboard navigation is active, references the ID of the currently focused list item."},{selector:".k-smart-box .k-input-prefix .k-icon",attribute:"aria-hidden=true",usage:"Decorative icons in the prefix area are hidden from screen readers."},{selector:".k-smart-box .k-input-suffix .k-button",attribute:"aria-label",usage:'Suffix buttons must have accessible labels describing their function (e.g., "Start voice input", "Send prompt").'},{selector:".k-smart-box .k-smart-box-send",attribute:"aria-label",usage:'The send button must be labelled to indicate its current action (e.g., "Send" or "Stop processing").'},{selector:".k-smart-box .k-smart-box-send.k-disabled",attribute:"disabled or aria-disabled=true",usage:"Indicates the button is disabled when there is no input or processing is not active."},{selector:".k-smart-box .k-smart-box-send.k-processing",attribute:"aria-pressed=true",usage:"Indicates that processing is in progress. The button changes function to stop processing."}]};import{jsx as Ls}from"react/jsx-runtime";var Y=e=>Ls(h,{icon:"folder",...e,"aria-label":e["aria-label"]||"Folder",children:void 0});import{jsx as Ns}from"react/jsx-runtime";var to=e=>Ns(h,{icon:"folder",children:"Button",...e});import{jsx as mt}from"react/jsx-runtime";var gs=h.options,ks=h.states,Is={...h.defaultOptions,variant:"text"},vs=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],Cs=[],le=e=>{let{variant:t,...o}=e;switch(t){case"icon-only":return mt(Y,{...o,icon:"star"});case"icon-and-text":return mt(to,{...o,icon:"star",children:"Button"});default:return mt(Ke,{...o,children:"Button"})}};le.options=gs;le.states=ks;le.variants=vs;le.defaultOptions=Is;le.modifiers=Cs;le.className=h.className;import{jsx as Ss}from"react/jsx-runtime";var oo="k-smart-box-send",no={processing:!1},G=e=>{let{processing:t=no.processing,...o}=e;return Ss(h,{...o,rounded:"full",size:"small",icon:t?"stop":"arrow-up",active:t,"aria-pressed":t?"true":void 0,"aria-label":t?"Stop processing":"Send",className:n(e.className,oo,{"k-processing":t})})};G.states=h.states;G.options=h.options;G.className=oo;G.defaultOptions=no;import{Fragment as jp,jsx as Zp,jsxs as ed}from"react/jsx-runtime";import{Fragment as ld,jsx as ad,jsxs as rd}from"react/jsx-runtime";import{Fragment as bd,jsx as fd,jsxs as xd}from"react/jsx-runtime";import{Fragment as vd,jsx as Id,jsxs as Cd}from"react/jsx-runtime";import{Fragment as ut,jsx as V,jsxs as so}from"react/jsx-runtime";var zd=e=>{let t=I("sb-listbox"),o=I("sb-item"),s=I("sb-item");return V(R,{opened:!0,focus:!0,separators:!1,inputAriaLabel:"AI-powered search",inputAriaControls:t,inputAriaAutocomplete:"list",inputAriaActiveDescendant:o,prefix:V(ut,{children:V(u,{icon:"sparkles",className:"k-accent-icon","aria-hidden":"true"})}),suffix:so(ut,{children:[V(Y,{icon:"microphone",fillMode:"clear",rounded:"full",size:"small","aria-label":"Start voice input"}),V(G,{})]}),popup:V(ut,{children:V(y,{children:so(w,{listboxId:t,"aria-label":"Suggestions",children:[V(M,{id:o,focus:!0,children:"List item 1"}),V(M,{id:s,children:"List item 2"})]})})}),...e})};export{zd as SmartBoxOpenedFocused};