UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 29.3 kB
import Ke 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,i)=>t[i]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var N=(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"}),C=(e,t)=>{let{valid:o,invalid:i,hover:a,focus:l,checked:c,active:p,selected:u,disabled:b,indeterminate:f,loading:g,empty:L,readonly:k,highlighted:V,..._}=t;return n({"k-valid":o,"k-invalid":i,"k-hover":a,"k-focus":l,"k-checked":c,"k-active":p,"k-selected":u,"k-disabled":b,"k-indeterminate":f&&!c,"k-loading":g,"k-empty":L,"k-readonly":k,"k-highlighted":V},Object.keys(_).reduce((I,K)=>(K.startsWith("k-")?I[K]=_[K]:I[`k-${K}`]=_[K],I),{}))};function lt(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(i=>[`k-${i}`,!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"},x={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},P={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"},s={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 Ee={};function A(e){return Ee[e]=(Ee[e]||0)+1,`k-${e}-${Ee[e]}`}import{jsx as ct}from"react/jsx-runtime";var to="k-list-group-sticky-header",Re=e=>ct("div",{className:n(to,e.className),children:ct("div",{className:"k-list-header-text",children:e.children})});import{jsx as no}from"react/jsx-runtime";var oo="k-no-data",_e=e=>{let{live:t,...o}=e;return no("span",{...o,className:n(oo,e.className),"aria-live":t?"polite":void 0,children:e.children})};var $="list",J=$;import{jsx as pt,jsxs as dt}from"react/jsx-runtime";var Pe="k-list",so=[],io={size:[r.undefined,r.small,r.medium,r.large]},ao={},v=e=>{let{size:t,virtualization:o,children:i,header:a,selectAll:l,optionLabel:c,customValue:p,noData:u,screenReaders:b,...f}=e,L=Ke.Children.toArray(i)[0],k=L?.props?.children?Ke.Children.count(L.props.children):Ke.Children.count(i);return dt("div",{...f,className:n(e.className,Pe,N(Pe,{size:t}),{"k-virtual-list":o}),children:[c,l,p,a&&pt(Re,{children:a}),i||(u!==void 0?u:pt(_e,{live:!0,children:"No data found."})),b&&i&&dt(_e,{className:"k-sr-only",live:!0,children:[k," items found."]})]})};v.states=so;v.options=io;v.className=Pe;v.defaultOptions=ao;v.moduleName=$;v.folderName=J;v.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 po}from"react/jsx-runtime";var mt="k-list-container",ro=[],lo={},co={},Q=e=>{let{...t}=e;return po("div",{...t,className:n(e.className,mt),children:e.children})};Q.states=ro;Q.options=lo;Q.className=mt;Q.defaultOptions=co;Q.moduleName=$;Q.folderName=J;var X="checkbox",Y=X;import{jsx as ut}from"react/jsx-runtime";var fe="k-checkbox",mo=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.checked,s.indeterminate],uo={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full]},fo={},O=e=>{let{id:t,checked:o,indeterminate:i,hover:a,focus:l,disabled:c,invalid:p,valid:u,required:b,size:f,rounded:g,wrapperRole:L,...k}=e;return ut("span",{className:"k-checkbox-wrap",role:L,children:ut("input",{...k,id:t,type:"checkbox",defaultChecked:o,required:b,disabled:c||void 0,"aria-invalid":p?"true":void 0,className:n(e.className,fe,N(fe,{size:f,rounded:g}),C(fe,{hover:a,focus:l,disabled:c,invalid:p,valid:u,indeterminate:i,checked:o}))})})};O.states=mo;O.options=uo;O.className=fe;O.defaultOptions=fo;O.moduleName=X;O.folderName=Y;O.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 R=O;import{jsx as ho}from"react/jsx-runtime";var ft="k-checkbox-list",bo=[],xo={},bt={layout:"vertical"},y=e=>{let{layout:t=bt.layout,...o}=e;return ho("ul",{...o,className:n(e.className,ft,{[`k-list-${t}`]:t}),children:e.children})};y.states=bo;y.options=xo;y.className=ft;y.defaultOptions=bt;y.moduleName=X;y.folderName=Y;import{jsx as ko}from"react/jsx-runtime";var xt="k-checkbox-list-item",Lo=[],No={},go={},M=e=>{let{...t}=e;return ko("li",{...t,className:n(e.className,xt),children:e.children})};M.states=Lo;M.options=No;M.className=xt;M.defaultOptions=go;M.moduleName=X;M.folderName=Y;import{Fragment as Io,jsx as ht,jsxs as Co}from"react/jsx-runtime";var z=({children:e="Label",id:t="cb-label-after",...o})=>Co(Io,{children:[ht(R,{id:t,...o}),ht("label",{className:"k-checkbox-label",htmlFor:t,children:e})]});import{Fragment as ri,jsx as ai,jsxs as li}from"react/jsx-runtime";import{Fragment as ui,jsx as mi,jsxs as fi}from"react/jsx-runtime";import{Fragment as Ni,jsx as Li,jsxs as gi}from"react/jsx-runtime";import{jsx as vi}from"react/jsx-runtime";import{jsx as Ai}from"react/jsx-runtime";import{jsx as Ri}from"react/jsx-runtime";import{jsx as E,jsxs as Lt}from"react/jsx-runtime";var vo=y.options,yo=y.states,Mo={...y.defaultOptions,variant:"vertical"},So=[{name:"vertical",title:"Vertical"},{name:"horizontal",title:"Horizontal"}],Ao=[],Z=e=>{let{variant:t,...o}=e;return t==="horizontal"?Lt(y,{layout:"horizontal",...o,children:[E(M,{children:E(z,{id:A("cb"),defaultChecked:!0,children:"Label"})}),E(M,{children:E(z,{id:A("cb"),children:"Label"})}),E(M,{children:E(z,{id:A("cb"),children:"Label"})})]}):Lt(y,{...o,children:[E(M,{children:E(z,{id:A("cb"),defaultChecked:!0,children:"Label"})}),E(M,{children:E(z,{id:A("cb"),children:"Label"})}),E(M,{children:E(z,{id:A("cb"),children:"Label"})})]})};Z.options=vo;Z.states=yo;Z.variants=So;Z.defaultOptions=Mo;Z.modifiers=Ao;Z.className=y.className;import{jsx as Ko}from"react/jsx-runtime";var Oo=R.options,To=R.states,Eo=R.defaultOptions,Ro=[],_o=[],j=e=>Ko(z,{id:A("checkbox"),...e,defaultChecked:!0,children:"Label"});j.options=Oo;j.states=To;j.variants=Ro;j.defaultOptions=Eo;j.modifiers=_o;j.className=R.className;import{Fragment as zo,jsx as Nt}from"react/jsx-runtime";var He="k-font-icon",Po=[],Ho={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]},wo={},ie=e=>{let{size:t,themeColor:o,icon:i,rotate:a,flip:l,...c}=e;return i?Nt("span",{...c,className:n(e.className,He,N(He,{size:t}),{[`k-i-${i}`]:i,[`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"}):Nt(zo,{})};ie.states=Po;ie.options=Ho;ie.className=He;ie.defaultOptions=wo;var gt=ie;import{Fragment as Uo,jsx as be}from"react/jsx-runtime";var we="k-svg-icon",Do=[],Bo={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:[P.outline,P.solid,P.duotone]},ze={viewBox:"0 0 24 24",variant:P.outline},ae=e=>{let{size:t,themeColor:o,rotate:i,flip:a,viewBox:l=ze.viewBox,variant:c=ze.variant,icon:p,...u}=e;if(!p)return be(Uo,{});if(p==="none")return be("span",{...u,className:n(e.className,we,N("k-icon",{size:t}),"k-none"),"aria-hidden":"true"});let b=typeof p=="object"&&p.name&&p.name,f=typeof p=="object"?c&&p.variants?.[c]||p.variants?.outline||p.content:void 0;return be("span",{...u,className:n(e.className,we,N("k-icon",{size:t}),{[`k-svg-i-${b}`]:b,[`k-color-${o}`]:o,[`k-rotate-${i}`]:i,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"}),"aria-hidden":"true",children:be("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof p=="object"?p.viewBox:l,dangerouslySetInnerHTML:f!==void 0?{__html:f}:void 0,children:p?void 0:e.children})})};ae.states=Do;ae.options=Bo;ae.className=we;ae.defaultOptions=ze;var De=ae;import*as Be from"@progress/kendo-svg-icons";var kt="icon",It="icons";import{useContext as Vo}from"react";import{createContext as Go}from"react";var Ct=Go({iconsType:"svg"});import{Fragment as vt,jsx as re}from"react/jsx-runtime";var xe="k-icon",Fo=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),$o=[],Xo={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:[P.outline,P.solid,P.duotone]},he={viewBox:"0 0 24 24",type:"svg",variant:P.outline},h=e=>{let{iconsType:t}=Vo(Ct),{size:o,themeColor:i,icon:a,type:l=t||he.type,rotate:c,flip:p,viewBox:u=he.viewBox,variant:b=he.variant,...f}=e;if(!a)return re(vt,{});if((t||l)==="svg"){if(a==="none")return re(De,{...f,className:n(e.className,xe),icon:a,size:o,variant:b});let L=Be[a]?a:Fo(`${a}-icon`);return Be[L]?re(De,{...f,className:n(e.className,xe),icon:Be[L],size:o,themeColor:i,rotate:c,flip:p,viewBox:u,variant:b}):re(vt,{})}return re(gt,{...f,className:n(e.className,xe),icon:a,size:o,themeColor:i,rotate:c,flip:p})};h.states=$o;h.options=Xo;h.defaultOptions=he;h.className=xe;h.moduleName=kt;h.folderName=It;h.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 W,jsxs as Qo}from"react/jsx-runtime";var Ue="k-list-item",Wo=[s.hover,s.focus,s.selected,s.disabled],qo={},Jo={},S=e=>{let{text:t,groupLabel:o,group:i,iconName:a,iconClassName:l,showCheckbox:c,checked:p,hover:u,focus:b,selected:f,disabled:g,actions:L,description:k,id:V,..._}=e,I=t||e.children;return Qo("li",{..._,id:V,role:i?"presentation":"option",tabIndex:i?void 0:b?0:-1,"aria-selected":!i&&f?"true":i?void 0:"false","aria-disabled":!i&&g?"true":void 0,className:n(e.className,i?"k-list-group-item":Ue,C(Ue,{hover:u,focus:b,disabled:g,selected:f})),children:[c&&W(O,{checked:p}),a&&W("span",{className:"k-list-item-icon-wrapper",children:W(h,{icon:a,className:n("k-list-item-icon",l)})}),W("span",{className:"k-list-item-text",children:I}),L&&W("div",{className:"k-list-item-actions",children:L}),k&&W("span",{className:"k-list-item-description",children:k}),o&&o!==""&&W("div",{className:"k-list-item-group-label",children:o})]})};S.states=Wo;S.options=qo;S.className=Ue;S.defaultOptions=Jo;S.moduleName=$;S.folderName=J;S.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 Zo}from"react/jsx-runtime";var Yo="k-list-ul",le=e=>{let{children:t,role:o,id:i,...a}=e;return Zo("ul",{...a,id:i,role:o,className:n(Yo,e.className),children:t})};le.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 Ge,jsxs as en}from"react/jsx-runtime";var jo="k-list-content",D=e=>{let{virtualization:t,grouping:o,"aria-label":i,"aria-labelledby":a,listboxId:l,...c}=e;return en("div",{...c,className:n(jo,e.className),role:o?"listbox":void 0,id:o?l:void 0,"aria-label":o?i:void 0,"aria-labelledby":o?a:void 0,children:[o?e.children:Ge(le,{role:"listbox",id:l,"aria-label":i,"aria-labelledby":a,children:e.children}),t&&Ge("div",{className:"k-height-container",children:Ge("div",{})})]})};D.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 Ve,jsxs as sn}from"react/jsx-runtime";var Le="k-list-sticky-header",tn=[s.hover,s.focus,s.selected],on={},nn={},Ne=e=>{let{label:t="Select all",showCheckbox:o=!0,checked:i,indeterminate:a,hover:l,focus:c,selected:p,...u}=e;return Ve("div",{...u,className:n(Le,e.className),children:sn("div",{className:n(`${Le}-item`,C(`${Le}-item`,{hover:l,focus:c,selected:p})),children:[o&&Ve(O,{checked:i,indeterminate:a,"aria-label":t}),Ve("span",{className:"k-list-item-text",children:t})]})})};Ne.states=tn;Ne.options=on;Ne.className=Le;Ne.defaultOptions=nn;import{Fragment as Wa,jsx as Xa,jsxs as qa}from"react/jsx-runtime";import{jsx as Fe,jsxs as rn}from"react/jsx-runtime";var an="k-list-group-item",$e=e=>{let{groupIconName:t,...o}=e;return rn("li",{...o,role:"presentation",className:n(an,e.className),children:[t&&Fe("span",{className:"k-list-item-icon-wrapper",children:Fe(h,{icon:t,className:"k-list-item-icon"})}),Fe("span",{className:"k-list-item-text",children:e.children})]})};$e.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 dn}from"react/jsx-runtime";var Xe="k-list-optionlabel",ln=[s.hover,s.focus,s.selected,s.disabled],cn={},pn={},ge=e=>{let{text:t,hover:o,focus:i,selected:a,disabled:l,...c}=e;return dn("div",{...c,className:n(Xe,C(Xe,{hover:o,focus:i,selected:a,disabled:l})),children:t})};ge.states=ln;ge.options=cn;ge.className=Xe;ge.defaultOptions=pn;import{jsx as bn}from"react/jsx-runtime";var We="k-list-custom-value",mn=[s.hover,s.focus,s.selected,s.disabled],un={},fn={},ke=e=>{let{text:t,hover:o,focus:i,selected:a,disabled:l,...c}=e;return bn("div",{...c,className:n(We,C(We,{hover:o,focus:i,selected:a,disabled:l})),children:t})};ke.states=mn;ke.options=un;ke.className=We;ke.defaultOptions=fn;import{Fragment as pr,jsx as cr,jsxs as dr}from"react/jsx-runtime";import{Fragment as hr,jsx as xr,jsxs as Lr}from"react/jsx-runtime";import{Fragment as yr,jsx as Cr,jsxs as vr}from"react/jsx-runtime";import{Fragment as Rr,jsx as Tr,jsxs as Er}from"react/jsx-runtime";import{jsx as Hr}from"react/jsx-runtime";import{Fragment as Gr,jsx as Ur,jsxs as Vr}from"react/jsx-runtime";var ce="input",Ie=ce;import{jsx as Nn}from"react/jsx-runtime";var Ce="k-input",xn=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],hn={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[x.undefined,x.solid,x.flat,x.outline]},Ln={},T=e=>{let{hover:t,focus:o,disabled:i,invalid:a,valid:l,loading:c,readonly:p,size:u,rounded:b,fillMode:f,...g}=e;return Nn("span",{...g,className:n(e.className,Ce,N(Ce,{size:u,rounded:b,fillMode:f}),C(Ce,{hover:t,focus:o,disabled:i,invalid:a,valid:l,loading:c,readonly:p}))})};T.states=xn;T.options=hn;T.className=Ce;T.defaultOptions=Ln;T.moduleName=ce;T.folderName=Ie;import{jsx as Cn}from"react/jsx-runtime";var ve="k-picker",gn=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],kn={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[x.undefined,x.solid,x.flat,x.outline]},In={},ee=e=>{let{hover:t,focus:o,disabled:i,invalid:a,valid:l,loading:c,readonly:p,size:u,rounded:b,fillMode:f,...g}=e;return Cn("span",{...g,className:n(e.className,ve,N(ve,{size:u,rounded:b,fillMode:f}),C(ve,{hover:t,focus:o,disabled:i,invalid:a,valid:l,loading:c,readonly:p})),children:e.children})};ee.states=gn;ee.options=kn;ee.className=ve;ee.defaultOptions=In;ee.moduleName=ce;ee.folderName=Ie;import{Fragment as Mn,jsx as qe}from"react/jsx-runtime";var yt="k-clear-value",vn=[s.disabled,s.loading,s.readonly],yn={},pe=e=>{let{disabled:t,loading:o,readonly:i,value:a}=e;return t||i||o||!a?qe(Mn,{}):qe("span",{className:n(e.className,yt),children:qe(h,{icon:"x"})})};pe.states=vn;pe.options=yn;pe.className=yt;import{jsx as On}from"react/jsx-runtime";var Je="k-input-inner",Sn=[],An={},ye={type:"text",autocomplete:"off",value:"",placeholder:""},q=e=>{let{value:t=ye.value,type:o=ye.type,placeholder:i=ye.placeholder,autocomplete:a=ye.autocomplete,disabled:l,readOnly:c,...p}=e;return On("input",{...p,type:o,className:n(e.className,Je,N(Je,e)),placeholder:i,autoComplete:a,defaultValue:t,disabled:l||void 0,readOnly:c||void 0})};q.states=Sn;q.options=An;q.className=Je;import{jsx as Mt,jsxs as Rn}from"react/jsx-runtime";var Qe="k-input-inner",Tn=[],En={},Ye=e=>{let{value:t,placeholder:o,showValue:i,valueIcon:a,valueIconName:l,...c}=e;return Rn("span",{...c,className:n(e.className,Qe,N(Qe,e)),children:[a,!a&&l&&Mt(h,{className:"k-input-value-icon",icon:l}),i&&!t&&o,i&&t&&Mt("span",{className:"k-input-value-text",children:t})]})};Ye.states=Tn;Ye.options=En;Ye.className=Qe;import{jsx as Pn}from"react/jsx-runtime";var Ze="k-input-inner",_n=[],Kn={},St={value:"",placeholder:""},je=e=>{let{value:t=St.value,placeholder:o=St.placeholder,rows:i,disabled:a,...l}=e;return Pn("textarea",{...l,className:n(e.className,Ze,N(Ze,e)),placeholder:o,rows:i,defaultValue:t,disabled:a||void 0})};je.states=_n;je.options=Kn;je.className=Ze;import{Fragment as wn,jsx as At}from"react/jsx-runtime";var Ot="k-input-loading-icon",Hn=[s.disabled,s.loading],Me=e=>{let{disabled:t,loading:o}=e;return t||!o?At(wn,{}):At("span",{className:n(e.className,Ot,"k-icon k-i-loading")})};Me.states=Hn;Me.className=Ot;import{Fragment as Bn,jsx as Tt}from"react/jsx-runtime";var Et="k-input-validation-icon",zn=[s.valid,s.invalid,s.disabled,s.loading],Dn={},de=e=>{let{valid:t,invalid:o,disabled:i,loading:a}=e,l=o?"warning-circle":"check-circle";return i||a||!!!(t||o)?Tt(Bn,{}):Tt(h,{className:n(Et),icon:l})};de.states=zn;de.options=Dn;de.className=Et;import{Fragment as Vn,jsx as Rt}from"react/jsx-runtime";var Un="k-input-prefix",Gn={direction:"horizontal"},Se=e=>{let{direction:t=Gn.direction,...o}=e;return e.children?Rt("span",{...o,className:n(Un,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):Rt(Vn,{})};import{Fragment as Xn,jsx as _t}from"react/jsx-runtime";var Fn="k-input-suffix",$n={direction:"horizontal"},Ae=e=>{let{direction:t=$n.direction,...o}=e;return e.children?_t("span",{...o,className:n(Fn,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):_t(Xn,{})};import{jsx as Wl}from"react/jsx-runtime";import{jsx as Yl}from"react/jsx-runtime";import{jsx as qn}from"react/jsx-runtime";var Kt="k-input-separator",Wn={direction:"vertical"},te=e=>{let{direction:t=Wn.direction,...o}=e;return qn("span",{...o,className:n(Kt,e.className,{[`${Kt}-${t}`]:t})})};var et="button",Pt=et;import{Fragment as Ht,jsx as oe,jsxs as wt}from"react/jsx-runtime";var me="k-button",Jn=["icon-button"],Qn=[s.hover,s.focus,s.active,s.selected,s.disabled,s.generating],Yn={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:[x.undefined,x.solid,x.flat,x.outline,x.clear,x.link],themeColor:[d.undefined,d.base,d.primary,d.secondary,d.tertiary,d.success,d.warning,d.error,d.info,d.inverse]},tt={showArrow:!1,arrowIconName:"chevron-down"},H=e=>{let{as:t="button",size:o,rounded:i,fillMode:a,themeColor:l,showArrow:c=tt.showArrow,arrowIconName:p=tt.arrowIconName,variant:u,hover:b,focus:f,active:g,selected:L,disabled:k,togglable:V,ariaDisabled:_,icon:I,iconSize:K,text:F,iconClassName:Te,className:Yt,...Zt}=e,jt=I!=null,eo=e.children!==void 0;return wt(t,{className:n(Yt,me,lt(me,u),N(me,{size:o,rounded:i,fillMode:a,themeColor:l}),C(me,{hover:b,focus:f,active:g,disabled:k||_,selected:L}),{"k-icon-button":!F&&!eo&&jt}),"aria-pressed":V?L?"true":"false":void 0,...Zt,"aria-disabled":_?"true":void 0,disabled:k||void 0,children:[typeof I=="string"&&I&&oe(h,{className:n(Te,"k-button-icon"),icon:I,size:K}),I&&typeof I!="string"&&oe(Ht,{children:I}),F?wt(Ht,{children:[F&&oe("span",{className:"k-button-text",children:F}),e.children]}):e.children&&oe("span",{className:"k-button-text",children:e.children}),c&&oe("span",{className:"k-menu-button-arrow k-button-arrow",children:oe(h,{icon:p})})]})};H.states=Qn;H.options=Yn;H.variants=Jn;H.className=me;H.defaultOptions=tt;H.moduleName=et;H.folderName=Pt;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 Zn}from"react/jsx-runtime";var zt=e=>Zn(H,{children:"Button",...e});import{Fragment as Dt,jsx as w,jsxs as ot}from"react/jsx-runtime";var jn=T.states,es=T.defaultOptions,ts=T.options,os=[{name:"prefix",title:"Prefix"},{name:"suffix",title:"Suffix"},{name:"clear-button",title:"`Clear` Button"},{name:"validation-icon",title:"Validation Icon"},{name:"separators",title:"Separators"}],ns=[],ne=e=>{let{modifiers:t,valid:o,invalid:i,loading:a,disabled:l,readonly:c,...p}=e,u=t?.prefix,b=t?.suffix,f=t?.["clear-button"],g=t?.["validation-icon"],L=t?.separators;return ot(T,{...p,valid:o,invalid:i,loading:a,disabled:l,readonly:c,style:{width:300},children:[u&&ot(Dt,{children:[w(Se,{children:w(h,{icon:"lock"})}),L&&w(te,{})]}),w(q,{placeholder:"Placeholder",value:"Value"}),g&&w(de,{valid:o,invalid:i,loading:a,disabled:l}),w(Me,{loading:a,disabled:l}),f&&w(pe,{loading:a,disabled:l,readonly:c,value:"Value"}),b&&ot(Dt,{children:[L&&w(te,{}),w(Ae,{children:w(zt,{size:p.size,fillMode:"clear",children:"Send"})})]})]})};ne.options=ts;ne.states=jn;ne.variants=ns;ne.defaultOptions=es;ne.modifiers=os;ne.className=T.className;var nt="popup",Bt=nt;import{jsx as Ut}from"react/jsx-runtime";var Gt="k-animation-container",ss=[],is={},st={positionMode:"absolute",shown:!0},U=e=>{let{positionMode:t=st.positionMode,shown:o=st.shown,animationStyle:i,offset:a,...l}=e;return Ut("div",{...l,style:{...a,...e.style},className:n(e.className,Gt,{"k-animation-container-shown":o,"k-animation-container-fixed":t==="fixed"}),children:Ut("div",{className:"k-child-animation-container",style:i,children:e.children})})};U.states=ss;U.options=is;U.className=Gt;U.defaultOptions=st;U.moduleName=nt;U.folderName=Bt;var it="popup",Vt=it;import{jsx as Ft}from"react/jsx-runtime";var $t="k-popup",as=[],rs={},Xt={positionMode:"absolute"},B=e=>{let{offset:t,positionMode:o=Xt.positionMode,animationStyle:i,containerClassName:a,containerRole:l,containerAriaLabel:c,...p}=e;return Ft(U,{positionMode:o,offset:t,animationStyle:i,className:a,role:l,"aria-label":c,children:Ft("div",{...p,className:n(e.className,$t),children:e.children})})};B.states=as;B.options=rs;B.className=$t;B.defaultOptions=Xt;B.moduleName=it;B.folderName=Vt;B.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 at="smart-box",Wt=at;import{Fragment as rt,jsx as se,jsxs as Oe}from"react/jsx-runtime";var qt="k-smart-box",ls=[s.hover,s.focus,s.disabled],cs={size:[r.undefined,r.small,r.medium,r.large],rounded:[m.undefined,m.none,m.small,m.medium,m.large,m.full],fillMode:[x.undefined,x.solid,x.flat,x.outline]},Jt={separators:!0},G=e=>{let{size:t,rounded:o,fillMode:i,separators:a=Jt.separators,prefix:l,suffix:c,value:p,placeholder:u,hover:b,focus:f,disabled:g,popup:L,opened:k,processing:V,inputAriaLabel:_,inputAriaControls:I,inputAriaActiveDescendant:K,inputAriaAutocomplete:F,...Te}=e;return Oe(rt,{children:[Oe(T,{...Te,size:t,rounded:o,fillMode:i,hover:b,focus:f,disabled:g,loading:V,className:n(e.className,qt),children:[l&&Oe(rt,{children:[se(Se,{children:l}),a&&se(te,{})]}),se(q,{placeholder:u,value:p,role:"combobox","aria-haspopup":"listbox","aria-expanded":k?"true":"false","aria-autocomplete":F,"aria-controls":k?I:void 0,"aria-activedescendant":k?K:void 0,"aria-label":_}),c&&Oe(rt,{children:[a&&se(te,{}),se(Ae,{children:c})]})]}),k&&L&&se(B,{className:"k-smart-box-popup",children:L})]})};G.states=ls;G.options=cs;G.className=qt;G.defaultOptions=Jt;G.moduleName=at;G.folderName=Wt;G.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."}]};var Qt=G;import{Fragment as ds,jsx as ue,jsxs as ps}from"react/jsx-runtime";var pp=e=>ue(Qt,{opened:!0,inputAriaLabel:"AI-powered search",inputAriaControls:"smart-box-listbox",inputAriaAutocomplete:"list",popup:ue(ds,{children:ue(v,{children:ps(D,{listboxId:"smart-box-listbox","aria-label":"Suggestions",children:[ue(S,{children:"List item"}),ue(S,{children:"List item"})]})})}),...e});export{pp as SmartBoxOpened};